mirror of
https://github.com/curl/curl.git
synced 2026-08-02 21:50:29 +03:00
websocket: improve handling of 0-len frames
Write out 9-length frames to client's WRITEFUNCTION Read 0-length frames from READFUNCTION *if* the function started a new frame via `curl_ws_start_frame()`. Fixes #18286 Closes #18332 Reported-by: Andriy Druk
This commit is contained in:
parent
fd2a204c23
commit
fa3baabbd8
11 changed files with 275 additions and 141 deletions
|
|
@ -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).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue