aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbartpolot <bartpolot@140774ce-b5e7-0310-ab8b-a85725594a96>2013-02-04 15:54:21 +0000
committerbartpolot <bartpolot@140774ce-b5e7-0310-ab8b-a85725594a96>2013-02-04 15:54:21 +0000
commit8a1feb8fefa9571532ce514bbc3544499868c49c (patch)
tree69fe58d2c93addf08104b7af9073997bd575c750
parente8f80b650d7fd5704158a227e3d5a6b0569a3536 (diff)
- add randomness to the announce period: 10-20 min
git-svn-id: https://gnunet.org/svn/gnunet@26004 140774ce-b5e7-0310-ab8b-a85725594a96
-rw-r--r--src/regex/gnunet-daemon-regexprofiler.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/regex/gnunet-daemon-regexprofiler.c b/src/regex/gnunet-daemon-regexprofiler.c
index f172011f81..ea508f9d2a 100644
--- a/src/regex/gnunet-daemon-regexprofiler.c
+++ b/src/regex/gnunet-daemon-regexprofiler.c
@@ -172,9 +172,19 @@ reannounce_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_assert (NULL != announce_handle);
GNUNET_REGEX_reannounce (announce_handle);
}
- reannounce_task = GNUNET_SCHEDULER_add_delayed (reannounce_freq,
- &reannounce_regex,
- cls);
+
+ reannounce_task = GNUNET_SCHEDULER_add_delayed (
+ GNUNET_TIME_relative_add (reannounce_freq,
+ GNUNET_TIME_relative_multiply (
+ GNUNET_TIME_UNIT_SECONDS,
+ GNUNET_CRYPTO_random_u32 (
+ GNUNET_CRYPTO_QUALITY_WEAK,
+ 600
+ )
+ )
+ ),
+ &reannounce_regex,
+ cls);
}