mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Kernet/Net: Close a TCP connection using FIN|ACK instead of just FIN
When initiating a connection termination, the FIN should be sent with a ACK from the last received segment even if that ACK already been sent.
This commit is contained in:
parent
d33b99dd24
commit
55faff80df
Notes:
sideshowbarker
2024-07-17 11:33:34 +09:00
Author: https://github.com/pdelagrave 🔰 Commit: https://github.com/SerenityOS/serenity/commit/55faff80df Pull-request: https://github.com/SerenityOS/serenity/pull/19698
1 changed files with 1 additions and 1 deletions
|
@ -534,7 +534,7 @@ void TCPSocket::shut_down_for_writing()
|
|||
{
|
||||
if (state() == State::Established) {
|
||||
dbgln_if(TCP_SOCKET_DEBUG, " Sending FIN from Established and moving into FinWait1");
|
||||
(void)send_tcp_packet(TCPFlags::FIN);
|
||||
(void)send_tcp_packet(TCPFlags::FIN | TCPFlags::ACK);
|
||||
set_state(State::FinWait1);
|
||||
} else {
|
||||
dbgln(" Shutting down TCPSocket for writing but not moving to FinWait1 since state is {}", to_string(state()));
|
||||
|
|
Loading…
Reference in a new issue