You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
I have searched the issue tracker for a similar issue and not found a similar issue.
IDF version.
v5.1.2
Espressif SoC revision.
ESP32-S3
Operating System used.
Windows
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
CMD
Development Kit.
Custom board with esp32s3-wroom-1
Power Supply used.
USB
What is the expected behavior?
I expect esp_transport_read_internal() to wait up to timeout_ms milliseconds to read data.
What is the actual behavior?
When reading a websocket header, and the buffer layer has 1B inside it, esp_transport_read_internal() returns 1B, and ws_read_header() does not check for this, so the stream becomes misaligned by 1B. Then WS parsing is corrupt and parser cannot be realigned.
Steps to reproduce.
Decrease MTU to minimum
Setup server to send random-length WS frames
Hope that somehow we align on 1B buffer boundary
add assert(rlen==header) to ws_read_header() after esp_transport_read_internal()
Debug Logs.
I (11887) SIOC: unhandled text msg:~
^This is because "~" is the next byte of the websocket header.
More Information.
No response
The text was updated successfully, but these errors were encountered:
Also fails when reading > 125B packet, and size sub-header fields are fragmented(either due to buffer or packet boundaries).
bryghtlabs-richard
changed the title
Websocket parser fails when 1B in buffer. (IDFGH-13857)
Websocket parser fails when header/size/mask not received contiguously. (IDFGH-13857)
Oct 10, 2024
Answers checklist.
IDF version.
v5.1.2
Espressif SoC revision.
ESP32-S3
Operating System used.
Windows
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
CMD
Development Kit.
Custom board with esp32s3-wroom-1
Power Supply used.
USB
What is the expected behavior?
I expect esp_transport_read_internal() to wait up to timeout_ms milliseconds to read data.
What is the actual behavior?
When reading a websocket header, and the buffer layer has 1B inside it, esp_transport_read_internal() returns 1B, and ws_read_header() does not check for this, so the stream becomes misaligned by 1B. Then WS parsing is corrupt and parser cannot be realigned.
Steps to reproduce.
Debug Logs.
More Information.
No response
The text was updated successfully, but these errors were encountered: