From 8da7412420e7bd63fd3d26313fb7f879b0c16b62 Mon Sep 17 00:00:00 2001 From: "Nathan S. Evans" Date: Fri, 22 Jul 2011 12:47:54 +0000 Subject: [PATCH] larger history, connect limit --- src/nse/gnunet-service-nse.c | 2 +- src/nse/nse-profiler.c | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c index 41b13a879..25d020caa 100644 --- a/src/nse/gnunet-service-nse.c +++ b/src/nse/gnunet-service-nse.c @@ -50,7 +50,7 @@ #include "gnunet_nse_service.h" #include "nse.h" -#define DEFAULT_HISTORY_SIZE 10 +#define DEFAULT_HISTORY_SIZE 20 #define DEFAULT_CORE_QUEUE_SIZE 32 diff --git a/src/nse/nse-profiler.c b/src/nse/nse-profiler.c index 70ea1a689..a1e15fdcb 100644 --- a/src/nse/nse-profiler.c +++ b/src/nse/nse-profiler.c @@ -31,6 +31,8 @@ #define VERBOSE GNUNET_NO +#define CONNECT_LIMIT GNUNET_YES + struct NSEPeer { struct NSEPeer *prev; @@ -135,6 +137,8 @@ static char *topology_file; static char *data_filename; +static uint64_t clock_skew; + /** * Check whether peers successfully shut down. */ @@ -225,6 +229,10 @@ connect_nse_service (void *cls, 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) + 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))) @@ -323,14 +331,15 @@ disconnect_nse_peers (void *cls, pos = peer_head; GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "TEST_NSE_MULTIPEER: disconnecting nse service of peers\n"); - while (pos != NULL) + while (NULL != (pos = peer_head)) { if (pos->nse_handle != NULL) { GNUNET_NSE_disconnect(pos->nse_handle); pos->nse_handle = NULL; } - pos = pos->next; + GNUNET_CONTAINER_DLL_remove(peer_head, peer_tail, pos); + GNUNET_free(pos); } GNUNET_asprintf(&buf, "round%llu", current_round); @@ -552,6 +561,12 @@ run (void *cls, return; } + if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno (testing_cfg, "nse-profiler", "skew_clock")) + { + GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Setting our clock as skewed...\n"); + clock_skew = GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_TIME_UNIT_MINUTES.rel_value); + } + data_file = GNUNET_DISK_file_open (data_filename, GNUNET_DISK_OPEN_READWRITE | GNUNET_DISK_OPEN_CREATE, -- 2.25.1