diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-30 08:17:37 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-30 08:17:37 +0000 |
commit | 95f9076a2139f5fb042b944a0658b6cda2fa35db (patch) | |
tree | b0826a2a1dcf812e6b4450fe6b05d47cd53ae49d /src/topology | |
parent | 7746f68db77b9ca3c4aaca24ab2ce5253461240b (diff) | |
download | gnunet-95f9076a2139f5fb042b944a0658b6cda2fa35db.tar.gz gnunet-95f9076a2139f5fb042b944a0658b6cda2fa35db.zip |
implementing new scheduler shutdown semantics
Diffstat (limited to 'src/topology')
-rw-r--r-- | src/topology/gnunet-daemon-topology.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c index 1a6c163ee..eddac8c8a 100644 --- a/src/topology/gnunet-daemon-topology.c +++ b/src/topology/gnunet-daemon-topology.c | |||
@@ -514,13 +514,9 @@ schedule_next_hello (void *cls) | |||
514 | struct FindAdvHelloContext fah; | 514 | struct FindAdvHelloContext fah; |
515 | size_t next_want; | 515 | size_t next_want; |
516 | struct GNUNET_TIME_Relative delay; | 516 | struct GNUNET_TIME_Relative delay; |
517 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
518 | 517 | ||
519 | pl->hello_delay_task = NULL; | 518 | pl->hello_delay_task = NULL; |
520 | GNUNET_assert (GNUNET_YES == pl->is_connected); | 519 | GNUNET_assert (GNUNET_YES == pl->is_connected); |
521 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
522 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | ||
523 | return; /* we're out of here */ | ||
524 | if (pl->hello_req != NULL) | 520 | if (pl->hello_req != NULL) |
525 | return; /* did not finish sending the previous one */ | 521 | return; /* did not finish sending the previous one */ |
526 | /* find applicable HELLOs */ | 522 | /* find applicable HELLOs */ |
@@ -535,7 +531,7 @@ schedule_next_hello (void *cls) | |||
535 | GNUNET_SCHEDULER_add_delayed (fah.next_adv, | 531 | GNUNET_SCHEDULER_add_delayed (fah.next_adv, |
536 | &schedule_next_hello, | 532 | &schedule_next_hello, |
537 | pl); | 533 | pl); |
538 | if (fah.result == NULL) | 534 | if (NULL == fah.result) |
539 | return; | 535 | return; |
540 | next_want = GNUNET_HELLO_size (fah.result->hello); | 536 | next_want = GNUNET_HELLO_size (fah.result->hello); |
541 | delay = GNUNET_TIME_absolute_get_remaining (pl->next_hello_allowed); | 537 | delay = GNUNET_TIME_absolute_get_remaining (pl->next_hello_allowed); |
@@ -1241,9 +1237,8 @@ run (void *cls, | |||
1241 | NULL, GNUNET_NO, | 1237 | NULL, GNUNET_NO, |
1242 | NULL, GNUNET_NO, | 1238 | NULL, GNUNET_NO, |
1243 | handlers); | 1239 | handlers); |
1244 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 1240 | GNUNET_SCHEDULER_add_shutdown (&cleaning_task, |
1245 | &cleaning_task, | 1241 | NULL); |
1246 | NULL); | ||
1247 | if (NULL == transport) | 1242 | if (NULL == transport) |
1248 | { | 1243 | { |
1249 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1244 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |