mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-11 17:00:37 +00:00
Kernel/Net: Socket connected state change should reevaluate blocks
This fixes an issue where TCP sockets could get into the Established state too quickly and fail to unblock a subsequent sys$select() call. This makes websites load *significantly* faster. :^)
This commit is contained in:
parent
7b735b55e1
commit
48589db3aa
Notes:
sideshowbarker
2024-07-19 00:53:21 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/48589db3aab
2 changed files with 10 additions and 1 deletions
|
@ -269,4 +269,13 @@ KResult Socket::stat(::stat& st) const
|
|||
return KSuccess;
|
||||
}
|
||||
|
||||
void Socket::set_connected(bool connected)
|
||||
{
|
||||
LOCKER(lock());
|
||||
if (m_connected == connected)
|
||||
return;
|
||||
m_connected = connected;
|
||||
evaluate_block_conditions();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ public:
|
|||
virtual Role role(const FileDescription&) const { return m_role; }
|
||||
|
||||
bool is_connected() const { return m_connected; }
|
||||
void set_connected(bool connected) { m_connected = connected; }
|
||||
void set_connected(bool);
|
||||
|
||||
bool can_accept() const { return !m_pending.is_empty(); }
|
||||
RefPtr<Socket> accept();
|
||||
|
|
Loading…
Reference in a new issue