mirror of
https://github.com/curl/curl.git
synced 2026-08-26 04:13:31 +03:00
ws: pause/unpause write handling
Websocket frames need to be written individualy, so that applications can access the frame meta data correctly. This worked until the write function triggered a pause. Remaining frames accumulated in the "out" writer's buffer and on unpaused were written in one chunk. ws decode writer will now stop writing frames when the client writer is paused. To handle the writing of buffered raw data after an unpause, client writers have gotten a new "flush" method. Add pytest test_20_12 with a new client to check handling of pauses and websocket frames. Reported-by: Hendrik Hübner Fixes #22273 Closes #22283
This commit is contained in:
parent
e89d5a1202
commit
b940cb1566
16 changed files with 470 additions and 90 deletions
|
|
@ -299,6 +299,7 @@ static const struct Curl_cwtype deflate_encoding = {
|
|||
NULL,
|
||||
deflate_do_init,
|
||||
deflate_do_write,
|
||||
Curl_cwriter_def_flush,
|
||||
deflate_do_close,
|
||||
sizeof(struct zlib_writer)
|
||||
};
|
||||
|
|
@ -360,6 +361,7 @@ static const struct Curl_cwtype gzip_encoding = {
|
|||
"x-gzip",
|
||||
gzip_do_init,
|
||||
gzip_do_write,
|
||||
Curl_cwriter_def_flush,
|
||||
gzip_do_close,
|
||||
sizeof(struct zlib_writer)
|
||||
};
|
||||
|
|
@ -493,6 +495,7 @@ static const struct Curl_cwtype brotli_encoding = {
|
|||
NULL,
|
||||
brotli_do_init,
|
||||
brotli_do_write,
|
||||
Curl_cwriter_def_flush,
|
||||
brotli_do_close,
|
||||
sizeof(struct brotli_writer)
|
||||
};
|
||||
|
|
@ -606,6 +609,7 @@ static const struct Curl_cwtype zstd_encoding = {
|
|||
NULL,
|
||||
zstd_do_init,
|
||||
zstd_do_write,
|
||||
Curl_cwriter_def_flush,
|
||||
zstd_do_close,
|
||||
sizeof(struct zstd_writer)
|
||||
};
|
||||
|
|
@ -617,6 +621,7 @@ static const struct Curl_cwtype identity_encoding = {
|
|||
"none",
|
||||
Curl_cwriter_def_init,
|
||||
Curl_cwriter_def_write,
|
||||
Curl_cwriter_def_flush,
|
||||
Curl_cwriter_def_close,
|
||||
sizeof(struct Curl_cwriter)
|
||||
};
|
||||
|
|
@ -704,6 +709,7 @@ static const struct Curl_cwtype error_writer = {
|
|||
NULL,
|
||||
error_do_init,
|
||||
error_do_write,
|
||||
Curl_cwriter_def_flush,
|
||||
error_do_close,
|
||||
sizeof(struct Curl_cwriter)
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue