mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-22 02:52:52 +00:00
RequestServer: Replace disconnected sockets in the grace period too
We previously only replaced disconnected sockets on the queued-request path, leading to attempts to send requests on a disconnected socket if the disconnection happened in the deletion grace period.
This commit is contained in:
parent
b387ac56b6
commit
c1184c1fde
Notes:
sideshowbarker
2024-07-17 20:04:51 +09:00
Author: https://github.com/alimpfard
Commit: c1184c1fde
Pull-request: https://github.com/SerenityOS/serenity/pull/12186
2 changed files with 18 additions and 11 deletions
|
@ -50,17 +50,7 @@ void request_did_finish(URL const& url, Core::Socket const* socket)
|
|||
};
|
||||
connection->removal_timer->start();
|
||||
} else {
|
||||
using SocketType = RemoveCVReference<decltype(*connection->socket)>;
|
||||
bool is_connected;
|
||||
if constexpr (IsSame<SocketType, TLS::TLSv12>)
|
||||
is_connected = connection->socket->is_established();
|
||||
else
|
||||
is_connected = connection->socket->is_connected();
|
||||
if (!is_connected) {
|
||||
// Create another socket for the connection.
|
||||
connection->socket = SocketType::construct(nullptr);
|
||||
dbgln_if(REQUESTSERVER_DEBUG, "Creating a new socket for {} -> {}", url, connection->socket);
|
||||
}
|
||||
recreate_socket_if_needed(*connection, url);
|
||||
dbgln_if(REQUESTSERVER_DEBUG, "Running next job in queue for connection {} @{}", &connection, connection->socket);
|
||||
auto request = connection->request_queue.take_first();
|
||||
connection->timer.start();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue