gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r27383 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r27383 - gnunet/src/mesh
Date: Fri, 7 Jun 2013 03:35:33 +0200

Author: bartpolot
Date: 2013-06-07 03:35:33 +0200 (Fri, 07 Jun 2013)
New Revision: 27383

Modified:
   gnunet/src/mesh/gnunet-service-mesh-new.c
Log:
- avoid infinite loop when destroying local loop tunnel

Modified: gnunet/src/mesh/gnunet-service-mesh-new.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh-new.c   2013-06-07 01:31:02 UTC (rev 
27382)
+++ gnunet/src/mesh/gnunet-service-mesh-new.c   2013-06-07 01:35:33 UTC (rev 
27383)
@@ -2118,7 +2118,7 @@
               "  sending tunnel destroy for tunnel: %s [%X]\n",
               GNUNET_i2s (&msg.oid), t->id.tid);
 
-  if (NULL == t->client)
+  if (NULL == t->client && 0 != t->next_hop)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  child: %u\n", t->next_hop);
     GNUNET_PEER_resolve (t->next_hop, &id);
@@ -2127,7 +2127,7 @@
                 GNUNET_i2s (&id));
     send_prebuilt_message (&msg.header, t->next_hop, t);
   }
-  if (NULL == t->owner)
+  if (NULL == t->owner && 0 != t->prev_hop)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  parent: %u\n", t->prev_hop);
     GNUNET_PEER_resolve (t->prev_hop, &id);
@@ -2397,11 +2397,13 @@
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Client %u is destination.\n", 
c->id);
     t->client = NULL;
+    t->next_hop = 0;
   }
   else if (c == t->owner)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Client %u is owner.\n", c->id);
     t->owner = NULL;
+    t->prev_hop = 0;
   }
   else
   {




reply via email to

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