]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
10 months agodocs/HTTPSRR.md: Typo fix AAA -> AAAA
MacKenzie [Tue, 4 Feb 2025 21:39:22 +0000 (17:39 -0400)] 
docs/HTTPSRR.md: Typo fix AAA -> AAAA

Closes #16173

10 months agopop3: revert connection ssl check
Stefan Eissing [Tue, 4 Feb 2025 20:53:55 +0000 (21:53 +0100)] 
pop3: revert connection ssl check

As reported in #16166, the STLS hangs with the check for SSL connection
filters, but is working with the old protocol handler way. Revert the
change, although it is unclear why it was no good here.

Fixes #16166
Reported-by: ralfjunker on github
Closes #16172

10 months agoHTTPSRR.md: implement what seems to be deployed
Daniel Stenberg [Mon, 3 Feb 2025 21:15:35 +0000 (22:15 +0100)] 
HTTPSRR.md: implement what seems to be deployed

Closes #16158

10 months agobuild: drop macro used to enable `-Wsign-conversion` warnings in CI
Viktor Szakats [Mon, 3 Feb 2025 18:31:10 +0000 (19:31 +0100)] 
build: drop macro used to enable `-Wsign-conversion` warnings in CI

We don't pursue this, and the necessary `#pragma` got in the way of
compiling curl with gcc 4.2 and older. Drop the logic completely.

Follow-up to 8a266ac4883958c339fe16796081a296cd66acb3 #15939

Reported-by: prpr19xx on Github
Fixes #16152
Closes #16157

10 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 3 Feb 2025 21:02:16 +0000 (22:02 +0100)] 
RELEASE-NOTES: synced

10 months agosymbols-in-versions: update version for LIBCURL_VERSION and LIBCURL_VERSION_NUM
Edoardo Lolletti [Fri, 31 Jan 2025 22:18:07 +0000 (23:18 +0100)] 
symbols-in-versions: update version for LIBCURL_VERSION and LIBCURL_VERSION_NUM

Those 2 symbols were available since the first 7.1.1 release

Closes #16141

10 months agox509asn1: add parse recursion limit
Stefan Eissing [Fri, 31 Jan 2025 12:13:34 +0000 (13:13 +0100)] 
x509asn1: add parse recursion limit

For ASN.1 tags with indefinite length, curl's own parser for TLS
backends that do not support certificate inspection calls itself
recursively. A malicious server certificate can then lead to high
recursion level exhausting the stack space.

This PR limits the recursion level to 16 which should be safe on all
architectures.

Added unit test 1657 to verify behaviour.

Fixes #16135
Reported-by: z2_
Closes #16137

10 months agows-docs: extend WebSocket documentation
Calvin Ruocco [Thu, 12 Dec 2024 14:36:08 +0000 (15:36 +0100)] 
ws-docs: extend WebSocket documentation

Closes #16118

10 months agoruntests.pl: fix precedence issue
mauke [Thu, 30 Jan 2025 05:28:50 +0000 (06:28 +0100)] 
runtests.pl: fix precedence issue

The condition `!$cmdtype eq "perl"` (introduced in a4765b0551) is always
false. It checks whether a logical negation (giving true/false) is equal
to the string `"perl"`. This is impossible, so the logging never worked.

The intent was probably to negate the result of the string
comparison:`!($cmdtype eq "perl")` or simply `$cmdtype ne "perl"`.

Fixes #16128
Reported-by: Igor Todorovski
Closes #16129

10 months agotests: stop promoting perl warnings to fatal errors
Dan Fandrich [Mon, 3 Feb 2025 18:19:20 +0000 (10:19 -0800)] 
tests: stop promoting perl warnings to fatal errors

While this is useful on CI to highlight issues in the scripts, it's a
recipe for pain when enabled on users' builds.

Suggested-by: Leon Timmermans
Ref: #16128

10 months agoc-ares: fix/tidy-up macro initializations, avoid a deprecated function
Viktor Szakats [Thu, 30 Jan 2025 11:42:52 +0000 (12:42 +0100)] 
c-ares: fix/tidy-up macro initializations, avoid a deprecated function

- replace deprecated `ares_init()` call with `ares_init_options()`.
  Follow-up to 0d4fdbf15d8eec908b3e63b606f112b18a63015e #16054

- dedupe `CARES_STATICLIB` initalizations into `curl_setup.h`, to
  ensure it's defined before the first (and every) `ares.h` include and
  avoid a potential confusion.

- move `CARES_NO_DEPRECATED` from build level to `curl_setup.h`.
  To work regardless of build system.
  It is necessary because curl calls `ares_getsock()` from two places,
  of which one feeds a chain of wrappers: `Curl_ares_getsock()`,
  `Curl_resolver_getsock()`, `Curl_resolv_getsock()`.

Closes #16131

10 months agoINSTALL-CMAKE.md: fix punctuation
Viktor Szakats [Thu, 30 Jan 2025 14:24:57 +0000 (15:24 +0100)] 
INSTALL-CMAKE.md: fix punctuation

10 months agoGHA: tidy up `apt` commands
Viktor Szakats [Wed, 29 Jan 2025 18:46:25 +0000 (19:46 +0100)] 
GHA: tidy up `apt` commands

- drop `--quiet 2` option where used, to have uniform output.
- replace `apt` with `apt-get` in one job. sync options with rest.
- replace deprecated `apt-key` command with the alternative recommended
  by `apt-key(8)`.
- drop stray `cd /tmp`, no longer needed after migrating to GHA.
- shorten `--option Dpkg::Use-Pty=0` to `-o Dpkg::Use-Pty=0`.
- add `-o Dpkg::Use-Pty=0` to hide `apt-get` progress bars taking
  vertical log space, where missing.
- drop `-y --no-install-suggests --no-install-recommends` `apt-get`
  options. They are the default in the ubuntu-24.04 image.
- GHA/distcheck: move `name:` to top in steps where not there.
- scripts/cijobs.pl: catch `apt-get` lines with the `-o` option.

Closes #16127

10 months agombedtls: PSA can be used independently of TLS 1.3 (avoid runtime errors)
Michael Schuster [Sat, 18 Jan 2025 04:38:41 +0000 (05:38 +0100)] 
mbedtls: PSA can be used independently of TLS 1.3 (avoid runtime errors)

Closes #16044

