gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r31929 - gnunet/src/mesh
Date: Thu, 16 Jan 2014 12:54:05 +0100

Author: bartpolot
Date: 2014-01-16 12:54:05 +0100 (Thu, 16 Jan 2014)
New Revision: 31929

Modified:
   gnunet/src/mesh/gnunet-service-mesh_tunnel.c
   gnunet/src/mesh/gnunet-service-mesh_tunnel.h
Log:
- add explicit shutdown state
- don't try to reconnect when destroying last connection during tunnel_destroy
- don't create new connections for a tunnel in shutdown



Modified: gnunet/src/mesh/gnunet-service-mesh_tunnel.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_tunnel.c        2014-01-16 11:50:59 UTC 
(rev 31928)
+++ gnunet/src/mesh/gnunet-service-mesh_tunnel.c        2014-01-16 11:54:05 UTC 
(rev 31929)
@@ -1872,6 +1872,7 @@
   /* Start new connections if needed */
   if (NULL == t->connection_head
       && GNUNET_SCHEDULER_NO_TASK == t->destroy_task
+      && MESH_TUNNEL3_SHUTDOWN != t->cstate
       && GNUNET_NO == shutting_down)
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG, "  no more connections, getting new ones\n");
@@ -1996,6 +1997,7 @@
   struct MeshTunnel3 *t = cls;
 
   t->destroy_task = GNUNET_SCHEDULER_NO_TASK;
+  t->cstate = MESH_TUNNEL3_SHUTDOWN;
   GMT_destroy (t);
 }
 
@@ -2127,6 +2129,12 @@
     return NULL;
   }
 
+  if (MESH_TUNNEL3_SHUTDOWN == t->cstate)
+  {
+    GNUNET_break (0);
+    return NULL;
+  }
+
   for (own_pos = 0; own_pos < p->length; own_pos++)
   {
     if (p->peers[own_pos] == myid)

Modified: gnunet/src/mesh/gnunet-service-mesh_tunnel.h
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_tunnel.h        2014-01-16 11:50:59 UTC 
(rev 31928)
+++ gnunet/src/mesh/gnunet-service-mesh_tunnel.h        2014-01-16 11:54:05 UTC 
(rev 31929)
@@ -64,6 +64,11 @@
      * Peer connected and ready to accept data.
      */
   MESH_TUNNEL3_READY,
+
+  /**
+   * Tunnel being shut down, don't try to keep it alive.
+   */
+  MESH_TUNNEL3_SHUTDOWN
 };
 
 




reply via email to

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