stun: set delay in retransmission instead of adding it
authorFabrice Bellet <fabrice@bellet.info>
Sun, 5 Apr 2020 19:02:47 +0000 (21:02 +0200)
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>
Thu, 7 May 2020 00:22:48 +0000 (00:22 +0000)
commitade16ee939e54ab8ebf73043169edc6d32c3239c
treef1c42fbdc36bdddf508ff156dd7bd3d783ee8723
parentc4993988067a2bf5056fa3146314992c06bfe51d
stun: set delay in retransmission instead of adding it

We may have situation when stun_timer_refresh is called with a
significant delay after the current deadline. In the actual situation,
this delay is just included to the computation of the new deadline of the
next stun retransmission. We think this may lead to unfair situations,
where the next deadline may be too short, just to compensate the first
deadline that was too long.

For example, if a stun request is scheduled with a delay of
200ms for the 2nd transmission, and 400ms for the 3rd transmission,
if stun_timer_remainder() is called 300ms after the start of the
timer, the second delay will last only 300ms, instead of 400ms.
stun/usages/timer.c