10 months agotest1960: don't close the socket too early 16123/head
Dan Fandrich [Fri, 24 Jan 2025 01:48:21 +0000 (17:48 -0800)] 
test1960: don't close the socket too early

The socket was closed while the handle was still in use, so
curl_easy_cleanup ended up setting nonblocking mode on a closed handle.

Closes #16123

10 months agocmake: warn for OpenSSL versions missing TLS 1.3 support
Viktor Szakats [Tue, 28 Jan 2025 15:51:18 +0000 (16:51 +0100)] 
cmake: warn for OpenSSL versions missing TLS 1.3 support

To match existing warnings for Secure Transport and BearSSL.

OpenSSL 1.1.1 or upper are offering TLS 1.3 support.

Ref: https://wiki.openssl.org/index.php/TLS1.3

Closes #16120

10 months agocd2nroff: do not insist on quoted <> within backticks
Daniel Stenberg [Tue, 28 Jan 2025 15:51:33 +0000 (16:51 +0100)] 
cd2nroff: do not insist on quoted <> within backticks

Ref: #16118
Closes #16121

10 months agogitignore: add `lib/Makefile.soname.cmake`
Viktor Szakats [Tue, 28 Jan 2025 15:04:29 +0000 (16:04 +0100)] 
gitignore: add `lib/Makefile.soname.cmake`

10 months agohttps-connect: start next immediately on failure
Stefan Eissing [Tue, 28 Jan 2025 12:38:43 +0000 (13:38 +0100)] 
https-connect: start next immediately on failure

When parallel connects are attempted, the second one is started on a
delay. Start it right away when the first one failed.

Closes #16114

10 months agogitignore: restore explicit lists and fix them
Viktor Szakats [Tue, 28 Jan 2025 13:15:46 +0000 (14:15 +0100)] 
gitignore: restore explicit lists and fix them

Range matches are not supported with `+`: https://git-scm.com/docs/gitignore

Also sync `.gitignore` file lists with source files and alphasort them.

Follow-up to 5c31c2e6709979db4c949b7cd6a3cf88dec4e1aa #16093
Reported-by: Stefan Eissing
Fixes #16112
Fixes #16115
Closes #16116

10 months agongtcp2: fix memory leak on connect failure
Stefan Eissing [Tue, 28 Jan 2025 12:23:31 +0000 (13:23 +0100)] 
ngtcp2: fix memory leak on connect failure

When a QUIC connection using ngtcp2 failed immediately, the TLS
instances were not always released.

Closes #16113

10 months agodocs/cmdline-opts/location.md: fix typos for location flag
Martin Harrigan [Tue, 28 Jan 2025 10:28:25 +0000 (10:28 +0000)] 
docs/cmdline-opts/location.md: fix typos for location flag

Closes #16110

10 months agoINTERNALS.md: sync wolfSSL version requirement with source code
Viktor Szakats [Mon, 27 Jan 2025 20:36:46 +0000 (21:36 +0100)] 
INTERNALS.md: sync wolfSSL version requirement with source code

`lib/vtls/wolfssl.c` enforces it via a hard #error.

Cherry-picked from #16104

10 months agoopenssl: define `HAVE_KEYLOG_CALLBACK` before use
Viktor Szakats [Mon, 27 Jan 2025 22:04:02 +0000 (23:04 +0100)] 
openssl: define `HAVE_KEYLOG_CALLBACK` before use

Before this patch this macro was used in `vtls/openssl.h` without
setting it first, causing the `keylog_done` member be present in
struct `ossl_ctx` while the code did not use it.

Follow-up to 3210101088dfa3d6a125d213226b092f2f866722 #13172
Closes #16105

10 months agoopenssl: drop unused `HAVE_SSL_GET_SHUTDOWN` macro
Viktor Szakats [Mon, 27 Jan 2025 20:07:55 +0000 (21:07 +0100)] 
openssl: drop unused `HAVE_SSL_GET_SHUTDOWN` macro

Follow-up to c31041b17e5ee60e7ecc2309daa8ababf7c7ad2d #13904
Closes #16103

10 months agotool_getparam: fail --hostpubsha256 if libssh2 is not used
Daniel Stenberg [Tue, 28 Jan 2025 08:20:35 +0000 (09:20 +0100)] 
tool_getparam: fail --hostpubsha256 if libssh2 is not used

Reported-by: Harry Sintonen
Closes #16109

10 months agows: Reject frames with unknown reserved bits set
Andrew Kaster [Tue, 21 Jan 2025 16:57:46 +0000 (09:57 -0700)] 
ws: Reject frames with unknown reserved bits set

RFC 6455 Section 5.2 notes that for bits RSV1, RSV2, and RSV3 of the
framing header, a non-zero value that is not defined by a negotiated
extension MUST Fail the WebSocket connection.

Test 2310 verifies

Closes #16069

10 months agovtls: fix default SSL backend as a fallback
Jay Satiro [Tue, 28 Jan 2025 04:48:18 +0000 (23:48 -0500)] 
vtls: fix default SSL backend as a fallback

- Use build-time CURL_DEFAULT_SSL_BACKEND as a fallback when environment
  variable CURL_SSL_BACKEND contains a backend that is unavailable.

Prior to this change if CURL_SSL_BACKEND was set then
CURL_DEFAULT_SSL_BACKEND was ignored even if the backend of the former
was unavailable. In that case libcurl would instead select the first
available backend in the list of backends.

Bug: https://github.com/curl/curl/issues/16076#issuecomment-2617354254
Reported-by: Jeroen Ooms
Closes https://github.com/curl/curl/pull/16108

10 months agoeasy: allow connect-only handle reuse with easy_perform
Jay Satiro [Wed, 15 Jan 2025 08:56:11 +0000 (03:56 -0500)] 
easy: allow connect-only handle reuse with easy_perform

- Detach and disconnect an attached connection before performing.

Prior to this change it was not possible to safely reuse an easy handle
with an attached connection in a second call to curl_easy_perform. The
only known case of this is a connect-only type handle where the
connection was detached when curl_easy_perform returned, only to be
reattached by either curl_easy_send/recv.

This commit effectively reverts 2f8ecd5d and be82a360, the latter of
which treated the reuse as an error. Prior to that change undefined
behavior may occur in such a case.

Bug: https://curl.se/mail/lib-2025-01/0044.html
Reported-by: Aleksander Mazur
Closes https://github.com/curl/curl/pull/16008

