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:
Mohamed amine Bounya 2025-03-14 01:13:04 +00:00 committed by Andrew Kaster
parent 82387e2127
commit b77643a2e8
Notes: github-actions[bot] 2025-05-01 00:21:27 +00:00
3 changed files with 10 additions and 6 deletions

View file

@ -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;
}