diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-05-31 12:46:17 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-05-31 12:46:17 +0000 |
commit | 3738046948e0eaacdc851b0b78ff8e66c5401e04 (patch) | |
tree | 4d15ad47b2998d0f5b0bb27ed8e3910cad7c4d6e /src/regex/gnunet-regex-profiler.c | |
parent | ecdc35a09b840720e1b87f2d51aba537976ccf3f (diff) | |
download | gnunet-3738046948e0eaacdc851b0b78ff8e66c5401e04.tar.gz gnunet-3738046948e0eaacdc851b0b78ff8e66c5401e04.zip |
- fix timeout handling
Diffstat (limited to 'src/regex/gnunet-regex-profiler.c')
-rw-r--r-- | src/regex/gnunet-regex-profiler.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/regex/gnunet-regex-profiler.c b/src/regex/gnunet-regex-profiler.c index 29e6372d8..b5f27def4 100644 --- a/src/regex/gnunet-regex-profiler.c +++ b/src/regex/gnunet-regex-profiler.c | |||
@@ -789,7 +789,10 @@ regex_found_handler (void *cls, | |||
789 | GNUNET_STRINGS_relative_time_to_string (prof_time, GNUNET_NO)); | 789 | GNUNET_STRINGS_relative_time_to_string (prof_time, GNUNET_NO)); |
790 | 790 | ||
791 | if (GNUNET_SCHEDULER_NO_TASK != search_timeout_task) | 791 | if (GNUNET_SCHEDULER_NO_TASK != search_timeout_task) |
792 | { | ||
792 | GNUNET_SCHEDULER_cancel (search_timeout_task); | 793 | GNUNET_SCHEDULER_cancel (search_timeout_task); |
794 | search_timeout_task = GNUNET_SCHEDULER_NO_TASK; | ||
795 | } | ||
793 | 796 | ||
794 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Collecting stats and shutting down.\n"); | 797 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Collecting stats and shutting down.\n"); |
795 | GNUNET_SCHEDULER_add_now (&do_collect_stats, NULL); | 798 | GNUNET_SCHEDULER_add_now (&do_collect_stats, NULL); |
@@ -982,11 +985,14 @@ announce_next_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
982 | return; | 985 | return; |
983 | if (next_search >= num_peers) | 986 | if (next_search >= num_peers) |
984 | { | 987 | { |
985 | if (GNUNET_SCHEDULER_NO_TASK != search_timeout_task) | 988 | if (strings_found != num_peers) |
986 | GNUNET_SCHEDULER_cancel (search_timeout_task); | 989 | { |
987 | search_timeout_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_HOURS, | 990 | if (GNUNET_SCHEDULER_NO_TASK != search_timeout_task) |
988 | &search_timed_out, | 991 | GNUNET_SCHEDULER_cancel (search_timeout_task); |
989 | NULL); | 992 | search_timeout_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_HOURS, |
993 | &search_timed_out, | ||
994 | NULL); | ||
995 | } | ||
990 | return; | 996 | return; |
991 | } | 997 | } |
992 | 998 | ||