]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
87 min agotests/server/sockfilt: avoid possible endless loop on Windows master
Viktor Szakats [Thu, 29 Jan 2026 21:57:19 +0000 (22:57 +0100)] 
tests/server/sockfilt: avoid possible endless loop on Windows

Seen to happen when run under WINE v10.0 on macOS.
```
$ CURL_TEST_EXE_EXT_SRV=.exe CURL_TEST_EXE_EXT_TOOL=.exe \
CURL_TEST_EXE_RUNNER=wine TFLAGS='951 -t' ninja tests
[...]
16:02:18.607002 [select_ws_wait_thread] PeekNamedPipe error: (0x00000032) - Request not supported.
[...endless repeat...]
```

Closes #20478

119 min agotests/server: tidy-up error messages (Windows)
Viktor Szakats [Thu, 29 Jan 2026 19:54:17 +0000 (20:54 +0100)] 
tests/server: tidy-up error messages (Windows)

- show error description on `PeekNamedPipe()` error.
- show `GetLastError()` instead of socket error on non-socket failures
  in the window handler.
- include full hex `GetLastError()` numbers in error messages, syncing
  with Schannel code.
- drop internal `win32_perror()` function, in favor of direct
  `curlx_*strerror()` calls.

Closes #20477

119 min agotool_help.h: drop redundant `U` suffix from literals
Viktor Szakats [Thu, 29 Jan 2026 18:37:24 +0000 (19:37 +0100)] 
tool_help.h: drop redundant `U` suffix from literals

Also:
- update the generator script accordingly.
- convert lowercase `u` suffix to uppercase to match rest of code.

Closes #20476

5 hours agohttp2: dedupe nghttp2 verbose frame print function
Viktor Szakats [Thu, 29 Jan 2026 14:59:15 +0000 (15:59 +0100)] 
http2: dedupe nghttp2 verbose frame print function

Closes #20472

9 hours agomd4, md5: replace custom types with `uint32_t`
Viktor Szakats [Thu, 29 Jan 2026 12:46:24 +0000 (13:46 +0100)] 
md4, md5: replace custom types with `uint32_t`

Closes #20469

9 hours agosetup-os400.h: drop no longer used custom type `u_int32_t`
Viktor Szakats [Thu, 29 Jan 2026 12:49:08 +0000 (13:49 +0100)] 
setup-os400.h: drop no longer used custom type `u_int32_t`

Unused since bb5529331334e1e1c79ff3320220bba12fc8457d.

Closes #20470

21 hours agosend: drop `CURL_UNCONST()` from buffer argument on most platforms
Viktor Szakats [Wed, 28 Jan 2026 14:24:09 +0000 (15:24 +0100)] 
send: drop `CURL_UNCONST()` from buffer argument on most platforms

Keep it on platforms requiring a non-const buffer. These are AmigaOS and
OS400.

Also:
- replace `SEND_QUAL_ARG2` with boolean macro `SEND_NONCONST_ARG2`.

Closes #20463

21 hours agoGHA/macos: merge an autotools job into a cmake one, drop an iOS job
Viktor Szakats [Thu, 29 Jan 2026 01:28:21 +0000 (02:28 +0100)] 
GHA/macos: merge an autotools job into a cmake one, drop an iOS job

Merging the two macOS jobs saves 4-5 minutes. The dropped iOS Ninja job
saves 0.5-1 minute. (Keep the two slow iOS jobs to maintain variation.)

Number of Apple jobs is 32 after this patch.

Also:
- skip building tests and example in iOS autotools to save 30-40s.

Closes #20467

31 hours agodocs: document the need for a 64-bit type and stdint.h
Dan Fandrich [Thu, 9 Jan 2025 18:57:39 +0000 (10:57 -0800)] 
docs: document the need for a 64-bit type and stdint.h

These are requirements above and above C89.

Ref: #20406

Closes #20384

33 hours agoGHA/windows: mark test 3001 flaky in native Windows jobs
Viktor Szakats [Wed, 28 Jan 2026 14:12:46 +0000 (15:12 +0100)] 
GHA/windows: mark test 3001 flaky in native Windows jobs

It has been happening for a long time.

Example:
```
test 3001...[HTTPS localhost, last subject alt name matches, CN does not match]

 3001: protocol FAILED!
 There was no content at all in the file log/7/server.input.
 Server glitch? Total curl failure? Returned: 56
== Contents of files in the log/7/ directory after test 3001
=== Start of file commands.log
 ../src/curl.exe -q --output log/7/curl3001.out  --include --trace-ascii log/7/trace3001 --trace-time -4 --cacert ./certs/test-ca.crt https://localhost:64259/3001 > log/7/stdout3001 2> log/7/stderr3001
=== End of file commands.log
=== Start of file http_server.log
 13:57:47.951283 Running HTTP IPv4 version on port 64256
=== End of file http_server.log
=== Start of file https_stunnel.log
 2026.01.28 13:57:48 LOG5[ui]: stunnel 5.76 on x64-pc-mingw32-gnu platform
 2026.01.28 13:57:48 LOG5[ui]: Compiled/running with OpenSSL 3.5.4 30 Sep 2025
 [...]
 2026.01.28 13:57:49 LOG5[0]: Service [curltest] accepted connection from 127.0.0.1:64281
 2026.01.28 13:57:51 LOG3[0]: s_connect: connect 127.0.0.1:64256: Connection refused (WSAECONNREFUSED) (10061)
 2026.01.28 13:57:51 LOG3[0]: No more addresses to connect
 2026.01.28 13:57:51 LOG5[0]: Connection reset: 0 byte(s) sent to TLS, 0 byte(s) sent to socket
=== End of file https_stunnel.log
=== Start of file server.cmd
 Testnum 3001
=== End of file server.cmd
=== Start of file stderr3001
 curl: (56) Recv failure: Connection was reset
=== End of file stderr3001
[...]
RUN: Unknown server on our https port: 64259 (56)
```

Ref: https://github.com/curl/curl/actions/runs/21440845836/job/61743268798?pr=20461

Closes #20462

33 hours agotests/server: drop stray casts from `swrite`/`sread` arguments
Viktor Szakats [Wed, 28 Jan 2026 13:50:19 +0000 (14:50 +0100)] 
tests/server: drop stray casts from `swrite`/`sread` arguments

Closes #20461

33 hours agotests/server: replace 4 remaining `send()` calls with `swrite()`
Viktor Szakats [Wed, 28 Jan 2026 13:35:18 +0000 (14:35 +0100)] 
tests/server: replace 4 remaining `send()` calls with `swrite()`

They were masked by `()`, which was also not necessary anymore.

Follow-up to 483f4291fb8134a31c437e82212d541782121ad7 #20459
Follow-up to a585cc35e57fc06806443207e31a244c9df029bb #20097
Follow-up to bf7375ecc50e857760b0d0a668c436e208a400bd #18503

Closes #20460

34 hours agobuild: replace `send`/`recv` with `swrite`/`sread` where missing
Viktor Szakats [Wed, 28 Jan 2026 11:57:23 +0000 (12:57 +0100)] 
build: replace `send`/`recv` with `swrite`/`sread` where missing

Also:
- checksrc: ban `send` and `recv`, as documented in `CODE_STYLE.md`.

Follow-up to 9a2663322c330ff11275abafd612e9c99407a94a #17572
Ref: a585cc35e57fc06806443207e31a244c9df029bb #20097
Ref: #20441

Closes #20459

36 hours agobuild: assume `stdint.h`
Viktor Szakats [Wed, 21 Jan 2026 15:20:51 +0000 (16:20 +0100)] 
build: assume `stdint.h`

curl requires `stdint.h` from C99, and no longer builds without it since
v8.18.0 (after dropping VS2008 support). Assume it's available, drop
feature checks.

Also:
- drop duplicate `stdint.h` includes.
- introduce internal `HAVE_UINTPTR_T`, enabled by default.
- OS400: disable `HAVE_UINTPTR_T`.
- build: keep cmake pre-fill and `cmp-config.pl` exception because cmake
  and autotools both detect `stdint.h` implicitly.

