aboutsummaryrefslogtreecommitdiff
path: root/src/service/peerstore/gnunet-service-peerstore.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/service/peerstore/gnunet-service-peerstore.c')
-rw-r--r--src/service/peerstore/gnunet-service-peerstore.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/service/peerstore/gnunet-service-peerstore.c b/src/service/peerstore/gnunet-service-peerstore.c
index ee9847164..72c7b035f 100644
--- a/src/service/peerstore/gnunet-service-peerstore.c
+++ b/src/service/peerstore/gnunet-service-peerstore.c
@@ -282,10 +282,12 @@ static struct Monitor *monitors_tail;
282static struct GNUNET_NotificationContext *monitor_nc; 282static struct GNUNET_NotificationContext *monitor_nc;
283 283
284/** 284/**
285 * Perform the actual shutdown operations 285 * Task run during shutdown.
286 *
287 * @param cls unused
286 */ 288 */
287static void 289static void
288do_shutdown () 290shutdown_task (void *cls)
289{ 291{
290 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 292 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
291 "Shutting down peerstore, bye.\n"); 293 "Shutting down peerstore, bye.\n");
@@ -305,21 +307,6 @@ do_shutdown ()
305 GNUNET_notification_context_destroy (monitor_nc); 307 GNUNET_notification_context_destroy (monitor_nc);
306 monitor_nc = NULL; 308 monitor_nc = NULL;
307 } 309 }
308 GNUNET_SCHEDULER_shutdown ();
309}
310
311
312/**
313 * Task run during shutdown.
314 *
315 * @param cls unused
316 */
317static void
318shutdown_task (void *cls)
319{
320 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
321 "Priming PEERSTORE for shutdown.\n");
322 do_shutdown ();
323} 310}
324 311
325 312
@@ -896,6 +883,7 @@ handle_monitor_start (void *cls, const struct PeerstoreMonitorStartMessage *msm)
896 monitors_tail, 883 monitors_tail,
897 mc); 884 mc);
898 GNUNET_SERVICE_client_mark_monitor (mc->pc->client); 885 GNUNET_SERVICE_client_mark_monitor (mc->pc->client);
886 GNUNET_SERVICE_client_continue (mc->pc->client);
899 GNUNET_notification_context_add (monitor_nc, mc->pc->mq); 887 GNUNET_notification_context_add (monitor_nc, mc->pc->mq);
900 if (mc->in_first_iteration) 888 if (mc->in_first_iteration)
901 mc->task = GNUNET_SCHEDULER_add_now (&monitor_iteration_next, mc); 889 mc->task = GNUNET_SCHEDULER_add_now (&monitor_iteration_next, mc);
@@ -1091,6 +1079,7 @@ client_disconnect_cb (void *cls,
1091 { 1079 {
1092 if (pc != mo->pc) 1080 if (pc != mo->pc)
1093 continue; 1081 continue;
1082 GNUNET_CONTAINER_DLL_remove (monitors_head, monitors_tail, mo);
1094 if (NULL != mo->task) 1083 if (NULL != mo->task)
1095 { 1084 {
1096 GNUNET_SCHEDULER_cancel (mo->task); 1085 GNUNET_SCHEDULER_cancel (mo->task);