mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
searches: improve handling of disconnected nodes in search tables
This commit is contained in:
1 parent
6d6a2214db
commit
eaa7fc77ed
1 file changed
+4
@@ -641,6 +641,10 @@ Dht::searchSendGetValues(Search& sr, SearchNode *n)
|
||||
void
|
||||
Dht::searchStep(Search& sr)
|
||||
{
|
||||
sr.nodes.erase(std::remove_if (sr.nodes.begin(), sr.nodes.end(), [this](const SearchNode& n) {
|
||||
return n.pinged >= 3 && n.reply_time < now.tv_sec - 7200;
|
||||
}), sr.nodes.end());
|
||||
|
||||
if (sr.nodes.empty()) {
|
||||
// No nodes... yet ?
|
||||
// Nothing to do, wait for the timeout.
|
||||
|
||||
Reference in new issue
Block a user