summaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2021-11-13 09:36:00 +0100
committert3sserakt <t3ss@posteo.de>2021-11-13 09:36:00 +0100
commit154d13fcb10205edf5fb56c12ac47e65abfec5a6 (patch)
tree9ea19addc17db8085650e95251bd4738d61f0894 /src/testing
parenta97852fb9e6a3eccd4261319787a26db68b0a801 (diff)
- Added broadcast test case. changed transport_api_cmd_start_peer.c to be configure to use broadcast or not. Changed transport_api_cmd_send_simple.c to use map of connected peers. Fixed bugs in service and udp communicator.
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/testing.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c
index 4ccf93c6b..ced04e65d 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -2122,13 +2122,14 @@ GNUNET_TESTING_get_connections (unsigned int num, struct
sizeof (*hkey));
node = GNUNET_CONTAINER_multishortmap_get (topology->map_globals,
hkey);
- node_connections = node->node_connections_head;
+ if (NULL != node)
+ node_connections = node->node_connections_head;
}
else
{
namespace_n = (unsigned int) ceil ((double) (num - topology->nodes_x)
/ topology->nodes_m);
- LOG (GNUNET_ERROR_TYPE_ERROR,
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
"ceil num: %u nodes_x: %u nodes_m: %u namespace_n: %u\n",
num,
topology->nodes_x,
@@ -2141,6 +2142,8 @@ GNUNET_TESTING_get_connections (unsigned int num, struct
sizeof (*hkey));
namespace = GNUNET_CONTAINER_multishortmap_get (topology->map_namespaces,
hkey);
+ if (NULL == namespace)
+ return NULL;
node_m = num - topology->nodes_x - topology->nodes_m * (namespace_n - 1);
hkey = GNUNET_new (struct GNUNET_ShortHashCode);
GNUNET_CRYPTO_hash (&node_m, sizeof(node_m), &hc);
@@ -2149,7 +2152,8 @@ GNUNET_TESTING_get_connections (unsigned int num, struct
sizeof (*hkey));
node = GNUNET_CONTAINER_multishortmap_get (namespace->nodes,
hkey);
- node_connections = node->node_connections_head;
+ if (NULL != node)
+ node_connections = node->node_connections_head;
}
GNUNET_free (hkey);