[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r26463 - gnunet/src/regex
From: |
gnunet |
Subject: |
[GNUnet-SVN] r26463 - gnunet/src/regex |
Date: |
Fri, 15 Mar 2013 16:23:46 +0100 |
Author: bartpolot
Date: 2013-03-15 16:23:46 +0100 (Fri, 15 Mar 2013)
New Revision: 26463
Modified:
gnunet/src/regex/gnunet-daemon-regexprofiler.c
gnunet/src/regex/gnunet-regex-profiler.c
Log:
- change regex daemon to announce every rand(0, t_max) period
Modified: gnunet/src/regex/gnunet-daemon-regexprofiler.c
===================================================================
--- gnunet/src/regex/gnunet-daemon-regexprofiler.c 2013-03-15 14:27:34 UTC
(rev 26462)
+++ gnunet/src/regex/gnunet-daemon-regexprofiler.c 2013-03-15 15:23:46 UTC
(rev 26463)
@@ -64,9 +64,9 @@
static GNUNET_SCHEDULER_TaskIdentifier reannounce_task;
/**
- * How often reannounce regex.
+ * What's the maximum reannounce period.
*/
-static struct GNUNET_TIME_Relative reannounce_freq;
+static struct GNUNET_TIME_Relative reannounce_period_max;
/**
* Maximal path compression length for regex announcing.
@@ -157,15 +157,13 @@
GNUNET_REGEX_reannounce (announce_handle);
}
- random_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
- GNUNET_CRYPTO_random_u32 (
- GNUNET_CRYPTO_QUALITY_WEAK,
- 600));
- reannounce_task =
- GNUNET_SCHEDULER_add_delayed (
- GNUNET_TIME_relative_add (reannounce_freq, random_delay),
- &reannounce_regex,
- cls);
+ random_delay =
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS,
+ GNUNET_CRYPTO_random_u32 (
+ GNUNET_CRYPTO_QUALITY_WEAK,
+ reannounce_period_max.rel_value));
+ reannounce_task = GNUNET_SCHEDULER_add_delayed (random_delay,
+ &reannounce_regex, cls);
}
@@ -311,13 +309,13 @@
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (cfg, "REGEXPROFILER",
- "REANNOUNCE_FREQ",
&reannounce_freq))
+ "REANNOUNCE_PERIOD_MAX",
+ &reannounce_period_max))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "reannounce_freq not given. Using 10 minutes.\n");
- reannounce_freq =
+ "reannounce_period_max not given. Using 10 minutes.\n");
+ reannounce_period_max =
GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 10);
-
}
stats_handle = GNUNET_STATISTICS_create ("regexprofiler", cfg);
Modified: gnunet/src/regex/gnunet-regex-profiler.c
===================================================================
--- gnunet/src/regex/gnunet-regex-profiler.c 2013-03-15 14:27:34 UTC (rev
26462)
+++ gnunet/src/regex/gnunet-regex-profiler.c 2013-03-15 15:23:46 UTC (rev
26463)
@@ -37,7 +37,7 @@
#include "gnunet_testbed_service.h"
#define FIND_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS,
90)
-#define SEARCHES_IN_PARALLEL 2
+#define SEARCHES_IN_PARALLEL 10
#define ANNOUNCE_DELAY GNUNET_TIME_relative_multiply(\
GNUNET_TIME_UNIT_MILLISECONDS,\
300)
@@ -1474,9 +1474,9 @@
peer->policy_file = GNUNET_strdup (filename);
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Creating peer %i on host %s for policy
file %s\n",
- peer->id,
- GNUNET_TESTBED_host_get_hostname (peer->host_handle),
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Creating peer %i on host %s for policy file %s\n",
+ peer->id, GNUNET_TESTBED_host_get_hostname (peer->host_handle),
filename);
/* Set configuration options specific for this peer
@@ -1484,7 +1484,8 @@
peer->cfg = GNUNET_CONFIGURATION_dup (cfg);
GNUNET_CONFIGURATION_set_value_number (peer->cfg, "REGEXPROFILER",
"MAX_PATH_COMPRESSION",
- (unsigned long
long)max_path_compression);
+ (unsigned long long)
+ max_path_compression);
GNUNET_CONFIGURATION_set_value_string (peer->cfg, "REGEXPROFILER",
"POLICY_FILE", filename);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r26463 - gnunet/src/regex,
gnunet <=