rps: flagging channels while destruction
authorJulius Bünger <buenger@mytum.de>
Fri, 29 Dec 2017 14:38:55 +0000 (15:38 +0100)
committerJulius Bünger <buenger@mytum.de>
Fri, 29 Dec 2017 14:38:55 +0000 (15:38 +0100)
src/rps/gnunet-service-rps.c

index 0b9e3e5374a621a532cf772d0e591ce2535ca5d0..2f0b2c5791a4c90495df62443864c71e874f01dc 100644 (file)
@@ -2568,6 +2568,7 @@ cleanup_destroyed_channel (void *cls,
 {
   struct GNUNET_PeerIdentity *peer = cls;
   uint32_t *channel_flag;
+  struct PeerContext *peer_ctx;
 
   if (GNUNET_NO == Peers_check_peer_known (peer))
   { /* We don't know a context to that peer */
@@ -2577,6 +2578,15 @@ cleanup_destroyed_channel (void *cls,
     return;
   }
 
+  peer_ctx = get_peer_ctx (peer);
+  if (GNUNET_YES == Peers_check_channel_role (peer, channel, Peers_CHANNEL_ROLE_RECEIVING))
+  {
+    set_channel_flag (peer_ctx->recv_channel_flags, Peers_CHANNEL_DESTROING);
+  } else if (GNUNET_YES == Peers_check_channel_role (peer, channel, Peers_CHANNEL_ROLE_SENDING))
+  {
+    set_channel_flag (peer_ctx->send_channel_flags, Peers_CHANNEL_DESTROING);
+  }
+
   if (GNUNET_YES == Peers_check_peer_flag (peer, Peers_TO_DESTROY))
   { /* We are in the middle of removing that peer from our knowledge. In this
        case simply make sure that the channels are cleaned. */