Reset the timer transitioning from TCP FIN-WAIT-1 to FIN-WAIT-2.
We don't transmit anything in FIN-WAIT-2, so we don't need the timer running, or we'll get spurious log messages about retransmissions. This also makes logic cleaner, although with no functional change.
This commit is contained in:
parent
cdf236412f
commit
7cd7bd4683
|
@ -992,9 +992,8 @@ impl<'a> TcpSocket<'a> {
|
||||||
(State::FinWait1, TcpControl::None) => {
|
(State::FinWait1, TcpControl::None) => {
|
||||||
if ack_of_fin {
|
if ack_of_fin {
|
||||||
self.set_state(State::FinWait2);
|
self.set_state(State::FinWait2);
|
||||||
} else {
|
|
||||||
self.timer.reset();
|
|
||||||
}
|
}
|
||||||
|
self.timer.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIN packets in FIN-WAIT-1 state change it to CLOSING, or to TIME-WAIT
|
// FIN packets in FIN-WAIT-1 state change it to CLOSING, or to TIME-WAIT
|
||||||
|
@ -2073,10 +2072,7 @@ mod test {
|
||||||
..SEND_TEMPL
|
..SEND_TEMPL
|
||||||
});
|
});
|
||||||
assert_eq!(s.state, State::FinWait2);
|
assert_eq!(s.state, State::FinWait2);
|
||||||
sanity!(s, TcpSocket {
|
sanity!(s, socket_fin_wait_2());
|
||||||
timer: Timer::Retransmit { expires_at: 100, delay: 100 },
|
|
||||||
..socket_fin_wait_2()
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Reference in New Issue