Co-authored-by: Dan Fandrich
Ref: #20405
Ref: #20384
Follow-up to 2e1a045d8985e5daa4d9a4f908ed870a16d8e41e #17931

Closes #20406

37 hours agopytest: remove 03_02
Stefan Eissing [Wed, 28 Jan 2026 08:46:18 +0000 (09:46 +0100)] 
pytest: remove 03_02

The test for restarting the server during ongoing transfers does not
work reliably for HTTP/3. This seems due to the nature of UDP/QUIC where
the client may learn about a closed connection at any time, not only
when starting a new request.

Remove the test.

Closes #20458

37 hours agoimap: fix custom listing
Christian Schmitz [Mon, 19 Jan 2026 16:01:16 +0000 (17:01 +0100)] 
imap: fix custom listing

Add test 1847 and 1848.

Fixes #20356
Closes #20360

37 hours agovquic: handle SOCKEMSGSIZE correctly
Stefan Eissing [Tue, 27 Jan 2026 13:27:24 +0000 (14:27 +0100)] 
vquic: handle SOCKEMSGSIZE correctly

Report UDP packets with SOCKEMSGSIZE as being "sent" to progress
the send buffer properly on PMTUD probes.

Reported-by: Daniil Gentili
Fixes #20440
Closes #20448

39 hours agocf-socket: use SOCK_CLOEXEC in socket_open when available
Itay Bookstein [Mon, 26 Jan 2026 18:23:18 +0000 (20:23 +0200)] 
cf-socket: use SOCK_CLOEXEC in socket_open when available

To close the possible race between socket() and fcntl(), we use
SOCK_CLOEXEC instead of fcntl() when it is available.

Closes #20442

39 hours agoh2+h3: align stream close handling
Stefan Eissing [Wed, 7 Jan 2026 14:07:13 +0000 (15:07 +0100)] 
h2+h3: align stream close handling

For HTTP/2, add error code description to close failures.

For HTTP/3, add special handling like in HTTP/2 when streams
have been rejected or an error comes during the response body
and we are not interested in the body.

Closes #20207

40 hours agoGHA: update openssl/openssl to v3.6.1
renovate[bot] [Tue, 27 Jan 2026 13:57:19 +0000 (13:57 +0000)] 
GHA: update openssl/openssl to v3.6.1

Closes #20449

45 hours agowindows: `USE_WINSOCK` to guard winsock2 code (where missing)
Viktor Szakats [Tue, 27 Jan 2026 22:53:05 +0000 (23:53 +0100)] 
windows: `USE_WINSOCK` to guard winsock2 code (where missing)

Replacing `_WIN32`.

Also:
- tool_doswin: guard possibly non-portable socket code with
  `USE_WINSOCK`. The socket is cast to `HANDLE` and passed to
  win32 API `SetStdHandle(STD_INPUT_HANDLE, ...)`.
- lib/setup-win32.h: move `#undef`s before their `#define` pair.

Closes #20455

45 hours agotool_doswin: avoid Windowsisms in socket code (cont.)
Viktor Szakats [Tue, 27 Jan 2026 23:46:37 +0000 (00:46 +0100)] 
tool_doswin: avoid Windowsisms in socket code (cont.)

For general readability. Also to match the rest of the source code.

- bump `send()` result type from `int` to `ssize_t`.
- fix an `int` to be `curl_socklen_t`.
- `.S_un.S_addr` -> `.s_addr`.
- `SD_RECEIVE` -> `SHUT_RD`.
- `SD_SEND` -> `SHUT_WR`.

Follow-up to a81ab3e6db370f31fca2fc67ca8bfda263f15caa #20452
Follow-up to 9a2663322c330ff11275abafd612e9c99407a94a #17572

Closes #20457

46 hours agoGHA/windows: fix shell, fix GHA fail to share cache between arm and intel Windows
Viktor Szakats [Tue, 27 Jan 2026 23:15:45 +0000 (00:15 +0100)] 
GHA/windows: fix shell, fix GHA fail to share cache between arm and intel Windows

A cache entry created by windows-2022 is not picked up by
windows-11-arm. Also a cache created by windows-11-arm is not picked up
by windows-2022. Possibly related to this filed in 2025 June:
https://github.com/actions/cache/issues/1622. Also tried
`enableCrossOsArchive` to no avail. Unclear if these two runners count
as distinct operating systems, I'd guess not. Cache entries are
identical on the web UI. Via GH API they show up with the same cache key
bot different "version" (hash) and different sizes, possibly due to the
zstd vs. gzip bug above.

Fixing (identical error text on either runner):
```
Error: Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: Windows-stunnel-5.76-amd64
```

Also fix a silly typo in the shell value.

Follow-up to 0f54ca6150f5bff5e8eb8b165de86262e98f5e69 #20454
Closes #20456

2 days agotls: remove checks for DEFAULT
Daniel Stenberg [Tue, 27 Jan 2026 15:59:32 +0000 (16:59 +0100)] 
tls: remove checks for DEFAULT

Since 9d8998c99408e1adf, the setopt code changes input DEFAULT to an
actual more specific TLS version (1.2) for the backends to use and check
for.

This means that the default value (0L) cannot and should not actually be
used when the TLS backends run. This change adds asserts to verify that
and removes code that accepts the DEFAULT value as a valid version with
the TLS version functions' logic.

Applications can still set a specific lower version if they want (1, 1.0
or 1.1).

Closes #20453

2 days agoTODO: remove item about signals
Stefan Eissing [Tue, 27 Jan 2026 13:00:30 +0000 (14:00 +0100)] 
TODO: remove item about signals

With SIGPIPE handling now automatic on most platforms, remove the
TODO item again.

Closes #20447

2 days agoGHA/windows: cache stunnel
Viktor Szakats [Tue, 27 Jan 2026 16:27:53 +0000 (17:27 +0100)] 
GHA/windows: cache stunnel

To avoid hammering `stunnel.org`.

Follow-up to 7c3a4a4b4cffa7a335ce383da84e8b758ee5cafa #20410

Closes #20454

2 days agotool_doswin: avoid Windowsisms in socket code
Viktor Szakats [Tue, 27 Jan 2026 05:09:40 +0000 (06:09 +0100)] 
tool_doswin: avoid Windowsisms in socket code

For general readability. Also to match the rest of the source code.

- `SOCKADDR` -> `struct sockaddr`
- `SOCKADDR_IN` -> `struct sockaddr_in`
- `== SOCKET_ERROR` -> `== -1` or silent `!= 0`

Follow-up to 9a2663322c330ff11275abafd612e9c99407a94a #17572

Closes #20452

2 days agocmake: initialize internal `CURL_INCLUDES` variable
Viktor Szakats [Tue, 27 Jan 2026 14:04:05 +0000 (15:04 +0100)] 
cmake: initialize internal `CURL_INCLUDES` variable

Closes #20451

2 days agoINSTALL-CMAKE.md: document new static options as experimental
Viktor Szakats [Tue, 27 Jan 2026 14:00:24 +0000 (15:00 +0100)] 
INSTALL-CMAKE.md: document new static options as experimental

Follow-up to 26c39d8df182a63d28d81ed2b044e6a343519d1a #20015

Closes #20450

2 days agocmake/FindGSS: add backtick missing from comment
Viktor Szakats [Tue, 27 Jan 2026 14:08:20 +0000 (15:08 +0100)] 
cmake/FindGSS: add backtick missing from comment

Follow-up to 16f073ef49f94412000218c9f6ad04e3fd7e4d01 #16973

2 days agoOpenSSL: check reuse of sessions for verify status
Stefan Eissing [Tue, 27 Jan 2026 12:28:09 +0000 (13:28 +0100)] 
OpenSSL: check reuse of sessions for verify status

OpenSSL records its peer verification status inside its SSL_SESSION
objects. When a session is later reused, the SSL connection inherits
this verify status.

