diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2024-02-25 17:15:20 +0100 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2024-02-25 17:15:20 +0100 |
commit | b6377a22a050b818eaa184b98e938ca41465c5eb (patch) | |
tree | 3bb787bc65d5557e60370f2a4aebdd189b4cd70f | |
parent | c38572985e80f253fdca25cfeefda777bb02bbaf (diff) | |
download | gnunet-b6377a22a050b818eaa184b98e938ca41465c5eb.tar.gz gnunet-b6377a22a050b818eaa184b98e938ca41465c5eb.zip |
PEERSTORE: Fix incorrect message type use.
-rw-r--r-- | src/service/peerstore/gnunet-service-peerstore.c | 23 | ||||
-rw-r--r-- | src/service/peerstore/peerstore_api.c | 2 |
2 files changed, 7 insertions, 18 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; | |||
282 | static struct GNUNET_NotificationContext *monitor_nc; | 282 | static 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 | */ |
287 | static void | 289 | static void |
288 | do_shutdown () | 290 | shutdown_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 | */ | ||
317 | static void | ||
318 | shutdown_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); |
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) | |||
714 | "Sending PEERSTORE_ITERATION_STOP message\n"); | 714 | "Sending PEERSTORE_ITERATION_STOP message\n"); |
715 | if (NULL != ic->h->mq) | 715 | if (NULL != ic->h->mq) |
716 | { | 716 | { |
717 | ev = GNUNET_MQ_msg (ism, GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_END); | 717 | ev = GNUNET_MQ_msg (ism, GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_STOP); |
718 | ism->rid = htons (ic->rid); | 718 | ism->rid = htons (ic->rid); |
719 | if (NULL != ic->h->mq) | 719 | if (NULL != ic->h->mq) |
720 | GNUNET_MQ_send (ic->h->mq, ev); | 720 | GNUNET_MQ_send (ic->h->mq, ev); |