aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorulfvonbelow <strilen@tilde.club>2023-01-29 05:47:00 -0600
committerMartin Schanzenbach <schanzen@gnunet.org>2023-02-06 13:33:43 +0900
commitd8cbbb5b6ba10b2c1ca5d889ecb3788f931d8566 (patch)
treedeeac3c8e67fae31824f91cc1accfad92d0e0ce3
parent491979ce510a5dd0f7afd7630a4e3ba55f1c5f37 (diff)
downloadgnunet-d8cbbb5b6ba10b2c1ca5d889ecb3788f931d8566.tar.gz
gnunet-d8cbbb5b6ba10b2c1ca5d889ecb3788f931d8566.zip
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 <schanzen@gnunet.org>
-rw-r--r--src/revocation/gnunet-service-revocation.c4
1 files 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,
899 cfg = c; 899 cfg = c;
900 revocation_map = GNUNET_CONTAINER_multihashmap_create (16, 900 revocation_map = GNUNET_CONTAINER_multihashmap_create (16,
901 GNUNET_NO); 901 GNUNET_NO);
902 GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
903 NULL);
902 if (GNUNET_OK != 904 if (GNUNET_OK !=
903 GNUNET_CONFIGURATION_get_value_number (cfg, 905 GNUNET_CONFIGURATION_get_value_number (cfg,
904 "REVOCATION", 906 "REVOCATION",
@@ -1001,8 +1003,6 @@ run (void *cls,
1001 } 1003 }
1002 GNUNET_free (fn); 1004 GNUNET_free (fn);
1003 1005
1004 GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
1005 NULL);
1006 peers = GNUNET_CONTAINER_multipeermap_create (128, 1006 peers = GNUNET_CONTAINER_multipeermap_create (128,
1007 GNUNET_YES); 1007 GNUNET_YES);
1008 /* Connect to core service and register core handlers */ 1008 /* Connect to core service and register core handlers */