From: Matthias Wachs Date: Mon, 17 May 2010 14:32:31 +0000 (+0000) Subject: (no commit message) X-Git-Tag: initial-import-from-subversion-38251~21677 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e95c25e12c6f8693c400ba7272317628a0c79ef2;p=oweals%2Fgnunet.git --- diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c index 8ddca00c7..f25e4f6ca 100644 --- a/src/hostlist/gnunet-daemon-hostlist.c +++ b/src/hostlist/gnunet-daemon-hostlist.c @@ -74,6 +74,11 @@ static int bootstrapping; */ static int learning; +/** + * Our configuration. + */ +static const struct GNUNET_CONFIGURATION_Handle *cfg; + /** * Statistics handle. */ @@ -251,6 +256,15 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_NO); stats = NULL; } + if (cfg != NULL) + { + GNUNET_CONFIGURATION_destroy(cfg); + } + if (tc->sched!=NULL) + { + GNUNET_SCHEDULER_shutdown (tc->sched); + + } } /** @@ -297,6 +311,9 @@ run (void *cls, _("None of the functions for the hostlist daemon were enabled. I have no reason to run!\n")); return; } + + + stats = GNUNET_STATISTICS_create (sched, "hostlist", cfg); core = GNUNET_CORE_connect (sched, cfg, diff --git a/src/hostlist/hostlist-server.c b/src/hostlist/hostlist-server.c index 098d766dd..53f2470a7 100644 --- a/src/hostlist/hostlist-server.c +++ b/src/hostlist/hostlist-server.c @@ -736,6 +736,8 @@ GNUNET_HOSTLIST_server_stop () GNUNET_PEERINFO_disconnect (peerinfo); peerinfo = NULL; } + cfg = NULL; + sched = NULL; } /* end of hostlist-server.c */ diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c index dcfb226cf..c08af48fb 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c @@ -160,9 +160,6 @@ static void shutdown_testcase() GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hostlist server ARM process %u stopped\n", adv_peer.arm_pid); #endif - /* - if (NULL != adv_peer.cfg) - GNUNET_CONFIGURATION_destroy (adv_peer.cfg);*/ #if START_ARM @@ -175,13 +172,16 @@ static void shutdown_testcase() GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hostlist client ARM process %u stopped\n", learn_peer.arm_pid); #endif - /* + if (NULL != learn_peer.cfg) - GNUNET_CONFIGURATION_destroy (learn_peer.cfg);*/ + GNUNET_CONFIGURATION_destroy (learn_peer.cfg); + if (NULL != adv_peer.cfg) + GNUNET_CONFIGURATION_destroy (adv_peer.cfg); - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown complete....\n"); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down scheduler\n"); GNUNET_SCHEDULER_shutdown (sched); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown complete....\n"); + } /**