Session keys prevent reuse of sessions between connections that verify
the peer and those who do not. However, when Apple SecTrust is used
to verify a connection, this does not update the Sessions verify
status (and there is no setter). On session reuse, OpenSSL fails
the verification and Apple SecTrust cannot verify either since the
certificate peer chain is not available.

Fix this by checking the verification status on session reuse and
remove the session again if the peer needs to be verified, but the
session is not.

Reported-by: Christian Schmitza
Fixes #20435
Closes #20446

2 days agocurl_multi_perform.md: resolve inconsistency
Billy O'Neal [Tue, 27 Jan 2026 00:03:33 +0000 (16:03 -0800)] 
curl_multi_perform.md: resolve inconsistency

... between curl_multi_perform and curl_multi_wait/poll documentation

The `curl_multi_perform` documentation uses integer contextual
conversion to `bool` to test the resulting `CURLMcode`, while other
functions like `curl_multi_wait` and `curl_multi_poll` test against
`CURLM_OK`. (I was initially confused by this as it looked like some
docs call curl_multi_wait/poll on error, while some called only on
success. But that was my misread, not a docs problem.)

Also fixed the example to print which function call failed; previously
an error reported by `curl_multi_perform` was printed as a failure of
`curl_multi_wait`.

Closes #20444

3 days agodocs: add LibreELEC to DISTROS.md
Dan Fandrich [Mon, 26 Jan 2026 20:12:05 +0000 (12:12 -0800)] 
docs: add LibreELEC to DISTROS.md

3 days agochecksrc-all.pl: skip non-repository files
Viktor Szakats [Mon, 26 Jan 2026 12:44:55 +0000 (13:44 +0100)] 
checksrc-all.pl: skip non-repository files

To avoid noise due to local C files when using automatic local checksrc
checks (e.g. via CMake `-DCURL_LINT=ON` option, or `curl-lint` target).

Also replace single-quote with double-quote in external git command, for
portability.

Follow-up to 88ff396549e12f070c65e69a0411d2e3e00be5b0 #17882
Follow-up to e785e898a6a32fc63b35615b55a147d309082f3d #17376

Closes #20439

3 days agoinclude: mask computed auth/proto bitmasks to 32 bits
Arnav-Purushotam-CUBoulder [Sat, 24 Jan 2026 17:11:14 +0000 (10:11 -0700)] 
include: mask computed auth/proto bitmasks to 32 bits

GCC 15.2 warns when assigning computed "all" bitmask macros to 32-bit
flag types because negated masks expand to the full width of unsigned
long/long on 64-bit platforms.

Mask these macros to a 32-bit domain so they do not set high bits and
avoid -Woverflow/-Wconversion warnings in callers.

Reported-by: Patrick Monnerat
Fixes #20242
Closes #20416

3 days agotool: rename curl handle and result variable in `--libcurl`-generated code
Viktor Szakats [Sun, 25 Jan 2026 17:14:23 +0000 (18:14 +0100)] 
tool: rename curl handle and result variable in `--libcurl`-generated code

To match documentation, examples and curl source code:
- `hnd` -> `curl`
- `ret` -> `result`

Closes #20437

3 days agotool_cb_hdr: with -J, use the redirect name as a backup
Daniel Stenberg [Sun, 25 Jan 2026 15:35:53 +0000 (16:35 +0100)] 
tool_cb_hdr: with -J, use the redirect name as a backup

The -J / --remote-header-name logic now records the file name part used
in the redirects so that it can use the last one as a name if no
Content-Disposition header arrives.

Add tests to verify:

1641: -J with a redirect and extract the CD contents in the second
response

1642: -J with a redirect but no Content-Disposition, use the name from
the Location: header

1643: -J with two redirects, using the last file name and also use
queries and fragments to verify them stripped off

Closes #20430

3 days agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 26 Jan 2026 11:47:02 +0000 (12:47 +0100)] 
RELEASE-NOTES: synced

3 days agoRELEASE-PROCEDURE.md: update future release dates
Daniel Stenberg [Mon, 26 Jan 2026 11:28:06 +0000 (12:28 +0100)] 
RELEASE-PROCEDURE.md: update future release dates

3 days agoGHA: sync up configure option order across builds
Viktor Szakats [Sat, 24 Jan 2026 22:22:21 +0000 (23:22 +0100)] 
GHA: sync up configure option order across builds

Closes #20423

3 days agoBUG-BOUNTY.md: we stop the bug-bounty end of Jan 2026
Daniel Stenberg [Thu, 22 Jan 2026 08:41:47 +0000 (09:41 +0100)] 
BUG-BOUNTY.md: we stop the bug-bounty end of Jan 2026

Remove mentions of the bounty and hackerone.

Closes #20312

3 days agotests: rename more `CURLcode` variables to `result`
Viktor Szakats [Sun, 25 Jan 2026 17:12:40 +0000 (18:12 +0100)] 
tests: rename more `CURLcode` variables to `result`

For consistency.

Also:
- one remaining in `src/tool_writeout.c`.
- replace casting an `int` to `CURLcode`.
- lib758: rename `CURLMcode` `result` to `mresult`.
- move literals to the right side of if expressions.

Follow-up to d0dc6e2ec059bf306f32e7a49e9ff7425cd26fcd #20426
Follow-up to 56f600ec23cab41fcced293ada81c8a30ac9cc87

Closes #20432

3 days agocmke: add `*_USE_STATIC_LIBS` options for 9 dependencies
Viktor Szakats [Tue, 16 Dec 2025 23:11:52 +0000 (00:11 +0100)] 
cmke: add `*_USE_STATIC_LIBS` options for 9 dependencies

Via options:

- `BROTLI_USE_STATIC_LIBS`
- `CARES_USE_STATIC_LIBS`
- `LIBSSH_USE_STATIC_LIBS`
- `LIBSSH2_USE_STATIC_LIBS`
- `MBEDTLS_USE_STATIC_LIBS`
- `NGHTTP2_USE_STATIC_LIBS`
- `NGHTTP3_USE_STATIC_LIBS`
- `NGTCP2_USE_STATIC_LIBS`
- `ZSTD_USE_STATIC_LIBS`

When enabled, make a "best effort" finding static libs first and set
the "build static" macro (on Windows) as required by the dependency.

When doing `pkg-config`-based detections, make curl select the static
configuration, which shall set the "build static" macro also.

These options resemble CMake's `OPENSSL_USE_STATIC_LIBS` and
`ZLIB_USE_STATIC_LIBS` (the latter does not support `pkg-config` as of
CMake v4.2.2).

Shared/static library selection based on loose filename conventions is
fragile and prone to break if the non-static-suffixed library is found
and happens to be a shared library, or, if the linker decides to pick up
a shared copy (e.g. `.a.dll`) that shadows the static one. It may help
to provide either static or shared, but not both, on the disk, and match
that with this setting.

Experimental.

Ref: #20013
Closes #20015

3 days agocmake: add `CURL_BUILD_EVERYTHING` option
Viktor Szakats [Sun, 25 Jan 2026 13:10:16 +0000 (14:10 +0100)] 
cmake: add `CURL_BUILD_EVERYTHING` option

To build all targets in a single go, meaning curl and libcurl as normal,
and tests and examples in addition. To build-test everything without
running multiple cmake commands.

Enable with:
- `-DCURL_BUILD_EVERYTHING=ON`
  Special values: `QUICK` to build examples quickly for build test,
  `NOEXAMPLES` to not build examples.

A well-equipped build takes 2.8s of configure time, and 1.7s to build
everything (shared, unity, ninja, prefill), 1.4s with `QUICK`. Without
this option it takes <1s to build curl/libcurl.

Also: streamline `CURL_LINT` internal logic.

Closes #20429

4 days agocmake: enable binutils ld workaround for all toolchains at build-time
Viktor Szakats [Sun, 25 Jan 2026 19:54:55 +0000 (20:54 +0100)] 
cmake: enable binutils ld workaround for all toolchains at build-time

To make it available for GCC if used when consuming libcurl.

Also add comment to `curl-config.cmake` explaining why these odd targets
are defined there.

