#define VERBOSE GNUNET_NO
-#define CONNECT_LIMIT GNUNET_YES
-
struct NSEPeer
{
struct NSEPeer *prev;
*/
static unsigned long long peers_next_round;
+/**
+ * Maximum number of connections to NSE services.
+ */
+static unsigned long long connection_limit;
+
/**
* Total number of connections in the whole network.
*/
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "TEST_NSE_MULTIPEER: connecting to nse service of peers\n");
for (i = 0; i < num_peers; i++)
{
-#if CONNECT_LIMIT
- if (i % 50 != 0)
+ if ((connection_limit > 0) && (i % (num_peers / connection_limit) != 0))
continue;
-#endif
current_peer = GNUNET_malloc(sizeof(struct NSEPeer));
current_peer->daemon = GNUNET_TESTING_daemon_get(pg, i);
if (GNUNET_YES == GNUNET_TESTING_daemon_running(GNUNET_TESTING_daemon_get(pg, i)))
return;
}
+ if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (testing_cfg, "nse-profiler", "connection_limit", &connection_limit))
+ {
+ connection_limit = 0;
+ }
+
if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (testing_cfg, "nse-profiler", "topology_output_file", &topology_file))
{
GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Option nse-profiler:topology_output_file is required!\n");