10 months agoasyn-ares: fix memory leak
Dexter Gerig [Tue, 28 Jan 2025 04:45:46 +0000 (22:45 -0600)] 
asyn-ares: fix memory leak

Closes #16107

10 months agoasyn-thread: fix HTTPS RR resolution
Dexter Gerig [Tue, 28 Jan 2025 04:45:38 +0000 (22:45 -0600)] 
asyn-thread: fix HTTPS RR resolution

Store the received data correctly.

Closes #16107

10 months agogitignore: add generated unity sources for lib and src
Viktor Szakats [Mon, 27 Jan 2025 21:55:39 +0000 (22:55 +0100)] 
gitignore: add generated unity sources for lib and src

Follow-up to 71cf0d1fca9e1f53524e1545ef0c08d174458d80 #14772

10 months agochecksrc: exclude generated bundle files to avoid race condition
Viktor Szakats [Mon, 27 Jan 2025 18:32:45 +0000 (19:32 +0100)] 
checksrc: exclude generated bundle files to avoid race condition

Necessary to catch rare cases when `checksrc` hits these files when they
are not populated yet:
```
./curltool_unity.c:1:1: error: Missing copyright statement (COPYRIGHT)
 ^
```
https://github.com/curl/curl/actions/runs/12995546740/job/36242556713?pr=16094#step:37:123

Follow-up to 71cf0d1fca9e1f53524e1545ef0c08d174458d80 #14772
Closes #16102

10 months agomsvc: add missing push/pop for warning pragmas
Viktor Szakats [Mon, 27 Jan 2025 14:43:32 +0000 (15:43 +0100)] 
msvc: add missing push/pop for warning pragmas

Also fix indentation/formatting around similar pragmas.

Closes #16101

10 months agoMakefile.dist: delete
Viktor Szakats [Sun, 26 Jan 2025 15:13:16 +0000 (16:13 +0100)] 
Makefile.dist: delete

It had shorthand aliases to launch `./configure` and
`./configure --with-openssl`. The former hasn't worked for a long while
because of missing TLS.

Its `ca-bundle` and `ca-firefox` targets have been broken for 2.5 years
till recently. These targets also exist in `./configure` and have been
working all along.

Also:
- cmake: add support `curl-ca-bundle` and `curl-ca-firefox` targets.
- tests/testcurl.pl: drop obsolete build logic.

Closes #16094

10 months agotidy-up: `.gitignore` lines mostly
Viktor Szakats [Sun, 26 Jan 2025 14:28:56 +0000 (15:28 +0100)] 
tidy-up: `.gitignore` lines mostly

- `.gitignore`: delete, dedupe and move rules upwards.
  Ref: 6389ba87b8e5cf74b70c54beab3498dfc773364e #13311
- `.gitignore`: fix generated test sources.
  Follow-up to 71cf0d1fca9e1f53524e1545ef0c08d174458d80 #14772
- `.gitignore`: replace exe listings with a wildcard.
- lib: move `setup-*.h` from `EXTRA_DIST` to `CURL_HFILES`.
- `makedebug.bat`: uppercase an argument to match docs.
- GHA/non-native: delete stray env.
  Follow-up to 12a6de2f660dd692cce93cb65ce6e3ec126bb531 #16043
- sort source lists.

Closes #16093

10 months agoVULN-DISCLOSURE-POLICY: on legacy dependencies
Daniel Stenberg [Sat, 25 Jan 2025 11:04:04 +0000 (12:04 +0100)] 
VULN-DISCLOSURE-POLICY: on legacy dependencies

Problems that only trigger using *legacy* dependencies are not
considered security problems.

Closes #16086

10 months agourldata: tweak the UserDefined struct
Daniel Stenberg [Mon, 27 Jan 2025 08:34:57 +0000 (09:34 +0100)] 
urldata: tweak the UserDefined struct

By better sticking to listing the struct members sorted by size, this
struct is now 48 bytes smaller on my fairly maximized build, without
removing anything.

Turned 'connect_only' into two bits instead of an unsigned char with two
magic values.

Also put the 'gssapi_delegation' field within ifdef HAVE_GSSAPI.

Closes #16097

10 months agohttp2: fix data_pending check
Stefan Eissing [Mon, 27 Jan 2025 10:36:22 +0000 (11:36 +0100)] 
http2: fix data_pending check

The h2 filter mistakenly also checked `sendbuf` when asked
about pending data. The call is only meant to account for
buffered data that still needs to be received.

Also, remove obsolete recvbuf in stream as we write received
headers and data directly.

Fixes #16084
Closes #16098
Reported-by: Deniz Sökmen
10 months agoINSTALL.md: add CMake examples for macOS and iOS
Viktor Szakats [Sun, 26 Jan 2025 23:44:49 +0000 (00:44 +0100)] 
INSTALL.md: add CMake examples for macOS and iOS

Closes #16095

10 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 27 Jan 2025 07:18:45 +0000 (08:18 +0100)] 
RELEASE-NOTES: synced

10 months agoversion: fix the IDN feature for winidn and appleidn
Daniel Stenberg [Sun, 26 Jan 2025 13:14:44 +0000 (14:14 +0100)] 
version: fix the IDN feature for winidn and appleidn

Closes #16091

10 months agoversion: rename c-ares-rr to asyn-rr
Daniel Stenberg [Sun, 26 Jan 2025 11:23:33 +0000 (12:23 +0100)] 
version: rename c-ares-rr to asyn-rr

Works better if we later introduce another way to do the asynch RR
resolves (together with the threaded resolver) that does not use c-ares.

Closes #16090

10 months agoGHA: fixup CM/AM order within Apple steps, move `name:` first, quote them
Viktor Szakats [Sun, 26 Jan 2025 13:33:10 +0000 (14:33 +0100)] 
GHA: fixup CM/AM order within Apple steps, move `name:` first, quote them

Closes #16092

10 months agoprojects: fix `INSTALL-CMAKE.md` references
Viktor Szakats [Sun, 26 Jan 2025 14:08:58 +0000 (15:08 +0100)] 
projects: fix `INSTALL-CMAKE.md` references

Follow-up to 0f4c19b66ad5c646ebc3c4268a0f3ad9c15bf57c #12772

