From 95f9076a2139f5fb042b944a0658b6cda2fa35db Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 30 Apr 2016 08:17:37 +0000 Subject: implementing new scheduler shutdown semantics --- src/topology/gnunet-daemon-topology.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/topology/gnunet-daemon-topology.c') 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) struct FindAdvHelloContext fah; size_t next_want; struct GNUNET_TIME_Relative delay; - const struct GNUNET_SCHEDULER_TaskContext *tc; pl->hello_delay_task = NULL; GNUNET_assert (GNUNET_YES == pl->is_connected); - tc = GNUNET_SCHEDULER_get_task_context (); - if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) - return; /* we're out of here */ if (pl->hello_req != NULL) return; /* did not finish sending the previous one */ /* find applicable HELLOs */ @@ -535,7 +531,7 @@ schedule_next_hello (void *cls) GNUNET_SCHEDULER_add_delayed (fah.next_adv, &schedule_next_hello, pl); - if (fah.result == NULL) + if (NULL == fah.result) return; next_want = GNUNET_HELLO_size (fah.result->hello); delay = GNUNET_TIME_absolute_get_remaining (pl->next_hello_allowed); @@ -1241,9 +1237,8 @@ run (void *cls, NULL, GNUNET_NO, NULL, GNUNET_NO, handlers); - GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, - &cleaning_task, - NULL); + GNUNET_SCHEDULER_add_shutdown (&cleaning_task, + NULL); if (NULL == transport) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, -- cgit v1.2.3