websocket: pause writing and meta data fix

When writing a decoded chunk of websocket data, always flush the writer
chain so that buffered data gets delivered before the ws meta data gets
updated.

Add client writer flags CURL_CW_FLAG_BLOWUP for writer types that may
significantly enlarge write sizes. This flag causes the pause writer to
be added and shrinks the write chunk sizes. We do not want that for
content decoders like WS that do not change the size.

Add test_20_13 to check that large frames are paused/unpaused correctly
with the matching meta data.

Fixes #22413
Reported-by: Hendrik Hübner
Closes #22416
This commit is contained in:
Stefan Eissing 2026-07-28 14:27:13 +02:00 committed by Daniel Stenberg
parent 53565fbfd6
commit 3974491c97
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
11 changed files with 64 additions and 23 deletions

View file

@ -465,6 +465,7 @@ static CURLcode cw_chunked_write(struct Curl_easy *data,
const struct Curl_cwtype Curl_httpchunk_unencoder = {
"chunked",
NULL,
0,
cw_chunked_init,
cw_chunked_write,
Curl_cwriter_def_flush,