10 months agowindows: drop two missed `buildconf.bat` references
Viktor Szakats [Sun, 26 Jan 2025 14:04:51 +0000 (15:04 +0100)] 
windows: drop two missed `buildconf.bat` references

Follow-up to 0035ff45c59437db1a8ffe960b40905c8582b149 #16081

10 months agobuild: drop `tool_hugehelp.c.cvs`, tidy up macros, drop `buildconf.bat`
Viktor Szakats [Fri, 24 Jan 2025 13:22:23 +0000 (14:22 +0100)] 
build: drop `tool_hugehelp.c.cvs`, tidy up macros, drop `buildconf.bat`

Rework the way `tool_hugehelp.c` is included in builds.

After this patch, with `./configure` and CMake `tool_hugehelp.c` is only
compiled when building with manuals enabled. With manuals disabled this
source file is not used anymore. The method is similar to how
8a3740bc8e558b9a9d4a652b74cf27a0961d7010 implemented `tool_ca_embed.c`.
`./configure` always generates it as before, otherwise the build fails.

- winbuild: rework to not need `buildconf.bat`, but automatically use
  `tool_hugehelp.c` if present (e.g. when building from an official
  source tarball) and enable `USE_MANUAL` accordingly.

- `buildconf.bat`: after dropping `tool_hugehelp.c` generation, the only
  logic left was `cp Makefile.dist Makefile`. This allowed to launch
  winbuild builds via GNU Make in a Git repo. Drop this option together
  with the batch file.

- build `libcurltool` without `USE_MANUAL` macro to exclude the manual
  and the dependence on the generator commands. Drop relying on
  `UNITTESTS` for this purpose.
  Follow-up to 96843f4ef74e02452972fd97fe15d8ff656f46ec #16068

- `src/mkhelp.pl`: include `tool_hugehelp.h` before using `USE_MANUAL`
  to have it set in `config-*.h` builds with source tarballs created
  with manual but without zlib.

Closes #16081

10 months agotests: change the behavior of swsbounce
Jay Satiro [Sat, 25 Jan 2025 08:17:10 +0000 (03:17 -0500)] 
tests: change the behavior of swsbounce

- Change the swsbounce keyword to override the part number on a
  subsequent request to the previous part number + 1.

Note the previous part number in this case is the part number that
was returned as a response to the previous request and contained
the swsbounce keyword.

Prior to this change swsbounce incremented the part number of the
subsequent request instead of overriding it, and did so in a more
limited fashion that prevented chaining swsbounce in multiple responses.

For example, if the test makes a request that causes the sws server to
return `<data>` as a response and that response contains `swsbounce`
then for the next response the sws server returns `<data1>`. If
`<data1>` also contains `swsbounce` then for the next response the sws
server now returns `<data2>` instead of the requested part.

Fixes https://github.com/curl/curl/discussions/16074
Closes https://github.com/curl/curl/pull/16085

10 months agodocs/HTTPSRR.md: fix typo in option name
Viktor Szakats [Sun, 26 Jan 2025 01:22:31 +0000 (02:22 +0100)] 
docs/HTTPSRR.md: fix typo in option name

Follow-up to 7f4f192f04ce5509046af76e34ba14e34a87a8dc #16052

10 months agocmake/Find: add `iphlpapi` for c-ares, omit syslibs if dep not found
Viktor Szakats [Sun, 26 Jan 2025 00:17:42 +0000 (01:17 +0100)] 
cmake/Find: add `iphlpapi` for c-ares, omit syslibs if dep not found

- add `iphlpapi` library for c-ares.
  Ref: https://github.com/curl/curl-for-win/commit/082d98ba6b3bdaca07c340796371da100515a335

- fix to not add system libs if the dependency was not found.
  librtmp, Rustls, wolfSSL
  Follow-up to 421e592db25cbbe4baadfeef8e6ed75a57579d0a #15832
  Follow-up to 7bab201abe3915a0167c002f9308950cb8a06e4b #15193

Closes #16089

10 months agodocs/HTTPSRR.md: initial HTTPS RR documentation 16052/head
Daniel Stenberg [Sun, 19 Jan 2025 11:51:37 +0000 (12:51 +0100)] 
docs/HTTPSRR.md: initial HTTPS RR documentation

Closes #16052

10 months agoasyn-thread: use c-ares to resolve HTTPS RR
Daniel Stenberg [Tue, 21 Jan 2025 10:42:20 +0000 (11:42 +0100)] 
asyn-thread: use c-ares to resolve HTTPS RR

Allow building with c-ares and yet use threaded resolver for the main
host A/AAAA resolving:

  `--with-ares` provides the c-ares install path and defaults to use
  c-ares for name resolving

  `--with-threaded-resolver` still uses c-ares in the build (for HTTPS)
  but uses the threaded resolver for "normal" resolves.

It works similarly for cmake: ENABLE_ARES enables ares, and if
ENABLE_THREADED_RESOLVER also is set, c-ares is used for HTTPS RR and
the threaded resolver for "normal" resolves.

HTTPSRR and c-ares-rr are new features return by curl_version_info() and
thus shown by curl -V.

The c-ares-rr feature bit is there to make it possible to distinguish
between builds using c-ares for all name resolves and builds that use
the threaded resolves for the regular name resolves and c-ares for
HTTPSRR only. "c-ares-rr" means it does not use c-ares for "plain" name
resolves.

HTTPSRR support is EXPERIMENTAL only.

Closes #16054

10 months agoGHA/non-native: bump to NetBSD 10.1
Viktor Szakats [Sat, 25 Jan 2025 21:52:23 +0000 (22:52 +0100)] 
GHA/non-native: bump to NetBSD 10.1

Closes #16088

10 months agoGHA/non-native: update cross-platform-actions/action action to v0.27.0
renovate[bot] [Wed, 22 Jan 2025 10:22:36 +0000 (10:22 +0000)] 
GHA/non-native: update cross-platform-actions/action action to v0.27.0

Closes #16071

10 months agocmake: drop `CURL_USE_PKGCONFIG` from `curl-config.cmake.in`
Viktor Szakats [Sat, 25 Jan 2025 13:54:47 +0000 (14:54 +0100)] 
cmake: drop `CURL_USE_PKGCONFIG` from `curl-config.cmake.in`

This variable was meant to be used by curl Find modules, but it turns
out it makes no sense to use those from `curl-config.cmake.in`. It means
this variable was not used before and will not be used in the future,
and therefore safe to delete.

