summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2015-02-15 17:19:51 +0000
committerJulius Bünger <buenger@mytum.de>2015-02-15 17:19:51 +0000
commit5a63f4cf0e61bc916e83a33f004263f9ff9e15f7 (patch)
tree37462836967973678b83e2dff445a8cb4731b377 /src
parentf921cbd8a9cdc617e6e60256d64459274733d7ce (diff)
- changed behaviour on peer disconnect
Diffstat (limited to 'src')
-rw-r--r--src/rps/gnunet-service-rps.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 874a5af0e..323a03bb2 100644
--- 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;
}
}