Bug: https://github.com/curl/curl/pull/20382#discussion_r2716660108
Follow-up to 3e841630ece59c04e26058a761302f38370fd0cc #20427
Follow-up to ef3101d1819928a7799309a16cc531818778e5c7 #20382
Follow-up to 16f073ef49f94412000218c9f6ad04e3fd7e4d01 #16973

Closes #20434

4 days agocmake: fix logic for openssl/zlib binutils ld workaround
Viktor Szakats [Sun, 25 Jan 2026 12:04:58 +0000 (13:04 +0100)] 
cmake: fix logic for openssl/zlib binutils ld workaround

While working #16973, the binutils ld lib order workaround logic
regressed so that it modified the wrong target, writing into the system
`ZLIB::ZLIB` and `OpenSSL::Crypto` ones a `INTERFACE_LINK_LIBRARIES`
property, instead of creating CURL-namespaced targets. Oddly enough,
this also fixed the binutils ld lib ordering issue. It seems this
property makes CMake insert each referenced library in two more
positions (not at the very end though), which allows ld to resolve all
symbols in the cases tested in CI.

Fix by creating the indented namespaced targets, and also creating
these in `curl-config.cmake` to be available when consuming libcurl.

Note that the logic continues doing `get_target_property()` on the two
system targets above. If these targets are defined manually and miss
the `LOCATION` propery, or are defined as aliases, this command may
fail. curl expects these targets be created by CMake's `FindZLIB` and
`FindOpenSSL` built-in Find modules (or ones compatible). Ref: #20419

The binutils ld issue is reproduced by these CI jobs:
 - Linux gcc glibc (amd64, arm64)
- Windows gcc zlib-classic (x64)

Currently using this curl-for-win revision:
https://github.com/curl/curl-for-win/commit/7d12669dafc5aadb525415abde2152a44e10f07d
Examples:
https://github.com/curl/curl/actions/runs/21332437230/job/61399234023?pr=20427
https://github.com/curl/curl/actions/runs/21332437230/job/61399234033?pr=20427

Comparison of lib orders, as passed by CMake to the linker:

without workaround (possibly breaking binutils `ld`):
```diff
 -framework [...]
 libssl.dylib
 libcrypto.dylib
 libz.tbd
 -lssh2 -lidn2
 libldap.tbd
 liblber.tbd
 -lbrotlidec -lbrotlicommon -lzstd -lnghttp2 -lpsl -lrtmp
 -lz
 -lssl
 -lcrypto
```

before this patch:
```diff
 -framework [...]
 libssl.dylib
 libcrypto.dylib
 libz.tbd
+libcrypto.dylib <== inserted via `INTERFACE_LINK_LIBRARIES`
+libz.tbd        <== inserted via `INTERFACE_LINK_LIBRARIES`
 -lssh2 -lidn2
 libldap.tbd
 liblber.tbd
+libcrypto.dylib <== inserted via `INTERFACE_LINK_LIBRARIES`
+ibz.tbd         <== inserted via `INTERFACE_LINK_LIBRARIES`
 -lbrotlidec -lbrotlicommon -lzstd -lnghttp2 -lpsl -lrtmp
 -lz
 -lssl
 -lcrypto
```

after this patch:
```diff
 -framework [...]
 libssl.dylib
 libcrypto.dylib
 libz.tbd
 -lssh2 -lidn2
 libldap.tbd
 liblber.tbd
 -lbrotlidec -lbrotlicommon -lzstd -lnghttp2 -lpsl -lrtmp
 -lz
 -lssl
 -lcrypto
+libcrypto.dylib <== inserted via `CURL::OpenSSL_Crypto`
+libz.tbd        <== inserted via `CURL::ZLIB`
```

Bug: https://github.com/curl/curl/pull/20382#discussion_r2716660108
Reverts: https://github.com/curl/curl/commit/615c43eae8f926418c8205b6fe4ff693e8fc6b7d
Follow-up to 16f073ef49f94412000218c9f6ad04e3fd7e4d01 #16973

Closes #20427

4 days agoGHA: switch 3 more small jobs to `ubuntu-slim`
Viktor Szakats [Sun, 25 Jan 2026 17:54:51 +0000 (18:54 +0100)] 
GHA: switch 3 more small jobs to `ubuntu-slim`

Follow-up to 30c49db6f7ad64c6819181283fd0baff44815441 #20431

Closes #20433

4 days agoGHA: use `ubuntu-slim` image in 3 jobs
Viktor Szakats [Sun, 25 Jan 2026 16:49:24 +0000 (17:49 +0100)] 
GHA: use `ubuntu-slim` image in 3 jobs

For small jobs using no parallelism, and which still use x64 for faster
`apt install`. x64 1-core (vs. 4), 5GB RAM (vs. 16), no Linuxbrew,
no arm64.

Refs:
https://docs.github.com/en/actions/reference/runners/github-hosted-runners
https://github.blog/changelog/2026-01-22-1-vcpu-linux-runner-now-generally-available-in-github-actions/
https://github.com/actions/runner-images/blob/285cf722f0145c477f7a65d4e822515500c10382/images/ubuntu-slim/ubuntu-slim-Readme.md

Closes #20431

4 days agotool: return code variable consistency
Daniel Stenberg [Sun, 25 Jan 2026 10:17:32 +0000 (11:17 +0100)] 
tool: return code variable consistency

- ParameterError variables are named 'err'
- CURLcode variables are named 'result'

For naming consistency across functions

Closes #20426

4 days agobuild: constify `memchr()`/`strchr()`/etc result variables (cont.)
Viktor Szakats [Sun, 25 Jan 2026 12:38:09 +0000 (13:38 +0100)] 
build: constify `memchr()`/`strchr()`/etc result variables (cont.)

Assisted-by: Rudi Heitbaum
Fixes #20420
Follow-up to 7dc60bdb90c710c2e36b2d05aa3686ff491a9bbe #20425
Follow-up to 0e2507a3c65376d6bda860ff20bd94ada9bbb9fd #20421

Closes #20428

4 days agocurlx: dedupe basename copies into `curlx_basename()`
Viktor Szakats [Sun, 25 Jan 2026 04:35:00 +0000 (05:35 +0100)] 
curlx: dedupe basename copies into `curlx_basename()`

Also stop redefining system `basename()` symbol. Call `curlx_basename()`
instead, and map that to `basename()` if available.

Closes #20424

4 days agobuild: constify `memchr()`/`strchr()`/etc result variables
Viktor Szakats [Sun, 25 Jan 2026 02:26:03 +0000 (03:26 +0100)] 
build: constify `memchr()`/`strchr()`/etc result variables

And a few variables around.

There remain cases where the accepted pointer is const, yet the returned
pointer is written to.

Partly addressing (glibc 2.43):
```
* For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
  strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return
  pointers into their input arrays now have definitions as macros that
  return a pointer to a const-qualified type when the input argument is
  a pointer to a const-qualified type.
```
Ref: https://lists.gnu.org/archive/html/info-gnu/2026-01/msg00005.html

Reported-by: Rudi Heitbaum
Ref: #20420

Closes #20421

4 days agonoproxy: simplify, don't mix const non-const in strchr()
Daniel Stenberg [Sun, 25 Jan 2026 09:46:24 +0000 (10:46 +0100)] 
noproxy: simplify, don't mix const non-const in strchr()

Ref: #20420
Closes #20425

4 days agoGHA: set `--enable-option-checking=fatal` where missing
Viktor Szakats [Sat, 24 Jan 2026 22:25:37 +0000 (23:25 +0100)] 
GHA: set `--enable-option-checking=fatal` where missing

Closes #20422

5 days agodocs: Update CodeSonar link
Dan Fandrich [Sat, 24 Jan 2026 21:24:37 +0000 (13:24 -0800)] 
docs: Update CodeSonar link

5 days agoGHA/codeql: improve perf on Windows, enable `CURL_WERROR=ON`, and more
Viktor Szakats [Sat, 24 Jan 2026 01:39:48 +0000 (02:39 +0100)] 
GHA/codeql: improve perf on Windows, enable `CURL_WERROR=ON`, and more

