gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r35041 - gnunet/src/rps


From: gnunet
Subject: [GNUnet-SVN] r35041 - gnunet/src/rps
Date: Wed, 28 Jan 2015 19:56:03 +0100

Author: bartpolot
Date: 2015-01-28 19:56:03 +0100 (Wed, 28 Jan 2015)
New Revision: 35041

Modified:
   gnunet/src/rps/gnunet-service-rps.c
Log:
- avoid chain-calling the destroy handler to destroy the channel currently 
being destroyed

Modified: gnunet/src/rps/gnunet-service-rps.c
===================================================================
--- gnunet/src/rps/gnunet-service-rps.c 2015-01-28 18:48:19 UTC (rev 35040)
+++ gnunet/src/rps/gnunet-service-rps.c 2015-01-28 18:56:03 UTC (rev 35041)
@@ -1388,6 +1388,7 @@
 {
   struct PeerContext *peer_ctx;
   const struct GNUNET_CADET_Channel *ch = (const struct GNUNET_CADET_Channel 
*) cls;
+  struct GNUNET_CADET_Channel *destroy;
 
   peer_ctx = (struct PeerContext *) value;
 
@@ -1402,11 +1403,19 @@
 
   if (NULL  != peer_ctx->send_channel
       && ch != peer_ctx->send_channel)
-    GNUNET_CADET_channel_destroy (peer_ctx->send_channel);
+  {
+    destroy = peer_ctx->send_channel;
+    peer_ctx->send_channel = NULL;
+    GNUNET_CADET_channel_destroy (destroy);
+  }
 
   if (NULL  != peer_ctx->recv_channel
       && ch != peer_ctx->recv_channel)
-    GNUNET_CADET_channel_destroy (peer_ctx->recv_channel);
+  {
+    destroy = peer_ctx->recv_channel;
+    peer_ctx->recv_channel = NULL;
+    GNUNET_CADET_channel_destroy (destroy);
+  }
 
   if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_remove_all (peer_map, key))
     LOG (GNUNET_ERROR_TYPE_WARNING, "removing peer from peer_map failed\n");




reply via email to

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