From cb6c0d401dbdad1002c449d7f699f5d6c54ed84f Mon Sep 17 00:00:00 2001 From: HKalbasi <45197576+HKalbasi@users.noreply.github.com> Date: Sun, 14 Jul 2024 22:27:37 +0330 Subject: [PATCH] Reset retransmit timer on ack regardless of the current timer state --- src/socket/tcp.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/socket/tcp.rs b/src/socket/tcp.rs index 946d6de88..68bcf9400 100644 --- a/src/socket/tcp.rs +++ b/src/socket/tcp.rs @@ -337,18 +337,12 @@ impl Timer { fn set_for_retransmit(&mut self, timestamp: Instant, delay: Duration) { match *self { - Timer::Idle { .. } | Timer::FastRetransmit { .. } => { + Timer::Idle { .. } | Timer::FastRetransmit { .. } | Timer::Retransmit { .. } => { *self = Timer::Retransmit { expires_at: timestamp + delay, delay, } } - Timer::Retransmit { expires_at, delay } if timestamp >= expires_at => { - *self = Timer::Retransmit { - expires_at: timestamp + delay, - delay: delay * 2, - } - } Timer::Retransmit { .. } => (), Timer::Close { .. } => (), }