fix shutdown order + disable broadcast in testcase
authorMatthias Wachs <wachs@net.in.tum.de>
Wed, 23 Nov 2011 15:10:10 +0000 (15:10 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Wed, 23 Nov 2011 15:10:10 +0000 (15:10 +0000)
src/transport/plugin_transport_udp.c
src/transport/template_cfg_peer1.conf
src/transport/template_cfg_peer2.conf
src/transport/test_transport_api_udp_peer1.conf
src/transport/test_transport_api_udp_peer2.conf

index 9ad97449ce871cb8183b6523ebeb3b24ef0de17f..87ee25005488dd0e16f80d92ce817d0fc31f0620 100644 (file)
@@ -2335,16 +2335,6 @@ libgnunet_plugin_transport_udp_done (void *cls)
     GNUNET_SCHEDULER_cancel (plugin->select_task);
     plugin->select_task = GNUNET_SCHEDULER_NO_TASK;
   }
-  if (plugin->sockv4 != NULL)
-  {
-    GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (plugin->sockv4));
-    plugin->sockv4 = NULL;
-  }
-  if (plugin->sockv6 != NULL)
-  {
-    GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (plugin->sockv6));
-    plugin->sockv6 = NULL;
-  }
 
   if (plugin->broadcast_ipv4)
   {
@@ -2377,10 +2367,6 @@ libgnunet_plugin_transport_udp_done (void *cls)
     if ( GNUNET_NETWORK_socket_setsockopt( plugin->sockv6, IPPROTO_IPV6, IPV6_LEAVE_GROUP, (char*) &multicastRequest, sizeof(multicastRequest)) == 0 )
     {
       LOG (GNUNET_ERROR_TYPE_DEBUG, "IPv6 Broadcasting stopped\n");
-
-      plugin->send_ipv6_broadcast_task =
-        GNUNET_SCHEDULER_add_now (&udp_ipv6_broadcast_send, plugin);
-      plugin->broadcast_ipv6 = GNUNET_YES;
     }
     else
       GNUNET_log_strerror(GNUNET_ERROR_TYPE_ERROR, setsockopt);
@@ -2394,6 +2380,18 @@ libgnunet_plugin_transport_udp_done (void *cls)
       GNUNET_SERVER_mst_destroy (plugin->broadcast_ipv6_mst);
   }
 
+
+  if (plugin->sockv4 != NULL)
+  {
+    GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (plugin->sockv4));
+    plugin->sockv4 = NULL;
+  }
+  if (plugin->sockv6 != NULL)
+  {
+    GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (plugin->sockv6));
+    plugin->sockv6 = NULL;
+  }
+
   GNUNET_SERVER_mst_destroy (plugin->mst);
   GNUNET_NETWORK_fdset_destroy (plugin->rs);
 
index 961c98b8fc3d01e10f36c873984933776a0ce437..8b6e04bd6eef0673ec6a4db61ad1f3abb0d1b894 100644 (file)
@@ -14,6 +14,9 @@ DISABLEV6 = NO
 PORT = 12000
 TIMEOUT = 5 s
 
+[transport-udp]
+BROADCAST = NO
+
 [arm]
 PORT = 12005
 DEFAULTSERVICES = transport
@@ -32,6 +35,7 @@ PORT = 12002
 UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock
 
 [transport]
+PREFIX = valgrind --leak-check=full
 PORT = 12001
 #DEBUG = YES
 UNIXPATH = /tmp/gnunet-p1-service-transport.sock
index e46f0b8a17ff10dac4b5c2496bbb16630b9c5b2c..3706ffb25766ae6c86cb040f062d8510d7ab8dda 100644 (file)
@@ -14,6 +14,9 @@ DISABLEV6 = NO
 PORT = 12100
 TIMEOUT = 5 s
 
+[transport-udp]
+BROADCAST = NO
+
 [arm]
 PORT = 12014
 DEFAULTSERVICES = transport
@@ -33,6 +36,7 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock
 TRUST = $SERVICEHOME/data/credit/
 
 [transport]
+PREFIX = valgrind --leak-check=full
 PORT = 12010
 UNIXPATH = /tmp/gnunet-p2-service-transport.sock
 
index f8b0ae47c432918c8f3302115542f2c3d717a354..a1216e4aa2dda81932fe9f11cff7c16214ab2c90 100644 (file)
@@ -5,7 +5,7 @@ DEFAULTCONFIG = test_transport_api_udp_peer1.conf
 
 [transport-udp]
 PORT = 12040
-BROADCAST = YES
+BROADCAST = NO
 BROADCAST_INTERVAL = 30000
 MAX_BPS = 50000000
 
index 751a15ae0fc0c7fbe78e8a139d25c8784eea0f1d..3e487a6bf80da2144628bba99bb9188687d18012 100644 (file)
@@ -5,6 +5,7 @@ DEFAULTCONFIG = test_transport_api_udp_peer2.conf
 
 [transport-udp]
 PORT = 12050
+BROADCAST = NO
 MAX_BPS = 50000000
 
 [arm]