diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-07-25 15:20:48 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-07-25 15:20:48 +0000 |
commit | ab9c4e9d3795f07a12e86717f0a635080728ef81 (patch) | |
tree | bc4206b5a9e4a9771d5958c9b9696dccd394b131 /src | |
parent | d2469f4bd8f26105392c7ccd110f38f6e2e8a8de (diff) | |
download | gnunet-ab9c4e9d3795f07a12e86717f0a635080728ef81.tar.gz gnunet-ab9c4e9d3795f07a12e86717f0a635080728ef81.zip |
exponential back-off
Diffstat (limited to 'src')
-rw-r--r-- | src/fs/gnunet-service-fs_pe.c | 11 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 4 | ||||
-rw-r--r-- | src/nse/test_nse.conf | 6 | ||||
-rw-r--r-- | src/nse/test_nse_multipeer.c | 3 |
4 files changed, 16 insertions, 8 deletions
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c index b62c20005..b52e04712 100644 --- a/src/fs/gnunet-service-fs_pe.c +++ b/src/fs/gnunet-service-fs_pe.c | |||
@@ -159,10 +159,13 @@ plan (struct PeerPlan *pp, | |||
159 | total_delay * 1000LL / plan_count, | 159 | total_delay * 1000LL / plan_count, |
160 | GNUNET_NO); | 160 | GNUNET_NO); |
161 | prd = GSF_pending_request_get_data_ (rp->pr); | 161 | prd = GSF_pending_request_get_data_ (rp->pr); |
162 | // FIXME: calculate 'rp->earliest_transmission'! | 162 | // FIXME: calculate 'rp->priority'! |
163 | // FIXME: claculate 'rp->priority'! | 163 | if (rp->transmission_counter < 32) |
164 | delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, | 164 | delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, |
165 | rp->transmission_counter); | 165 | 1LL << rp->transmission_counter); |
166 | else | ||
167 | delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, | ||
168 | UINT_MAX); | ||
166 | rp->earliest_transmission | 169 | rp->earliest_transmission |
167 | = GNUNET_TIME_relative_to_absolute (delay); | 170 | = GNUNET_TIME_relative_to_absolute (delay); |
168 | #if DEBUG_FS | 171 | #if DEBUG_FS |
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index fb4c7ec9e..37865d913 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -305,6 +305,10 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, | |||
305 | GNUNET_h2s (query), | 305 | GNUNET_h2s (query), |
306 | type); | 306 | type); |
307 | #endif | 307 | #endif |
308 | GNUNET_STATISTICS_update (GSF_stats, | ||
309 | gettext_noop ("# Pending requests created"), | ||
310 | 1, | ||
311 | GNUNET_NO); | ||
308 | pr = GNUNET_malloc (sizeof (struct GSF_PendingRequest)); | 312 | pr = GNUNET_malloc (sizeof (struct GSF_PendingRequest)); |
309 | pr->local_result_offset = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, | 313 | pr->local_result_offset = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, |
310 | UINT64_MAX); | 314 | UINT64_MAX); |
diff --git a/src/nse/test_nse.conf b/src/nse/test_nse.conf index d8440e904..475f87eaf 100644 --- a/src/nse/test_nse.conf +++ b/src/nse/test_nse.conf | |||
@@ -15,8 +15,8 @@ CONFIG = $DEFAULTCONFIG | |||
15 | # Overriding network settings for faster testing (do NOT use | 15 | # Overriding network settings for faster testing (do NOT use |
16 | # these values in production just because they are here) | 16 | # these values in production just because they are here) |
17 | WORKDELAY = 1 | 17 | WORKDELAY = 1 |
18 | INTERVAL = 15000 | 18 | INTERVAL = 120000 |
19 | WORKBITS = 8 | 19 | WORKBITS = 1 |
20 | 20 | ||
21 | HISTOGRAM = $SERVICEHOME/nse-histogram | 21 | HISTOGRAM = $SERVICEHOME/nse-histogram |
22 | 22 | ||
@@ -58,7 +58,7 @@ EXTERNAL_ADDRESS = 127.0.0.1 | |||
58 | AUTOSTART = NO | 58 | AUTOSTART = NO |
59 | 59 | ||
60 | [testing] | 60 | [testing] |
61 | NUM_PEERS = 50 | 61 | NUM_PEERS = 100 |
62 | WEAKRANDOM = YES | 62 | WEAKRANDOM = YES |
63 | TOPOLOGY = NONE | 63 | TOPOLOGY = NONE |
64 | CONNECT_TOPOLOGY = SMALL_WORLD_RING | 64 | CONNECT_TOPOLOGY = SMALL_WORLD_RING |
diff --git a/src/nse/test_nse_multipeer.c b/src/nse/test_nse_multipeer.c index 97db91fd3..277f73b21 100644 --- a/src/nse/test_nse_multipeer.c +++ b/src/nse/test_nse_multipeer.c | |||
@@ -51,7 +51,7 @@ struct NSEPeer *peer_tail; | |||
51 | /** | 51 | /** |
52 | * How long do we run the test? | 52 | * How long do we run the test? |
53 | */ | 53 | */ |
54 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 30) | 54 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 60) |
55 | 55 | ||
56 | static int ok; | 56 | static int ok; |
57 | 57 | ||
@@ -270,6 +270,7 @@ check () | |||
270 | return ok; | 270 | return ok; |
271 | } | 271 | } |
272 | 272 | ||
273 | |||
273 | int | 274 | int |
274 | main (int argc, char *argv[]) | 275 | main (int argc, char *argv[]) |
275 | { | 276 | { |