From b6377a22a050b818eaa184b98e938ca41465c5eb Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Sun, 25 Feb 2024 17:15:20 +0100 Subject: PEERSTORE: Fix incorrect message type use. --- src/service/peerstore/gnunet-service-peerstore.c | 23 ++++++----------------- src/service/peerstore/peerstore_api.c | 2 +- 2 files changed, 7 insertions(+), 18 deletions(-) (limited to 'src') 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; static struct GNUNET_NotificationContext *monitor_nc; /** - * Perform the actual shutdown operations + * Task run during shutdown. + * + * @param cls unused */ static void -do_shutdown () +shutdown_task (void *cls) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down peerstore, bye.\n"); @@ -305,21 +307,6 @@ do_shutdown () GNUNET_notification_context_destroy (monitor_nc); monitor_nc = NULL; } - GNUNET_SCHEDULER_shutdown (); -} - - -/** - * Task run during shutdown. - * - * @param cls unused - */ -static void -shutdown_task (void *cls) -{ - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Priming PEERSTORE for shutdown.\n"); - do_shutdown (); } @@ -896,6 +883,7 @@ handle_monitor_start (void *cls, const struct PeerstoreMonitorStartMessage *msm) monitors_tail, mc); GNUNET_SERVICE_client_mark_monitor (mc->pc->client); + GNUNET_SERVICE_client_continue (mc->pc->client); GNUNET_notification_context_add (monitor_nc, mc->pc->mq); if (mc->in_first_iteration) mc->task = GNUNET_SCHEDULER_add_now (&monitor_iteration_next, mc); @@ -1091,6 +1079,7 @@ client_disconnect_cb (void *cls, { if (pc != mo->pc) continue; + GNUNET_CONTAINER_DLL_remove (monitors_head, monitors_tail, mo); if (NULL != mo->task) { GNUNET_SCHEDULER_cancel (mo->task); diff --git a/src/service/peerstore/peerstore_api.c b/src/service/peerstore/peerstore_api.c index 9f6523e38..a69237c9b 100644 --- a/src/service/peerstore/peerstore_api.c +++ b/src/service/peerstore/peerstore_api.c @@ -714,7 +714,7 @@ GNUNET_PEERSTORE_iteration_stop (struct GNUNET_PEERSTORE_IterateContext *ic) "Sending PEERSTORE_ITERATION_STOP message\n"); if (NULL != ic->h->mq) { - ev = GNUNET_MQ_msg (ism, GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_END); + ev = GNUNET_MQ_msg (ism, GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_STOP); ism->rid = htons (ic->rid); if (NULL != ic->h->mq) GNUNET_MQ_send (ic->h->mq, ev); -- cgit v1.2.3