From: Christian Grothoff Date: Tue, 8 May 2012 18:06:26 +0000 (+0000) Subject: -fix: min delay 50ms, do not skip mindelay if fragmentation block only consists of... X-Git-Tag: initial-import-from-subversion-38251~13595 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9af949a9275d971a6fa1c8a4e1af721135304863;p=oweals%2Fgnunet.git -fix: min delay 50ms, do not skip mindelay if fragmentation block only consists of 1 msg --- diff --git a/src/fragmentation/fragmentation.c b/src/fragmentation/fragmentation.c index 8fab3fee4..1cc28bf38 100644 --- a/src/fragmentation/fragmentation.c +++ b/src/fragmentation/fragmentation.c @@ -28,6 +28,9 @@ #include "fragmentation.h" +#define MIN_ACK_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 50) + + /** * Fragmentation context. */ @@ -172,6 +175,11 @@ transmit_next (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } fc->next_transmission = (fc->next_transmission + 1) % 64; wrap |= (fc->next_transmission == 0); + while (0 == (fc->acks & (1LL << fc->next_transmission))) + { + fc->next_transmission = (fc->next_transmission + 1) % 64; + wrap |= (fc->next_transmission == 0); + } /* assemble fragmentation message */ mbuf = (const char *) &fc[1]; @@ -211,7 +219,7 @@ transmit_next (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_TIME_relative_multiply (fc->delay, fc->num_rounds)); /* never use zero, need some time for ACK always */ - delay = GNUNET_TIME_relative_max (GNUNET_TIME_UNIT_MILLISECONDS, delay); + delay = GNUNET_TIME_relative_max (MIN_ACK_DELAY, delay); fc->last_round = GNUNET_TIME_absolute_get (); fc->wack = GNUNET_YES; }