]> git.ipfire.org Git - thirdparty/curl.git/commit
websocket: introduce blocking sends
authorStefan Eissing <stefan@eissing.org>
Thu, 8 Aug 2024 14:00:24 +0000 (16:00 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 12 Aug 2024 17:19:28 +0000 (19:19 +0200)
commit3e64569a9e1d7e8a1dd6d9a1637d1ec3f6c81ad9
tree23a13a95df3e26747951a78eb5c6ef5fdd54629b
parent0a5ea09a910e7883fd7a1c333e8a36fc782fe537
websocket: introduce blocking sends

When using `curl_ws_send()`, perform a blocking send of the data under
the following conditions:

- the websocket is in raw mode and the call is done from within a curl
  callback. A partial write of the data could subsequently mess up the
  ws framing, as a callback has a hard time handling this.

- the websocket is encoding the data itself, has added it to its
  internal sendbuf. A partial flush of the buffer has unclear semantics
  for the caller, as they will have no idea what to send again.

Fixes WebSockets tests with CURL_DBG_SOCK_WBLOCK=90 set.
Closes #14458
docs/TODO
docs/libcurl/curl_global_trace.md
docs/libcurl/curl_ws_send.md
lib/bufq.c
lib/bufq.h
lib/curl_trc.c
lib/curl_trc.h
lib/ws.c