diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-10-08 21:41:46 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-10-08 21:44:50 +0200 |
commit | 9bb0374d7de30817dff619947fab8f2b38344876 (patch) | |
tree | 74f558e60f2da7d83e0ef0cbbe2f991dac8c5538 /Kernel/Net | |
parent | 3aa27b5b0e95b8fb975497a2777bc26cd9bf2811 (diff) | |
download | serenity-9bb0374d7de30817dff619947fab8f2b38344876.zip |
Kernel: Delay moving accepted sockets to SetupState::Completed a bit
Make sure we don't move accepted sockets to the Completed setup state
until we've actually constructed a FileDescription for them.
This is important, since this state transition will trigger connect()
to unblock on the client side, and the client may try writing to the
socket right away.
This makes DNS lookups way more reliable since we don't just fail to
write() right after connect()ing to LookupServer sometimes. :^)
Diffstat (limited to 'Kernel/Net')
-rw-r--r-- | Kernel/Net/Socket.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/Kernel/Net/Socket.cpp b/Kernel/Net/Socket.cpp index 91d5bc31cb..0749d0ee2e 100644 --- a/Kernel/Net/Socket.cpp +++ b/Kernel/Net/Socket.cpp @@ -65,7 +65,6 @@ RefPtr<Socket> Socket::accept() auto client = m_pending.take_first(); ASSERT(!client->is_connected()); client->m_acceptor_pid = m_origin_pid; - client->set_setup_state(SetupState::Completed); client->m_connected = true; client->m_role = Role::Accepted; return client; |