aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2018-10-31 11:52:23 +0100
committerJulius Bünger <buenger@mytum.de>2018-10-31 11:52:23 +0100
commitb6395044ac67983a271581839e945027f6c089cf (patch)
tree2afa204a3e5cfdb13b5fe12a780ca07e39f32e0f
parentec90e2445aa5e5650bbe3274b134a5bd35ed4d39 (diff)
downloadgnunet-b6395044ac67983a271581839e945027f6c089cf.tar.gz
gnunet-b6395044ac67983a271581839e945027f6c089cf.zip
RPS service: Try to fix peer destruction during cleanup
-rw-r--r--src/rps/gnunet-service-rps.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 2e2fa96a7..d129ba746 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -2690,6 +2690,14 @@ clean_peer (struct Sub *sub,
2690 #endif /* ENABLE_MALICIOUS */ 2690 #endif /* ENABLE_MALICIOUS */
2691 } 2691 }
2692 2692
2693 if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (sub->peer_map, peer))
2694 {
2695 /* Peer was already removed by callback on destroyed channel */
2696 LOG (GNUNET_ERROR_TYPE_WARNING,
2697 "Peer was removed from our knowledge during cleanup\n");
2698 return;
2699 }
2700
2693 if ( (GNUNET_NO == check_peer_send_intention (get_peer_ctx (sub->peer_map, 2701 if ( (GNUNET_NO == check_peer_send_intention (get_peer_ctx (sub->peer_map,
2694 peer))) && 2702 peer))) &&
2695 (GNUNET_NO == View_contains_peer (sub->view, peer)) && 2703 (GNUNET_NO == View_contains_peer (sub->view, peer)) &&
@@ -2729,7 +2737,8 @@ cleanup_destroyed_channel (void *cls,
2729 channel_ctx->channel = NULL; 2737 channel_ctx->channel = NULL;
2730 remove_channel_ctx (channel_ctx); 2738 remove_channel_ctx (channel_ctx);
2731 if (NULL != peer_ctx && 2739 if (NULL != peer_ctx &&
2732 peer_ctx->send_channel_ctx == channel_ctx) 2740 peer_ctx->send_channel_ctx == channel_ctx &&
2741 GNUNET_YES == check_sending_channel_needed (channel_ctx->peer_ctx))
2733 { 2742 {
2734 remove_peer (peer_ctx->sub, &peer_ctx->peer_id); 2743 remove_peer (peer_ctx->sub, &peer_ctx->peer_id);
2735 } 2744 }