Commit Graph

5 Commits

Author SHA1 Message Date
Sam Atkins
7889a46724 LibWebSocket: Time out stalled close handshakes
Start a single-shot timer when a websocket enters CLOSING and fail
the connection if the peer never answers with its close frame.

Without a bound here, a dropped or non-responsive peer can leave the
websocket stuck in the closing handshake forever, which is another
path to rare websocket timeouts during repeated test runs.
2026-05-05 19:14:29 +02:00
Sam Atkins
485f50287f LibWebSocket: Close failed sockets cleanly
Route fatal protocol-level websocket failures through fail_connection(),
emit both error and close once a socket exists, and drop the old
fatal_error() helper.

This gives callers a terminal close event instead of leaving transport
failures as error-only state changes.
2026-05-05 19:14:29 +02:00
Shannon Booth
a1a9ff6bf5 LibWebSocket: Add enum definition for status 1005 "no status received"
Just for a little less use of magic numbers.
2026-03-13 17:28:06 +01:00
Luke Wilde
9c5dff5be0 RequestServer+LibWebSocket: Drain underlying socket and resulting frames
`curl_easy_recv` must be called in a loop until it returns EAGAIN,
because it may cache data, but only activate the read notifier once.

Additionally, the data received can contain multiple WebSocket frames
and only activate the notifier once, so we have to keep reading frames
until there isn't enough data.

We also have to do this immediately after connecting a WebSocket,
since the server may immediately send data when the WebSocket opens
and before we create the read notifier.

This makes Discord login faster and more reliable, and makes Discord
activities start loading.
2025-07-22 13:55:45 +02:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00