rps service: set delete flags on channel properly
authorJulius Bünger <buenger@mytum.de>
Mon, 2 Jul 2018 10:48:05 +0000 (12:48 +0200)
committerJulius Bünger <buenger@mytum.de>
Mon, 2 Jul 2018 10:49:16 +0000 (12:49 +0200)
po/POTFILES.in
src/rps/gnunet-service-rps.c

index 38fa52508c29c48660f188a2e59b256485dd3d3e..8a95064a6dc9c23e4e6217868563bffe010d373b 100644 (file)
@@ -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
index 84fb33be26017726076f6c387ab4d88f7afe0d38..5a75ac55a0fde5d1ab3880387667c300d7246b8a 100644 (file)
@@ -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 */