Skip to content

Commit

Permalink
Once got response from lastNodeAsked, reset the search timeout timer
Browse files Browse the repository at this point in the history
  • Loading branch information
madafoo committed Jun 30, 2015
1 parent 3323575 commit f3fe82b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dht/dhtcore/SearchRunner.c
Expand Up @@ -132,6 +132,11 @@ static void searchReplyCallback(struct RouterModule_Promise* promise,
struct SearchRunner_Search* search =
Identity_check((struct SearchRunner_Search*)promise->userData);

if (!Bits_memcmp(from->ip6.bytes, search->lastNodeAsked.ip6.bytes, 16)) {
Timeout_resetTimeout(search->continueSearchTimeout,
RouterModule_searchTimeoutMilliseconds(search->runner->router));
}

if (!Bits_memcmp(from->ip6.bytes, search->target.ip6.bytes, 16)) {
search->numFinds++;
}
Expand Down

0 comments on commit f3fe82b

Please sign in to comment.