fix: flush local-tun tcp writer half before close (#1759)

This commit is contained in:
Aleksandr Krotov
2024-11-11 14:51:52 +08:00
committed by GitHub
parent 3582e27e63
commit 7a4136f8b5
@@ -357,7 +357,7 @@ impl TcpTun {
}
// SHUT_WR
if matches!(control.send_state, TcpSocketState::Close) {
if matches!(control.send_state, TcpSocketState::Close) && socket.send_queue() == 0 && control.send_buffer.is_empty() {
trace!("closing TCP Write Half, {:?}", socket.state());
// Close the socket. Set to FIN state