gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r31399 - gnunet/src/mesh
Date: Mon, 16 Dec 2013 11:25:09 +0100

Author: bartpolot
Date: 2013-12-16 11:25:08 +0100 (Mon, 16 Dec 2013)
New Revision: 31399

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
   gnunet/src/mesh/gnunet-service-mesh_peer.c
   gnunet/src/mesh/gnunet-service-mesh_tunnel.c
Log:
- signal shutdown, don't create new connections, fix 3214


Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2013-12-16 10:10:52 UTC (rev 
31398)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2013-12-16 10:25:08 UTC (rev 
31399)
@@ -75,6 +75,12 @@
  */
 struct GNUNET_PeerIdentity my_full_id;
 
+
+/**
+ * Signal that shutdown is happening: prevent recover measures.
+ */
+int shutting_down;
+
 /*************************** Static global variables 
**************************/
 
 /**
@@ -98,6 +104,8 @@
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutting down\n");
 
+  shutting_down = GNUNET_YES;
+
   GML_shutdown ();
   GMD_shutdown ();
   GMC_shutdown ();
@@ -160,6 +168,7 @@
   int ret;
   int r;
 
+  shutting_down = GNUNET_NO;
   r = GNUNET_SERVICE_run (argc, argv, "mesh", GNUNET_SERVICE_OPTION_NONE, &run,
                           NULL);
   GNUNET_free (my_private_key);

Modified: gnunet/src/mesh/gnunet-service-mesh_peer.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_peer.c  2013-12-16 10:10:52 UTC (rev 
31398)
+++ gnunet/src/mesh/gnunet-service-mesh_peer.c  2013-12-16 10:25:08 UTC (rev 
31399)
@@ -1695,6 +1695,7 @@
 struct MeshTunnel3 *
 GMP_get_tunnel (const struct MeshPeer *peer)
 {
+  GNUNET_assert (NULL != peer->tunnel);
   return peer->tunnel;
 }
 

Modified: gnunet/src/mesh/gnunet-service-mesh_tunnel.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_tunnel.c        2013-12-16 10:10:52 UTC 
(rev 31398)
+++ gnunet/src/mesh/gnunet-service-mesh_tunnel.c        2013-12-16 10:25:08 UTC 
(rev 31399)
@@ -222,6 +222,12 @@
 
 
 /**
+ * Don't try to recover tunnels if shutting down.
+ */
+extern int shutting_down;
+
+
+/**
  * Set of all tunnels, in order to trigger a new exchange on rekey.
  * Indexed by peer's ID.
  */
@@ -1756,7 +1762,8 @@
  * @param c Connection.
  */
 void
-GMT_remove_connection (struct MeshTunnel3 *t, struct MeshConnection *c)
+GMT_remove_connection (struct MeshTunnel3 *t,
+                       struct MeshConnection *c)
 {
   struct MeshTConnection *aux;
   struct MeshTConnection *next;
@@ -1774,7 +1781,9 @@
   }
 
   /* Start new connections if needed */
-  if (NULL == t->connection_head && GNUNET_NO == t->destroy)
+  if (NULL == t->connection_head
+      && GNUNET_NO == t->destroy
+      && GNUNET_NO == shutting_down)
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG, "  no more connections\n");
     GMP_connect (t->peer);




reply via email to

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