diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-06-16 11:34:16 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-06-16 11:34:16 +0000 |
commit | f7f92cced4a202b846a152fd582b9fb0ecb16473 (patch) | |
tree | 03d04034c8a468295e5d8c75544363580e570d2e | |
parent | a25e91fe64981bad87d8a2a438b87a60a86041a3 (diff) | |
download | gnunet-f7f92cced4a202b846a152fd582b9fb0ecb16473.tar.gz gnunet-f7f92cced4a202b846a152fd582b9fb0ecb16473.zip |
cleaner
-rw-r--r-- | src/core/test_core_api_preferences.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/core/test_core_api_preferences.c b/src/core/test_core_api_preferences.c index eb56a91fb..5e8448880 100644 --- a/src/core/test_core_api_preferences.c +++ b/src/core/test_core_api_preferences.c | |||
@@ -103,7 +103,10 @@ terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
103 | if (GNUNET_SCHEDULER_NO_TASK != irc_task) | 103 | if (GNUNET_SCHEDULER_NO_TASK != irc_task) |
104 | GNUNET_SCHEDULER_cancel (irc_task); | 104 | GNUNET_SCHEDULER_cancel (irc_task); |
105 | if (GNUNET_SCHEDULER_NO_TASK != ask_task) | 105 | if (GNUNET_SCHEDULER_NO_TASK != ask_task) |
106 | GNUNET_SCHEDULER_cancel (ask_task); | 106 | { |
107 | GNUNET_SCHEDULER_cancel (ask_task); | ||
108 | ask_task = GNUNET_SCHEDULER_NO_TASK; | ||
109 | } | ||
107 | GNUNET_CORE_disconnect (p1.ch); | 110 | GNUNET_CORE_disconnect (p1.ch); |
108 | GNUNET_CORE_disconnect (p2.ch); | 111 | GNUNET_CORE_disconnect (p2.ch); |
109 | GNUNET_TRANSPORT_disconnect (p1.th); | 112 | GNUNET_TRANSPORT_disconnect (p1.th); |
@@ -233,8 +236,11 @@ connect_notify (void *cls, | |||
233 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 236 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
234 | "Encrypted connection established to peer `%4s'\n", | 237 | "Encrypted connection established to peer `%4s'\n", |
235 | GNUNET_i2s (peer)); | 238 | GNUNET_i2s (peer)); |
236 | GNUNET_SCHEDULER_cancel (ask_task); | 239 | if (GNUNET_SCHEDULER_NO_TASK != ask_task) |
237 | ask_task = GNUNET_SCHEDULER_NO_TASK; | 240 | { |
241 | GNUNET_SCHEDULER_cancel (ask_task); | ||
242 | ask_task = GNUNET_SCHEDULER_NO_TASK; | ||
243 | } | ||
238 | GNUNET_SCHEDULER_cancel (err_task); | 244 | GNUNET_SCHEDULER_cancel (err_task); |
239 | err_task = | 245 | err_task = |
240 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 120), | 246 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 120), |
@@ -314,6 +320,8 @@ static void | |||
314 | ask_connect_task (void *cls, | 320 | ask_connect_task (void *cls, |
315 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 321 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
316 | { | 322 | { |
323 | if (GNUNET_SCHEDULER_NO_TASK != ask_task) | ||
324 | GNUNET_SCHEDULER_cancel (ask_task); | ||
317 | ask_task = | 325 | ask_task = |
318 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, | 326 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, |
319 | &ask_connect_task, NULL); | 327 | &ask_connect_task, NULL); |
@@ -366,6 +374,8 @@ init_notify (void *cls, | |||
366 | err_task = | 374 | err_task = |
367 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 60), | 375 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 60), |
368 | &terminate_task_error, NULL); | 376 | &terminate_task_error, NULL); |
377 | if (GNUNET_SCHEDULER_NO_TASK != ask_task) | ||
378 | GNUNET_SCHEDULER_cancel (ask_task); | ||
369 | ask_task = | 379 | ask_task = |
370 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, | 380 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, |
371 | &ask_connect_task, NULL); | 381 | &ask_connect_task, NULL); |