mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 16:21:29 +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:
parent
210a5d77dc
commit
960a4b636c
Notes:
sideshowbarker
2024-07-16 23:44:30 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/960a4b636c Pull-request: https://github.com/SerenityOS/serenity/pull/24392 Reviewed-by: https://github.com/kennethmyhra ✅
|
@ -188,7 +188,7 @@ ErrorOr<void> recreate_socket_if_needed(T& connection, URL::URL const& url)
|
|||
using SocketType = typename T::SocketType;
|
||||
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;
|
||||
// Create another socket for the connection.
|
||||
auto set_socket = [&](NonnullOwnPtr<SocketStorageType>&& socket) -> ErrorOr<void> {
|
||||
|
|
Loading…
Reference in a new issue