Also add missing macros passed to `curl-config.cmake` to comment.

Ref: https://github.com/curl/curl/pull/14930#discussion_r1929537797

Closes #16087

10 months agoci: update dependency cloudflare/quiche to v0.23.2
renovate[bot] [Fri, 24 Jan 2025 23:45:00 +0000 (23:45 +0000)] 
ci: update dependency cloudflare/quiche to v0.23.2

Closes #16082

10 months agoGHA/curl-for-win: fix `DOCKER_CONTENT_TRUST` for a job [ci skip]
Viktor Szakats [Fri, 24 Jan 2025 23:41:11 +0000 (00:41 +0100)] 
GHA/curl-for-win: fix `DOCKER_CONTENT_TRUST` for a job [ci skip]

Follow-up to 28230bec1ff32798a1daa1ad37ee0a43734b1d40 #15141

10 months agocontent_encoding: put the decomp buffers into the writer structs 16079/head
Daniel Stenberg [Fri, 24 Jan 2025 12:19:30 +0000 (13:19 +0100)] 
content_encoding: put the decomp buffers into the writer structs

- no more malloc/free per chunk
- removes the extra malloc entirely
- make the buffer (much) smaller (10MB => 16KB!)
- rename 'decomp' to 'buffer' to clarify purpose

Closes #16079

10 months agocontent_encoding: drop support for zlib before 1.2.0.4
Daniel Stenberg [Fri, 24 Jan 2025 10:13:24 +0000 (11:13 +0100)] 
content_encoding: drop support for zlib before 1.2.0.4

zlib 1.2.0.4 was released on 10 August 2003

Closes #16079

10 months agolib: redirect handling by protocol handler
Stefan Eissing [Thu, 23 Jan 2025 10:48:06 +0000 (11:48 +0100)] 
lib: redirect handling by protocol handler

Adds a `follow()` callback to protocol handlers, so they may decide how
to act on a `newurl` after a request has been done. This is optional.

This moves the HTTP code for handling redirects from multi.c to http.c
where it should be. If we ever add a protocol with its own logic, it
would install its own follow function.

Closes #16075

10 months agolib: clarify 'conn->httpversion'
Stefan Eissing [Wed, 22 Jan 2025 13:45:30 +0000 (14:45 +0100)] 
lib: clarify 'conn->httpversion'

The variable `conn->httpversion` was used for several purposes and it
was unclear at which time the value represents what.

- rename `conn->httpversion` to `conn->httpversion_seen`
  This makes clear that the variable only records the last
  HTTP version seen on the connection - if any. And that it
  no longer is an indication of what version to use.
- Change Alt-Svc handling to no longer modify `conn->httpversion`
  but set `data->state.httpwant` for influencing the HTTP version
  to use on a transfer.
- Add `data->req.httpversion_sent` to have a record of what
  HTTP version was sent in a request
- Add connection filter type CF_TYPE_HTTP
- Add filter query `CF_QUERY_HTTP_VERSION` to ask what HTTP
  filter version is in place
- Lookup filters HTTP version instead of using `conn->httpversion`

Test test_12_05 now switches to HTTP/1.1 correctly and the
expectations have been fixed.

Removed the connection fitler "is_httpN()" checks and using
the version query instead.

Closes #16073

10 months agobuild: fix compiling with GCC 4.x versions
Viktor Szakats [Sat, 11 Jan 2025 23:11:59 +0000 (00:11 +0100)] 
build: fix compiling with GCC 4.x versions

- silence false positive picky warnings.
- avoid "possible noreturn" warnings for standalone tests and examples.
- fix to compile without `#pragma GCC diagnostic push` support.
- fix "#pragma GCC diagnostic not allowed inside functions".

Prerequisite for #15975 that needs GCC 4.4 for the latest pre-built
CeGCC/mingw32ce toolchain for Windows CE.

Cherry-picked from #15975
Closes #16062

10 months agosrc: omit hugehelp and ca-embed from libcurltool
Viktor Szakats [Tue, 21 Jan 2025 16:11:45 +0000 (17:11 +0100)] 
src: omit hugehelp and ca-embed from libcurltool

CMake builds using the Xcode generator broke with an error saying it
doesn't support multiple targets depending on the same custom commands.
These custom commands are generating `tool_hugehelp.c` and
`tool_c_embed.c` for the curl tool and libcurltool.

`unit1394` and `unit1604` tests use libcurltool to test tool-specific
functions. They don't need hugehelp and ca-embed. It's thus safe to
disable and exclude them when compiling the sources for libcurltool.
Use the `UNITTESTS` macro to detect a libcurltool build within C.

After this patch these sources are solely used for building the curl
tool. Making the build compatible with the CMake Xcode generator.

Apply the change to autotools too to keep build systems synchronized.

Follow-up to 12a6de2f660dd692cce93cb65ce6e3ec126bb531 #16043
Closes #16068

10 months agocmake: prefer dash-style MSVC options
Viktor Szakats [Tue, 21 Jan 2025 10:30:52 +0000 (11:30 +0100)] 
cmake: prefer dash-style MSVC options

They play better with Unixy shells. The compiler has been supporting
dash options since its early versions.

Also fix to detect warnings options passed in dash-style.

Closes #16063

10 months agocfilters: kill connection filter events attach+detach
Stefan Eissing [Tue, 21 Jan 2025 13:47:29 +0000 (14:47 +0100)] 
cfilters: kill connection filter events attach+detach

Make transfer attach/detach to/from connections chepaer.

- the "attach" event was no longer implemented by any filter
- the "detach" did the same as the "done" event for the filters
  who still implemented it. It should be superfluous as the "done"
  must always happen.

Closes #16067

10 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 22 Jan 2025 07:08:47 +0000 (08:08 +0100)] 
RELEASE-NOTES: synced

10 months agocurl_multi_fdset: include the shutdown connections in the set
Daniel Stenberg [Sun, 19 Jan 2025 10:16:56 +0000 (11:16 +0100)] 
curl_multi_fdset: include the shutdown connections in the set

They were previously missing.

Follow-up from c9b95c0bb30f88bf00e1ac7e706c

Fixes #15156
Reported-by: Christopher Dannemiller
Closes #16049