- set `CURL_DROP_UNUSED=ON` for Windows (MSVC) to make the analysis step
  faster: 1m30s -> 1m15s

- enable `CURL_WERROR=ON` in all builds, to catch potential build issues
  in addition to running CodeQL. To make these builds useful as regular
  build tests too.

- add links to CodeQL Actions documentation.

- delete test data C files after checkout in an attempt to remove them
  from CodeQL code coverage stats.

Closes #20418

5 days agobuild: fix unused variables/values/code in non-verbose builds
Viktor Szakats [Fri, 23 Jan 2026 23:03:23 +0000 (00:03 +0100)] 
build: fix unused variables/values/code in non-verbose builds

Seen in GHA/codeql builds.

One of them also affected wolfSSL < 3.9.10 builds.

61093e2a819d26b7ddf309baef264b9e50c6c56f #20353
Cherry-picked from #20404
Closes #20417

6 days agosetopt: fix checking range for CURLOPT_MAXCONNECTS
MichaÅ‚ Antoniak [Fri, 23 Jan 2026 15:51:44 +0000 (16:51 +0100)] 
setopt: fix checking range for CURLOPT_MAXCONNECTS

- Use upper limit INT_MAX instead of UINT_MAX.

UINT_MAX doesn't work as the max value for the variable since it is
passed as a long and becomes -1 on platforms that have same sized
int and long, like Windows.

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

6 days agoGHA/windows: install stunnel manually, enable for Cygwin
Viktor Szakats [Fri, 23 Jan 2026 12:37:59 +0000 (13:37 +0100)] 
GHA/windows: install stunnel manually, enable for Cygwin

Replace Chocolatey install with direct download and unpack. To reduce
CI dependencies (Chocolatey, NuGet), improve install performance
(10s -> 1s) and hopefully reliability. Last but not least to enable it
for the Cygwin CI job.

Caveats:
- Need to bump stunnel versions manually (2-3 times a year).
  Renovate could likely do it, but I failed to understand its
  documentation and miss tooling/interface to make tests.
- FIPS not enabled. (can be done if necessary)
- Possibly losing checksum verification (not sure if Chocolatey did it
  automatically for this package.)

Also:
- Increase minimum tests by 100 for the Cygwin job.

Ref: #16819 (earlier attempt)
Ref: https://www.stunnel.org/archive/
Ref: https://www.githubstatus.com/incidents/cqb5hcy0gx18
Follow-up to d176f58a2003e4231c75f09813125c5a5bb26913 #20413
Follow-up to 19b1e44660d68d38a2f48f24740a3aac1d46b9a0 #20409

Closes #20410

6 days agoruntests: pass config filename to stunnel in native format (Windows)
Viktor Szakats [Fri, 23 Jan 2026 15:23:57 +0000 (16:23 +0100)] 
runtests: pass config filename to stunnel in native format (Windows)

Fixing (Seen when enabling stunnel for Cygwin in CI):
```
=== Start of file https_stunnel.log
 [ ] Initializing inetd mode configuration
 [ ] Running on Windows 6.2
[...]
 [.] Reading configuration from file /cygdrive/d/a/curl/curl/bld/tests/log/6/server/https_stunnel.conf
 [!] Cannot open configuration file
```
Ref: https://github.com/curl/curl/actions/runs/21289677523/job/61279662459?pr=20410

Cherry-picked from #20410
Closes #20413

6 days agorenovate: merge two custom regex rules, escape dots
Viktor Szakats [Fri, 23 Jan 2026 14:38:15 +0000 (15:38 +0100)] 
renovate: merge two custom regex rules, escape dots

There are no longer envs ending with `_VER` in Circle CI config.

Follow-up to 17a669426f36b467dfd945b4b35f6211598b7977 #17537

Closes #20412

6 days agoverbose.md: explain the { and } prefixes
Daniel Stenberg [Thu, 22 Jan 2026 09:04:41 +0000 (10:04 +0100)] 
verbose.md: explain the { and } prefixes

The prefixes are now made as subtitles

Reported-by: Thibault de Villèle
Fixes #20386
Closes #20396

6 days agocmake: sync two unix pre-fill comments with win32 [ci skip]
Viktor Szakats [Fri, 23 Jan 2026 12:16:15 +0000 (13:16 +0100)] 
cmake: sync two unix pre-fill comments with win32 [ci skip]

Cherry-picked from #20406

6 days agoGHA/windows: fail CI early on stunnel install failure
Viktor Szakats [Fri, 23 Jan 2026 11:25:29 +0000 (12:25 +0100)] 
GHA/windows: fail CI early on stunnel install failure

Before this patch CI silently ignored stunnel install failures. This
pushed the failure to the test run step due to not meeting the minimum
number of tests.

Make the root cause obvious by failing early in this case.

Reported-by: Stefan Eissing
Follow-up to 3f1cd809eeae05f39fec72fe780f3a69d21972fb #19942
Ref: https://github.com/curl/curl/actions/runs/21245626382/job/61134101176?pr=20397
Ref: #16819

Closes #20409

6 days agoGHA/distcheck: bump old cmake, switch to arm64 for performance
Viktor Szakats [Wed, 26 Nov 2025 18:11:16 +0000 (19:11 +0100)] 
GHA/distcheck: bump old cmake, switch to arm64 for performance

Bump CMake version in CMake integration tests for better performance
(8x on macOS, 2-3x on Windows) and native arm64 binaries.

- bump old CMake in integration tests to v3.19.8 (was: v3.11.4)
- switch to native arm64 CMake binaries on macOS.
- switch Linux CMake integration job to arm64.

Speed gains:
- Linux: 2m -> 1m30s
- macOS: 9-10m -> 1m15s
- Windows: 6-7m -> 2m43s

Before:
https://github.com/curl/curl/actions/runs/21255697172
https://github.com/curl/curl/actions/runs/21255020621

After:
https://github.com/curl/curl/actions/runs/21272021446

With this, CI is:
- no longer testing deprecated CMake versions.
  Follow-up to a7c974e038572bd1d4a653afbd6de5fad5a10215 #19902
- not testing the next (from 2026 April) minimum 3.18, but going for
  3.19 instead. For arm64 binaries on both macOS and Linux. There is
  no 3.18-specific CMake code in curl.

Cherry-picked from #20407
Closes #20408

7 days agoGHA: migrate 3 linter jobs to arm64
Viktor Szakats [Thu, 22 Jan 2026 22:01:42 +0000 (23:01 +0100)] 
GHA: migrate 3 linter jobs to arm64

Also to make them finish as fast or overall faster.

checkdocs/proselint:
before: https://github.com/curl/curl/actions/runs/21255607528/job/61169136666 22s
after: https://github.com/curl/curl/actions/runs/21266680535/job/61207470652?pr=20403 19s

checksrc/spellcheck, linters, REUSE:
before: https://github.com/curl/curl/actions/runs/21255607522/job/61169137076 3m11s
after: https://github.com/curl/curl/actions/runs/21266680282/job/61207475282?pr=20403 2m27s
typos: 13s -> 28s
pytype: 2m24s -> 1m24s

checksrc/misc checks:
before: https://github.com/curl/curl/actions/runs/21255607522/job/61169137176 2m29s
after: https://github.com/curl/curl/actions/runs/21266680282/job/61207475248?pr=20403 2m5s
shellcheck: seems larger and slower on arm64. 33 -> 45MB, 1s -> 3s
badwords: 2m1s -> 1m35s

Closes #20403

7 days agotidy-up: Markdown, clang-format nits
Viktor Szakats [Tue, 20 Jan 2026 23:44:39 +0000 (00:44 +0100)] 
tidy-up: Markdown, clang-format nits

- drop leading indent from Markdown.
- switch to Markdown section markers where missing.
- move `&&` and `||` to the end of the line (C, Perl).
- openssl: add parenthesis to an if sub-expression.
- misc clang-format nits.
- unfold Markdown links.
- SSL-PROBLEMS.md: drop stray half code-fence.

