From 68621a1c1481126790d308c97dda6981f17e8b9e Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Wed, 23 Nov 2011 15:10:10 +0000 Subject: fix shutdown order + disable broadcast in testcase --- src/transport/plugin_transport_udp.c | 26 ++++++++++++------------- src/transport/template_cfg_peer1.conf | 4 ++++ src/transport/template_cfg_peer2.conf | 4 ++++ src/transport/test_transport_api_udp_peer1.conf | 2 +- src/transport/test_transport_api_udp_peer2.conf | 1 + 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 9ad97449c..87ee25005 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c @@ -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); diff --git a/src/transport/template_cfg_peer1.conf b/src/transport/template_cfg_peer1.conf index 961c98b8f..8b6e04bd6 100644 --- a/src/transport/template_cfg_peer1.conf +++ b/src/transport/template_cfg_peer1.conf @@ -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 diff --git a/src/transport/template_cfg_peer2.conf b/src/transport/template_cfg_peer2.conf index e46f0b8a1..3706ffb25 100644 --- a/src/transport/template_cfg_peer2.conf +++ b/src/transport/template_cfg_peer2.conf @@ -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 diff --git a/src/transport/test_transport_api_udp_peer1.conf b/src/transport/test_transport_api_udp_peer1.conf index f8b0ae47c..a1216e4aa 100644 --- a/src/transport/test_transport_api_udp_peer1.conf +++ b/src/transport/test_transport_api_udp_peer1.conf @@ -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 diff --git a/src/transport/test_transport_api_udp_peer2.conf b/src/transport/test_transport_api_udp_peer2.conf index 751a15ae0..3e487a6bf 100644 --- a/src/transport/test_transport_api_udp_peer2.conf +++ b/src/transport/test_transport_api_udp_peer2.conf @@ -5,6 +5,7 @@ DEFAULTCONFIG = test_transport_api_udp_peer2.conf [transport-udp] PORT = 12050 +BROADCAST = NO MAX_BPS = 50000000 [arm] -- cgit v1.2.3