10 months agocontent_encoding: support use of custom libzstd memory functions
Neil Johari [Fri, 17 Jan 2025 01:14:49 +0000 (17:14 -0800)] 
content_encoding: support use of custom libzstd memory functions

If ZSTD_STATIC_LINKING_ONLY is defined.

This functionality was introduced in zstd v0.8.1 in 2016 here:
facebook/zstd@be6180c

Closes #16028

10 months agoappveyor: bump to OpenSSL 3.4
Viktor Szakats [Tue, 21 Jan 2025 11:20:10 +0000 (12:20 +0100)] 
appveyor: bump to OpenSSL 3.4

Closes #16064

10 months agodocs/TLS-SESSIONS: fix typo, the->they
Yedaya Katsman [Mon, 20 Jan 2025 19:58:35 +0000 (21:58 +0200)] 
docs/TLS-SESSIONS: fix typo, the->they

Closes #16057

10 months agoeasy_lock: use Sleep(1) for thread yield on old Windows
Jay Satiro [Sun, 19 Jan 2025 06:18:23 +0000 (01:18 -0500)] 
easy_lock: use Sleep(1) for thread yield on old Windows

- Prefer Sleep(1) over sched_yield() for pre-Vista thread yield.

On Windows sched_yield is often implemented as Sleep(0) which only
yields to threads of highest priority to current priority. However,
during libcurl initialization if there is thread contention then it's
possible that there is a wait for a different library or OS thread of
a lesser priority and then the yield is not effective during that time.
On the other hand Sleep(1) will wait the minimum time slice which is
usually like 15ms or more.

Prior to this change 2c4bfef removed sched_yield detection on Windows,
which effectively removed the yield in the spin lock, and therefore this
change restores the yield but in a different way.

For Windows Vista and later we use SRW locks and do not have this issue.

Ref: https://github.com/curl/curl/pull/16037#issuecomment-2600161764
Ref: https://devblogs.microsoft.com/oldnewthing/20051004-09/?p=33923

Closes https://github.com/curl/curl/pull/16048

10 months agoGHA/non-native: fix TLS backend in Android job names
Viktor Szakats [Tue, 21 Jan 2025 00:05:56 +0000 (01:05 +0100)] 
GHA/non-native: fix TLS backend in Android job names

Also drop whitespaces/alignment.

Reported-by: Tal Regev
Follow-up to 12a6de2f660dd692cce93cb65ce6e3ec126bb531 #16043

10 months agoGHA: add iOS jobs with LibreSSL, enable dependencies for Android via vcpkg
Viktor Szakats [Sat, 18 Jan 2025 01:11:37 +0000 (02:11 +0100)] 
GHA: add iOS jobs with LibreSSL, enable dependencies for Android via vcpkg

iOS:

- add jobs with autotools, CMake, CMake Xcode generator.
  The Xcode generator is >10x slower than Unix Makefiles. Keep it
  because it's the one recommended by CMake and for having its own
  quirks we may want to know about.
- build, cache and use LibreSSL for these jobs.
  With workaround for an iOS build issue fixed in master.
- make Xcode generator work by explicitly disabling code signing.
- make tests and examples build with the Xcode generator by setting
  `-DMACOSX_BUNDLE_GUI_IDENTIFIER=se.curl`, to avoid
  "Bundle identifier is missing" errors.
- cmake: disable `CURL_USE_PKGCONFIG` by default for Apple device.
- cmake: add `stdc++` library for BoringSSL and AWS-LC, with
  `OPENSSL_USE_STATIC_LIBS=ON` set.
- cmake: add workaround for Xcode generator issue, where it cannot
  handle two targets depending on one custom command. A better fix may
  be dropping `tool_hugehelp.c` and `tool_ca_embed.c` from curltool
  library. For a future PR.

Android:

- add vcpkg to Android jobs, enable dependencies.
Assisted-by: Tal Regev via #16045
- make vcpkg work with autotools.
- pass `--with-brotli` to autotools to detect the vcpkg-supplied brotli.
- enable BoringSSL for Android and add a job with it.
- silence 457 CMake configure warnings about the Android NDK CMake
  scripts targeting freshly deprecated CMake versions.

These were much more involved than imagined. Basically nothing works out
of the box, and when combined, everything becomes a unique edge case.
autotools builds were a much easier to make work than CMake ones.

Also:

- GHA/non-native: re-sync names to be shorter and more aligned with
  other workflows.
- GHA: add `persist-credentials: false` where missing.

Unresolved issues:

- `OPENSSL_ROOT_DIR` ignored/mis-used when pointing it to LibreSSL.
  CMake seems to prepend the sysroot to the passed absolute directory.
  Found no workaround.
