mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
LibHTTP+LibGemini: Set underlying sockets as idle when detaching
This ultimately makes the sockets not spin while unused (particularly in the 10s shutdown period that RequestServer's cache has).
This commit is contained in:
parent
29acb7fcf8
commit
64e231bd38
Notes:
sideshowbarker
2024-07-18 03:04:49 +09:00
Author: https://github.com/alimpfard
Commit: 64e231bd38
Pull-request: https://github.com/SerenityOS/serenity/pull/10350
Reviewed-by: https://github.com/awesomekling ✅
3 changed files with 6 additions and 0 deletions
|
@ -22,6 +22,7 @@ void HttpJob::start(NonnullRefPtr<Core::Socket> socket)
|
|||
did_fail(Core::NetworkJob::Error::ConnectionFailed);
|
||||
});
|
||||
};
|
||||
m_socket->set_idle(false);
|
||||
if (m_socket->is_connected()) {
|
||||
dbgln("Reusing previous connection for {}", url());
|
||||
deferred_invoke([this] {
|
||||
|
@ -52,6 +53,7 @@ void HttpJob::shutdown(ShutdownMode mode)
|
|||
} else {
|
||||
m_socket->on_ready_to_read = nullptr;
|
||||
m_socket->on_connected = nullptr;
|
||||
m_socket->set_idle(true);
|
||||
m_socket = nullptr;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue