aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2011-07-22 12:47:54 +0000
committerNathan S. Evans <evans@in.tum.de>2011-07-22 12:47:54 +0000
commit8da7412420e7bd63fd3d26313fb7f879b0c16b62 (patch)
tree0961ad012871ec3db31be5673fb6f5250ad470c6 /src
parenta40231f56cc5d0f0bd3593a954000245c235c14f (diff)
downloadgnunet-8da7412420e7bd63fd3d26313fb7f879b0c16b62.tar.gz
gnunet-8da7412420e7bd63fd3d26313fb7f879b0c16b62.zip
larger history, connect limit
Diffstat (limited to 'src')
-rw-r--r--src/nse/gnunet-service-nse.c2
-rw-r--r--src/nse/nse-profiler.c19
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 @@
50#include "gnunet_nse_service.h" 50#include "gnunet_nse_service.h"
51#include "nse.h" 51#include "nse.h"
52 52
53#define DEFAULT_HISTORY_SIZE 10 53#define DEFAULT_HISTORY_SIZE 20
54 54
55#define DEFAULT_CORE_QUEUE_SIZE 32 55#define DEFAULT_CORE_QUEUE_SIZE 32
56 56
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 @@
31 31
32#define VERBOSE GNUNET_NO 32#define VERBOSE GNUNET_NO
33 33
34#define CONNECT_LIMIT GNUNET_YES
35
34struct NSEPeer 36struct NSEPeer
35{ 37{
36 struct NSEPeer *prev; 38 struct NSEPeer *prev;
@@ -135,6 +137,8 @@ static char *topology_file;
135 137
136static char *data_filename; 138static char *data_filename;
137 139
140static uint64_t clock_skew;
141
138/** 142/**
139 * Check whether peers successfully shut down. 143 * Check whether peers successfully shut down.
140 */ 144 */
@@ -225,6 +229,10 @@ connect_nse_service (void *cls,
225 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "TEST_NSE_MULTIPEER: connecting to nse service of peers\n"); 229 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "TEST_NSE_MULTIPEER: connecting to nse service of peers\n");
226 for (i = 0; i < num_peers; i++) 230 for (i = 0; i < num_peers; i++)
227 { 231 {
232#if CONNECT_LIMIT
233 if (i % 50 != 0)
234 continue;
235#endif
228 current_peer = GNUNET_malloc(sizeof(struct NSEPeer)); 236 current_peer = GNUNET_malloc(sizeof(struct NSEPeer));
229 current_peer->daemon = GNUNET_TESTING_daemon_get(pg, i); 237 current_peer->daemon = GNUNET_TESTING_daemon_get(pg, i);
230 if (GNUNET_YES == GNUNET_TESTING_daemon_running(GNUNET_TESTING_daemon_get(pg, i))) 238 if (GNUNET_YES == GNUNET_TESTING_daemon_running(GNUNET_TESTING_daemon_get(pg, i)))
@@ -323,14 +331,15 @@ disconnect_nse_peers (void *cls,
323 pos = peer_head; 331 pos = peer_head;
324 332
325 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "TEST_NSE_MULTIPEER: disconnecting nse service of peers\n"); 333 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "TEST_NSE_MULTIPEER: disconnecting nse service of peers\n");
326 while (pos != NULL) 334 while (NULL != (pos = peer_head))
327 { 335 {
328 if (pos->nse_handle != NULL) 336 if (pos->nse_handle != NULL)
329 { 337 {
330 GNUNET_NSE_disconnect(pos->nse_handle); 338 GNUNET_NSE_disconnect(pos->nse_handle);
331 pos->nse_handle = NULL; 339 pos->nse_handle = NULL;
332 } 340 }
333 pos = pos->next; 341 GNUNET_CONTAINER_DLL_remove(peer_head, peer_tail, pos);
342 GNUNET_free(pos);
334 } 343 }
335 344
336 GNUNET_asprintf(&buf, "round%llu", current_round); 345 GNUNET_asprintf(&buf, "round%llu", current_round);
@@ -552,6 +561,12 @@ run (void *cls,
552 return; 561 return;
553 } 562 }
554 563
564 if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno (testing_cfg, "nse-profiler", "skew_clock"))
565 {
566 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Setting our clock as skewed...\n");
567 clock_skew = GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_TIME_UNIT_MINUTES.rel_value);
568 }
569
555 570
556 data_file = GNUNET_DISK_file_open (data_filename, GNUNET_DISK_OPEN_READWRITE 571 data_file = GNUNET_DISK_file_open (data_filename, GNUNET_DISK_OPEN_READWRITE
557 | GNUNET_DISK_OPEN_CREATE, 572 | GNUNET_DISK_OPEN_CREATE,