gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: RPS service: Check existenc


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: RPS service: Check existence of peer before destruction
Date: Thu, 21 Feb 2019 16:41:59 +0100

This is an automated email from the git hooks/post-receive script.

julius-buenger pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 6795812d9 RPS service: Check existence of peer before destruction
6795812d9 is described below

commit 6795812d9db9bc981e62042447bdffbf2ee4a8d9
Author: Julius Bünger <address@hidden>
AuthorDate: Thu Feb 21 16:36:05 2019 +0100

    RPS service: Check existence of peer before destruction
    
    This is only a workaround.
    What was causing an issue was that, during the removal of a peer (from
    all datastructures), the peer was also removed from the peer_map,
    causing the final destruction call to fail.
    With this workaround the peer is only destroyed if it is still in the
    peer_map.
---
 src/rps/gnunet-service-rps.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index a448d17e4..35ed1022f 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -2676,11 +2676,23 @@ static void
 remove_peer (struct Sub *sub,
              const struct GNUNET_PeerIdentity *peer)
 {
-  (void) View_remove_peer (sub->view, peer);
-  CustomPeerMap_remove_peer (sub->pull_map, peer);
-  CustomPeerMap_remove_peer (sub->push_map, peer);
-  RPS_sampler_reinitialise_by_value (sub->sampler, peer);
-  destroy_peer (get_peer_ctx (sub->peer_map, peer));
+  (void) View_remove_peer (sub->view,
+                           peer);
+  CustomPeerMap_remove_peer (sub->pull_map,
+                             peer);
+  CustomPeerMap_remove_peer (sub->push_map,
+                             peer);
+  RPS_sampler_reinitialise_by_value (sub->sampler,
+                                     peer);
+  /* We want to destroy the peer now.
+   * Sometimes, it just seems that it's already been removed from the peer_map,
+   * so check the peer_map first. */
+  if (GNUNET_YES == check_peer_known (sub->peer_map,
+                                      peer))
+  {
+          destroy_peer (get_peer_ctx (sub->peer_map,
+                                      peer));
+  }
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]