Closes #20402

7 days agoGHA/linux: rename `intel` to `intelc` to avoid mixup with `<pkg>-intel`
Viktor Szakats [Thu, 22 Jan 2026 17:29:55 +0000 (18:29 +0100)] 
GHA/linux: rename `intel` to `intelc` to avoid mixup with `<pkg>-intel`

To avoid unnecessarily installing Intel C for any `<pkg>-intel` locally
built dependency.

Follow-up to ab8ccaed2479bf7d019b3aa25f22299546e23828 #20392
Follow-up to d9fe60d4572bf82e407ae33277f81def896d06f2 #20248

Closes #20400

7 days agoGHA/linux: move mbedTLS and wolfSSL valgrind jobs to arm64
Viktor Szakats [Thu, 22 Jan 2026 01:45:10 +0000 (02:45 +0100)] 
GHA/linux: move mbedTLS and wolfSSL valgrind jobs to arm64

For significantly better performance.

AM wolfssl-opensslextra valgrind 1:  6m53s -> 4m15s
AM wolfssl-opensslextra valgrind 2:  6m47s -> 4m25s
CM mbedtls gss valgrind 1:           8m33s -> 4m31s
CM mbedtls gss valgrind 2:           8m39s -> 4m34s
('after' times corrected for 'install prereq' differences)

before: https://github.com/curl/curl/actions/runs/21255607562
after: https://github.com/curl/curl/actions/runs/21257368016

Also tried rustls, but that'd require linux arm64 release binaries at:
https://github.com/rustls/rustls-ffi/releases

Closes #20392

7 days agosocketpair: set SO_NOSIGPIPE where possible
Stefan Eissing [Thu, 22 Jan 2026 10:46:46 +0000 (11:46 +0100)] 
socketpair: set SO_NOSIGPIPE where possible

Set SO_NOSIGPIPE on socketpair/inet-simulated socketpair
implementations. eventfd and pipe() do not need/want it.

Closes #20397

7 days agocmake: always define `CURL::win32_winsock` on Windows in `curl-config.cmake`
Kai Pastor [Wed, 21 Jan 2026 08:04:14 +0000 (09:04 +0100)] 
cmake: always define `CURL::win32_winsock` on Windows in `curl-config.cmake`

The CMake config can be consumed by project which enable only language
`CXX`. `CMAKE_C_COMPILER_ID` isn't defined in this case, and the target
definition would be missing. But the check for compiler id isn't really
needed: The target is namespaced and valid, regardless of actual
compiler.

Noticed in https://github.com/microsoft/vcpkg/issues/49518, building cpr.

Follow-up to 16f073ef49f94412000218c9f6ad04e3fd7e4d01 #16973

Closes #20382

7 days agocmake: add `CURL_DROP_UNUSED` option to reduce binary sizes
Viktor Szakats [Mon, 19 Jan 2026 11:34:59 +0000 (12:34 +0100)] 
cmake: add `CURL_DROP_UNUSED` option to reduce binary sizes

To enable known linker options dropping unused, dead, code and data from
the executables built.

Useful to reduce binary sizes for curl, libcurl shared lib and apps
linking static libcurl. It's effective on both "unity" and non-unity
builds. Aligning "unity" build sizes with default, non-unity ones.

Supported platforms: Apple, MSVC, llvm/clang and GCC on all tested
platforms: Linux, BSDs, Windows, MSYS2/Cygwin, Android, MS-DOS.

Notes:
- Static libraries grow 20-30% with non-Apple toolchains.
  This effect is controlled by separate, optional compiler flags on
  non-Apple. This patch enables them automatically for public binaries
  (libcurl and curl tool), and leaves them off for internal/test ones.
- MSVC enables this option by default for 'Release' configurations.
  The curl build option has no effect on it.
- Observed effect on VS2010 is negligible. VS2012+ is recommended.
- Works with LTO, Fil-C.
- No observed/conclusive effect on build speed.
- On Windows with clang/gcc (mingw-w64/MSYS2/Cygwin) it also enables
  `-fno-asynchronous-unwind-tables` as a workaround to make
  the toolchain options actually work.
  Ref: https://sourceware.org/bugzilla/show_bug.cgi?id=11539
Thanks-to: Andarwinux
Also:
- GHA: enable in Linux and MinGW jobs to test it. Size changes:

  - linux aws-lc H3:
    curl: 2000000 -> 1937152, libcurl.a: 2065724 -> 2716532 bytes
  - macos clang HTTP-only:
    curl: 1364376 -> 128799 bytes, libcurl.a: unchanged
  - macos llvm MultiSSL:
    curl: 410056 -> 405720, libcurl.dylib: 1350336 -> 1348480 bytes
  - mingw schannel c-ares U:
    curl: 1588736 -> 1507328, libcurl-d.a: 3322040 -> 3884746 bytes
    bld: 34 -> 35MB

- GHA: enable in MSVC and Apple jobs to reduce disk footprint, with no
  obvious downside. Size changes:

  - AppVeyor CI VS2019:
    curl: 2339840 -> 1295872, libcurl-d.dll: 3155968 -> 1900544 bytes
    bld: 161 -> 97MB
  - AppVeyor CI VS2022 clang-cl:
    curl: 2933248 -> 2332160, libcurl-d.lib: 4762688 -> 5511330 bytes
    bld: 133 -> 121MB
  - AppVeyor CI VS2022 HTTP-only:
    curl: 3514368 -> 2177024, libcurl-d.lib: 2538420 -> 3151740 bytes
    bld: 137 -> 83MB
  - GHA intel:
    curl: 2629120 -> 2023424, libcurl-d.lib: 4366652 -> 5350670 bytes
    bld: 86 -> 69MB
  - GHA arm64:
    curl: 2832896 -> 2063872, libcurl-d.lib: 4690616 -> 5597250 bytes
    bld: 82 -> 66MB

Refs:
https://maskray.me/blog/2021-02-28-linker-garbage-collection
https://web.archive.org/web/20110811230637/msdn.microsoft.com/en-us/library/bxwfs976.aspx (VS2010)
https://learn.microsoft.com/cpp/build/reference/opt-optimizations
https://learn.microsoft.com/cpp/build/reference/gy-enable-function-level-linking

Closes #20357

7 days agotool: enable header separation for HTTPS proxies
Jacek Migacz [Thu, 22 Jan 2026 10:36:44 +0000 (10:36 +0000)] 
tool: enable header separation for HTTPS proxies

When using a proxy, --header specified headers were leaking into CONNECT
requests. This could break corporate proxies that reject custom
User-Agent headers in CONNECT.

Enable CURLHEADER_SEPARATE only for HTTPS through proxy or when
--proxytunnel is used, ensuring:

- --header affects only HTTP requests (not CONNECT)
- --proxy-header affects only CONNECT requests
- --user-agent affects both consistently

Fixes the redirect + proxy + custom UA issue while maintaining
compatibility with HTTP proxy scenarios.

Closes #20398

8 days agoasyn-ares: abort with OOM error when Curl_dnscache_mk_entry fails
Daniel Stenberg [Wed, 21 Jan 2026 09:08:27 +0000 (10:08 +0100)] 
asyn-ares: abort with OOM error when Curl_dnscache_mk_entry fails

Closes #20385

8 days agobuild: opt-in MSVC to C99-style verbose logging logic
Viktor Szakats [Wed, 21 Jan 2026 12:35:07 +0000 (13:35 +0100)] 
build: opt-in MSVC to C99-style verbose logging logic

MSVC does not advertise itself as C99 via `__STDC_VERSION__`, but
supports variadic macros in all curl-supported versions. Fix by
explicitly enabling C99 verbose string logic for MSVC.

With verbose logging enabled (default), this makes logging perform
better, on par with clang/gcc (and other C99) builds. (With the cost
of extra binary size.) With verbose logging disabled, it excludes all
verbose logging related strings and code from the binary. Before this
patch, MSVC used the C89 fallback code in both configs, which used
a fixed function call, with the called function deciding to actually
log or not, while also retaining the verbose log string in both configs.

