log: fix LogMethod copy

This commit is contained in:
Adrien Béraud committed 2018-05-24 11:57:12 -04:00
1 parent 1fe9f2fdb1
commit f5f71a0365
4 files changed
+21 -5

No files matched your search

+2 -1
View File
@@ -571,13 +571,14 @@ DhtProxyClient::getProxyInfos()
void
DhtProxyClient::onProxyInfos(const Json::Value& proxyInfos, sa_family_t family)
{
DHT_LOG.d("Got proxy infos %s", family == AF_INET ? "IPv4" : "IPv6");
std::lock_guard<std::mutex> l(lockCurrentProxyInfos_);
auto oldStatus = std::max(statusIpv4_, statusIpv6_);
auto& status = family == AF_INET ? statusIpv4_ : statusIpv6_;
if (not proxyInfos.isMember("node_id")) {
DHT_LOG.e("Proxy info request failed for %s", family == AF_INET ? "IPv4" : "IPv6");
status = NodeStatus::Disconnected;
} else {
DHT_LOG.d("Got proxy reply for %s", family == AF_INET ? "IPv4" : "IPv6");
try {
myid = InfoHash(proxyInfos["node_id"].asString());
stats4_ = NodeStats(proxyInfos["ipv4"]);