mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
This fixes several assertion errors that were found in fuzz testing, for unimplemented portions of the websocket spec. The assertions were either turned into Python exceptions, or the missing functionality was implemented. Split frames are now enabled and work, enabling reception of frames up to 64kB (assuming they are encoded with a 16-bit size field). Frames with a 64-bit size fields remain unsupported but no longer result in an assertion error. Instead, 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>
20 lines
452 B
Plaintext
20 lines
452 B
Plaintext
b'ping'
|
|
b'\x81\x04pong'
|
|
b'pingPi'
|
|
b'ngPI'
|
|
b'NG'
|
|
b''
|
|
b'pingpingpingpingpingpingpingpingpingpingpingpingpingpingpingpingpingpingpingpingpingpingpingpingpingpingpingpingpingpingpingping'
|
|
b'\x81~\x00\x80pongpongpongpongpongpongpongpongpongpongpongpongpongpongpongpongpongpongpongpongpongpongpongpongpongpongpongpongpongpongpongpong'
|
|
ioctl: EIO: True
|
|
b'\x00\x00\x00\x00 '
|
|
b'\x00\x00\x00\x00 '
|
|
b''
|
|
b'\x88\x00'
|
|
b'ping'
|
|
b'pong'
|
|
0
|
|
1
|
|
2
|
|
ioctl: EINVAL: True
|