Size comparison (bytes), schannel, static, debug, VS2022, local build:
curl-before-verbose.exe    4,024,832
curl-before-noverbose.exe  4,013,056
curl-after-verbose.exe     4,117,504
curl-after-noverbose.exe   3,928,064

In CI with non-verbose:
Before:
```
3274240 bytes: ./_bld/lib/Debug/libcurl-d.dll
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/53408629/job/htj7ps88q83ew9ww#L224

After:
```
3155968 bytes: ./_bld/lib/Debug/libcurl-d.dll
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/53408771/job/tp9epgjpef098vsr#L224

Idea-by: Arnav Purushotam
Ref: #20367
Ref: #20341
Follow-up to 61093e2a819d26b7ddf309baef264b9e50c6c56f #20353

Closes #20387

8 days agoappveyor: simplify job configuration
Viktor Szakats [Wed, 21 Jan 2026 15:41:42 +0000 (16:41 +0100)] 
appveyor: simplify job configuration

Replace interim knobs with cmake options.

Also:
- use CMake env `CMAKE_GENERATOR` to select the generator.
  (with workaround to make it work with CMake <3.15.)
- deduct some configuration from the job name.
- drop unused test runner logic.
- drop obsolete `BUILD_OPT` use.
- tidy-up job names and sync them with GHA ones.
- add newline between job configurations for readability.

Closes #20390

8 days agodynhds: drop duplicate includes
Viktor Szakats [Wed, 21 Jan 2026 15:35:19 +0000 (16:35 +0100)] 
dynhds: drop duplicate includes

Already included via `dynhds.h`.

Closes #20389

8 days agoGHA: strip Windows/MS-DOS/Android binaries to see their real size
Viktor Szakats [Mon, 19 Jan 2026 15:00:56 +0000 (16:00 +0100)] 
GHA: strip Windows/MS-DOS/Android binaries to see their real size

Unstripped size hides effective binary sizes due to the added debug
information. E.g. `--gc-sections` may inflate unstripped binaries, while
their unstripped size decreases. To see if binary size optimization
options work, it's more useful to observe unstripped size.

Ref: #20357
Follow-up to 4cf43508e8e60d0d8acef1beecb0f76040609543 #20355

Closes #20359

8 days agowindows: test non-verbose builds, fix fallouts
Viktor Szakats [Wed, 21 Jan 2026 12:55:32 +0000 (13:55 +0100)] 
windows: test non-verbose builds, fix fallouts

- schannel: fix mixed-up declaration. (originally fenced infof for
  verbose, then changed to failf with the fence kept, then fence
  removed and variable marked as verbose, when in fact it's not, but
  not tested and caught in CI.
- fix two other fallouts.
- GHA/windows: disable verbose strings in a mingw job.
- appveyor: disable verbose strings in an MSVC job.
- appveyor: add way to pass any CMake option per-job.

Cherry-picked from #20387
Follow-up to 61093e2a819d26b7ddf309baef264b9e50c6c56f #20353

Closes #20388

8 days agobuild: fully omit verbose strings and code when disabled
Viktor Szakats [Mon, 19 Jan 2026 06:29:43 +0000 (07:29 +0100)] 
build: fully omit verbose strings and code when disabled

When the compiler supports C99.

- map logging functions to macro stubs when verbose logging is disabled
  and the compiler is C99. Make sure these stubs silence unused variable
  warnings for non-variadic arguments.
  Before this patch they mapped to function stubs, the same codepath
  used for C89 compiler in this configuration.

- introduce new macros to tell the compiler which code to include
  when verbose code is active, or inactive:

  - `CURLVERBOSE`: defined when verbose code is active.
    To enclose blocks of code only used for verbose logging.

  - `VERBOSE(statement);`:
    compile statement when verbose code is active.
    To mark code lines only used for verbose logging.

  - `NOVERBOSE(statement);`:
    compile statement when verbose code is inactive.
    To suppress warnings for arguments passed to logging functions via
    printf masks, e.g. `NOVERBOSE((void)ipaddress);`, yet keeping
    the warning in verbose builds.

  Note these macros are not the same as `CURL_DISABLE_VERBOSE_STRINGS`.
  Verbose code is always active in C89 mode (without variadic macro
  support).

- drop existing uses of `CURL_DISABLE_VERBOSE_STRINGS` where redundant,
  or replace with the above macros. Ending up reducing the number of
  `#ifdef`s, and also the number of lines.

Assisted-by: Daniel Stenberg
Assisted-by: Jay Satiro
Reported-by: Dan Fandrich
Fixes #20341
Refs: #12105 #12167

Closes #20353

8 days agomulti: probe for IPv6 functionality in multi_init()
Daniel Stenberg [Wed, 21 Jan 2026 08:14:40 +0000 (09:14 +0100)] 
multi: probe for IPv6 functionality in multi_init()

In some legacy systems IPv6 might dynamically work/not work and thus
curl needs to check/probe to see if it should indeed be used.

This change moves the probe that checks for working IPv6 to the multi
handle setup function instead of delaying it to when the first name
resolve is performed. This avoids a later tricky error path if the
socket cannot be created due to OOM.

Closes #20383

8 days agowinapi: use FormatMessageA instead of FormatMessageW
dEajL3kA [Fri, 16 Jan 2026 10:20:48 +0000 (11:20 +0100)] 
winapi: use FormatMessageA instead of FormatMessageW

Use FormatMessageA() to get the error message as multibyte-character
string (local codepage) directly, instead of using FormatMessageW()
and then convert the string from Unicode (UTF-16) to multi-byte (local
codepage) manually.

Prior to this change we used FormatMessageW + conversion because some
Windows CE did not have FormatMessageA. Since curl no longer supports
Windows CE, FormatMessageA can be used.

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

8 days agohostip: omit forward declaration of verbose logging function
Viktor Szakats [Wed, 21 Jan 2026 02:31:41 +0000 (03:31 +0100)] 
hostip: omit forward declaration of verbose logging function

Closes #20381

8 days agourldata.h: delete orphan forward declaration
Viktor Szakats [Wed, 21 Jan 2026 02:28:02 +0000 (03:28 +0100)] 
urldata.h: delete orphan forward declaration

Closes #20380

9 days agobuild: update to not need `_CRT_NONSTDC_NO_DEPRECATE` with MSVC
Viktor Szakats [Wed, 7 Jan 2026 18:37:02 +0000 (19:37 +0100)] 
build: update to not need `_CRT_NONSTDC_NO_DEPRECATE` with MSVC

Use non-deprecated CRT function variants on Windows.

- introduce `curlx_fdopen()`, `curlx_close()` and use them. Map them to
  non-deprecated, underscored, CRT functions on Windows.

- replace `close()` uses with either `sclose()` (for sockets) or
  `curlx_close()` (for files).

- map `fileno`, `unlink`, `isatty` to their non-deprecated, underscored,
  versions on Windows.

- tool_dirhie: map `mkdir` to `_mkdir` on Windows.

- easy: use `_strdup()` on Windows, regardless of how `HAVE_STRDUP` is
  set.

- cmake: assume `HAVE_STRDUP` on Windows. To allow dropping a detection
  hack using `_CRT_NONSTDC_NO_DEPRECATE` with MSVC. Windows always has
  `_strdup()` which the code uses, but also needs `HAVE_STRDUP` defined
  to disable curl's own `strdup()` implementation.

- curl_setup.h: drop `_CRT_NONSTDC_NO_DEPRECATE` as no longer necessary.

Closes #20212

9 days agoCI: do not codespell `RELEASE-NOTES`
Viktor Szakats [Tue, 20 Jan 2026 18:14:37 +0000 (19:14 +0100)] 
CI: do not codespell `RELEASE-NOTES`

It contains names.

Reported-by: Daniel Stenberg
Fixes #20376
Revert 3e3d526c4ce4fea3c3a1b46bf55cc1b64fa10c5d
Follow-up to 5f5e000278df1029db2ee3f4499b5ce27c1861b2
Follow-up to 85cfc15601b19f13f1d480e6f7ba8922850429c3
Follow-up to 977595772c6e650b538da965cde676c9bc15cfd8
Follow-up to 0260e8465a2373b22588086acdfa5f4cf0e16e29 #17905

Closes #20378

9 days agocodespell: ignore false positive found in RELEASE-NOTES
Viktor Szakats [Tue, 20 Jan 2026 16:56:45 +0000 (17:56 +0100)] 
codespell: ignore false positive found in RELEASE-NOTES

9 days agoconfig2setopts: acknowledge OOM error from CURLOPT_MIMEPOST
Daniel Stenberg [Tue, 20 Jan 2026 15:26:34 +0000 (16:26 +0100)] 
config2setopts: acknowledge OOM error from CURLOPT_MIMEPOST

It should make curl exit. Found with "strict torture".

Closes #20375

9 days agotimeout handling: auto-detect effective timeout
Stefan Eissing [Mon, 19 Jan 2026 10:38:35 +0000 (11:38 +0100)] 
timeout handling: auto-detect effective timeout

When checking a transfer for being expired via `Curl_timeleft_ms()`,
eleminate the `bool connecting` parameter and have the function check
the `mstate` of the transfer instead.

Advantages:
* eleminate the caller needing awareness if the transfer is
  connecting or in a later state
* fix pingpong timeout handling to check the correct timeout
  during "proto_connect" phases
* avoid using "connecting" timeouts during establishing a secondary
  connection (e.g. FTP) since this would use the timestamp from
  the original, primary connect and thus be wrong

Reported-by: Wyuer on github
Fixes #20347
Closes #20354

9 days agoGHA: update ngtcp2/ngtcp2 to v1.20.0
renovate[bot] [Tue, 20 Jan 2026 11:38:57 +0000 (11:38 +0000)] 
GHA: update ngtcp2/ngtcp2 to v1.20.0

Closes #20372

9 days agoGHA: update ngtcp2/nghttp3 to v1.15.0
renovate[bot] [Tue, 20 Jan 2026 10:23:42 +0000 (10:23 +0000)] 
GHA: update ngtcp2/nghttp3 to v1.15.0

Closes #20371

9 days agosocket: check result of SO_NOSIGPIPE
Stefan Eissing [Tue, 20 Jan 2026 10:09:58 +0000 (11:09 +0100)] 
socket: check result of SO_NOSIGPIPE

New define USE_SO_NOSIGPIPE in curl_setup.h, for now set whenever
SO_NOSIGPIPE is defined. Maybe overridden in the future on systems where
this does not work.

With USE_SO_NOSIGPIPE defined, set SO_NOSIGPIPE on all sockets created
by libcurl and fail the creation when setsockopt() fails.

Closes #20370

9 days agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 20 Jan 2026 15:01:16 +0000 (16:01 +0100)] 
RELEASE-NOTES: synced

