aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_pe.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-10-19 14:09:50 +0000
committerChristian Grothoff <christian@grothoff.org>2011-10-19 14:09:50 +0000
commite79f6019ce2f082bd247e1d4fca950d0c7cb7b57 (patch)
tree73aeea23d0369416c746a69065c695d7ed023b9f /src/fs/gnunet-service-fs_pe.c
parent24bd0eabe9599e8c3da2f86aeed49ba53d52816a (diff)
downloadgnunet-e79f6019ce2f082bd247e1d4fca950d0c7cb7b57.tar.gz
gnunet-e79f6019ce2f082bd247e1d4fca950d0c7cb7b57.zip
prevent loopback routing, add some statistics, faster re-transmit
Diffstat (limited to 'src/fs/gnunet-service-fs_pe.c')
-rw-r--r--src/fs/gnunet-service-fs_pe.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c
index dc83c9960..6bf85df92 100644
--- a/src/fs/gnunet-service-fs_pe.c
+++ b/src/fs/gnunet-service-fs_pe.c
@@ -229,12 +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 < 32) 233 if (rp->transmission_counter < 32)
233 delay = 234 delay =
234 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 235 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
235 1LL << rp->transmission_counter); 236 1LL << rp->transmission_counter);
236 else 237 else
237 delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, UINT_MAX); 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)
245 delay =
246 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
247 32 + (1LL << rp->transmission_counter));
248 else
249 delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, UINT_MAX);
250#endif
238 rp->earliest_transmission = GNUNET_TIME_relative_to_absolute (delay); 251 rp->earliest_transmission = GNUNET_TIME_relative_to_absolute (delay);
239#if DEBUG_FS 252#if DEBUG_FS
240 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 253 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -361,14 +374,6 @@ schedule_peer_transmission (void *cls,
361 GSF_peer_transmit_cancel_ (pp->pth); 374 GSF_peer_transmit_cancel_ (pp->pth);
362 pp->pth = NULL; 375 pp->pth = NULL;
363 } 376 }
364 GNUNET_STATISTICS_set (GSF_stats,
365 gettext_noop ("# query delay heap size"),
366 GNUNET_CONTAINER_heap_get_size (pp->delay_heap),
367 GNUNET_NO);
368 GNUNET_STATISTICS_set (GSF_stats,
369 gettext_noop ("# query priority heap size"),
370 GNUNET_CONTAINER_heap_get_size (pp->priority_heap),
371 GNUNET_NO);
372 /* move ready requests to priority queue */ 377 /* move ready requests to priority queue */
373 while ((NULL != (rp = GNUNET_CONTAINER_heap_peek (pp->delay_heap))) && 378 while ((NULL != (rp = GNUNET_CONTAINER_heap_peek (pp->delay_heap))) &&
374 (GNUNET_TIME_absolute_get_remaining 379 (GNUNET_TIME_absolute_get_remaining