gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r30842 - gnunet/src/mesh
Date: Thu, 21 Nov 2013 18:49:11 +0100

Author: bartpolot
Date: 2013-11-21 18:49:11 +0100 (Thu, 21 Nov 2013)
New Revision: 30842

Modified:
   gnunet/src/mesh/gnunet-service-mesh_connection.c
Log:
- destroy all connections on shutdown, so core_disconnect doesn't cause errors


Modified: gnunet/src/mesh/gnunet-service-mesh_connection.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_connection.c    2013-11-21 17:08:07 UTC 
(rev 30841)
+++ gnunet/src/mesh/gnunet-service-mesh_connection.c    2013-11-21 17:49:11 UTC 
(rev 30842)
@@ -2079,12 +2079,35 @@
   connections = GNUNET_CONTAINER_multihashmap_create (1024, GNUNET_YES);
 }
 
+
 /**
+ * Destroy each connection on shutdown.
+ *
+ * @param cls Closure (unused).
+ * @param key Current key code (CID, unused).
+ * @param value Value in the hash map (connection)
+ *
+ * @return #GNUNET_YES, because we should continue to iterate,
+ */
+static int
+shutdown_iterator (void *cls,
+                   const struct GNUNET_HashCode *key,
+                   void *value)
+{
+  struct MeshConnection *c = value;
+
+  GMC_destroy (c);
+  return GNUNET_YES;
+}
+
+
+/**
  * Shut down the connections subsystem.
  */
 void
 GMC_shutdown (void)
 {
+  GNUNET_CONTAINER_multihashmap_iterate (connections, &shutdown_iterator, 
NULL);
   GNUNET_CONTAINER_multihashmap_destroy (connections);
   connections = NULL;
 }




reply via email to

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