gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r30813 - gnunet/src/mesh
Date: Tue, 19 Nov 2013 16:38:49 +0100

Author: bartpolot
Date: 2013-11-19 16:38:49 +0100 (Tue, 19 Nov 2013)
New Revision: 30813

Modified:
   gnunet/src/mesh/gnunet-service-mesh_tunnel.c
Log:
- more shutdown fixes


Modified: gnunet/src/mesh/gnunet-service-mesh_tunnel.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_tunnel.c        2013-11-19 15:33:37 UTC 
(rev 30812)
+++ gnunet/src/mesh/gnunet-service-mesh_tunnel.c        2013-11-19 15:38:49 UTC 
(rev 30813)
@@ -867,6 +867,27 @@
 
 
 /**
+ * Called only on shutdown, destroy every tunnel.
+ *
+ * @param cls Closure (unused).
+ * @param key Current public key.
+ * @param value Value in the hash map (tunnel).
+ *
+ * @return #GNUNET_YES, so we should continue to iterate,
+ */
+static int
+destroy_iterator (void *cls,
+                const struct GNUNET_PeerIdentity *key,
+                void *value)
+{
+  struct MeshTunnel3 *t = value;
+
+  GMT_destroy (t);
+  return GNUNET_YES;
+}
+
+
+/**
  * Demultiplex data per channel and call appropriate channel handler.
  *
  * @param t Tunnel on which the data came.
@@ -1397,6 +1418,7 @@
     GNUNET_SCHEDULER_cancel (rekey_task);
     rekey_task = GNUNET_SCHEDULER_NO_TASK;
   }
+  GNUNET_CONTAINER_multipeermap_iterate (tunnels, &destroy_iterator, NULL);
   GNUNET_CONTAINER_multipeermap_destroy (tunnels);
 }
 




reply via email to

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