9 days agolib: use ISBLANK and ISNEWLINE more
Daniel Stenberg [Tue, 20 Jan 2026 11:07:15 +0000 (12:07 +0100)] 
lib: use ISBLANK and ISNEWLINE more

Closes #20373

9 days agocmake: silence silly Apple clang warnings in C89 mode, test in CI
Viktor Szakats [Mon, 19 Jan 2026 22:24:47 +0000 (23:24 +0100)] 
cmake: silence silly Apple clang warnings in C89 mode, test in CI

- `stdbool.h` is also included via system headers. Disabling it from curl
  does not fix it. Silencing lots of these:
  ```
  curl/lib/curlx/warnless.h:64:1: warning: '_Bool' is a C99 extension [-Wc99-extensions]
   64 | bool curlx_sztouz(ssize_t sznum, size_t *puznum);
      | ^
  /Library/Developer/CommandLineTools/usr/lib/clang/17/include/stdbool.h:24:14: note: expanded from macro 'bool'
   24 | #define bool _Bool
      |              ^
  ```

- silence `-Wcomma` warnings.
  in favor of the global silencing approach, since a couple of more of
  these were hit (in vquic, tool1622, unit1309, unit1636), and it seems
  silly to update them all.
  Revert e8189c44201db6bff987a8771df90f853d93dec5 #20362

Also:
- cmake: include C standard in 'platform flags' log line.
- GHA/macos: switch a job to C89 to verify.
- GHA/linux: show 'C89' in job names.

Ref: https://cmake.org/cmake/help/v3.7/variable/CMAKE_C_STANDARD.html

Closes #20363

9 days agobuild: drop global suppression of `-Wformat-nonliteral`, fix fallouts
Viktor Szakats [Tue, 20 Jan 2026 01:52:53 +0000 (02:52 +0100)] 
build: drop global suppression of `-Wformat-nonliteral`, fix fallouts

Extend two existing local suppressions to GCC, and add another
GCC-specific one as a replacement.

Before this patch suppressing this warning was odd with clang, because
after this option, `-Wformat=2` is used, which re-enables it.

Also:
- mprintf: minimize scope of a warning suppression.
- tests/server: suppress this warning for a system `vsnprintf()` call
  where it could trigger in C89 builds or with
  `CFLAGS=-DCURL_NO_FMT_CHECKS` set. Seen with Apple clang 17:
  ```
  curl/tests/server/util.c:114:37: warning: format string is not a string literal [-Wformat-nonliteral]
    114 |   vsnprintf(buffer, sizeof(buffer), msg, ap);
        |                                     ^~~
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:124:69: note: expanded from macro 'vsnprintf'
    124 | #define vsnprintf(str, len, ...) __vsnprintf_chk_func (str, len, 0, __VA_ARGS__)
        |                                                                     ^~~~~~~~~~~
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:81:65: note: expanded from macro '__vsnprintf_chk_func'
     81 |         __builtin___vsnprintf_chk (str, len, flag, __darwin_obsz(str), format, ap)
        |                                                                        ^~~~~~
  ```

Ref: #20363

Closes #20366

9 days agortsp: fix missing variable declaration
Viktor Szakats [Tue, 20 Jan 2026 02:30:24 +0000 (03:30 +0100)] 
rtsp: fix missing variable declaration

```
lib/rtsp.c:1073:26: error: no previous extern declaration for non-static variable 'Curl_scheme_rtsp' [-Werror,-Wmissing-variable-declarations]
 1073 | const struct Curl_scheme Curl_scheme_rtsp = {
      |                          ^
lib/rtsp.c:1073:7: note: declare 'static' if the variable is not intended to be used outside of this translation unit
 1073 | const struct Curl_scheme Curl_scheme_rtsp = {
      |       ^
```
Ref: https://github.com/curl/trurl/actions/runs/21157411659/job/60844860592?pr=425#step:3:3036

Follow-up to 8edc0338f30f458f812f9ea355de1240771fa343 #20351

Closes #20365

9 days agotidy-up: miscellaneous
Viktor Szakats [Fri, 16 Jan 2026 17:13:44 +0000 (18:13 +0100)] 
tidy-up: miscellaneous

- whitespace, indent, comments, clang-format.
- openssl: move feature guards within function blocks.
- tunit: drop redundant blocks.

Closes #20361

9 days agolibcurl docs: reduce 'since ...' in descriptions
Daniel Stenberg [Tue, 20 Jan 2026 10:01:31 +0000 (11:01 +0100)] 
libcurl docs: reduce 'since ...' in descriptions

Reduce mentions of libcurl versions like "since 7.xx ..." in option
descriptions to reduce clutter and make the texts easier to read. Keep
them in, or move them to, the HISTORY or DEPRECATED sections

The last version 7 release (7.88.1) shipped on Februrary 20, 2023.

Closes #20369

9 days agotls: add new SSLSUPP flags for several options
Frank Buss [Mon, 19 Jan 2026 23:03:00 +0000 (00:03 +0100)] 
tls: add new SSLSUPP flags for several options

So that curl_easy_setopt() correctly returns error for those not
supported by the backend.

Closes #20364