/**
* Target fragment size.
*/
- uint16_t mtu;
+ uint16_t mtu;
};
if (wrap)
{
/* full round transmitted wait 2x delay for ACK before going again */
+ fc->num_rounds++;
delay =
GNUNET_TIME_relative_max (GNUNET_TIME_relative_multiply (delay, 2),
- fc->delay);
+ 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);
fc->last_round = GNUNET_TIME_absolute_get ();
fc->wack = GNUNET_YES;
- fc->num_rounds++;
}
fc->proc_busy = GNUNET_YES;
fc->delay_until = GNUNET_TIME_relative_to_absolute (delay);
if (ntohl (fa->fragment_id) != fc->fragment_id)
return GNUNET_SYSERR; /* not our ACK */
abits = GNUNET_ntohll (fa->bits);
- if ( (GNUNET_YES == fc->wack) &&
- (abits == (fc->acks & abits)) )
+ if ((GNUNET_YES == fc->wack) && (abits == (fc->acks & abits)))
{
/* normal ACK, can update running average of delay... */
fc->wack = GNUNET_NO;
ndelay = GNUNET_TIME_absolute_get_duration (fc->last_round);
- fc->delay.rel_value = (ndelay.rel_value * fc->num_rounds + 3 * fc->delay.rel_value) / 4;
+ fc->delay.rel_value =
+ (ndelay.rel_value * fc->num_rounds + 3 * fc->delay.rel_value) / 4;
}
GNUNET_STATISTICS_update (fc->stats,
_("# fragment acknowledgements received"), 1,