- CMake when combined with Android, both the Google-recommended method
  and the built-in CMake method fail to provide a way to avoid
  `pkg-config` packages at system directories. Failed to find a knob
  that can remove `/usr/include` from the search path. The workaround is
  to disable zstd. (I enabled it by default in this release, maybe
  premature?: f2adb3b6d73cad0c28ec8a32f5fa969d0f6378a0 #15431)
  Disabling `pkg-config` doesn't work because vcpkg dependencies do not
  link without it.
- CMake's Xcode generator is slow because each `try_compile()` feature
  check springs a new CMake + Xcode project taking a long time to run,
  just to compile single-liner C files. A known issue, with no solution.
  `-DCMAKE_MACOSX_BUNDLE=OFF` did not help, limiting build types to
  a single one (e.g. `Debug`) also had no effect.
   make | Xcode | GHA run
  :---- | :---- | :--------------------------------------------------------------------
    16s | 2m57s | https://github.com/curl/curl/actions/runs/12866334102/job/35868712426
    23s | 4m13s | https://github.com/curl/curl/actions/runs/12868128013/job/35874212461
    16s | 3m39s | https://github.com/curl/curl/actions/runs/12859073531/job/35849041880
    14s | 2m23s | https://github.com/curl/curl/actions/runs/12858298423/job/35847201313
    15s | 2m36s | https://github.com/curl/curl/actions/runs/12858058492/job/35846669761
    19s | 3m19s | https://github.com/curl/curl/actions/runs/12868919430/job/35876601168

Closes #16043

10 months agowindows: merge `config-win32ce.h` into `config-win32.h`
Viktor Szakats [Fri, 17 Jan 2025 20:33:12 +0000 (21:33 +0100)] 
windows: merge `config-win32ce.h` into `config-win32.h`

They were more or less the same, but each missed some things the other
had. Windows CE is a subset of Win32, make the headers reflect that and
avoid duplications.

Ref: #15975
Closes #16038

10 months agoGHA: replace hard-coded home dir in cache `path:` with `~`
Viktor Szakats [Mon, 20 Jan 2025 14:17:02 +0000 (15:17 +0100)] 
GHA: replace hard-coded home dir in cache `path:` with `~`

Closes #16056

10 months agodocs: document the behavior of -- in the curl command line
9cel [Mon, 20 Jan 2025 10:35:42 +0000 (06:35 -0400)] 
docs: document the behavior of -- in the curl command line

Closes #16053

10 months agolibcurl/opts: do not save files in dirs where attackers have access
Daniel Stenberg [Sun, 19 Jan 2025 11:35:39 +0000 (12:35 +0100)] 
libcurl/opts: do not save files in dirs where attackers have access

libcurl cannot fully protect against attacks where an attacker has write
access to the same directory where it is directed to save files. This is
particularly sensitive if you save files using elevated privileges.

Previously only mentioned in VULN-DISCLOSURE-POLICY.md.

Highlighted-by: Donguk Kim
Closes #16051

10 months agoGHA: tidy up quotes, checkout order, silence Android/CMake warnings
Viktor Szakats [Sat, 18 Jan 2025 01:30:08 +0000 (02:30 +0100)] 
GHA: tidy up quotes, checkout order, silence Android/CMake warnings

- move checkout step right before use.
- quotes in yaml and bash.
- unfold single-line run commands.
- set `CMAKE_WARN_DEPRECATED=OFF` for CMake with Android NDK to avoid
  a wall of useless deprecation warnings hiding useful output.
  These warnings happen in 3rd-party scripts, and unfixable in curl.

Closes #16042

10 months agocmake: drop `fseeko()` pre-fill and check for Windows
Viktor Szakats [Fri, 17 Jan 2025 23:07:16 +0000 (00:07 +0100)] 
cmake: drop `fseeko()` pre-fill and check for Windows

To sync detection code with autotools.

Closes #16041

10 months agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 19 Jan 2025 10:55:02 +0000 (11:55 +0100)] 
RELEASE-NOTES: synced

10 months agocurl_multi_waitfds.md: tidy up the example
Daniel Stenberg [Sun, 19 Jan 2025 10:27:53 +0000 (11:27 +0100)] 
curl_multi_waitfds.md: tidy up the example

- remove typecast
- shorten comment

Closes #16050

10 months agoasyn-ares: initial HTTPS resolve support
Daniel Stenberg [Sat, 18 Jan 2025 21:47:54 +0000 (22:47 +0100)] 
asyn-ares: initial HTTPS resolve support

Gets the ALPN list the same way DoH does. Needs c-ares 1.28.0 or later.

Thanks-to: Brad House
Closes #16039

10 months agombedtls: prefix our feature defines with HAS_
Daniel Stenberg [Sat, 18 Jan 2025 22:01:15 +0000 (23:01 +0100)] 
mbedtls: prefix our feature defines with HAS_

Consistent naming helps.

Closes #16046

10 months agochecksrc.bat: remove explicit SNPRINTF bypass
Jay Satiro [Fri, 17 Jan 2025 08:17:15 +0000 (03:17 -0500)] 
checksrc.bat: remove explicit SNPRINTF bypass

- Remove the command line argument passed to checksrc.pl that accepts
  SNPRINTF violations in docs/examples.

This is a follow-up to c445b742 which introduced a different management
of banned functions and removed the SNPRINTF rule in favor of banning
snprintf in lib. There's no longer a SNPRINTF warning to suppress.

Closes https://github.com/curl/curl/pull/16032

10 months agocmake: do not store `MINGW64_VERSION` in cache
Viktor Szakats [Fri, 17 Jan 2025 22:40:09 +0000 (23:40 +0100)] 
cmake: do not store `MINGW64_VERSION` in cache

Follow-up to e49797abc24b8e0ac652d7aa0ceec7d252f9a019 #16022
Closes #16040

10 months agobuild: stop detecting `sched_yield()` on Windows
Viktor Szakats [Thu, 16 Jan 2025 19:39:13 +0000 (20:39 +0100)] 
build: stop detecting `sched_yield()` on Windows

On Windows a successful `sched_yield()` detection requires mingw-w64
built with POSIX threads (not Win32 threads) and GCC (not llvm/clang).
(linking to `winpthread` via custom options may also work.)

In CMake builds, it was pre-cached as unavailable before this patch.

When detected (via autotools), it got only used for Windows XP or older
targets combined with a non-GCC, non-clang compiler that doesn't support
`__builtin_ia32_pause()`, or with the Intel C compiler. According to
`lib/easy_lock.h`.

mingw-w64 only supports GCC and clang, leaving a very narrow chance when
`shed_yield()` gets called on Windows. Even then, `sched_yield()` is
implemented in `winpthread` as `Sleep(0)`, which may or not be a useful.
It's also trivial to implement locally if it is, and such rare build
combination is also deemed useful.

Thus, this patch marks `sched_yields()` permanently unavailable on the
Windows platform also with autotools, and instead of pre-caching, skip
this feature check with CMake.

This syncs `HAVE_SCHED_YIELDS` between builds methods on Windows.

Follow-up to 9b517c8b69a1f365fdb6f54f7153561182285b6c #11973
Follow-up to 23af112f5556d6a785c17e09f2422ac931405f61 #8680

Closes #16037

10 months agocmake: detect mingw-w64 version, pre-fill `HAVE_STRTOK_R`
Viktor Szakats [Thu, 16 Jan 2025 17:10:31 +0000 (18:10 +0100)] 
cmake: detect mingw-w64 version, pre-fill `HAVE_STRTOK_R`

Replace `strtok_r()` detection with detection mingw-w64 version.
The use this version to pre-fill `HAVE_STRTOK_R`.

This gives use mingw-w64 version information for free.

Closes #16022

10 months agocmake: pre-fill `HAVE_STDATOMIC_H`, `HAVE_ATOMIC` for mingw-w64
Viktor Szakats [Thu, 16 Jan 2025 14:21:23 +0000 (15:21 +0100)] 
cmake: pre-fill `HAVE_STDATOMIC_H`, `HAVE_ATOMIC` for mingw-w64

