mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 15:43:20 +00:00
RequestServer: Don't assert for socket fd not being CURL_SOCKET_BAD
The assertion in `WebSocketImplCurl::did_connect()` keeps failing for
multiple websockets when loading `https://www.speedtest.net/` since
commit 14ebcd4
. This fixes that by checking and returning false if
something went wrong and letting the caller function handle it.
This commit is contained in:
parent
82387e2127
commit
b77643a2e8
Notes:
github-actions[bot]
2025-05-01 00:21:27 +00:00
Author: https://github.com/mobounya
Commit: b77643a2e8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3930
Reviewed-by: https://github.com/ADKaster ✅
3 changed files with 10 additions and 6 deletions
|
@ -625,10 +625,12 @@ void ConnectionFromClient::check_active_requests()
|
|||
// FIXME: Come up with a unified way to track websockets and standard fetches instead of this nasty tagged pointer
|
||||
if (reinterpret_cast<uintptr_t>(application_private) & websocket_private_tag) {
|
||||
auto* websocket_impl = reinterpret_cast<WebSocketImplCurl*>(reinterpret_cast<uintptr_t>(application_private) & ~websocket_private_tag);
|
||||
if (msg->data.result == CURLE_OK)
|
||||
websocket_impl->did_connect();
|
||||
else
|
||||
if (msg->data.result == CURLE_OK) {
|
||||
if (!websocket_impl->did_connect())
|
||||
websocket_impl->on_connection_error();
|
||||
} else {
|
||||
websocket_impl->on_connection_error();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue