When curl_ws_start_frame() has been called, do not treat a 0

return value as an EOF. Continue reading frames.

Merge client reader rewind/unpause callbacks into a single "cntrl"
callback and define opcodes to trigger the rewind/unpause/eos clearing.

Add pytest case test_20_09 for transmitting 0-length ws frames.
This commit is contained in:
Stefan Eissing 2025-08-21 11:03:54 +02:00
parent 476076e6c2
commit caa37c390b
No known key found for this signature in database
9 changed files with 188 additions and 107 deletions

View file

@ -46,6 +46,14 @@ the data belonging to the frame.
The function fails, if a previous frame has not been completely
read yet. Also it fails in *CURLWS_RAW_MODE*.
The read function in libcurl usually treats a return value of 0
as the end of file indication and stops any further reads. This
would prevent sending WebSocket frames of length 0.
If the read function calls `curl_ws_start_frame()` however, a return
value of 0 is *not* treated as an end of file and libcurl calls
the read function again.
# FLAGS
Supports all flags documented in curl_ws_meta(3).