diff options
Diffstat (limited to 'stun/usages/timer.c')
-rw-r--r-- | stun/usages/timer.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/stun/usages/timer.c b/stun/usages/timer.c index 2862ab8..5370cba 100644 --- a/stun/usages/timer.c +++ b/stun/usages/timer.c @@ -145,7 +145,11 @@ StunUsageTimerReturn stun_timer_refresh (StunTimer *timer) if (timer->retransmissions >= timer->max_retransmissions) return STUN_USAGE_TIMER_RETURN_TIMEOUT; - add_delay (&timer->deadline, timer->delay *= 2); + if (timer->retransmissions == timer->max_retransmissions - 1) + timer->delay = timer->delay / 2; + else + timer->delay = timer->delay * 2; + add_delay (&timer->deadline, timer->delay); timer->retransmissions++; return STUN_USAGE_TIMER_RETURN_RETRANSMIT; } |