diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-05-08 18:06:26 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-05-08 18:06:26 +0000 |
commit | 9af949a9275d971a6fa1c8a4e1af721135304863 (patch) | |
tree | d55aef49cb6657e1957f1d732cc1604c04c06cf5 /src/fragmentation | |
parent | 16546613251edfcd595e4f584b1a2d2a414d0b1a (diff) | |
download | gnunet-9af949a9275d971a6fa1c8a4e1af721135304863.tar.gz gnunet-9af949a9275d971a6fa1c8a4e1af721135304863.zip |
-fix: min delay 50ms, do not skip mindelay if fragmentation block only consists of 1 msg
Diffstat (limited to 'src/fragmentation')
-rw-r--r-- | src/fragmentation/fragmentation.c | 10 |
1 files changed, 9 insertions, 1 deletions
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 @@ | |||
28 | #include "fragmentation.h" | 28 | #include "fragmentation.h" |
29 | 29 | ||
30 | 30 | ||
31 | #define MIN_ACK_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 50) | ||
32 | |||
33 | |||
31 | /** | 34 | /** |
32 | * Fragmentation context. | 35 | * Fragmentation context. |
33 | */ | 36 | */ |
@@ -172,6 +175,11 @@ transmit_next (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
172 | } | 175 | } |
173 | fc->next_transmission = (fc->next_transmission + 1) % 64; | 176 | fc->next_transmission = (fc->next_transmission + 1) % 64; |
174 | wrap |= (fc->next_transmission == 0); | 177 | wrap |= (fc->next_transmission == 0); |
178 | while (0 == (fc->acks & (1LL << fc->next_transmission))) | ||
179 | { | ||
180 | fc->next_transmission = (fc->next_transmission + 1) % 64; | ||
181 | wrap |= (fc->next_transmission == 0); | ||
182 | } | ||
175 | 183 | ||
176 | /* assemble fragmentation message */ | 184 | /* assemble fragmentation message */ |
177 | mbuf = (const char *) &fc[1]; | 185 | mbuf = (const char *) &fc[1]; |
@@ -211,7 +219,7 @@ transmit_next (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
211 | GNUNET_TIME_relative_multiply (fc->delay, | 219 | GNUNET_TIME_relative_multiply (fc->delay, |
212 | fc->num_rounds)); | 220 | fc->num_rounds)); |
213 | /* never use zero, need some time for ACK always */ | 221 | /* never use zero, need some time for ACK always */ |
214 | delay = GNUNET_TIME_relative_max (GNUNET_TIME_UNIT_MILLISECONDS, delay); | 222 | delay = GNUNET_TIME_relative_max (MIN_ACK_DELAY, delay); |
215 | fc->last_round = GNUNET_TIME_absolute_get (); | 223 | fc->last_round = GNUNET_TIME_absolute_get (); |
216 | fc->wack = GNUNET_YES; | 224 | fc->wack = GNUNET_YES; |
217 | } | 225 | } |