diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-11-23 15:10:10 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-11-23 15:10:10 +0000 |
commit | 68621a1c1481126790d308c97dda6981f17e8b9e (patch) | |
tree | dce8b9ae108420c6932af6d085ec15e1878ebc19 /src/transport | |
parent | 012a2fb048225012e3f07461ba4aa1238e78392f (diff) | |
download | gnunet-68621a1c1481126790d308c97dda6981f17e8b9e.tar.gz gnunet-68621a1c1481126790d308c97dda6981f17e8b9e.zip |
fix shutdown order + disable broadcast in testcase
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/plugin_transport_udp.c | 26 | ||||
-rw-r--r-- | src/transport/template_cfg_peer1.conf | 4 | ||||
-rw-r--r-- | src/transport/template_cfg_peer2.conf | 4 | ||||
-rw-r--r-- | src/transport/test_transport_api_udp_peer1.conf | 2 | ||||
-rw-r--r-- | 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) | |||
2335 | GNUNET_SCHEDULER_cancel (plugin->select_task); | 2335 | GNUNET_SCHEDULER_cancel (plugin->select_task); |
2336 | plugin->select_task = GNUNET_SCHEDULER_NO_TASK; | 2336 | plugin->select_task = GNUNET_SCHEDULER_NO_TASK; |
2337 | } | 2337 | } |
2338 | if (plugin->sockv4 != NULL) | ||
2339 | { | ||
2340 | GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (plugin->sockv4)); | ||
2341 | plugin->sockv4 = NULL; | ||
2342 | } | ||
2343 | if (plugin->sockv6 != NULL) | ||
2344 | { | ||
2345 | GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (plugin->sockv6)); | ||
2346 | plugin->sockv6 = NULL; | ||
2347 | } | ||
2348 | 2338 | ||
2349 | if (plugin->broadcast_ipv4) | 2339 | if (plugin->broadcast_ipv4) |
2350 | { | 2340 | { |
@@ -2377,10 +2367,6 @@ libgnunet_plugin_transport_udp_done (void *cls) | |||
2377 | if ( GNUNET_NETWORK_socket_setsockopt( plugin->sockv6, IPPROTO_IPV6, IPV6_LEAVE_GROUP, (char*) &multicastRequest, sizeof(multicastRequest)) == 0 ) | 2367 | if ( GNUNET_NETWORK_socket_setsockopt( plugin->sockv6, IPPROTO_IPV6, IPV6_LEAVE_GROUP, (char*) &multicastRequest, sizeof(multicastRequest)) == 0 ) |
2378 | { | 2368 | { |
2379 | LOG (GNUNET_ERROR_TYPE_DEBUG, "IPv6 Broadcasting stopped\n"); | 2369 | LOG (GNUNET_ERROR_TYPE_DEBUG, "IPv6 Broadcasting stopped\n"); |
2380 | |||
2381 | plugin->send_ipv6_broadcast_task = | ||
2382 | GNUNET_SCHEDULER_add_now (&udp_ipv6_broadcast_send, plugin); | ||
2383 | plugin->broadcast_ipv6 = GNUNET_YES; | ||
2384 | } | 2370 | } |
2385 | else | 2371 | else |
2386 | GNUNET_log_strerror(GNUNET_ERROR_TYPE_ERROR, setsockopt); | 2372 | GNUNET_log_strerror(GNUNET_ERROR_TYPE_ERROR, setsockopt); |
@@ -2394,6 +2380,18 @@ libgnunet_plugin_transport_udp_done (void *cls) | |||
2394 | GNUNET_SERVER_mst_destroy (plugin->broadcast_ipv6_mst); | 2380 | GNUNET_SERVER_mst_destroy (plugin->broadcast_ipv6_mst); |
2395 | } | 2381 | } |
2396 | 2382 | ||
2383 | |||
2384 | if (plugin->sockv4 != NULL) | ||
2385 | { | ||
2386 | GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (plugin->sockv4)); | ||
2387 | plugin->sockv4 = NULL; | ||
2388 | } | ||
2389 | if (plugin->sockv6 != NULL) | ||
2390 | { | ||
2391 | GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (plugin->sockv6)); | ||
2392 | plugin->sockv6 = NULL; | ||
2393 | } | ||
2394 | |||
2397 | GNUNET_SERVER_mst_destroy (plugin->mst); | 2395 | GNUNET_SERVER_mst_destroy (plugin->mst); |
2398 | GNUNET_NETWORK_fdset_destroy (plugin->rs); | 2396 | GNUNET_NETWORK_fdset_destroy (plugin->rs); |
2399 | 2397 | ||
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 | |||
14 | PORT = 12000 | 14 | PORT = 12000 |
15 | TIMEOUT = 5 s | 15 | TIMEOUT = 5 s |
16 | 16 | ||
17 | [transport-udp] | ||
18 | BROADCAST = NO | ||
19 | |||
17 | [arm] | 20 | [arm] |
18 | PORT = 12005 | 21 | PORT = 12005 |
19 | DEFAULTSERVICES = transport | 22 | DEFAULTSERVICES = transport |
@@ -32,6 +35,7 @@ PORT = 12002 | |||
32 | UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock | 35 | UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock |
33 | 36 | ||
34 | [transport] | 37 | [transport] |
38 | PREFIX = valgrind --leak-check=full | ||
35 | PORT = 12001 | 39 | PORT = 12001 |
36 | #DEBUG = YES | 40 | #DEBUG = YES |
37 | UNIXPATH = /tmp/gnunet-p1-service-transport.sock | 41 | 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 | |||
14 | PORT = 12100 | 14 | PORT = 12100 |
15 | TIMEOUT = 5 s | 15 | TIMEOUT = 5 s |
16 | 16 | ||
17 | [transport-udp] | ||
18 | BROADCAST = NO | ||
19 | |||
17 | [arm] | 20 | [arm] |
18 | PORT = 12014 | 21 | PORT = 12014 |
19 | DEFAULTSERVICES = transport | 22 | DEFAULTSERVICES = transport |
@@ -33,6 +36,7 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock | |||
33 | TRUST = $SERVICEHOME/data/credit/ | 36 | TRUST = $SERVICEHOME/data/credit/ |
34 | 37 | ||
35 | [transport] | 38 | [transport] |
39 | PREFIX = valgrind --leak-check=full | ||
36 | PORT = 12010 | 40 | PORT = 12010 |
37 | UNIXPATH = /tmp/gnunet-p2-service-transport.sock | 41 | UNIXPATH = /tmp/gnunet-p2-service-transport.sock |
38 | 42 | ||
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 | |||
5 | 5 | ||
6 | [transport-udp] | 6 | [transport-udp] |
7 | PORT = 12040 | 7 | PORT = 12040 |
8 | BROADCAST = YES | 8 | BROADCAST = NO |
9 | BROADCAST_INTERVAL = 30000 | 9 | BROADCAST_INTERVAL = 30000 |
10 | MAX_BPS = 50000000 | 10 | MAX_BPS = 50000000 |
11 | 11 | ||
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 | |||
5 | 5 | ||
6 | [transport-udp] | 6 | [transport-udp] |
7 | PORT = 12050 | 7 | PORT = 12050 |
8 | BROADCAST = NO | ||
8 | MAX_BPS = 50000000 | 9 | MAX_BPS = 50000000 |
9 | 10 | ||
10 | [arm] | 11 | [arm] |