From d8cbbb5b6ba10b2c1ca5d889ecb3788f931d8566 Mon Sep 17 00:00:00 2001 From: ulfvonbelow Date: Sun, 29 Jan 2023 05:47:00 -0600 Subject: REVOCATION: add shutdown task earlier. There are many things that can go wrong and require cleanup before the shutdown task is currently added. In these cases, GNUNET_SCHEDULER_shutdown is run and run() is returned from. At present, the only harm in running shutdown_task earlier would be it unconditionally destroying revocation_map, so we can add it as soon as that exists. Signed-off-by: Martin Schanzenbach --- src/revocation/gnunet-service-revocation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c index e10771557..2cee70857 100644 --- a/src/revocation/gnunet-service-revocation.c +++ b/src/revocation/gnunet-service-revocation.c @@ -899,6 +899,8 @@ run (void *cls, cfg = c; revocation_map = GNUNET_CONTAINER_multihashmap_create (16, GNUNET_NO); + GNUNET_SCHEDULER_add_shutdown (&shutdown_task, + NULL); if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (cfg, "REVOCATION", @@ -1001,8 +1003,6 @@ run (void *cls, } GNUNET_free (fn); - GNUNET_SCHEDULER_add_shutdown (&shutdown_task, - NULL); peers = GNUNET_CONTAINER_multipeermap_create (128, GNUNET_YES); /* Connect to core service and register core handlers */ -- cgit v1.2.3