IPv4: Put some TCP close handshake debug spam behind TCP_SOCKET_DEBUG

This commit is contained in:
Andreas Kling 2020-02-08 16:00:31 +01:00
parent 3891e6d739
commit 70c9a89707
Notes: sideshowbarker 2024-07-19 09:31:33 +09:00

View file

@ -441,7 +441,9 @@ bool TCPSocket::protocol_is_disconnected() const
void TCPSocket::shut_down_for_writing()
{
if (state() == State::Established) {
#ifdef TCP_SOCKET_DEBUG
dbg() << " Sending FIN/ACK from Established and moving into FinWait1";
#endif
send_tcp_packet(TCPFlags::FIN | TCPFlags::ACK);
set_state(State::FinWait1);
} else {
@ -453,7 +455,9 @@ void TCPSocket::close()
{
IPv4Socket::close();
if (state() == State::CloseWait) {
#ifdef TCP_SOCKET_DEBUG
dbg() << " Sending FIN from CloseWait and moving into LastAck";
#endif
send_tcp_packet(TCPFlags::FIN | TCPFlags::ACK);
set_state(State::LastAck);
}