gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r25377 - gnunet/src/mesh
Date: Mon, 10 Dec 2012 18:48:21 +0100

Author: bartpolot
Date: 2012-12-10 18:48:20 +0100 (Mon, 10 Dec 2012)
New Revision: 25377

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
Log:
- use child count, add debug info

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2012-12-10 17:44:05 UTC (rev 
25376)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2012-12-10 17:48:20 UTC (rev 
25377)
@@ -4547,9 +4547,20 @@
     return;
 
   if (0 != t->nclients ||
-      0 != GNUNET_CONTAINER_multihashmap_size (t->children_fc))
+      0 != tree_count_children (t->tree))
     return;
 
+  #if MESH_DEBUG
+  {
+    struct GNUNET_PeerIdentity id;
+
+    GNUNET_PEER_resolve (t->id.oid, &id);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "executing destruction of empty tunnel %s [%X]\n",
+                GNUNET_i2s (&id), t->id.tid);
+  }
+  #endif
+
   tunnel_destroy (t);
 }
 
@@ -4564,8 +4575,25 @@
 {
   if (GNUNET_SCHEDULER_NO_TASK != t->delayed_destroy || 
       0 != t->nclients ||
-      0 != GNUNET_CONTAINER_multihashmap_size (t->children_fc))
+      0 != tree_count_children (t->tree))
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "%u %u %u\n",
+                t->delayed_destroy, t->nclients, tree_count_children(t->tree));
     return;
+  }
+
+  #if MESH_DEBUG
+  {
+    struct GNUNET_PeerIdentity id;
+
+    GNUNET_PEER_resolve (t->id.oid, &id);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "scheduling destruction of empty tunnel %s [%X]\n",
+                GNUNET_i2s (&id), t->id.tid);
+  }
+  #endif
+
   t->delayed_destroy =
       GNUNET_SCHEDULER_add_delayed (TUNNEL_DESTROY_EMPTY_TIME,
                                     &tunnel_destroy_empty_delayed,
@@ -4691,16 +4719,12 @@
   if (c != t->owner)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Client %u is destination.\n", c->id);
-    tunnel_delete_client(t, c);
-    client_delete_tunnel(c, t);
-    if (0 != t->nclients)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "  More destination clients present. keeping the tunnel.\n");
-      return GNUNET_OK;
-    }
+    tunnel_delete_client (t, c);
+    client_delete_tunnel (c, t);
+    tunnel_destroy_empty (t);
+    return GNUNET_OK;
   }
-  tunnel_send_destroy(t);
+  tunnel_send_destroy (t);
   t->owner = NULL;
   t->destroy = GNUNET_YES;
 




reply via email to

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