curl/docs
Stefan Eissing 02edae54e8 websocket: fix message send corruption
- Fix a bug in EAGAIN handling when sending frames that led to a
  corrupted last byte of the frame sent.

- Restore sanity to curl_ws_send() behaviour:

  - Partial writes are reported as OK with the actual number of
    payload bytes sent.

  - CURLE_AGAIN is only returned when none of the payload bytes
    (or for 0-length frames, not all of the frame header bytes)
    could be sent.

  - curl_ws_send() now behaves like a common send() call.

- Change 'ws-data' test client to allow concurrent send/recv
  operations and vary frame sizes and repeat count.

- Add DEBUG env var CURL_WS_CHUNK_EAGAIN to simulate blocking
  after a chunk of an encoded websocket frame has been sent.

- Add tests.


Prior to this change data corruption may occur when sending websocket
messages due to two bugs:

1) 3e64569a (precedes 8.10.0) caused a data corruption bug in the last
   byte of frame of large messages.

2) curl_ws_send had non-traditional send behavior and could return
   CURLE_AGAIN with bytes sent and expect the caller to adjust buffer
   and buflen in a subsequent call. That behavior was not documented.


Reported-by: na-trium-144@users.noreply.github.com

Fixes https://github.com/curl/curl/issues/15865
Fixes https://github.com/curl/curl/issues/15865#issuecomment-2569870144
Closes https://github.com/curl/curl/pull/15901
2025-01-16 16:19:07 -05:00
..
cmdline-opts cmdline-opts/version.md: describe multissl, mention SSLS-EXPORT 2025-01-14 11:08:24 +01:00
examples tidy-up: drop parenthesis around return expression 2025-01-14 12:11:42 +01:00
internals docs: use lowercase curl and libcurl 2025-01-02 17:15:54 +01:00
libcurl websocket: fix message send corruption 2025-01-16 16:19:07 -05:00
.gitignore docs: add RELEASE-TOOLS.md.dist to .gitignore 2024-07-01 22:49:55 +02:00
ALTSVC.md docs: bring back ALTSVC.md and HSTS.md 2024-12-09 09:32:19 +01:00
BINDINGS.md BINDINGS: add zig binding 2024-08-07 14:51:09 +02:00
BUG-BOUNTY.md BUG-BOUNTY.md: clarify the third party situation 2024-05-14 16:23:42 +02:00
BUGS.md docs: use lowercase curl and libcurl 2025-01-02 17:15:54 +01:00
CIPHERS-TLS12.md docs: update CIPHERS.md 2024-08-12 23:35:56 +02:00
CIPHERS.md schannel: remove TLS 1.3 ciphersuite-list support 2024-11-21 17:09:24 -05:00
CMakeLists.txt cmake: replace CURL_*_DIR with {PROJECT,CMAKE_CURRENT}_*_DIR 2024-10-22 19:13:08 +02:00
CODE_OF_CONDUCT.md reuse: add copyright + license info to individual docs/*.md files 2024-03-31 12:01:18 +02:00
CODE_REVIEW.md docs: misc language polish 2024-07-01 16:45:17 +02:00
CONTRIBUTE.md CONTRIBUTE: polished 2024-08-26 15:04:01 +02:00
curl-config.md docs: use lowercase curl and libcurl 2025-01-02 17:15:54 +01:00
CURL-DISABLE.md cmake: document -D and env build options 2024-10-24 23:06:40 +02:00
CURLDOWN.md curldown: fixups 2024-07-19 17:03:25 +02:00
DEPRECATE.md cmake: deprecate winbuild, add migration guide from legacy build methods 2025-01-10 18:20:52 +01:00
DISTROS.md DISTROS: update Alt Linux links 2024-11-29 00:54:47 -08:00
EARLY-RELEASE.md reuse: add copyright + license info to individual docs/*.md files 2024-03-31 12:01:18 +02:00
ECH.md docs: use lowercase curl and libcurl 2025-01-02 17:15:54 +01:00
EXPERIMENTAL.md docs/EXPERIMENTAL.md: add a mention of HTTPSRR as experimental 2025-01-16 19:41:42 +01:00
FAQ docs: suggest --ssl-reqd instead of --ftp-ssl 2024-12-02 09:07:50 +01:00
FEATURES.md FEATURES.md: fix typo 2024-08-23 08:46:09 +02:00
GOVERNANCE.md reuse: add copyright + license info to individual docs/*.md files 2024-03-31 12:01:18 +02:00
HELP-US.md reuse: add copyright + license info to individual docs/*.md files 2024-03-31 12:01:18 +02:00
HISTORY.md docs: use lowercase curl and libcurl 2025-01-02 17:15:54 +01:00
HSTS.md docs: bring back ALTSVC.md and HSTS.md 2024-12-09 09:32:19 +01:00
HTTP3.md GHA: silence proselint warnings and an error 2024-10-15 16:44:17 +02:00
HTTP-COOKIES.md docs/HTTP-COOKIES.md: link to more information 2025-01-01 22:45:48 +01:00
INFRASTRUCTURE.md INFRASTRUCTURE.md: project infra 2025-01-05 11:25:06 +01:00
INSTALL INSTALL: converted to markdown => INSTALL.md 2016-10-21 15:57:29 +02:00
INSTALL-CMAKE.md pytest: use httpd/apache2 directly, no apachectl 2025-01-14 11:33:49 +01:00
INSTALL.md INSTALL.md: tweak to the MSVC version line [ci skip] 2025-01-15 02:33:54 +01:00
INTERNALS.md tidy-up: OS names 2024-08-04 19:17:45 +02:00
IPFS.md reuse: add copyright + license info to individual docs/*.md files 2024-03-31 12:01:18 +02:00
KNOWN_BUGS mbedtls: fix handling of blocked sends 2024-12-30 10:20:27 +01:00
MAIL-ETIQUETTE.md GHA: silence proselint warnings and an error 2024-10-15 16:44:17 +02:00
Makefile.am INFRASTRUCTURE.md: project infra 2025-01-05 11:25:06 +01:00
MANUAL.md docs: use lowercase curl and libcurl 2025-01-02 17:15:54 +01:00
mk-ca-bundle.md curldown: make 'added-in:' a mandatory header field 2024-07-18 18:04:09 +02:00
options-in-versions vtls: feature ssls-export for SSL session im-/export 2025-01-08 23:32:07 +01:00
README.md reuse: add copyright + license info to individual docs/*.md files 2024-03-31 12:01:18 +02:00
RELEASE-PROCEDURE.md RELEASE-PROCEDURE.md: mention how to publish security advisories 2024-12-11 11:11:32 +01:00
ROADMAP.md CI: add whitespace checker 2024-06-27 13:33:30 +02:00
RUSTLS.md docs: use lowercase curl and libcurl 2025-01-02 17:15:54 +01:00
SECURITY-ADVISORY.md reuse: add copyright + license info to individual docs/*.md files 2024-03-31 12:01:18 +02:00
SPONSORS.md GHA: silence proselint warnings and an error 2024-10-15 16:44:17 +02:00
SSL-PROBLEMS.md GHA: silence proselint warnings and an error 2024-10-15 16:44:17 +02:00
SSLCERTS.md curl: add options for safe/no CA bundle search (Windows) 2024-09-22 18:17:25 +02:00
THANKS THANKS: contributors from 8.11.1 2024-12-11 08:05:13 +01:00
THANKS-filter RELEASE-NOTES: synced 2024-12-03 17:21:42 +01:00
TheArtOfHttpScripting.md docs: use lowercase curl and libcurl 2025-01-02 17:15:54 +01:00
TODO TODO: write an SMB test server to replace impacket 2025-01-16 20:51:00 +01:00
URL-SYNTAX.md GHA: silence proselint warnings and an error 2024-10-15 16:44:17 +02:00
VERSIONS.md docs: use lowercase curl and libcurl 2025-01-02 17:15:54 +01:00
VULN-DISCLOSURE-POLICY.md VULN-DISCLOSURE-POLICY.md: mention the not setting CVSS 2024-12-19 22:59:54 +01:00

curl logo

Documentation

You find a mix of various documentation in this directory and subdirectories, using several different formats. Some of them are not ideal for reading directly in your browser.

If you would rather see the rendered version of the documentation, check out the curl website's documentation section for general curl stuff or the libcurl section for libcurl related documentation.