From f37a1330954a757525a34ebecc074412e66d7fe8 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 29 Jun 2016 16:10:45 +0000 Subject: -add extra checks to catch shutdown bug --- src/gns/gnunet-service-gns.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/gns/gnunet-service-gns.c') diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index e2bb0ad8c..78c8e8233 100644 --- a/src/gns/gnunet-service-gns.c +++ b/src/gns/gnunet-service-gns.c @@ -274,9 +274,12 @@ shutdown_task (void *cls) } while (NULL != (clh = clh_head)) { - GNUNET_SERVER_client_set_user_context (clh->client, NULL); + GNUNET_SERVER_client_set_user_context (clh->client, + NULL); GNS_resolver_lookup_cancel (clh->lookup); - GNUNET_CONTAINER_DLL_remove (clh_head, clh_tail, clh); + GNUNET_CONTAINER_DLL_remove (clh_head, + clh_tail, + clh); GNUNET_free (clh); } @@ -303,7 +306,8 @@ shutdown_task (void *cls) } if (NULL != statistics) { - GNUNET_STATISTICS_destroy (statistics, GNUNET_NO); + GNUNET_STATISTICS_destroy (statistics, + GNUNET_NO); statistics = NULL; } if (NULL != zone_publish_task) @@ -353,6 +357,7 @@ static void publish_zone_dht_next (void *cls) { zone_publish_task = NULL; + GNUNET_assert (NULL != namestore_iter); GNUNET_NAMESTORE_zone_iterator_next (namestore_iter); } @@ -401,6 +406,7 @@ dht_put_continuation (void *cls, "Current zone iteration interval (ms)", next_put_interval.rel_value_us / 1000LL, GNUNET_NO); + GNUNET_assert (NULL == zone_publish_task); zone_publish_task = GNUNET_SCHEDULER_add_delayed (next_put_interval, &publish_zone_dht_next, NULL); @@ -584,6 +590,7 @@ put_gns_record (void *cls, "Number of public records in DHT", last_num_public_records, GNUNET_NO); + GNUNET_assert (NULL == zone_publish_task); if (0 == num_public_records) zone_publish_task = GNUNET_SCHEDULER_add_delayed (put_interval, &publish_zone_dht_start, @@ -601,6 +608,7 @@ put_gns_record (void *cls, /* We got a set of records to publish */ if (0 == rd_public_count) { + GNUNET_assert (NULL == zone_publish_task); zone_publish_task = GNUNET_SCHEDULER_add_now (&publish_zone_dht_next, NULL); return; @@ -633,6 +641,7 @@ publish_zone_dht_start (void *cls) "Starting DHT zone update!\n"); /* start counting again */ num_public_records = 0; + GNUNET_assert (NULL == namestore_iter); namestore_iter = GNUNET_NAMESTORE_zone_iteration_start (namestore_handle, NULL, /* All zones */ &put_gns_record, NULL ); @@ -846,6 +855,7 @@ notify_client_disconnect (void *cls, static void monitor_sync_event (void *cls) { + GNUNET_assert (NULL == zone_publish_task); zone_publish_task = GNUNET_SCHEDULER_add_now (&publish_zone_dht_start, NULL); } -- cgit v1.2.3