Commit graph

3 commits

Author SHA1 Message Date
e2428a8178 websocket: Implement 64-bit frames, enable split frames.
This fixes several assertion errors that were found in fuzz
testing, for unimplemented portions of the spec. The assertions
were either turned into Python exceptions, or the missing
functionality was implemented.

Frames larger than 4GB are unsupported. Initial reception of
such a frame will result in OSError(EIO) and subsequent operations
on the same websocket will fail because framing has been lost.

Transmitting frames larger than 64kB is unsupported. Attempting
to transmit such a frame will result in OSError(ENOBUFS). Subsequent
operations on the websocket are possible.

Signed-off-by: Jeff Epler <jepler@gmail.com>
2025-08-04 10:22:48 -05:00
Felix Dörre
8547a78275 extmod/modwebsocket: Fix websocket to send correct close frame.
When the websocket closes currently, it does not send a proper
"close"-frame, but rather encodes the 0x8800-sequence inside a binary
packet, which is wrong.  The close packet is a different kind of websocket
frame, according to https://www.rfc-editor.org/rfc/rfc6455.

This change resolves an error in Firefox when the websocket closes.

Signed-off-by: Felix Dörre <felix@dogcraft.de>
2024-02-26 12:20:40 +11:00
Damien George
f07a56fa3b tests/extmod: Rename websocket test to websocket_basic.
This is so that the filename of the test doesn't clash with the module name
itself (being "websocket"), and lead to potential problems executing the
test.
2017-03-10 15:05:08 +11:00
Renamed from tests/extmod/websocket.py.exp (Browse further)