From b37045470834cf349c8bdf31938823809e67bfb5 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Thu, 30 May 2013 00:09:55 +0000 Subject: [PATCH] - adjust timeout when no more strings are left to be found --- src/regex/gnunet-regex-profiler.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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]; -- 2.25.1