diff options
author | Julius Bünger <buenger@mytum.de> | 2017-12-29 15:38:55 +0100 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2017-12-29 15:38:55 +0100 |
commit | a8b68db5ecda35da151e05ce7f475675d276996e (patch) | |
tree | 622a01bac0d510b85f02c7de899775229d270ccd /src/rps | |
parent | f2b64da6fd07c3a20c8f202fa8920f9f2e96e51e (diff) | |
download | gnunet-a8b68db5ecda35da151e05ce7f475675d276996e.tar.gz gnunet-a8b68db5ecda35da151e05ce7f475675d276996e.zip |
rps: flagging channels while destruction
Diffstat (limited to 'src/rps')
-rw-r--r-- | src/rps/gnunet-service-rps.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index 0b9e3e537..2f0b2c579 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c | |||
@@ -2568,6 +2568,7 @@ cleanup_destroyed_channel (void *cls, | |||
2568 | { | 2568 | { |
2569 | struct GNUNET_PeerIdentity *peer = cls; | 2569 | struct GNUNET_PeerIdentity *peer = cls; |
2570 | uint32_t *channel_flag; | 2570 | uint32_t *channel_flag; |
2571 | struct PeerContext *peer_ctx; | ||
2571 | 2572 | ||
2572 | if (GNUNET_NO == Peers_check_peer_known (peer)) | 2573 | if (GNUNET_NO == Peers_check_peer_known (peer)) |
2573 | { /* We don't know a context to that peer */ | 2574 | { /* We don't know a context to that peer */ |
@@ -2577,6 +2578,15 @@ cleanup_destroyed_channel (void *cls, | |||
2577 | return; | 2578 | return; |
2578 | } | 2579 | } |
2579 | 2580 | ||
2581 | peer_ctx = get_peer_ctx (peer); | ||
2582 | if (GNUNET_YES == Peers_check_channel_role (peer, channel, Peers_CHANNEL_ROLE_RECEIVING)) | ||
2583 | { | ||
2584 | set_channel_flag (peer_ctx->recv_channel_flags, Peers_CHANNEL_DESTROING); | ||
2585 | } else if (GNUNET_YES == Peers_check_channel_role (peer, channel, Peers_CHANNEL_ROLE_SENDING)) | ||
2586 | { | ||
2587 | set_channel_flag (peer_ctx->send_channel_flags, Peers_CHANNEL_DESTROING); | ||
2588 | } | ||
2589 | |||
2580 | if (GNUNET_YES == Peers_check_peer_flag (peer, Peers_TO_DESTROY)) | 2590 | if (GNUNET_YES == Peers_check_peer_flag (peer, Peers_TO_DESTROY)) |
2581 | { /* We are in the middle of removing that peer from our knowledge. In this | 2591 | { /* We are in the middle of removing that peer from our knowledge. In this |
2582 | case simply make sure that the channels are cleaned. */ | 2592 | case simply make sure that the channels are cleaned. */ |