From: Bart Polot Date: Thu, 30 May 2013 00:09:55 +0000 (+0000) Subject: - adjust timeout when no more strings are left to be found X-Git-Tag: initial-import-from-subversion-38251~8872 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b37045470834cf349c8bdf31938823809e67bfb5;p=oweals%2Fgnunet.git - adjust timeout when no more strings are left to be found --- diff --git a/src/regex/gnunet-regex-profiler.c b/src/regex/gnunet-regex-profiler.c index c38615498..d5a962f6f 100644 --- a/src/regex/gnunet-regex-profiler.c +++ b/src/regex/gnunet-regex-profiler.c @@ -978,9 +978,17 @@ announce_next_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { struct RegexPeer *peer; - if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) || - next_search >= num_peers) + if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) + return; + if (next_search >= num_peers) + { + if (GNUNET_SCHEDULER_NO_TASK != search_timeout_task) + GNUNET_SCHEDULER_cancel (search_timeout_task); + search_timeout_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_HOURS, + &search_timed_out, + NULL); return; + } GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Starting daemon %u\n", next_search); peer = &peers[next_search];