From bb3371542e3c1fff2c4abb4d2ba3decf925b4352 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20B=C3=BCnger?= Date: Mon, 2 Jul 2018 12:48:05 +0200 Subject: [PATCH] rps service: set delete flags on channel properly --- po/POTFILES.in | 1 + src/rps/gnunet-service-rps.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/po/POTFILES.in b/po/POTFILES.in index 38fa52508..8a95064a6 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -325,6 +325,7 @@ src/rps/gnunet-service-rps_sampler.c src/rps/gnunet-service-rps_sampler_elem.c src/rps/gnunet-service-rps_view.c src/rps/rps_api.c +src/rps/rps_test_lib.c src/rps/rps-test_util.c src/scalarproduct/gnunet-scalarproduct.c src/scalarproduct/gnunet-service-scalarproduct_alice.c diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index 84fb33be2..5a75ac55a 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c @@ -1666,10 +1666,11 @@ Peers_cleanup_destroyed_channel (void *cls, { struct GNUNET_PeerIdentity *peer = cls; struct PeerContext *peer_ctx; + uint32_t *channel_flag; if (GNUNET_NO == Peers_check_peer_known (peer)) {/* We don't want to implicitly create a context that we're about to kill */ - LOG (GNUNET_ERROR_TYPE_DEBUG, + LOG (GNUNET_ERROR_TYPE_WARNING, "channel (%s) without associated context was destroyed\n", GNUNET_i2s (peer)); return; @@ -1697,12 +1698,16 @@ Peers_cleanup_destroyed_channel (void *cls, if (NULL != peer_ctx->send_channel) { GNUNET_CADET_channel_destroy (peer_ctx->send_channel); + channel_flag = Peers_get_channel_flag (&peer_ctx->peer_id, Peers_CHANNEL_ROLE_SENDING); + Peers_set_channel_flag (channel_flag, Peers_CHANNEL_DESTROING); peer_ctx->send_channel = NULL; peer_ctx->mq = NULL; } if (NULL != peer_ctx->recv_channel) { GNUNET_CADET_channel_destroy (peer_ctx->recv_channel); + channel_flag = Peers_get_channel_flag (&peer_ctx->peer_id, Peers_CHANNEL_ROLE_RECEIVING); + Peers_set_channel_flag (channel_flag, Peers_CHANNEL_DESTROING); peer_ctx->recv_channel = NULL; } /* Set the #Peers_ONLINE flag accordingly */ -- 2.25.1