[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r16144 - gnunet/src/nse
From: |
gnunet |
Subject: |
[GNUnet-SVN] r16144 - gnunet/src/nse |
Date: |
Fri, 22 Jul 2011 15:06:59 +0200 |
Author: nevans
Date: 2011-07-22 15:06:59 +0200 (Fri, 22 Jul 2011)
New Revision: 16144
Modified:
gnunet/src/nse/nse-profiler.c
Log:
connection limits
Modified: gnunet/src/nse/nse-profiler.c
===================================================================
--- gnunet/src/nse/nse-profiler.c 2011-07-22 12:47:54 UTC (rev 16143)
+++ gnunet/src/nse/nse-profiler.c 2011-07-22 13:06:59 UTC (rev 16144)
@@ -31,8 +31,6 @@
#define VERBOSE GNUNET_NO
-#define CONNECT_LIMIT GNUNET_YES
-
struct NSEPeer
{
struct NSEPeer *prev;
@@ -94,6 +92,11 @@
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.
*/
static unsigned int total_connections;
@@ -229,10 +232,8 @@
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)))
@@ -549,6 +550,11 @@
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");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r16144 - gnunet/src/nse,
gnunet <=