mirror of
https://github.com/curl/curl.git
synced 2026-08-25 08:13:31 +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
|
|
@ -135,7 +135,7 @@ class TestWebsockets:
|
|||
if not client.exists():
|
||||
pytest.skip(f'example client not built: {client.name}')
|
||||
url = f'ws://localhost:{env.ws_port}/'
|
||||
r = client.run(args=[f'-{model}', '-m', str(0), '-M', str(10), url])
|
||||
r = client.run(args=[f'-{model}', '-m', str(1), '-M', str(10), url])
|
||||
r.check_exit_code(0)
|
||||
|
||||
@pytest.mark.parametrize("model", [
|
||||
|
|
@ -193,3 +193,17 @@ class TestWebsockets:
|
|||
large = 20000
|
||||
r = client.run(args=[f'-{model}', '-c', str(count), '-m', str(large), url])
|
||||
r.check_exit_code(0)
|
||||
|
||||
@pytest.mark.parametrize("model", [
|
||||
pytest.param(1, id='multi_perform'),
|
||||
pytest.param(2, id='curl_ws_send+recv'),
|
||||
])
|
||||
def test_20_09_data_empty(self, env: Env, ws_echo, model):
|
||||
client = LocalClient(env=env, name='cli_ws_data')
|
||||
if not client.exists():
|
||||
pytest.skip(f'example client not built: {client.name}')
|
||||
url = f'ws://localhost:{env.ws_port}/'
|
||||
count = 10
|
||||
large = 0
|
||||
r = client.run(args=[f'-{model}', '-c', str(count), '-m', str(large), url])
|
||||
r.check_exit_code(0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue