Skip to content

Commit

Permalink
Reset retransmit timer on ack regardless of the current timer state
Browse files Browse the repository at this point in the history
  • Loading branch information
HKalbasi committed Jul 14, 2024
1 parent 7b125ef commit 1d44e43
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/socket/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,19 +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 { .. } => (),
}
}
Expand Down

0 comments on commit 1d44e43

Please sign in to comment.