mirror of
https://github.com/curl/curl.git
synced 2026-08-25 13:23:33 +03:00
ws: fix write callback error handling
When websocket writes out data thought the registered write callback and that returns an error, clear the write buffers, so a sub-sequent flush will not attempt another write. The transfer is failed at that point and should no longer invoke the callback. Fixes #22627 Reported-by: Scott Talbert Closes #22634
This commit is contained in:
parent
5d6dc81678
commit
7e7ee16dd3
4 changed files with 155 additions and 3 deletions
6
lib/ws.c
6
lib/ws.c
|
|
@ -754,7 +754,8 @@ static CURLcode ws_cw_write(struct Curl_easy *data,
|
|||
}
|
||||
else if(result) {
|
||||
failf(data, "[WS] decode payload error %d", (int)result);
|
||||
return result;
|
||||
Curl_bufq_reset(&ctx->buf);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -812,7 +813,8 @@ static CURLcode ws_cw_flush(struct Curl_easy *data,
|
|||
}
|
||||
else if(result) {
|
||||
failf(data, "[WS] decode payload error %d", (int)result);
|
||||
return result;
|
||||
Curl_bufq_reset(&ctx->buf);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue