commit 5a63f4cf0e61bc916e83a33f004263f9ff9e15f7
parent f921cbd8a9cdc617e6e60256d64459274733d7ce
Author: Julius Bünger <buenger@mytum.de>
Date: Sun, 15 Feb 2015 17:19:51 +0000
- changed behaviour on peer disconnect
Diffstat:
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
@@ -1750,9 +1750,17 @@ cleanup_channel (void *cls,
if (NULL == peer_ctx) /* It could have been removed by shutdown_task */
return;
- /* Somwewhat {ab,re}use the iterator function */
- /* Cast to void is ok, because it's used as void in peer_remove_cb */
- (void) peer_remove_cb ((void *) channel, peer, peer_ctx);
+ if (channel == peer_ctx->send_channel)
+ { /* Peer probably went down */
+ rem_from_list (&gossip_list, &gossip_list_size, peer);
+ rem_from_list (&pending_pull_reply_list, &pending_pull_reply_list_size, peer);
+
+ /* Somwewhat {ab,re}use the iterator function */
+ /* Cast to void is ok, because it's used as void in peer_remove_cb */
+ (void) peer_remove_cb ((void *) channel, peer, peer_ctx);
+ }
+ else
+ peer_ctx->recv_channel = NULL;
}
}