diff options
Diffstat (limited to 'src/fragmentation')
-rw-r--r-- | src/fragmentation/fragmentation.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/fragmentation/fragmentation.c b/src/fragmentation/fragmentation.c index e5b11f5d9..8fab3fee4 100644 --- a/src/fragmentation/fragmentation.c +++ b/src/fragmentation/fragmentation.c | |||
@@ -117,7 +117,7 @@ struct GNUNET_FRAGMENT_Context | |||
117 | /** | 117 | /** |
118 | * Target fragment size. | 118 | * Target fragment size. |
119 | */ | 119 | */ |
120 | uint16_t mtu; | 120 | uint16_t mtu; |
121 | 121 | ||
122 | }; | 122 | }; |
123 | 123 | ||
@@ -208,7 +208,8 @@ transmit_next (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
208 | fc->num_rounds++; | 208 | fc->num_rounds++; |
209 | delay = | 209 | delay = |
210 | GNUNET_TIME_relative_max (GNUNET_TIME_relative_multiply (delay, 2), | 210 | GNUNET_TIME_relative_max (GNUNET_TIME_relative_multiply (delay, 2), |
211 | GNUNET_TIME_relative_multiply (fc->delay, fc->num_rounds)); | 211 | GNUNET_TIME_relative_multiply (fc->delay, |
212 | fc->num_rounds)); | ||
212 | /* never use zero, need some time for ACK always */ | 213 | /* never use zero, need some time for ACK always */ |
213 | delay = GNUNET_TIME_relative_max (GNUNET_TIME_UNIT_MILLISECONDS, delay); | 214 | delay = GNUNET_TIME_relative_max (GNUNET_TIME_UNIT_MILLISECONDS, delay); |
214 | fc->last_round = GNUNET_TIME_absolute_get (); | 215 | fc->last_round = GNUNET_TIME_absolute_get (); |
@@ -330,13 +331,13 @@ GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc, | |||
330 | if (ntohl (fa->fragment_id) != fc->fragment_id) | 331 | if (ntohl (fa->fragment_id) != fc->fragment_id) |
331 | return GNUNET_SYSERR; /* not our ACK */ | 332 | return GNUNET_SYSERR; /* not our ACK */ |
332 | abits = GNUNET_ntohll (fa->bits); | 333 | abits = GNUNET_ntohll (fa->bits); |
333 | if ( (GNUNET_YES == fc->wack) && | 334 | if ((GNUNET_YES == fc->wack) && (abits == (fc->acks & abits))) |
334 | (abits == (fc->acks & abits)) ) | ||
335 | { | 335 | { |
336 | /* normal ACK, can update running average of delay... */ | 336 | /* normal ACK, can update running average of delay... */ |
337 | fc->wack = GNUNET_NO; | 337 | fc->wack = GNUNET_NO; |
338 | ndelay = GNUNET_TIME_absolute_get_duration (fc->last_round); | 338 | ndelay = GNUNET_TIME_absolute_get_duration (fc->last_round); |
339 | fc->delay.rel_value = (ndelay.rel_value * fc->num_rounds + 3 * fc->delay.rel_value) / 4; | 339 | fc->delay.rel_value = |
340 | (ndelay.rel_value * fc->num_rounds + 3 * fc->delay.rel_value) / 4; | ||
340 | } | 341 | } |
341 | GNUNET_STATISTICS_update (fc->stats, | 342 | GNUNET_STATISTICS_update (fc->stats, |
342 | _("# fragment acknowledgements received"), 1, | 343 | _("# fragment acknowledgements received"), 1, |