From 97a7963f9603a3092108e895d80a0a1510a629e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com> Date: Thu, 20 Nov 2014 15:58:45 -0500 Subject: [PATCH] fix warnings --- src/dht.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/dht.cpp b/src/dht.cpp index 09b62926..49f3fe00 100644 --- a/src/dht.cpp +++ b/src/dht.cpp @@ -695,7 +695,7 @@ Dht::searchStep(Search& sr) TransId {TransPrefix::ANNOUNCE_VALUES, sr.tid}, sr.id, *a.value, n.token, n.reply_time >= now.tv_sec - 15); if (a_status == n.acked.end()) { - n.acked[vid] = { .request_time = now.tv_sec }; + n.acked[vid] = { .request_time = now.tv_sec, .reply_time = 0 }; } else { a_status->second.request_time = now.tv_sec; } @@ -1085,6 +1085,7 @@ Dht::cancelPut(const InfoHash& id, const Value::Id& vid) ++it; } } + return canceled; } /* A struct storage stores all the stored peer addresses for a given info @@ -1689,14 +1690,9 @@ Dht::processMessage(const uint8_t *buf, size_t buflen, const sockaddr *from, soc newNode(id, from, fromlen, 2); for (auto& sn : sr->nodes) if (sn.id == id) { - auto it = sn.acked.insert({value_id, {}}); - it.first->second.request_time = 0; - it.first->second.reply_time = now.tv_sec; + sn.acked.insert({value_id, {.request_time = 0, .reply_time = now.tv_sec}}); sn.request_time = 0; - //sn.reply_time = now.tv_sec; - //sn.acked[value_id] = now.tv_sec; sn.pinged = 0; - break; } /* See comment for gp above. */ -- GitLab