`stdatomic.h` and `_Atomic` were first available in gcc 4.9.0 and
llvm/clang 3.6. Set detection values accordingly and save these two
detections on configure runs.

Closes #16036

10 months agoTLS: check connection for SSL use, not handler
Stefan Eissing [Fri, 17 Jan 2025 10:57:00 +0000 (11:57 +0100)] 
TLS: check connection for SSL use, not handler

Protocol handler option PROTOPT_SSL is used to setup a connection
filters. Once that is done, used `Curl_conn_is_ssl()` to check if
a connection uses SSL.

There may be other reasons to add SSL to a connection, e.g. starttls.

Closes #16034

10 months agopytest: remove 'repeat' parameter
Stefan Eissing [Fri, 17 Jan 2025 10:16:37 +0000 (11:16 +0100)] 
pytest: remove 'repeat' parameter

With the use of the pytest-repeat plugin, this parameter is no
longer necessary.

Closes #16033

10 months agowindows: drop dupe macros, detect `CURL_OS` for WinCE ARM, indentation
Viktor Szakats [Thu, 16 Jan 2025 14:31:54 +0000 (15:31 +0100)] 
windows: drop dupe macros, detect `CURL_OS` for WinCE ARM, indentation

- setup-win32: drop duplicate `WIN32_LEAN_AND_MEAN` and `NOGDI` macros
  (set earlier in `curl_setup.h`)

- config-win32ce: detect ARM for `CURL_OS` macro.
  Based on: https://cegcc.sourceforge.net/docs/details.html
  It should also apply to MSVC. (untested)

- indentation.

Closes #16029

10 months agoGHA: update `ubuntu-24.04` to `ubuntu-latest`
Viktor Szakats [Fri, 17 Jan 2025 02:29:26 +0000 (03:29 +0100)] 
GHA: update `ubuntu-24.04` to `ubuntu-latest`

`ubuntu-latest` is an alias for `ubuntu-24.04` now.

10 months agoconfigure: do not inline 'dnl' comments [ci skip]
Viktor Szakats [Fri, 17 Jan 2025 01:34:47 +0000 (02:34 +0100)] 
configure: do not inline 'dnl' comments [ci skip]

(Did not cause issues in this particular case.)

Follow-up to a1184525a6fc144cccf81cab406880519777bd21 #15971

11 months agoconfigure: UWP and Android follow-up fixes
Viktor Szakats [Fri, 17 Jan 2025 00:09:48 +0000 (01:09 +0100)] 
configure: UWP and Android follow-up fixes

- limit UWP detection to native Windows.
- add missing double-quotes to variable.
- drop interlock and sync order in buildinfo flags.

Follow-up to 56a74fac47a27cfbfe2f49976938dab7a1b9b4f2 #16014
Follow-up to f7bb6c1f64049dcdaee970de6759db6f8597879e #16020

Closes #16027

11 months agoandroid: add CI jobs, buildinfo, cmake docs, disable `CURL_USE_PKGCONFIG` by default
Viktor Szakats [Wed, 15 Jan 2025 14:46:32 +0000 (15:46 +0100)] 
android: add CI jobs, buildinfo, cmake docs, disable `CURL_USE_PKGCONFIG` by default

- GHA/non-native: add Android builds, both cmake and autotools,
  both NDK 21 (oldest available) and 35 (newest available)
  https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
  It comes with a maintenance burden to bump the oldest/latest values
  with CI runner updates.

- cmake: disable `CURL_USE_PKGCONFIG` by default for Android.
  To avoid picking up system package by default.

- build: add `ANDROID-<NDK-LEVEL>` flag to `buildinfo.txt`.
  Also detect NDK level with the CMake built-in build method:
  https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-android

- INSTALL.md: add CMake build instructions for Android.

- INSTALL.md: make NDK levels consistent in `./configure` example.

Closes #16014

11 months agoGHA: start using ARM Linux runners
Viktor Szakats [Thu, 16 Jan 2025 18:12:02 +0000 (19:12 +0100)] 
GHA: start using ARM Linux runners

- GHA/linux: allow per-job runner image override.
- GHA/linux: add an arm version of an existing job.
  Add workaround for broken `PATH` in the arm runner image.
- GHA/non-native: add CPU arch to job name where missing.
- GHA/checkdocs: switch a linter job to arm.

Performance looks a little bit better than Intel
(presumably with lower power consumption).

Test jobs, with openssl, tests, pytests, examples:
- arm:
  - https://github.com/curl/curl/actions/runs/12816430794/job/35737374521 4m7s
  - https://github.com/curl/curl/actions/runs/12816201136/job/35736615144 4m5s
- Intel:
  - https://github.com/curl/curl/actions/runs/12816430794/job/35737374118 4m32s
  - https://github.com/curl/curl/actions/runs/12816201136/job/35736614764 4m13s

Ref: https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/

Closes #16023

11 months agoGHA/linux: enable wolfSSH in a wolfSSL job
Viktor Szakats [Thu, 16 Jan 2025 21:19:51 +0000 (22:19 +0100)] 
GHA/linux: enable wolfSSH in a wolfSSL job

With tests. (Most SFTP tests fail with wolfSSH.)

Also:
- disable pseudo-terminal in wolfSSH builds (also in CircleCI).
  Not needed for curl.
- test642: add "compressed" to the description.
  To avoid being the same as test600.
  Follow-up to b7b4dc0d49543175ab0d9bb1cdc257a2d7f7cf0a #1735

Closes #16025

11 months agowebsocket: fix message send corruption
Stefan Eissing [Thu, 2 Jan 2025 15:34:52 +0000 (16:34 +0100)] 
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

11 months agoTODO: write an SMB test server to replace impacket
Daniel Stenberg [Thu, 16 Jan 2025 19:27:07 +0000 (20:27 +0100)] 
TODO: write an SMB test server to replace impacket

Closes #15697
Closes #16024

11 months agoasyn-ares: acknowledge CURLOPT_DNS_SERVERS set to NULL
Daniel Stenberg [Thu, 16 Jan 2025 07:45:45 +0000 (08:45 +0100)] 
asyn-ares: acknowledge CURLOPT_DNS_SERVERS set to NULL

Since c-ares has no function to restore this value to default, it
instead closes and re-inits the c-ares channel.

Reported-by: Deniz Sökmen
Fixes #16015
Closes #16016