mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
RequestServer: Account for null sockets in recreate_socket_if_needed()
A connection's socket is allowed to be null if it's being recreated after a failed connect(), this was handled correctly in request_did_finish but not in recreate_socket_if_needed; this commit fixes this oversight.
This commit is contained in:
committed by
Andreas Kling
parent
210a5d77dc
commit
960a4b636c
@@ -188,7 +188,7 @@ ErrorOr<void> recreate_socket_if_needed(T& connection, URL::URL const& url)
|
|||||||
using SocketType = typename T::SocketType;
|
using SocketType = typename T::SocketType;
|
||||||
using SocketStorageType = typename T::StorageType;
|
using SocketStorageType = typename T::StorageType;
|
||||||
|
|
||||||
if (!connection.socket->is_open() || connection.socket->is_eof()) {
|
if (!connection.socket || !connection.socket->is_open() || connection.socket->is_eof()) {
|
||||||
connection.socket = nullptr;
|
connection.socket = nullptr;
|
||||||
// Create another socket for the connection.
|
// Create another socket for the connection.
|
||||||
auto set_socket = [&](NonnullOwnPtr<SocketStorageType>&& socket) -> ErrorOr<void> {
|
auto set_socket = [&](NonnullOwnPtr<SocketStorageType>&& socket) -> ErrorOr<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user