diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/testing/gnunet-cmds-helper.c | 2 | ||||
-rw-r--r-- | src/testing/testing.c | 58 | ||||
-rw-r--r-- | src/transport/gnunet-communicator-tcp.c | 2 | ||||
-rw-r--r-- | src/transport/gnunet-communicator-udp.c | 1 | ||||
-rw-r--r-- | src/transport/test_transport_plugin_cmd_simple_send.c | 4 | ||||
-rw-r--r-- | src/transport/test_transport_plugin_cmd_simple_send_broadcast.c | 31 | ||||
-rw-r--r-- | src/transport/test_transport_plugin_cmd_simple_send_dv.c | 30 | ||||
-rw-r--r-- | src/transport/test_transport_plugin_cmd_udp_backchannel.c | 38 | ||||
-rw-r--r-- | src/transport/transport_api_cmd_backchannel_check.c | 9 |
9 files changed, 132 insertions, 43 deletions
diff --git a/src/testing/gnunet-cmds-helper.c b/src/testing/gnunet-cmds-helper.c index be58f6f6a..8114d156d 100644 --- a/src/testing/gnunet-cmds-helper.c +++ b/src/testing/gnunet-cmds-helper.c | |||
@@ -606,7 +606,7 @@ main (int argc, char **argv) | |||
606 | int i; | 606 | int i; |
607 | size_t topology_data_length = 0; | 607 | size_t topology_data_length = 0; |
608 | unsigned int read_file; | 608 | unsigned int read_file; |
609 | char cr[1] = "\n"; | 609 | char cr[2] = "\n\0"; |
610 | 610 | ||
611 | GNUNET_log_setup ("gnunet-cmds-helper", | 611 | GNUNET_log_setup ("gnunet-cmds-helper", |
612 | "DEBUG", | 612 | "DEBUG", |
diff --git a/src/testing/testing.c b/src/testing/testing.c index 95651830f..956820a15 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c | |||
@@ -2150,7 +2150,6 @@ get_node_info (unsigned int num, | |||
2150 | topology->nodes_x, | 2150 | topology->nodes_x, |
2151 | topology->nodes_m, | 2151 | topology->nodes_m, |
2152 | namespace_n); | 2152 | namespace_n); |
2153 | hkey = GNUNET_new (struct GNUNET_ShortHashCode); | ||
2154 | GNUNET_CRYPTO_hash (&namespace_n, sizeof(namespace_n), &hc); | 2153 | GNUNET_CRYPTO_hash (&namespace_n, sizeof(namespace_n), &hc); |
2155 | memcpy (hkey, | 2154 | memcpy (hkey, |
2156 | &hc, | 2155 | &hc, |
@@ -2179,8 +2178,8 @@ get_node_info (unsigned int num, | |||
2179 | *namespace_ex = namespace; | 2178 | *namespace_ex = namespace; |
2180 | *node_connections_ex = node_connections; | 2179 | *node_connections_ex = node_connections; |
2181 | } | 2180 | } |
2182 | GNUNET_free (hkey); | ||
2183 | } | 2181 | } |
2182 | GNUNET_free (hkey); | ||
2184 | } | 2183 | } |
2185 | 2184 | ||
2186 | 2185 | ||
@@ -2442,6 +2441,7 @@ static void | |||
2442 | parse_ac (struct GNUNET_TESTING_NetjailNode *p_node, char *token) | 2441 | parse_ac (struct GNUNET_TESTING_NetjailNode *p_node, char *token) |
2443 | { | 2442 | { |
2444 | char *ac_value; | 2443 | char *ac_value; |
2444 | int ret; | ||
2445 | 2445 | ||
2446 | ac_value = get_value ("AC", token); | 2446 | ac_value = get_value ("AC", token); |
2447 | if (NULL != ac_value) | 2447 | if (NULL != ac_value) |
@@ -2449,7 +2449,13 @@ parse_ac (struct GNUNET_TESTING_NetjailNode *p_node, char *token) | |||
2449 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2449 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2450 | "ac value: %s\n", | 2450 | "ac value: %s\n", |
2451 | ac_value); | 2451 | ac_value); |
2452 | sscanf (ac_value, "%u", &p_node->additional_connects); | 2452 | errno = 0; |
2453 | ret = sscanf (ac_value, "%u", &p_node->additional_connects); | ||
2454 | if (errno != 0) | ||
2455 | { | ||
2456 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); | ||
2457 | } | ||
2458 | GNUNET_assert (0 < ret); | ||
2453 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2459 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2454 | "AC %u\n", | 2460 | "AC %u\n", |
2455 | p_node->additional_connects); | 2461 | p_node->additional_connects); |
@@ -2481,7 +2487,6 @@ GNUNET_TESTING_get_topo_from_string (char *data) | |||
2481 | struct GNUNET_TESTING_NetjailTopology *topo; | 2487 | struct GNUNET_TESTING_NetjailTopology *topo; |
2482 | struct GNUNET_TESTING_NetjailRouter *router; | 2488 | struct GNUNET_TESTING_NetjailRouter *router; |
2483 | struct GNUNET_TESTING_NetjailNamespace *namespace; | 2489 | struct GNUNET_TESTING_NetjailNamespace *namespace; |
2484 | struct GNUNET_ShortHashCode *hkey; | ||
2485 | struct GNUNET_HashCode hc; | 2490 | struct GNUNET_HashCode hc; |
2486 | 2491 | ||
2487 | token = strtok_r (data, "\n", &rest); | 2492 | token = strtok_r (data, "\n", &rest); |
@@ -2552,7 +2557,8 @@ GNUNET_TESTING_get_topo_from_string (char *data) | |||
2552 | } | 2557 | } |
2553 | else if (0 == strcmp (key, "K")) | 2558 | else if (0 == strcmp (key, "K")) |
2554 | { | 2559 | { |
2555 | hkey = GNUNET_new (struct GNUNET_ShortHashCode); | 2560 | struct GNUNET_ShortHashCode *hkey_k = GNUNET_new (struct |
2561 | GNUNET_ShortHashCode); | ||
2556 | struct GNUNET_TESTING_NetjailNode *k_node = GNUNET_new (struct | 2562 | struct GNUNET_TESTING_NetjailNode *k_node = GNUNET_new (struct |
2557 | GNUNET_TESTING_NetjailNode); | 2563 | GNUNET_TESTING_NetjailNode); |
2558 | 2564 | ||
@@ -2564,18 +2570,18 @@ GNUNET_TESTING_get_topo_from_string (char *data) | |||
2564 | out); | 2570 | out); |
2565 | k_node->node_n = out; | 2571 | k_node->node_n = out; |
2566 | GNUNET_CRYPTO_hash (&out, sizeof(out), &hc); | 2572 | GNUNET_CRYPTO_hash (&out, sizeof(out), &hc); |
2567 | memcpy (hkey, | 2573 | memcpy (hkey_k, |
2568 | &hc, | 2574 | &hc, |
2569 | sizeof (*hkey)); | 2575 | sizeof (*hkey_k)); |
2570 | k_node->is_global = GNUNET_YES; | 2576 | k_node->is_global = GNUNET_YES; |
2571 | 2577 | ||
2572 | if (GNUNET_YES == GNUNET_CONTAINER_multishortmap_contains ( | 2578 | if (GNUNET_YES == GNUNET_CONTAINER_multishortmap_contains ( |
2573 | topo->map_globals, | 2579 | topo->map_globals, |
2574 | hkey)) | 2580 | hkey_k)) |
2575 | GNUNET_break (0); | 2581 | GNUNET_break (0); |
2576 | else | 2582 | else |
2577 | GNUNET_CONTAINER_multishortmap_put (topo->map_globals, | 2583 | GNUNET_CONTAINER_multishortmap_put (topo->map_globals, |
2578 | hkey, | 2584 | hkey_k, |
2579 | k_node, | 2585 | k_node, |
2580 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | 2586 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); |
2581 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2587 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -2591,7 +2597,8 @@ GNUNET_TESTING_get_topo_from_string (char *data) | |||
2591 | } | 2597 | } |
2592 | else if (0 == strcmp (key, "R")) | 2598 | else if (0 == strcmp (key, "R")) |
2593 | { | 2599 | { |
2594 | hkey = GNUNET_new (struct GNUNET_ShortHashCode); | 2600 | struct GNUNET_ShortHashCode *hkey_r = GNUNET_new (struct |
2601 | GNUNET_ShortHashCode); | ||
2595 | router = GNUNET_new (struct GNUNET_TESTING_NetjailRouter); | 2602 | router = GNUNET_new (struct GNUNET_TESTING_NetjailRouter); |
2596 | 2603 | ||
2597 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2604 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -2601,9 +2608,9 @@ GNUNET_TESTING_get_topo_from_string (char *data) | |||
2601 | "R: %u\n", | 2608 | "R: %u\n", |
2602 | out); | 2609 | out); |
2603 | GNUNET_CRYPTO_hash (&out, sizeof(out), &hc); | 2610 | GNUNET_CRYPTO_hash (&out, sizeof(out), &hc); |
2604 | memcpy (hkey, | 2611 | memcpy (hkey_r, |
2605 | &hc, | 2612 | &hc, |
2606 | sizeof (*hkey)); | 2613 | sizeof (*hkey_r)); |
2607 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2614 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2608 | "Get value for key tcp_port on R.\n"); | 2615 | "Get value for key tcp_port on R.\n"); |
2609 | value = get_value ("tcp_port", token); | 2616 | value = get_value ("tcp_port", token); |
@@ -2626,10 +2633,10 @@ GNUNET_TESTING_get_topo_from_string (char *data) | |||
2626 | GNUNET_free (value2); | 2633 | GNUNET_free (value2); |
2627 | if (GNUNET_YES == GNUNET_CONTAINER_multishortmap_contains ( | 2634 | if (GNUNET_YES == GNUNET_CONTAINER_multishortmap_contains ( |
2628 | topo->map_namespaces, | 2635 | topo->map_namespaces, |
2629 | hkey)) | 2636 | hkey_r)) |
2630 | { | 2637 | { |
2631 | namespace = GNUNET_CONTAINER_multishortmap_get (topo->map_namespaces, | 2638 | namespace = GNUNET_CONTAINER_multishortmap_get (topo->map_namespaces, |
2632 | hkey); | 2639 | hkey_r); |
2633 | } | 2640 | } |
2634 | else | 2641 | else |
2635 | { | 2642 | { |
@@ -2637,7 +2644,7 @@ GNUNET_TESTING_get_topo_from_string (char *data) | |||
2637 | namespace->namespace_n = out; | 2644 | namespace->namespace_n = out; |
2638 | namespace->nodes = GNUNET_CONTAINER_multishortmap_create (1,GNUNET_NO); | 2645 | namespace->nodes = GNUNET_CONTAINER_multishortmap_create (1,GNUNET_NO); |
2639 | GNUNET_CONTAINER_multishortmap_put (topo->map_namespaces, | 2646 | GNUNET_CONTAINER_multishortmap_put (topo->map_namespaces, |
2640 | hkey, | 2647 | hkey_r, |
2641 | namespace, | 2648 | namespace, |
2642 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | 2649 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); |
2643 | } | 2650 | } |
@@ -2648,7 +2655,8 @@ GNUNET_TESTING_get_topo_from_string (char *data) | |||
2648 | { | 2655 | { |
2649 | struct GNUNET_TESTING_NetjailNode *p_node = GNUNET_new (struct | 2656 | struct GNUNET_TESTING_NetjailNode *p_node = GNUNET_new (struct |
2650 | GNUNET_TESTING_NetjailNode); | 2657 | GNUNET_TESTING_NetjailNode); |
2651 | hkey = GNUNET_new (struct GNUNET_ShortHashCode); | 2658 | struct GNUNET_ShortHashCode *hkey_p = GNUNET_new (struct |
2659 | GNUNET_ShortHashCode); | ||
2652 | 2660 | ||
2653 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2661 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2654 | "Get first Value for P.\n"); | 2662 | "Get first Value for P.\n"); |
@@ -2657,16 +2665,16 @@ GNUNET_TESTING_get_topo_from_string (char *data) | |||
2657 | "P: %u\n", | 2665 | "P: %u\n", |
2658 | out); | 2666 | out); |
2659 | GNUNET_CRYPTO_hash (&out, sizeof(out), &hc); | 2667 | GNUNET_CRYPTO_hash (&out, sizeof(out), &hc); |
2660 | memcpy (hkey, | 2668 | memcpy (hkey_p, |
2661 | &hc, | 2669 | &hc, |
2662 | sizeof (*hkey)); | 2670 | sizeof (*hkey_p)); |
2663 | 2671 | ||
2664 | if (GNUNET_YES == GNUNET_CONTAINER_multishortmap_contains ( | 2672 | if (GNUNET_YES == GNUNET_CONTAINER_multishortmap_contains ( |
2665 | topo->map_namespaces, | 2673 | topo->map_namespaces, |
2666 | hkey)) | 2674 | hkey_p)) |
2667 | { | 2675 | { |
2668 | namespace = GNUNET_CONTAINER_multishortmap_get (topo->map_namespaces, | 2676 | namespace = GNUNET_CONTAINER_multishortmap_get (topo->map_namespaces, |
2669 | hkey); | 2677 | hkey_p); |
2670 | } | 2678 | } |
2671 | else | 2679 | else |
2672 | { | 2680 | { |
@@ -2674,7 +2682,7 @@ GNUNET_TESTING_get_topo_from_string (char *data) | |||
2674 | namespace->nodes = GNUNET_CONTAINER_multishortmap_create (1,GNUNET_NO); | 2682 | namespace->nodes = GNUNET_CONTAINER_multishortmap_create (1,GNUNET_NO); |
2675 | namespace->namespace_n = out; | 2683 | namespace->namespace_n = out; |
2676 | GNUNET_CONTAINER_multishortmap_put (topo->map_namespaces, | 2684 | GNUNET_CONTAINER_multishortmap_put (topo->map_namespaces, |
2677 | hkey, | 2685 | hkey_p, |
2678 | namespace, | 2686 | namespace, |
2679 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | 2687 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); |
2680 | } | 2688 | } |
@@ -2685,12 +2693,12 @@ GNUNET_TESTING_get_topo_from_string (char *data) | |||
2685 | "P: %u\n", | 2693 | "P: %u\n", |
2686 | out); | 2694 | out); |
2687 | GNUNET_CRYPTO_hash (&out, sizeof(out), &hc); | 2695 | GNUNET_CRYPTO_hash (&out, sizeof(out), &hc); |
2688 | memcpy (hkey, | 2696 | memcpy (hkey_p, |
2689 | &hc, | 2697 | &hc, |
2690 | sizeof (*hkey)); | 2698 | sizeof (*hkey_p)); |
2691 | if (GNUNET_YES == GNUNET_CONTAINER_multishortmap_contains ( | 2699 | if (GNUNET_YES == GNUNET_CONTAINER_multishortmap_contains ( |
2692 | namespace->nodes, | 2700 | namespace->nodes, |
2693 | hkey)) | 2701 | hkey_p)) |
2694 | { | 2702 | { |
2695 | GNUNET_break (0); | 2703 | GNUNET_break (0); |
2696 | } | 2704 | } |
@@ -2698,7 +2706,7 @@ GNUNET_TESTING_get_topo_from_string (char *data) | |||
2698 | { | 2706 | { |
2699 | 2707 | ||
2700 | GNUNET_CONTAINER_multishortmap_put (namespace->nodes, | 2708 | GNUNET_CONTAINER_multishortmap_put (namespace->nodes, |
2701 | hkey, | 2709 | hkey_p, |
2702 | p_node, | 2710 | p_node, |
2703 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | 2711 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); |
2704 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2712 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
diff --git a/src/transport/gnunet-communicator-tcp.c b/src/transport/gnunet-communicator-tcp.c index 2a5290bf9..74c509ec5 100644 --- a/src/transport/gnunet-communicator-tcp.c +++ b/src/transport/gnunet-communicator-tcp.c | |||
@@ -3554,6 +3554,8 @@ run (void *cls, | |||
3554 | socklen_t addr_len_ipv6; | 3554 | socklen_t addr_len_ipv6; |
3555 | 3555 | ||
3556 | (void) cls; | 3556 | (void) cls; |
3557 | memset (&v4,0,sizeof(struct sockaddr_in)); | ||
3558 | memset (&v6,0,sizeof(struct sockaddr_in6)); | ||
3557 | cfg = c; | 3559 | cfg = c; |
3558 | if (GNUNET_OK != | 3560 | if (GNUNET_OK != |
3559 | GNUNET_CONFIGURATION_get_value_string (cfg, | 3561 | GNUNET_CONFIGURATION_get_value_string (cfg, |
diff --git a/src/transport/gnunet-communicator-udp.c b/src/transport/gnunet-communicator-udp.c index 07beeac38..9ca9fb90a 100644 --- a/src/transport/gnunet-communicator-udp.c +++ b/src/transport/gnunet-communicator-udp.c | |||
@@ -2367,6 +2367,7 @@ sock_read (void *cls) | |||
2367 | { | 2367 | { |
2368 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2368 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2369 | "Received our own broadcast\n"); | 2369 | "Received our own broadcast\n"); |
2370 | GNUNET_free (addr_verify); | ||
2370 | return; | 2371 | return; |
2371 | } | 2372 | } |
2372 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2373 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
diff --git a/src/transport/test_transport_plugin_cmd_simple_send.c b/src/transport/test_transport_plugin_cmd_simple_send.c index ee6b9669b..5941a991b 100644 --- a/src/transport/test_transport_plugin_cmd_simple_send.c +++ b/src/transport/test_transport_plugin_cmd_simple_send.c | |||
@@ -113,14 +113,11 @@ handle_result (void *cls, | |||
113 | enum GNUNET_GenericReturnValue rv) | 113 | enum GNUNET_GenericReturnValue rv) |
114 | { | 114 | { |
115 | struct TestState *ts = cls; | 115 | struct TestState *ts = cls; |
116 | struct GNUNET_MessageHeader *reply; | ||
117 | 116 | ||
118 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 117 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
119 | "Local test exits with status %d\n", | 118 | "Local test exits with status %d\n", |
120 | rv); | 119 | rv); |
121 | 120 | ||
122 | reply = GNUNET_TESTING_send_local_test_finished_msg (); | ||
123 | |||
124 | ts->finished_cb (); | 121 | ts->finished_cb (); |
125 | GNUNET_free (ts->testdir); | 122 | GNUNET_free (ts->testdir); |
126 | GNUNET_free (ts->cfgname); | 123 | GNUNET_free (ts->cfgname); |
@@ -238,6 +235,7 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
238 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); | 235 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); |
239 | } | 236 | } |
240 | GNUNET_assert (0 < sscanf_ret); | 237 | GNUNET_assert (0 < sscanf_ret); |
238 | |||
241 | if (0 == n_int) | 239 | if (0 == n_int) |
242 | num = m_int; | 240 | num = m_int; |
243 | else | 241 | else |
diff --git a/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c b/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c index 6254dba36..3a282bb11 100644 --- a/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c +++ b/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c | |||
@@ -226,9 +226,14 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
226 | unsigned int num; | 226 | unsigned int num; |
227 | struct TestState *ts = GNUNET_new (struct TestState); | 227 | struct TestState *ts = GNUNET_new (struct TestState); |
228 | struct GNUNET_TESTING_NetjailTopology *topology; | 228 | struct GNUNET_TESTING_NetjailTopology *topology; |
229 | 229 | unsigned int sscanf_ret = 0; | |
230 | 230 | ||
231 | ts->finished_cb = finished_cb; | 231 | ts->finished_cb = finished_cb; |
232 | LOG (GNUNET_ERROR_TYPE_ERROR, | ||
233 | "n %s m %s\n", | ||
234 | n, | ||
235 | m); | ||
236 | |||
232 | if (GNUNET_YES == *read_file) | 237 | if (GNUNET_YES == *read_file) |
233 | { | 238 | { |
234 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 239 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -240,9 +245,27 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
240 | 245 | ||
241 | ts->topology = topology; | 246 | ts->topology = topology; |
242 | 247 | ||
243 | sscanf (m, "%u", &m_int); | 248 | errno = 0; |
244 | sscanf (n, "%u", &n_int); | 249 | sscanf_ret = sscanf (m, "%u", &m_int); |
245 | sscanf (local_m, "%u", &local_m_int); | 250 | if (errno != 0) |
251 | { | ||
252 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); | ||
253 | } | ||
254 | GNUNET_assert (0 < sscanf_ret); | ||
255 | errno = 0; | ||
256 | sscanf_ret = sscanf (n, "%u", &n_int); | ||
257 | if (errno != 0) | ||
258 | { | ||
259 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); | ||
260 | } | ||
261 | GNUNET_assert (0 < sscanf_ret); | ||
262 | errno = 0; | ||
263 | sscanf_ret = sscanf (local_m, "%u", &local_m_int); | ||
264 | if (errno != 0) | ||
265 | { | ||
266 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); | ||
267 | } | ||
268 | GNUNET_assert (0 < sscanf_ret); | ||
246 | 269 | ||
247 | if (0 == n_int) | 270 | if (0 == n_int) |
248 | num = m_int; | 271 | num = m_int; |
diff --git a/src/transport/test_transport_plugin_cmd_simple_send_dv.c b/src/transport/test_transport_plugin_cmd_simple_send_dv.c index ea0c9aea8..8bfa1fd0a 100644 --- a/src/transport/test_transport_plugin_cmd_simple_send_dv.c +++ b/src/transport/test_transport_plugin_cmd_simple_send_dv.c | |||
@@ -256,8 +256,14 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
256 | ts), | 256 | ts), |
257 | GNUNET_MQ_handler_end () | 257 | GNUNET_MQ_handler_end () |
258 | }; | 258 | }; |
259 | unsigned int sscanf_ret = 0; | ||
259 | 260 | ||
260 | ts->finished_cb = finished_cb; | 261 | ts->finished_cb = finished_cb; |
262 | LOG (GNUNET_ERROR_TYPE_ERROR, | ||
263 | "n %s m %s\n", | ||
264 | n, | ||
265 | m); | ||
266 | |||
261 | if (GNUNET_YES == *read_file) | 267 | if (GNUNET_YES == *read_file) |
262 | { | 268 | { |
263 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 269 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -269,9 +275,27 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
269 | 275 | ||
270 | ts->topology = topology; | 276 | ts->topology = topology; |
271 | 277 | ||
272 | sscanf (m, "%u", &m_int); | 278 | errno = 0; |
273 | sscanf (n, "%u", &n_int); | 279 | sscanf_ret = sscanf (m, "%u", &m_int); |
274 | sscanf (local_m, "%u", &local_m_int); | 280 | if (errno != 0) |
281 | { | ||
282 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); | ||
283 | } | ||
284 | GNUNET_assert (0 < sscanf_ret); | ||
285 | errno = 0; | ||
286 | sscanf_ret = sscanf (n, "%u", &n_int); | ||
287 | if (errno != 0) | ||
288 | { | ||
289 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); | ||
290 | } | ||
291 | GNUNET_assert (0 < sscanf_ret); | ||
292 | errno = 0; | ||
293 | sscanf_ret = sscanf (local_m, "%u", &local_m_int); | ||
294 | if (errno != 0) | ||
295 | { | ||
296 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); | ||
297 | } | ||
298 | GNUNET_assert (0 < sscanf_ret); | ||
275 | 299 | ||
276 | if (0 == n_int) | 300 | if (0 == n_int) |
277 | num = m_int; | 301 | num = m_int; |
diff --git a/src/transport/test_transport_plugin_cmd_udp_backchannel.c b/src/transport/test_transport_plugin_cmd_udp_backchannel.c index 87065e340..5a0dac32b 100644 --- a/src/transport/test_transport_plugin_cmd_udp_backchannel.c +++ b/src/transport/test_transport_plugin_cmd_udp_backchannel.c | |||
@@ -34,7 +34,7 @@ | |||
34 | /** | 34 | /** |
35 | * Generic logging shortcut | 35 | * Generic logging shortcut |
36 | */ | 36 | */ |
37 | #define LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__) | 37 | #define LOG(kind, ...) GNUNET_log_from (kind, "udp-backchannel", __VA_ARGS__) |
38 | 38 | ||
39 | #define BASE_DIR "testdir" | 39 | #define BASE_DIR "testdir" |
40 | 40 | ||
@@ -187,18 +187,46 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
187 | unsigned int num; | 187 | unsigned int num; |
188 | struct TestState *ts = GNUNET_new (struct TestState); | 188 | struct TestState *ts = GNUNET_new (struct TestState); |
189 | struct GNUNET_TESTING_NetjailTopology *topology; | 189 | struct GNUNET_TESTING_NetjailTopology *topology; |
190 | unsigned int sscanf_ret = 0; | ||
190 | 191 | ||
191 | ts->finished_cb = finished_cb; | 192 | ts->finished_cb = finished_cb; |
193 | LOG (GNUNET_ERROR_TYPE_ERROR, | ||
194 | "n %s m %s\n", | ||
195 | n, | ||
196 | m); | ||
197 | |||
192 | if (GNUNET_YES == *read_file) | 198 | if (GNUNET_YES == *read_file) |
199 | { | ||
200 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
201 | "read from file\n"); | ||
193 | topology = GNUNET_TESTING_get_topo_from_file (topology_data); | 202 | topology = GNUNET_TESTING_get_topo_from_file (topology_data); |
203 | } | ||
194 | else | 204 | else |
195 | topology = GNUNET_TESTING_get_topo_from_string (topology_data); | 205 | topology = GNUNET_TESTING_get_topo_from_string (topology_data); |
196 | 206 | ||
197 | ts->topology = topology; | 207 | ts->topology = topology; |
198 | 208 | ||
199 | sscanf (m, "%u", &m_int); | 209 | errno = 0; |
200 | sscanf (n, "%u", &n_int); | 210 | sscanf_ret = sscanf (m, "%u", &m_int); |
201 | sscanf (local_m, "%u", &local_m_int); | 211 | if (errno != 0) |
212 | { | ||
213 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); | ||
214 | } | ||
215 | GNUNET_assert (0 < sscanf_ret); | ||
216 | errno = 0; | ||
217 | sscanf_ret = sscanf (n, "%u", &n_int); | ||
218 | if (errno != 0) | ||
219 | { | ||
220 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); | ||
221 | } | ||
222 | GNUNET_assert (0 < sscanf_ret); | ||
223 | errno = 0; | ||
224 | sscanf_ret = sscanf (local_m, "%u", &local_m_int); | ||
225 | if (errno != 0) | ||
226 | { | ||
227 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); | ||
228 | } | ||
229 | GNUNET_assert (0 < sscanf_ret); | ||
202 | 230 | ||
203 | 231 | ||
204 | if (0 == n_int) | 232 | if (0 == n_int) |
@@ -296,7 +324,7 @@ libgnunet_test_transport_plugin_cmd_udp_backchannel_init (void *cls) | |||
296 | 324 | ||
297 | GNUNET_log_setup ("udp-backchannel", | 325 | GNUNET_log_setup ("udp-backchannel", |
298 | "DEBUG", | 326 | "DEBUG", |
299 | NULL); | 327 | "plugin.out"); |
300 | 328 | ||
301 | api = GNUNET_new (struct GNUNET_TESTING_PluginFunctions); | 329 | api = GNUNET_new (struct GNUNET_TESTING_PluginFunctions); |
302 | api->start_testcase = &start_testcase; | 330 | api->start_testcase = &start_testcase; |
diff --git a/src/transport/transport_api_cmd_backchannel_check.c b/src/transport/transport_api_cmd_backchannel_check.c index b285d7abf..bf4fe2e20 100644 --- a/src/transport/transport_api_cmd_backchannel_check.c +++ b/src/transport/transport_api_cmd_backchannel_check.c | |||
@@ -36,7 +36,7 @@ | |||
36 | /** | 36 | /** |
37 | * Generic logging shortcut | 37 | * Generic logging shortcut |
38 | */ | 38 | */ |
39 | #define LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__) | 39 | #define LOG(kind, ...) GNUNET_log_from (kind, "udp-backchannel",__VA_ARGS__) |
40 | 40 | ||
41 | #define UDP "udp" | 41 | #define UDP "udp" |
42 | 42 | ||
@@ -413,6 +413,9 @@ backchannel_check_run (void *cls, | |||
413 | const struct GNUNET_TESTING_NetjailNode *node; | 413 | const struct GNUNET_TESTING_NetjailNode *node; |
414 | const struct GNUNET_TESTING_NetjailNamespace *namespace; | 414 | const struct GNUNET_TESTING_NetjailNamespace *namespace; |
415 | 415 | ||
416 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
417 | "check run 1\n"); | ||
418 | |||
416 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 419 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
417 | cs->start_peer_label); | 420 | cs->start_peer_label); |
418 | GNUNET_TRANSPORT_get_trait_application_handle (peer1_cmd, | 421 | GNUNET_TRANSPORT_get_trait_application_handle (peer1_cmd, |
@@ -429,7 +432,7 @@ backchannel_check_run (void *cls, | |||
429 | cs->topology); | 432 | cs->topology); |
430 | 433 | ||
431 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 434 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
432 | "check run\n"); | 435 | "check run 2\n"); |
433 | 436 | ||
434 | 437 | ||
435 | node_it = GNUNET_CONTAINER_multishortmap_iterator_create ( | 438 | node_it = GNUNET_CONTAINER_multishortmap_iterator_create ( |
@@ -450,6 +453,7 @@ backchannel_check_run (void *cls, | |||
450 | add_search_string (cs, node); | 453 | add_search_string (cs, node); |
451 | } | 454 | } |
452 | } | 455 | } |
456 | GNUNET_free (node_it); | ||
453 | namespace_it = GNUNET_CONTAINER_multishortmap_iterator_create ( | 457 | namespace_it = GNUNET_CONTAINER_multishortmap_iterator_create ( |
454 | cs->topology->map_namespaces); | 458 | cs->topology->map_namespaces); |
455 | while (GNUNET_YES == GNUNET_CONTAINER_multishortmap_iterator_next ( | 459 | while (GNUNET_YES == GNUNET_CONTAINER_multishortmap_iterator_next ( |
@@ -478,6 +482,7 @@ backchannel_check_run (void *cls, | |||
478 | add_search_string (cs, node); | 482 | add_search_string (cs, node); |
479 | } | 483 | } |
480 | } | 484 | } |
485 | GNUNET_free (node_it); | ||
481 | } | 486 | } |
482 | 487 | ||
483 | if (0 != cs->con_num) | 488 | if (0 != cs->con_num) |