#define VERBOSE GNUNET_NO
+#define CONNECT_LIMIT GNUNET_YES
+
struct NSEPeer
{
struct NSEPeer *prev;
static char *data_filename;
+static uint64_t clock_skew;
+
/**
* Check whether peers successfully shut down.
*/
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)))
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);
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,