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/fs | |
parent | d2469f4bd8f26105392c7ccd110f38f6e2e8a8de (diff) | |
download | gnunet-ab9c4e9d3795f07a12e86717f0a635080728ef81.tar.gz gnunet-ab9c4e9d3795f07a12e86717f0a635080728ef81.zip |
exponential back-off
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-service-fs_pe.c | 11 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 4 |
2 files changed, 11 insertions, 4 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); |