loads in host status record.
| 184 | |
| 185 | // loads in host status record. |
| 186 | void |
| 187 | HostStatus::loadRecord(std::string_view name, HostStatRec &h) |
| 188 | { |
| 189 | HostStatRec *host_stat = nullptr; |
| 190 | Dbg(dbg_ctl_host_statuses, "loading host status record for %.*s", int(name.size()), name.data()); |
| 191 | ink_rwlock_wrlock(&host_status_rwlock); |
| 192 | { |
| 193 | auto it = hosts_statuses.find(std::string(name)); |
| 194 | if (it == hosts_statuses.end()) { |
| 195 | host_stat = static_cast<HostStatRec *>(ats_malloc(sizeof(HostStatRec))); |
| 196 | *host_stat = h; |
| 197 | hosts_statuses.emplace(name, host_stat); |
| 198 | } |
| 199 | } |
| 200 | ink_rwlock_unlock(&host_status_rwlock); |
| 201 | } |
| 202 | |
| 203 | void |
| 204 | HostStatus::setHostStatus(const std::string_view name, TSHostStatus status, const unsigned int down_time, const unsigned int reason) |
nothing calls this directly
no test coverage detected