ladybird/Userland/Libraries/LibWebSocket
Luke Wilde 1535fe0324 LibWebSocket: Add to the total read in bytes instead of subtracting
read_length in WebSocket::read_frame is used to track how many bytes we
have read in from the network. However, we was subtracting the number
of read in bytes instead of adding, underflowing it to about the 64-bit
unsigned integer limit.

This effectively limited us to only doing one read from the network.
This was only an issue if the server stalled when sending data,
which is especially common for large payloads. This would also cause us
to go out of sync. This meant when a new frame came in, we would read
the payload data of the previous frame as if it was the frame header
and payload of the next frame.

This allows us to read in the initial payload from Discord Gateway
that describes to the client the servers we are in, the emotes the
server has, the channels it has, etc. For an account that's only in
the Serenity Discord, this was about 20 KB (compressed!)
2022-03-10 01:15:00 +01:00
..
Impl LibWebSocket: Switch to using Core::Stream 2022-02-06 13:10:10 +01:00
CMakeLists.txt LibWebSocket: Switch to using Core::Stream 2022-02-06 13:10:10 +01:00
ConnectionInfo.cpp LibWebSocket+telws: Use my own copyright headers :^) 2021-04-25 19:04:34 +02:00
ConnectionInfo.h LibCore+Userland: Remove Core::TCPSocket :^) 2022-02-06 17:28:17 +00:00
Message.h Everywhere: Convert ByteBuffer factory methods from Optional -> ErrorOr 2022-01-24 22:36:09 +01:00
WebSocket.cpp LibWebSocket: Add to the total read in bytes instead of subtracting 2022-03-10 01:15:00 +01:00
WebSocket.h LibWebSocket: Switch to using Core::Stream 2022-02-06 13:10:10 +01:00