diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-19 20:07:13 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-19 20:07:13 +0000 |
commit | 5bdaaa0231184c53d784fc30e1617baad00da76f (patch) | |
tree | 4227fd6355cee1ac5c9398c55f508c5363e51c68 /src/fs/gnunet-service-fs_pe.c | |
parent | e3bb58c8e0f73697c22397165d0ff24424e32839 (diff) | |
download | gnunet-5bdaaa0231184c53d784fc30e1617baad00da76f.tar.gz gnunet-5bdaaa0231184c53d784fc30e1617baad00da76f.zip |
fixing 1830
Diffstat (limited to 'src/fs/gnunet-service-fs_pe.c')
-rw-r--r-- | src/fs/gnunet-service-fs_pe.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c index 6bf85df92..4555355d2 100644 --- a/src/fs/gnunet-service-fs_pe.c +++ b/src/fs/gnunet-service-fs_pe.c | |||
@@ -229,25 +229,25 @@ plan (struct PeerPlan *pp, struct GSF_RequestPlan *rp) | |||
229 | total_delay * 1000LL / plan_count, GNUNET_NO); | 229 | total_delay * 1000LL / plan_count, GNUNET_NO); |
230 | prd = GSF_pending_request_get_data_ (rp->prl_head->pr); | 230 | prd = GSF_pending_request_get_data_ (rp->prl_head->pr); |
231 | // FIXME: calculate 'rp->priority'! | 231 | // FIXME: calculate 'rp->priority'! |
232 | #if 0 | 232 | if (rp->transmission_counter < 8) |
233 | if (rp->transmission_counter < 32) | ||
234 | delay = | 233 | delay = |
235 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, | 234 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, |
236 | 1LL << rp->transmission_counter); | 235 | rp->transmission_counter); |
237 | else | ||
238 | delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, UINT_MAX); | ||
239 | #else | ||
240 | if (rp->transmission_counter < 32) | ||
241 | delay = | ||
242 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, | ||
243 | rp->transmission_counter); | ||
244 | else if (rp->transmission_counter < 32) | 236 | else if (rp->transmission_counter < 32) |
245 | delay = | 237 | delay = |
246 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, | 238 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, |
247 | 32 + (1LL << rp->transmission_counter)); | 239 | 8 + (1LL << (rp->transmission_counter - 8))); |
248 | else | 240 | else |
249 | delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, UINT_MAX); | 241 | delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, |
250 | #endif | 242 | 8 + (1LL << 24)); |
243 | delay.rel_value = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, | ||
244 | delay.rel_value + 1); | ||
245 | if (rp->transmission_counter != 0) | ||
246 | delay.rel_value += TTL_DECREMENT; | ||
247 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
248 | "Considering (re)transmission number %u in %llu ms\n", | ||
249 | (unsigned int) rp->transmission_counter, | ||
250 | (unsigned long long) delay.rel_value); | ||
251 | rp->earliest_transmission = GNUNET_TIME_relative_to_absolute (delay); | 251 | rp->earliest_transmission = GNUNET_TIME_relative_to_absolute (delay); |
252 | #if DEBUG_FS | 252 | #if DEBUG_FS |
253 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 253 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |