]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 hours agowindows: drop two interim, single-use macros master
Viktor Szakats [Wed, 30 Jul 2025 22:59:39 +0000 (00:59 +0200)] 
windows: drop two interim, single-use macros

Follow-up to e77d8670685d38d80c940877a4fdfa3382c4d6cc

Closes #18114

3 hours agocurl_mime_data_cb.md: mention what datasize is for
Daniel Stenberg [Thu, 31 Jul 2025 08:13:34 +0000 (10:13 +0200)] 
curl_mime_data_cb.md: mention what datasize is for

Closes #18115

4 hours agobufq: add integer overflow checks before chunk allocations
Cole Leavitt [Thu, 31 Jul 2025 05:19:01 +0000 (22:19 -0700)] 
bufq: add integer overflow checks before chunk allocations

Closes #18112

4 hours agolibtests: update format strings to avoid casts, drop some macros
Viktor Szakats [Wed, 30 Jul 2025 00:12:22 +0000 (02:12 +0200)] 
libtests: update format strings to avoid casts, drop some macros

- bump format strings to show the full value, drop casts.
- drop redundant casts (enum -> `%d`).
- drop some single-use macros.
- replace `int` with `bool` in testtrace.

Closes #18106

4 hours agoCURLOPT: bump `CURL_REDIR_*` macros to `long`
Viktor Szakats [Wed, 30 Jul 2025 21:54:47 +0000 (23:54 +0200)] 
CURLOPT: bump `CURL_REDIR_*` macros to `long`

This patch bumps the size of these macros from `int` to `long`, while
keeping their actual values the same. It may cause incompatibilities in
user code, requiring the bump of holder variables and/or adding casts:

- CURL_REDIR_GET_ALL
- CURL_REDIR_POST_301
- CURL_REDIR_POST_302
- CURL_REDIR_POST_303
- CURL_REDIR_POST_ALL

Also:
- keep existing cast within the documentation to make sure it applies
  to older curl versions as well.

Closes #18110

4 hours agowindows: document toolchain support for some macros (cont.)
Viktor Szakats [Thu, 31 Jul 2025 05:42:50 +0000 (07:42 +0200)] 
windows: document toolchain support for some macros (cont.)

Follow-up to 3bfcfe82b9e7fe18cdbd3a06b219a8ce40188a23 #18085

Closes #18113

5 hours agocurl: make --retry-delay and --retry-max-time accept decimal seconds
Daniel Stenberg [Wed, 30 Jul 2025 22:02:25 +0000 (00:02 +0200)] 
curl: make --retry-delay and --retry-max-time accept decimal seconds

Like other time options already do.

Reported-by: Alice Lee Poetics
Fixes #18109
Closes #18111

13 hours agowindows: document toolchain support for some macros
Viktor Szakats [Tue, 29 Jul 2025 17:36:20 +0000 (19:36 +0200)] 
windows: document toolchain support for some macros

The oldest MS SDK I checked is 6.0A (VS2008). Versions are approximate
beyond 7.1A. I only have two Win10 SDKs to verify:
10.0.16299.0 (VS2017-15.4) and 10.0.22621.0 (VS2022).

Ref: https://en.wikipedia.org/wiki/Microsoft_Windows_SDK
Ref: https://developer.microsoft.com/windows/downloads/sdk-archive/index-legacy (recent versions mostly)

Closes #18085

13 hours agoschannel: assume `CERT_CHAIN_REVOCATION_CHECK_CHAIN`
Viktor Szakats [Wed, 30 Jul 2025 20:33:26 +0000 (22:33 +0200)] 
schannel: assume `CERT_CHAIN_REVOCATION_CHECK_CHAIN`

Always available in supported mingw-w64 and MSVC compilers, except
in UWP mode. For mingw32ce this macro is defined later in the code.

Also available in OpenWatcom 2.
https://github.com/open-watcom/open-watcom-v2/blob/ce6c37eb29f3fda95f9c4e8e37dee866b8c4e496/bld/w32api/include/winerror.mh

Closes #18108

13 hours agoGHA/distcheck: add more tarball builds
Viktor Szakats [Wed, 30 Jul 2025 11:50:38 +0000 (13:50 +0200)] 
GHA/distcheck: add more tarball builds

- add AM out-of-tree no perl job.
- add AM in-tree no perl job.
- make CM out-of-tree job use no perl.
- add CM in-tree no perl job.
- run `curl -V` after builds.
- show the number of `--manual` lines.
- set `--enable-werror` in autotools jobs.

Ref: https://github.com/curl/curl/issues/18088#issuecomment-3135112176

Closes #18104

15 hours agotest757: MIME parts reused as a child part, using data_cb
Daniel Stenberg [Wed, 30 Jul 2025 12:32:36 +0000 (14:32 +0200)] 
test757: MIME parts reused as a child part, using data_cb

An attempt to reproduce #18070. That turned out to not be a bug, but the
test is still a good one.

Based on test695

Closes #18101

15 hours agocurl: make the URL indexes 64 bit
Daniel Stenberg [Wed, 30 Jul 2025 09:20:45 +0000 (11:20 +0200)] 
curl: make the URL indexes 64 bit

Otherwise we could misbehave already at 2 billion URLs and we can't have
that. A few of the counters are already correctly using the right type.

Closes #18096

22 hours agowindows: drop `CRYPT_E_*` macro fallbacks, limit one to mingw32ce
Viktor Szakats [Tue, 29 Jul 2025 18:07:06 +0000 (20:07 +0200)] 
windows: drop `CRYPT_E_*` macro fallbacks, limit one to mingw32ce

They are defined by all mingw-w64 versions and all supported MSVC
versions (VS2008 and up).

Also by OpenWatcom 2:
https://github.com/open-watcom/open-watcom-v2/blob/ce6c37eb29f3fda95f9c4e8e37dee866b8c4e496/bld/w32api/include/winerror.mh

mingw32ce misses `CRYPT_E_NOT_IN_REVOCATION_DATABASE`.

Closes #18092

23 hours agotests: fix perl warnings in http2-server, http3-server
Viktor Szakats [Wed, 30 Jul 2025 12:11:05 +0000 (14:11 +0200)] 
tests: fix perl warnings in http2-server, http3-server

AM libressl heimdal:
```
Global symbol "$verbose" requires explicit package name (did you forget to declare "my $verbose"?) at tests/http2-server.pl line 52.
Global symbol "$certfile" requires explicit package name (did you forget to declare "my $certfile"?) at tests/http2-server.pl line 109.
Global symbol "$keyfile" requires explicit package name (did you forget to declare "my $keyfile"?) at tests/http2-server.pl line 110.
Execution of tests/http2-server.pl aborted due to compilation errors.
[...]
```
Ref: https://github.com/curl/curl/actions/runs/16622030370/job/47028537336?pr=18099#step:39:3148

Follow-up to 2ec54556d4e3f3ab551b5298adab0c703d85a463 #17877

Closes #18100

23 hours agotests: fix prechecks to call the bundle libtest tool
Viktor Szakats [Wed, 30 Jul 2025 11:15:20 +0000 (13:15 +0200)] 
tests: fix prechecks to call the bundle libtest tool

Some tests make a hard-coded call to the libtest binary in the precheck
step. With bundle builds the binary changed name and calling convention.
Before this patch these tests failed the pre-check and did not run for
the 5 affected tests: 518, 537, 678, 1517, 1960

Fixing, e.g.:
```
test 1517 SKIPPED: precheck command error
```
https://github.com/curl/curl/actions/runs/16611990422/job/46996698437?pr=18039#step:13:4832

It also fixes builds with a custom `CURL_DIRSUFFIX` set.

Follow-up to 2c27a67daa1b76859c18d63e4e1f528db05b5e13 #17590
Follow-up to 71cf0d1fca9e1f53524e1545ef0c08d174458d80 #14772

Closes #18099

25 hours agoschannel: drop fallbacks for 4 macros
Viktor Szakats [Wed, 30 Jul 2025 02:58:14 +0000 (04:58 +0200)] 
schannel: drop fallbacks for 4 macros

They are defined by all mingw-w64 versions and all supported MSVC
versions (SDK 7.1A+).

Also by OpenWatcom 2:
https://github.com/open-watcom/open-watcom-v2/blob/ce6c37eb29f3fda95f9c4e8e37dee866b8c4e496/bld/w32api/include/wincrypt.mh

These aren't defined by mingw32ce. And likely defined by MS WinCE SDK,
but curl code doesn't use them in WinCE builds.

Closes #18093

25 hours agoschannel: drop fallbacks for unused `BCRYPT_*` macros
Viktor Szakats [Tue, 29 Jul 2025 17:49:08 +0000 (19:49 +0200)] 
schannel: drop fallbacks for unused `BCRYPT_*` macros

In case they are used again in the future, the fallbacks are not
necessary for the supported mingw-w64 (v3+) and MSVC versions.

Follow-up to 6238888ca7f0e473e9713a7c372fac8f025db569 #15621

Closes #18091

26 hours agoschannel: fix recent update for mingw32ce
Viktor Szakats [Wed, 30 Jul 2025 09:23:57 +0000 (11:23 +0200)] 
schannel: fix recent update for mingw32ce

Follow-up to 952c929bdf70645ee263c45a19518ae976a0292d #18084
Closes #18097

26 hours agobuild: fix mingw-w64 version guard for mingw32ce
Viktor Szakats [Wed, 30 Jul 2025 09:15:08 +0000 (11:15 +0200)] 
build: fix mingw-w64 version guard for mingw32ce

Follow-up to a28f5f68b965119d9dd1ab6c2a2ccc66c6ed5d1f #18010
Closes #18095

26 hours agoschannel: use if(result) like the code style says
Daniel Stenberg [Wed, 30 Jul 2025 08:38:08 +0000 (10:38 +0200)] 
schannel: use if(result) like the code style says

instead of comparing != CURLE_OK

Closes #18094

27 hours agoconnectdata: remove primary+secondary ip_quadruple
Stefan Eissing [Fri, 18 Jul 2025 11:18:44 +0000 (13:18 +0200)] 
connectdata: remove primary+secondary ip_quadruple

Since the content varies during connection setup and while doing it
(eyeballing), remove these strcut from `connectdata` and replace use
with querying the connection filters. Those keep that information
already.

Change the info logging of established connections to also give the
local address and port.

Closes #17960

28 hours agosmtp: allow suffix behind a mail address for RFC 3461
Dominik Tomecki [Wed, 30 Jul 2025 07:48:13 +0000 (09:48 +0200)] 
smtp: allow suffix behind a mail address for RFC 3461

Verified in test 3215

Closes #16643

28 hours agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 30 Jul 2025 07:31:18 +0000 (09:31 +0200)] 
RELEASE-NOTES: synced

29 hours agotop-complexity: set cutoff level to 80
Daniel Stenberg [Tue, 29 Jul 2025 14:17:42 +0000 (16:17 +0200)] 
top-complexity: set cutoff level to 80

Closes #18080

29 hours agoopenssl: split cert_stuff into smaller sub functions
Daniel Stenberg [Tue, 29 Jul 2025 14:47:12 +0000 (16:47 +0200)] 
openssl: split cert_stuff into smaller sub functions

- rename it client_cert
- make it return CURLcode

Closes #18081

29 hours agounit-tests: build the unitprotos.h from here
Daniel Stenberg [Tue, 29 Jul 2025 21:14:41 +0000 (23:14 +0200)] 
unit-tests: build the unitprotos.h from here

Make the bundle depend on the header in the lib dir and built it now if
not present.

Reported-by: Todd Gamblin
Fixes #18088
Closes #18089

34 hours agotidy-up: whitespace, indent, `#if 0`
Viktor Szakats [Fri, 25 Jul 2025 14:23:15 +0000 (16:23 +0200)] 
tidy-up: whitespace, indent, `#if 0`

Closes #18090

35 hours agocmake: defer building `unitprotos.h` till a test target needs it
Viktor Szakats [Tue, 29 Jul 2025 19:15:02 +0000 (21:15 +0200)] 
cmake: defer building `unitprotos.h` till a test target needs it

Follow-up to c9bb9cd165c1b25c2fe005befdcfe479fc9b68e1 #17750
Ref: https://github.com/curl/curl/pull/17750#issuecomment-3133749477
Closes #18086

35 hours agotests: merge clients into libtests, drop duplicate code
Viktor Szakats [Tue, 29 Jul 2025 07:53:14 +0000 (09:53 +0200)] 
tests: merge clients into libtests, drop duplicate code

libtests and clients were built the same way after recent overhauls.
libtests are used by runtests, clients by pytests.

Merge clients into libtests, aligning their entry function signature,
dropping common utility functions, and simplifying the build.

Note: After this patch `CURLDEBUG` applies to cli tests, when enabled.

Also:
- lib552: drop local copy-paste debug callback in favor of testtrace.
- lib552: drop local copy-paste dump function in favor of testtrace.
- clients: use `long` for HTTP version, drop casts.
- clients: replace local dump function in favor of testrace clone.
- sync cli test entry function prototype with libtests'.
- h2_serverpush: replace local trace callback with testtrace.
- de-duplicate 3 websocket close, ping, ping, functions. Kept the pong
  iteration from `ws_pingpong`. Note: the pong clone in `lib2304` was
  returning an error when `curl_ws_recv()` returned non-zero and
  the payload matched the expected one anyway. After this patch, this
  case returns success, as it does in `ws_pingpong`.
  `lib2304` keeps passing, but I'm not sure if the previous behavior
  was intentional.
- display full value in websocket close, ping, pong, drop casts.

Closes #18079

39 hours agoschannel: drop old-mingw special case
Viktor Szakats [Tue, 29 Jul 2025 17:11:35 +0000 (19:11 +0200)] 
schannel: drop old-mingw special case

mingw-w64 always defines `CERT_CHAIN_REVOCATION_CHECK_CHAIN`.

Also confirmed in CI.

Follow-up to 38029101e2d78ba125732b3bab6ec267b80a0e72 #11625
Ref: a28f5f68b965119d9dd1ab6c2a2ccc66c6ed5d1f #18010
Closes #18084

39 hours agoGHA/windows: enable HTTP/3 in an MSYS2 mingw-w64 OpenSSL job
Viktor Szakats [Tue, 29 Jul 2025 19:31:40 +0000 (21:31 +0200)] 
GHA/windows: enable HTTP/3 in an MSYS2 mingw-w64 OpenSSL job

Closes #18087

45 hours agoconfig2setopts: set more options unconditionally
Daniel Stenberg [Tue, 29 Jul 2025 12:19:56 +0000 (14:19 +0200)] 
config2setopts: set more options unconditionally

This function would set some options to NULL and some not. This change
now more consistently set the value, even if NULL/0/default.

Also removes the 'new in [version]' comments as they were not
consistently used and as they have moved around probably aren't correct
anymore.

Closes #18078

46 hours agotool_operate: simplify single_transfer
Daniel Stenberg [Tue, 29 Jul 2025 11:29:25 +0000 (13:29 +0200)] 
tool_operate: simplify single_transfer

- let the caller do the cleanup on fail
- avoid gotos and use direct returns more
- use while() loop

Closes #18077

47 hours agopytest: use dante-server in CI
Stefan Eissing [Tue, 29 Jul 2025 08:15:43 +0000 (10:15 +0200)] 
pytest: use dante-server in CI

- add startup check for 'danted' to avoid fails on low cpu
- rename 'sockd' to 'danted' everywhere to clarify what we use
- add proper defaults for 'danted' for debian
- install 'dante-server' in pytest ci runs

Closes #18075

2 days agotests: constify command-line arguments
Viktor Szakats [Tue, 29 Jul 2025 09:27:48 +0000 (11:27 +0200)] 
tests: constify command-line arguments

For libtests, tunits, units.

Also:
- lib3033: tidy up headers.
- lib/netrc: constify an arg in `Curl_parsenetrc()`.

Closes #18076

2 days agosetopt: refactor out the booleans from setopt_long to setopt_bool
Daniel Stenberg [Tue, 29 Jul 2025 09:22:12 +0000 (11:22 +0200)] 
setopt: refactor out the booleans from setopt_long to setopt_bool

- add a message if a boolean is set to something not 1 or 0 (as it might be
  made to mean something else in a future)

- use 's->' in all setopt_* functions

Closes #17887

2 days agomulti: add CURLMOPT_NETWORK_CHANGED to signal network changed
Stefan Eissing [Fri, 13 Jun 2025 10:38:44 +0000 (12:38 +0200)] 
multi: add CURLMOPT_NETWORK_CHANGED to signal network changed

New multi option CURLMOPT_NETWORK_CHANGED with a long bitmask value:

- CURLM_NWCOPT_CLEAR_CONNS: do not reuse existing connections, close all
  idle connections.

- CURLM_NWCOPT_CLEAR_DNS: clear the multi's DNS cache.

All other bits reserved for future extensions.

Fixes #17225
Reported-by: ウさん
Closes #17613

2 days agodelta: fix counters
Daniel Stenberg [Tue, 29 Jul 2025 07:27:44 +0000 (09:27 +0200)] 
delta: fix counters

Follow-up to b1df1d38afce5b2d9

Closes #18072

2 days agoparallel-max: bump the max value to 65535
Daniel Stenberg [Mon, 28 Jul 2025 21:46:01 +0000 (23:46 +0200)] 
parallel-max: bump the max value to 65535

When doing HTTP/2 and HTTP/3, it is possible to achieve quite a massive
parallelism so limiting this to 300 seems restrictive.

With other protocols, going beyond 300-400 might not be recommended but
curl does not have to enforce the limit.

Closes #18068

2 days agobuild: allow libtests/clients to use libcurl dependencies directly
Viktor Szakats [Mon, 28 Jul 2025 22:57:55 +0000 (00:57 +0200)] 
build: allow libtests/clients to use libcurl dependencies directly

For libcurl API tests that need interacting directly with TLS-backends.

Partial revert of 58b9c6134bf8632442aa7d703aa8c7061604785e #17696 for
cmake, and implementing the same for autotools.

Ref: #18066
Closes #18069

2 days agowindows: assume `ADDRESS_FAMILY`, drop feature checks
Viktor Szakats [Fri, 25 Jul 2025 13:48:35 +0000 (15:48 +0200)] 
windows: assume `ADDRESS_FAMILY`, drop feature checks

Early mingw-w64 releases missed it, but by requiring v3.0, this is no
longer an issue. Supported Visual Studio SDKs also offer it.

Follow-up to a28f5f68b965119d9dd1ab6c2a2ccc66c6ed5d1f #18010
Closes #18057

2 days agoservers: convert two macros to scoped static const strings
Viktor Szakats [Thu, 24 Jul 2025 00:34:39 +0000 (02:34 +0200)] 
servers: convert two macros to scoped static const strings

Closes #18067

2 days agomulti: process pending, one by one
Stefan Eissing [Mon, 28 Jul 2025 09:37:26 +0000 (11:37 +0200)] 
multi: process pending, one by one

Before curl 8.14.0, when pending was a list, `process_pending_handles()`
move a single transfer to processing. In 8.14.0 we changed that to move
all pending transfers to processing. This lead to unwanted performance
drops as reported in #18017.

Restore the old behaviour.

While the old behviour is better, the overall handling of "pending"
transfers is not optimal, since we do not keep track of the "condition"
a pending transfer is waiting on. This means, when moving a single,
pending transfer, we might move one that still cannot be processed while
another that could is kept pending.

Since we trigger `process_pending_handles()` from various changes, the
stalled pending will eventually make it to the processing queue, but
this is not optimal.

Fixes #18017
Reported-by: rm-rmonaghan on github
Closes #18056

2 days agows: avoid NULL pointer deref in curl_ws_recv
Daniel Stenberg [Mon, 28 Jul 2025 13:54:59 +0000 (15:54 +0200)] 
ws: avoid NULL pointer deref in curl_ws_recv

If a NULL easy handle is passed in.

Pointed out by Coverity

Follow-up to 960fb4924523a853d5de8f30

Closes #18065

2 days agolibssh: Use sftp_aio instead of sftp_async for sftp_recv
Eshan Kelkar [Fri, 23 May 2025 15:23:17 +0000 (20:53 +0530)] 
libssh: Use sftp_aio instead of sftp_async for sftp_recv

This commit replaces the usage of the old deprecated sftp_async API with
the new sftp_aio API for remote file reading.

Signed-off-by: Eshan Kelkar <eshankelkar@galorithm.com>
Closes #17440

2 days agomemory: make function overrides work reliably in unity builds
Viktor Szakats [Sat, 5 Jul 2025 09:14:24 +0000 (11:14 +0200)] 
memory: make function overrides work reliably in unity builds

Fixing:
- HTTPS-RR builds with c-ares and Linux MUSL.
- curl-for-win minimal builds with Linux MUSL.

It should fix all other kinds of entaglement between curl's redefintions
of system symbols and system (or 3rd-party) headers sensitive to that.

It also syncs memory override behavior between unity & non-unity builds,
thus reducing build variations.

The idea is to define and declare everything once in `curl_setup.h`,
without overriding any system symbols with curl ones yet. Then, like
before this patch, override them, if necessary, in each source file via
`curl_memory.h` and `memdebug.h`, after including system headers.
To ensure a clean slate with no overrides at the beginning of each
source file, reset all of them unconditionally at the end of
`curl_setup.h`, by including `curl_mem_undef.h`. (This assumes
`curl_setup.h` is always included first, which is already the case
throughout the codebase.)

`curl_mem_undef.h` can also be included explicitly wherever overrides
are causing problems. E.g. in tests which use unity-style builds and
a previously included `curl_memory.h`/`memdebug.h` can be spilling into
other source files.

The simplified role of the two override headers:
- `curl_memory.h`: overrides system memory allocator functions to
  libcurl ones, when memory tracing (aka `CURLDEBUG`) is disabled.
- `memdebug.h`: overrides system memory allocator and some other
  functions to curl debug functions, when memory tracing is enabled.

Changed made in this patch, step-by-step:
- curl_memory.h: move allocator typedefs and protos to `curl_setup.h`.
- memdebug.h: move `ALLOC_*` macros to `curl_setup.h`.
- memdebug.h: move allocator protos to `curl_setup.h`.
- memdebug.h: move `Curl_safefree()` macro to `curl_setup.h`.
  (it's a regular macro, with a one-time, global, definition.)
- curl_memory.h: move system symbol undefs to a new, separate header:
  `curl_mem_undef.h`.
- curl_setup.h: include `curl_mem_undef.h` at the end, unconditionally,
  to reset system symbol macros after each inclusion.
- handle `sclose()` and `fake_sclose()` in `curl_setup.h`. They are not
  system symbols, a one-time definition does the job.

Also:
- GHA/linux: enable unity mode for the HTTP-RR c-ares MUSL job.
  Follow-up to 17ab4d62e62bd3bfb6dbf6cb51460629f21c03e7 #16413

That said, I'd still find it better to avoid redefining system macros.
To communicate clearly the fact that they are not the original system
calls and they do behave differently. And, it would allow dropping the
undef/redef dance in each source file, and maintaining the logic with
it. The "last #include files should be in this order" comments in each
source would also become unnecessary. Also the trick of using
`(func)` (or interim macros) to call the non-overridden function where
required. This method works for printf and most everything else already.
For `_tcsdup`, socket and fopen functions this could work without
disturbing the codebase much.

Ref: #16428 (clean reboot of)

Closes #17827

2 days agoCURLOPT: bump `CURLHEADER_*` macros to `long`, drop casts
Viktor Szakats [Mon, 28 Jul 2025 09:10:34 +0000 (11:10 +0200)] 
CURLOPT: bump `CURLHEADER_*` macros to `long`, drop casts

This patch bumps the size of these macros from `int` to `long`, while
keeping their actual values the same. It may cause incompatibilities in
user code, requiring the bump of holder variables and/or adding casts:

- CURLHEADER_SEPARATE
- CURLHEADER_UNIFIED

Also:
- keep existing cast within the documentation to make sure it applies
  to older curl versions as well.

Closes #18055

2 days agoCURLOPT: bump `CURLPROXY_*` enums to `long`, drop casts
Viktor Szakats [Mon, 28 Jul 2025 08:59:48 +0000 (10:59 +0200)] 
CURLOPT: bump `CURLPROXY_*` enums to `long`, drop casts

This patch bumps the size of these macros from `int` to `long`, while
keeping their actual values the same. It may cause incompatibilities in
user code, requiring the bump of holder variables and/or adding casts:

- CURLPROXY_HTTP
- CURLPROXY_HTTP_1_0
- CURLPROXY_HTTPS
- CURLPROXY_HTTPS2
- CURLPROXY_SOCKS4
- CURLPROXY_SOCKS4A
- CURLPROXY_SOCKS5
- CURLPROXY_SOCKS5_HOSTNAME

Also:
- keep existing cast within the documentation to make sure it applies
  to older curl versions as well.

Closes #18054

2 days agoCURLOPT: bump `CURLALTSVC_*` macros to `long`
Viktor Szakats [Mon, 28 Jul 2025 12:56:18 +0000 (14:56 +0200)] 
CURLOPT: bump `CURLALTSVC_*` macros to `long`

This patch bumps the size of these macros from `int` to `long`, while
keeping their actual values the same. It may cause incompatibilities in
user code, requiring the bump of holder variables and/or adding casts:

- CURLALTSVC_H1
- CURLALTSVC_H2
- CURLALTSVC_H3
- CURLALTSVC_READONLYFILE

Also:
- keep existing cast within the documentation to make sure it applies
  to older curl versions as well.

Closes #18063

2 days agolib1560: replace an `int` with `bool`
Viktor Szakats [Mon, 28 Jul 2025 13:08:03 +0000 (15:08 +0200)] 
lib1560: replace an `int` with `bool`

Follow-up to 7d1ca2e7e1a3b9d3ba70f587f6bc5e83f905afd5 #17933

Closes #18064

2 days agocontrithanks: fix for BSD `sed` tool
Viktor Szakats [Mon, 28 Jul 2025 12:45:57 +0000 (14:45 +0200)] 
contrithanks: fix for BSD `sed` tool

Fixing on macOS, and possibly other BSDs:
```
sed: 83: ./docs/THANKS-filter: RE error: illegal byte sequence
```
Where line 83 contains `\xED`.

Switch to raw encoding to avoid `sed` evaluating the stream of bytes.

Ref: #18061

Closes #18062

2 days agodelta: fix warnings, fix for non-GNU `date` tool
Viktor Szakats [Mon, 28 Jul 2025 12:21:41 +0000 (14:21 +0200)] 
delta: fix warnings, fix for non-GNU `date` tool

It makes the script run on BSD-like envs.

Follow-up to f63bdea79028c30780b3450e5d444c84b63a5434 #18058
Follow-up to 2ec54556d4e3f3ab551b5298adab0c703d85a463 #17877

Closes #18061

2 days agolib517: use `LL` 64-bit literals & re-enable a test case (`time_t`)
Viktor Szakats [Sat, 26 Jul 2025 13:37:53 +0000 (15:37 +0200)] 
lib517: use `LL` 64-bit literals & re-enable a test case (`time_t`)

Suffix two 64-bit `time_t` test literals with `LL` to make them compile
with mingw-w64 x86_64 in C89 (the default) mode. Possibly other old gcc
compilers are affected (e.g. mips gcc 4.9.4, power gcc 15.1.0), but
could not pinpoint the exact rules. This also fixes a compiler warning
and test failure with MSVC, allowing to re-enable a disabled test case.

`LL` is not C89, but used in the code before this patch, which tells
it's safe to use.

Also display expected / actual timestamp values as `curl_off_t` instead
of `long`, making them work with 64-bit timestamps.

This was triggered by this issue seen while testing mingw-w64 gcc 4.8.1:
```
tests/libtest/lib517.c:147:5: error: this decimal constant is unsigned only in ISO C90
     {"Sun, 06 Nov 2044 08:49:37 GMT", (time_t) 2362034977 },
     ^
```
Ref: https://github.com/curl/curl/actions/runs/16540378828/job/46780712313?pr=18010#step:12:32

Closes #18032

2 days agocurl: add long option '--out-null'
Stefan Eissing [Wed, 2 Jul 2025 07:43:13 +0000 (09:43 +0200)] 
curl: add long option '--out-null'

Add a new commandline option --out-null that discards all
response bytes into the void. Replaces non-portable use of
'-o /dev/null' with more efficiency.

Feature added in 8.16.0

Closes #17800

2 days ago_PROTOCOLS.md: mention file:// is only for absolute paths
Daniel Stenberg [Mon, 28 Jul 2025 11:35:18 +0000 (13:35 +0200)] 
_PROTOCOLS.md: mention file:// is only for absolute paths

... when using curl.

Asked-by: Paul Gilmartin
URL: https://curl.se/mail/archive-2025-07/0018.html
Closes #18060

3 days agodocs/cmdline-opts: the auth types are not mutually exclusive
Daniel Stenberg [Mon, 28 Jul 2025 11:23:35 +0000 (13:23 +0200)] 
docs/cmdline-opts: the auth types are not mutually exclusive

They are booleans

URL: https://curl.se/mail/archive-2025-07/0019.html
Closes #18059

3 days agoalpn: query filter
Stefan Eissing [Thu, 17 Jul 2025 09:53:31 +0000 (11:53 +0200)] 
alpn: query filter

Add a connection filter query to obtained the negotiated ALPN
protocol to check in setup/protocols how the connection needs
to behave.

Remove the members `alpn` and `proxy_alpn` from `connectdata`.

Closes #17947

3 days agodelta: drop the warnings+strict
Daniel Stenberg [Mon, 28 Jul 2025 11:07:58 +0000 (13:07 +0200)] 
delta: drop the warnings+strict

They really don't do much good here and I rather do this than adding
'my' on 40+ lines.

Follow-up from 2ec54556d4e3f3ab55

Closes #18058

3 days agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 28 Jul 2025 11:04:36 +0000 (13:04 +0200)] 
RELEASE-NOTES: synced

3 days agopytest: relax error check on test_07_22
Stefan Eissing [Mon, 28 Jul 2025 08:03:49 +0000 (10:03 +0200)] 
pytest: relax error check on test_07_22

Add code 56 to the list of accepted errors, as it varies
with backend and speediness of test run.

Closes #18050

3 days agomemanalyze: fix warnings
Viktor Szakats [Mon, 28 Jul 2025 07:49:21 +0000 (09:49 +0200)] 
memanalyze: fix warnings

Also fix possibly missing reallocated memory from 'Total allocated':
```
Use of uninitialized value $size in addition (+) at tests/memanalyze.pl line 240, <$fileh> line 4.
```
Ref: https://github.com/curl/curl/actions/runs/16565283280/job/46843800711?pr=18049#step:39:3834

Ref: https://github.com/curl/curl/actions/runs/16556860012/job/46819517495?pr=17927#step:39:156
Follow-up to fc98a630cfb27dd097b31b57aa59fb578b390063 #18048
Follow-up to 2ec54556d4e3f3ab551b5298adab0c703d85a463 #17877
Closes #18049

3 days agobuild: bump minimum required mingw-w64 to v3.0 (from v1.0)
Viktor Szakats [Thu, 24 Jul 2025 00:57:49 +0000 (02:57 +0200)] 
build: bump minimum required mingw-w64 to v3.0 (from v1.0)

mingw-w64 3.0 was released on 2013-09-20. Offered by Debian jessie.

1.0 and 2.0 were released in 2011. It seems unlikely that many people
use them. The oldest downloadable toolchain (that I know of) comes with
3.0. Due to this, older versions weren't CI tested, and probably seldom
tested elsewhere. The last bugfix update for both 1.0 and 2.0 was
released in 2015.

curl can now assume availability of these 3.0 features/fixes:
- 64-bit file offsets.
- `ADDRESS_FAMILY` type.
- `__MINGW_PRINTF_FORMAT` macro. (in public curl headers)

Public curl headers keep supporting older mingw-w64 versions.

Fixes #17984
Closes #18010

3 days agobuild: tidy up compiler definition for tests
Viktor Szakats [Fri, 27 Jun 2025 22:01:49 +0000 (00:01 +0200)] 
build: tidy up compiler definition for tests

- tests: merge cmake commands.
- tests: use `target_compile_definitions()`.
- tests/server: use generator expression for platform-specific macro.
- tests/unit: sync `Makefile.am` comment with cmake.
- tests/unit: merge two `AM_CPPFLAGS` lines to keep synced with cmake.
- tests: move macro definitions to `first.h` headers from build level.
  `CURL_NO_OLDIES`, `CURL_DISABLE_DEPRECATION`, `WITHOUT_LIBCURL`,
  `CURL_STATICLIB` (for servers).
  To share more logic.
  Pass `CURL_STATICLIB` in server on all platforms for simplicity.
  (On non-Windows, it's a no-op. It's already done like this with curlu
  and libcurltool.)

Also for lib:
- lib: merge commands.
- lib: sync macro order with tests (also in `Makefile.am`).

Closes #17768

3 days agocmake: omit linking duplicate/unnecessary libs to tests & examples
Viktor Szakats [Sat, 21 Jun 2025 18:05:39 +0000 (20:05 +0200)] 
cmake: omit linking duplicate/unnecessary libs to tests & examples

Before this patch we explicitly linked the full list of libcurl
dependency libs to tests and examples via `CURL_LIBS`. This was
redundant, because test and example code do not directly use these
dependency libs and for indirect use they are implicitly passed
via libcurl as needed. After this patch, tests and examples only link
explicitly to system libs (e.g. socket).

Also bringing it closer to how `./configure` does this.

Borrow the variable name `CURL_NETWORK_AND_TIME_LIBS` from
`./configure`. However, its content is not exactly the same. With cmake
it also holds `pthread`, but doesn't hold AmiSSL.

Closes #17696

3 days agobuild: fix disable-verbose
Stefan Eissing [Mon, 28 Jul 2025 08:45:18 +0000 (10:45 +0200)] 
build: fix disable-verbose

Fix compile error when building with `--disable-verbose`.

Adjust pytest to skip when curl is not a debug build but needs
traces.

Follow-up to b453a447ce4e6aa2a352b196

Closes #18053

3 days agomulti: fix assert in multi_getsock()
Stefan Eissing [Mon, 28 Jul 2025 08:10:39 +0000 (10:10 +0200)] 
multi: fix assert in multi_getsock()

Now that multi keeps the "dirty" bitset, the detection of possibly
stalling transfers needs to adapt. Before dirty, transfers needed
to expose a socket to poll or a timer to wait for.

Dirty transfer might no longer have a timer, but will run, so do
not need to report a socket. Adjust the assert condition.

Fixes #18046
Reported-by: Viktor Szakats
Closes #18051

3 days agoCURLOPT: bump `CURLFTP*` enums to `long`, drop casts
Viktor Szakats [Tue, 1 Jul 2025 15:15:45 +0000 (17:15 +0200)] 
CURLOPT: bump `CURLFTP*` enums to `long`, drop casts

This patch bumps the size of these constants from `int` to `long`, while
keeping their actual values the same. It may cause incompatibilities in
user code, requiring the bump of holder variables and/or adding casts:

- CURLFTP_CREATE_DIR
- CURLFTP_CREATE_DIR_NONE
- CURLFTP_CREATE_DIR_RETRY
- CURLFTPAUTH_DEFAULT
- CURLFTPAUTH_SSL
- CURLFTPAUTH_TLS
- CURLFTPMETHOD_DEFAULT
- CURLFTPMETHOD_MULTICWD
- CURLFTPMETHOD_NOCWD
- CURLFTPMETHOD_SINGLECWD
- CURLFTPSSL_CCC_ACTIVE
- CURLFTPSSL_CCC_NONE
- CURLFTPSSL_CCC_PASSIVE

Also:
- keep existing casts within the documentation to make sure it applies
  to older curl versions as well.

Closes #17797

3 days agoCURLOPT: drop redundant `long` casts
Viktor Szakats [Tue, 1 Jul 2025 09:31:01 +0000 (11:31 +0200)] 
CURLOPT: drop redundant `long` casts

Also:
- CURLOPT_HSTS_CTRL.md: sync macro definitions with `curl/curl.h`.
  Perhaps it'd be better to delete copies like this?
- keep existing casts within the documentation to make sure it applies
  to older curl versions as well.
- CURLOPT_IPRESOLVE.md: re-add a long cast to man page, for consistency
  with the above.

Closes #17791

3 days agomemanalyze.pl: remove strict+warnings
Daniel Stenberg [Mon, 28 Jul 2025 06:59:26 +0000 (08:59 +0200)] 
memanalyze.pl: remove strict+warnings

These introduced *hundreds* of lines of output in a single test run.

I think this also shows strict+warnigns in perl in their most annoying
way.

Follow-up to 2ec54556d4

Closes #18048

3 days agoDEPRECATE.md: remove leftover "nothing"
Daniel Stenberg [Sun, 27 Jul 2025 22:11:51 +0000 (00:11 +0200)] 
DEPRECATE.md: remove leftover "nothing"

It was just wrong and confusing

Closes #18044

3 days agoconfig-win32.h: do not use winsock2 `inet_ntop()`/`inet_pton()`
Viktor Szakats [Sun, 27 Jul 2025 22:22:36 +0000 (00:22 +0200)] 
config-win32.h: do not use winsock2 `inet_ntop()`/`inet_pton()`

Syncing winbuild and VS Project File builds with the same fix applied
to cmake and autotools builds earlier.

Also fixes these warnings seen in the VisualStudioSolution (VS2013) job
on AppVeyor CI:
```
lib\hostip.c(148): warning C4090: 'function' : different 'const' qualifiers
lib\hostip.c(155): warning C4090: 'function' : different 'const' qualifiers
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/52470650/job/gslnjrdxnd8b9mtv#L180

Went unnoticed because warnings are not promoted to error in these builds.
winbuild CI jobs did not hit this warning for some reason.

Follow-up to 8537a5b0bcf4565551774c2b2375c49767e405a7 #16577
Closes #18045

3 days agoinet_pton, inet_ntop: drop declarations when unused
Viktor Szakats [Sun, 27 Jul 2025 22:03:03 +0000 (00:03 +0200)] 
inet_pton, inet_ntop: drop declarations when unused

Do not declare local inet_pton/inet_ntop implementations when they are
not used. In this case the same symbol is defined as a macro and mapped
to the system implementation.

Syncing this with their definitions.

Closes #18043

3 days agoscripts: fix two Perl uninitialized value warnings
Viktor Szakats [Sun, 27 Jul 2025 21:36:33 +0000 (23:36 +0200)] 
scripts: fix two Perl uninitialized value warnings

```
Use of uninitialized value $errors in exit at .github/scripts/badwords.pl line 87.
Use of uninitialized value $o in concatenation (.) or string at ../.github/scripts/randcurl.pl line 99.
```

Follow-up to 2ec54556d4e3f3ab551b5298adab0c703d85a463 #17877
Cherry-picked from #18042
Closes #18047

3 days agobuild: extend GNU C guards to clang where applicable, fix fallouts
Viktor Szakats [Thu, 17 Jul 2025 17:01:42 +0000 (19:01 +0200)] 
build: extend GNU C guards to clang where applicable, fix fallouts

Some GNU C version guards implicitly include the clang compiler, because
clang reports itself as GCC 4.2.1.

This implicit inclusion doesn't happen if the guard requires a GCC
version above 4.2.1.

Fix two such guards to explicitly include clang where it does support
the guarded feature:

- curl/curl.h: use `typecheck-gcc.h` with clang.
  llvm clang v14+ supports this. The corresponding Apple clang version
  is also v14.
  Ref: https://en.wikipedia.org/wiki/Xcode#Toolchain_versions
  Apple clang v14 tested OK in CI:
  https://github.com/curl/curl/actions/runs/16353901480/job/46207437204

- tool_urlglib: use `__builtin_mul_overflow()` with clang v8+.
  llvm clang v3.8+ supports this, but to accommodate for Apple clang,
  start with v8, the Apple version having the mainline v3.8 feature set.

Also fix compile warnings triggered by the above:
- lib1912: fix duplicate `;`:
  ```
  tests/libtest/lib1912.c:44:57: error: empty expression statement has no effect; remove unnecessary ';' to silence this warning [-Werror,-Wextra-semi-stmt]
   44 |       print_err(o->name, "CURLOT_LONG or CURLOT_VALUES");
      |                                                         ^
  [...]
  ```
  Ref: https://github.com/curl/curl/actions/runs/16351302841/job/46198524880?pr=17955#step:12:61

- lib2032: silence typcheck warning with a cast:
  ```
  tests/libtest/lib2032.c:145:29: error: sizeof on pointer operation will return size of 'CURL **' (aka 'void **') instead of 'CURL *[3]' (aka 'void *[3]') [-Werror,-Wsizeof-array-decay]
    145 |                   ntlm_easy + num_handles);
        |                   ~~~~~~~~~ ^
  ```
  Ref: https://github.com/curl/curl/actions/runs/16351302841/job/46198524880?pr=17955#step:12:86

Closes #17955

3 days agoconnection: terminate after goaway
Stefan Eissing [Thu, 10 Jul 2025 10:16:40 +0000 (12:16 +0200)] 
connection: terminate after goaway

When a multiplex connection (h2/h3) is shutdown by the server, the
reported number of parallel transfers allowed drops to 0.

Determine that when the last transfer is done and terminate the
connection instead of keeping it in the cache.

We detect the drop to 0 also when we try to reuse such a connection, but
if we know this at the time the last transfer is done, we better
terminate it right away.

Have a consistent trace logging to this with the connections current
hostname and port. Adjust test expectations to carry port numbers.

Closes #17884

3 days agoscripts: enable strict warnings in Perl where missing, fix fallouts
Viktor Szakats [Wed, 9 Jul 2025 19:18:29 +0000 (21:18 +0200)] 
scripts: enable strict warnings in Perl where missing, fix fallouts

- add 'use warnings' and 'use strict' where missing from Perl scripts.
- fix 'Use of uninitialized value'.
- fix missing declarations.
- test1140.pl: fix 'Possible precedence issue with control flow operator'.
- fix other misc issues.

Most actual errors found during this PR were fixed and merged via
separate PRs.

Likely there are remaining warnings not found and fixed in this PR.

Closes #17877

3 days agotidy-up: prefer `ifdef`/`ifndef` for single checks
Viktor Szakats [Fri, 25 Jul 2025 12:31:16 +0000 (14:31 +0200)] 
tidy-up: prefer `ifdef`/`ifndef` for single checks

Closes #18018

3 days agotidy-up: move literal to the right side of comparisons
Viktor Szakats [Tue, 8 Jul 2025 12:10:35 +0000 (14:10 +0200)] 
tidy-up: move literal to the right side of comparisons

Closes #17876

3 days agodoh: rename symbols to avoid collision with mingw-w64 headers
Viktor Szakats [Sun, 27 Jul 2025 13:09:08 +0000 (15:09 +0200)] 
doh: rename symbols to avoid collision with mingw-w64 headers

Collision happens when building with mingw-w64 v3 or v2 while targeting
Vista or newer. `iphlpapi.h` includes `windns.h` in this case, which
defines macros named `DNS_TYPE_*`, colliding with curl doh enums.

The issue was fixed in mingw-w64 v4:
https://github.com/mirror/mingw-w64/commit/ea95d55e3387353e453d6ae8fc5cb8f7503947c2

Fixes:
```
lib/doh.h:54:3: error: expected identifier before numeric constant
   DNS_TYPE_A = 1,
   ^
```
Ref: https://github.com/curl/curl/actions/runs/16551209676/job/46806303365?pr=18009#step:10:17

This workaround seems harmless and generally good practice, but
another option is to require mingw-w64 v4.

Ref: #18009
Closes #18041

3 days agomulti: replace remaining EXPIRE_RUN_NOW
Stefan Eissing [Thu, 10 Jul 2025 08:55:43 +0000 (10:55 +0200)] 
multi: replace remaining EXPIRE_RUN_NOW

Remove EXPIRE_RUN_NOW completely. Replace the remaining use of
EXPIRE_RUN_NOW with marking transfers as dirty.

Closes #17883

3 days agomulti: don't insert a node into the splay tree twice
David Zhuang [Wed, 23 Jul 2025 10:18:37 +0000 (03:18 -0700)] 
multi: don't insert a node into the splay tree twice

Closes #18005

3 days agotool_getparam: add support for `--longopt=value`
Daniel Stenberg [Mon, 30 Jun 2025 21:53:29 +0000 (23:53 +0200)] 
tool_getparam: add support for `--longopt=value`

If the long option name ends with an equals sign (`=`), the argument is
the text following on its right side.

This makes the command line parser accept this common style in addition
to the existing way to accept option arguments more similar to how other
command line tools do.

Example: `curl --user-agent=curl-2000 https://example.com/`

Change a few existing tests to use this syntax: 206, 1333, 1335, 1442

Closes #17789

3 days agonetrc: use the NETRC environment variable (first) if set
Daniel Stenberg [Sun, 22 Jun 2025 22:09:18 +0000 (00:09 +0200)] 
netrc: use the NETRC environment variable (first) if set

Add test 755 to verify.

Proposed-by: Berthin Torres Callañaupa
URL: https://curl.se/mail/lib-2025-06/0015.html

Closes #17712

3 days agotls: make default TLS version be minimum 1.2
Daniel Stenberg [Fri, 11 Jul 2025 06:14:42 +0000 (08:14 +0200)] 
tls: make default TLS version be minimum 1.2

This still allows users to explictily ask for 1.0 or 1.1 as the minimum
version. If the TLS library allows it.

Starting with this change, the CURL_SSLVERSION_DEFAULT value is no
longer used as minimum version when the TLS backend are called.

This also makes curl set the minimum version to 1.2 independently of
libcurl for the rare case where a newer curl tool would use an older
libcurl.

URL: https://curl.se/mail/lib-2025-07/0007.html
Assisted-by: Stefan Eissing
Closes #17894

3 days agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 27 Jul 2025 16:03:13 +0000 (18:03 +0200)] 
RELEASE-NOTES: synced

Working towards 8.16.0 now

3 days agovquic: drop msh3
Daniel Stenberg [Tue, 24 Jun 2025 06:34:58 +0000 (08:34 +0200)] 
vquic: drop msh3

It has never been properly functional in curl while there are several
alternatives that are.

Closes #17729

4 days agocurl_addrinfo: drop workaround for old-mingw
Viktor Szakats [Sun, 27 Jul 2025 08:57:07 +0000 (10:57 +0200)] 
curl_addrinfo: drop workaround for old-mingw

Follow-up to a3585c9576abccddbd27200058912cef900c3c0f #15543

Closes #18038

4 days agocf-https-connect: delete unused declaration
Viktor Szakats [Sun, 27 Jul 2025 08:43:40 +0000 (10:43 +0200)] 
cf-https-connect: delete unused declaration

Closes #18036

4 days agoGHA/windows: add minimal mingw-w64 v3 job
Viktor Szakats [Sat, 26 Jul 2025 18:00:28 +0000 (20:00 +0200)] 
GHA/windows: add minimal mingw-w64 v3 job

Also document mingw-w64 versions for dl-mingw jobs.

Cherry-picked from #18010
Closes #18037

4 days agoGHA: skip building certs, build more tests, one minor fix
Viktor Szakats [Sat, 26 Jul 2025 20:27:56 +0000 (22:27 +0200)] 
GHA: skip building certs, build more tests, one minor fix

- GHA/windows: disable building certs in the MSVC job that's not running
  tests. Saves 4-5 seconds for MSVC, makes logs shorter for the rests.

- GHA/linux: build tests in two more jobs (LTO, CM Rustls), 5s each.

- GHA/linux: skip 'install test prereqs' for `skiprun` jobs.
  (there were no such jobs before this patch.)

Closes #18034

5 days agoDEPRECATE.md: drop support for Windows XP/2003
Viktor Szakats [Fri, 25 Jul 2025 01:33:17 +0000 (03:33 +0200)] 
DEPRECATE.md: drop support for Windows XP/2003

Dropped from curl-for-win on August 28, 2022:
https://github.com/curl/curl-for-win/commit/6976612160075c1e9ee967964d5dec1a25c5ac6c

https://en.wikipedia.org/wiki/Windows_XP
https://en.wikipedia.org/wiki/Windows_Server_2003

Ref: #17985
Closes #18016

5 days agoGHA: Update dependency awslabs/aws-lc to v1.56.0
renovate[bot] [Wed, 23 Jul 2025 14:23:54 +0000 (14:23 +0000)] 
GHA: Update dependency awslabs/aws-lc to v1.56.0

Closes #18006

5 days agoGHA: update dependency ngtcp2/nghttp3 to v1.11.0
renovate[bot] [Fri, 25 Jul 2025 18:17:03 +0000 (18:17 +0000)] 
GHA: update dependency ngtcp2/nghttp3 to v1.11.0

Closes #18021

5 days agohttp: silence `-Warray-bounds` with gcc 13+
Viktor Szakats [Fri, 25 Jul 2025 17:54:39 +0000 (19:54 +0200)] 
http: silence `-Warray-bounds` with gcc 13+

This became an issue after promoting curl compiler warnings to errors in
curl-for-win. The code is correct. It over-allocates a struct to store
variable sized data past its length. Similar code is present in
`lib/smb.c`, silenced earlier.

Seen in linux-musl-debian-testing-gcc curl-for-win builds, gcc 14.2.0,
RISC-V (but not amd64/aarch64), unity, debian:testing (trixie):

musl:
```
In file included from /curl/_r64-linux-musl-bld/lib/CMakeFiles/libcurl_object.dir/Unity/unity_0_c.c:184:
In function 'Curl_http_req_make',
    inlined from 'Curl_http_proxy_create_CONNECT' at /curl/lib/http_proxy.c:252:12:
/curl/lib/http.c:4373:3: error: 'memcpy' offset [137, 142] from the object at 'req' is out of the bounds of
referenced subobject 'method' with type 'char[1]' at offset 136 [-Werror=array-bounds=]
 4373 |   memcpy(req->method, method, m_len);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /curl/lib/urldata.h:182,
                 from /curl/lib/altsvc.c:32,
                 from /curl/_r64-linux-musl-bld/lib/CMakeFiles/libcurl_object.dir/Unity/unity_0_c.c:4:
/curl/lib/http.h: In function 'Curl_http_proxy_create_CONNECT':
/curl/lib/http.h:230:8: note: subobject 'method' declared here
  230 |   char method[1];
      |        ^~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/16527769182/job/46745369844?pr=18025#step:3:5798
Ref: https://github.com/curl/curl-for-win/actions/runs/16525969694/job/46739239206#step:3:5958

glibc (with unity batch):
```
In file included from /usr/riscv64-linux-gnu/include/string.h:548,
                 from /curl/lib/curl_setup_once.h:33,
                 from /curl/lib/curl_setup.h:823,
                 from /curl/lib/http.c:25,
                 from /curl/_r64-linux-gnu-bld/lib/CMakeFiles/libcurl_object.dir/Unity/unity_2_c.c:4:
In function 'memcpy',
    inlined from 'Curl_http_req_make' at /curl/lib/http.c:4373:3,
    inlined from 'Curl_http_proxy_create_CONNECT' at /curl/lib/http_proxy.c:252:12:
/usr/riscv64-linux-gnu/include/bits/string_fortified.h:29:10: error: '__builtin_memcpy' offset [137, 142]
from the object at 'req' is out of the bounds of
referenced subobject 'method' with type 'char[1]' at offset 136 [-Werror=array-bounds=]
   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /curl/lib/urldata.h:182,
                 from /curl/lib/http.c:50:
/curl/lib/http.h: In function 'Curl_http_proxy_create_CONNECT':
/curl/lib/http.h:230:8: note: subobject 'method' declared here
  230 |   char method[1];
      |        ^~~~~~
```
Ref: https://github.com/curl/curl-for-win/actions/runs/16538174468/job/46775731055#step:3:5936

Ref: https://github.com/curl/curl-for-win/commit/f45df099f38f83f2def8344e335f73cc33eea51b
Follow-up to 14f26f5ee78204c15bf906f3cf7480308e2feb28 #16187
Cherry-picked from #18025
Closes #18030

5 days agoGHA/http3-linux: bump to ngtcp2 1.14.0, fix local build
Viktor Szakats [Fri, 25 Jul 2025 19:35:57 +0000 (21:35 +0200)] 
GHA/http3-linux: bump to ngtcp2 1.14.0, fix local build

ngtcp2 1.14.0 added crypto dependencies to the ngtcp2 crypto `.pc`
files. It broke GHA builds, because how curl's `configure` is setting up
the per-dependency custom prefixes for pkg-config.

`configure` uses `PKG_CONFIG_LIBDIR` to set per-dependency custom
prefixes, as specified via `--with-ngtcp2=<custom-dir>`. In classic
`pkg-config` this overrides any previously configured `PKG_CONFIG_DIR`.
This in turn break detecting transitive pkg-config modules unless they
are found at locations `pkg-config` is searching by default. This
doesn't affect `pkgconf` because it appends `PKG_CONFIG_LIBDIR` to
the custom `PKG_CONFIG_DIR`, according to its man page.

It may make sense to fix this in`acinclude.m4`, to make sure to honor
global custom pkg-config paths while detecting components at custom
locations, regardless of pkg-config implementation. But this PR doesn't
do this.

Instead it drops the ngtcp2 custom path and lets detection rely on
`PKG_CONFIG_DIR` that's already set up for all custom-built dependencies
anyway.

Also:
- fix `openssl-quic` job to use the custom-built nghttp2 (like other
  jobs do) instead of the system default.
- configure nghttp3 via `PKG_CONFIG_DIR` in the `openssl-quic` job,
  to sync with other jobs. And drop `--with-nghttp3` option.

https://github.com/curl/curl/blob/cb9b1a4c4e875ac4eac2209d8686acef3114abdf/acinclude.m4#L1376-L1381
https://manpages.debian.org/unstable/pkg-config/pkg-config.1.en.html
https://man.archlinux.org/man/pkgconf.1.en

Ref: https://github.com/ngtcp2/ngtcp2/pull/1689#issuecomment-3121576712
Closes #18022
Closes #18028

5 days agocurl_ossl: extend callback table for nghttp3 1.11.0
Viktor Szakats [Fri, 25 Jul 2025 17:22:01 +0000 (19:22 +0200)] 
curl_ossl: extend callback table for nghttp3 1.11.0

```
../../lib/vquic/curl_osslq.c:1091:1: error: missing initializer for field 'recv_origin' of 'nghttp3_callbacks' [-Werror=missing-field-initializers]
 1091 | };
      | ^
In file included from ../../lib/vquic/curl_osslq.c:33:
/home/runner/nghttp3/build/include/nghttp3/nghttp3.h:2082:23: note: 'recv_origin' declared here
 2082 |   nghttp3_recv_origin recv_origin;
      |                       ^~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/16527325587/job/46743893924?pr=18021#step:18:35

Follow-up to 1055144063ca5f8c67ae6b7d727f76c9bdad88ba #18019

Closes #18026

5 days agocurl_ngtcp2: extend callback tables for nghttp3 1.11.0 and ngtcp2 1.14.0
Viktor Szakats [Fri, 25 Jul 2025 14:40:26 +0000 (16:40 +0200)] 
curl_ngtcp2: extend callback tables for nghttp3 1.11.0 and ngtcp2 1.14.0

An emergency update to initialize callbacks to NULL.

May need further updates, e.g. to provide the recommended random
generator callback for nghttp3.

Fixing potential crashes at runtime in curl-for-win 8.15.0_3, and these
build warnings:
```
/home/appveyor/projects/curl-for-win/curl/lib/vquic/curl_ngtcp2.c:836:1:
warning: missing field 'begin_path_validation' initializer [-Wmissing-field-initializers]
  836 | };
      | ^
/home/appveyor/projects/curl-for-win/curl/lib/vquic/curl_ngtcp2.c:1186:1:
warning: missing field 'recv_origin' initializer [-Wmissing-field-initializers]
 1186 | };
      | ^
2 warnings generated.
```
Ref: https://ci.appveyor.com/project/curlorg/curl-for-win/builds/52462852#L14821

Also causing all `GHA/curl-for-win` jobs to fail:
https://github.com/curl/curl/actions/runs/16523625082?pr=18010

Ref: https://github.com/ngtcp2/nghttp3/releases/tag/v1.11.0
Ref: https://github.com/ngtcp2/ngtcp2/releases/tag/v1.14.0
Ref: https://github.com/curl/curl-for-win/commit/ff788c81e44f998d0d41f362d442a7e97cc0fd46

Closes #18019

6 days agotidy-up: more whitespace/indent, comments
Viktor Szakats [Mon, 14 Jul 2025 15:08:05 +0000 (17:08 +0200)] 
tidy-up: more whitespace/indent, comments

Also a couple of minor formatting updates in the root `CMakeLists.txt`.
One swap to `#ifdef`.

Closes #17929

6 days agoCODE_STYLE: sync with recent `checksrc.pl` updates
Viktor Szakats [Fri, 25 Jul 2025 00:41:21 +0000 (02:41 +0200)] 
CODE_STYLE: sync with recent `checksrc.pl` updates

Follow-up to ef2ccf862f8fbfe5cb86cb716aead57694a95ef5 #17840
Follow-up to f9656445ba275efca02994808f1a89cf055e5e44 #17764

Closes #18015

6 days agowindows: include `wincrypt.h` before `iphlpapi.h` for mingw-w64 <6
Viktor Szakats [Thu, 24 Jul 2025 12:44:03 +0000 (14:44 +0200)] 
windows: include `wincrypt.h` before `iphlpapi.h` for mingw-w64 <6

Required for mingw-w64 5.x (and older) builds targeting a Windows 7+.

mingw-w64 6+ fixed `mprapi.h` (included indirectly via `iphlpapi.h`)
to include `wincrypt.h` for the missing types.

MSVC is not affected because SDK 7.1a (the oldest MS SDK curl supports),
`mprapi.h` does include `wincrypt.h`.

Make sure to include `wincrypt.h` before including `iphlpapi.h` as
a workaround. `wincrypt.h` is used unconditionally even though it's
not available in UWP. This is safe in this context, because we use
`iphlpapi.h` for `if_nametoindex`, which is not supported and used
in UWP builds.

This fixes auto-detection that missed detecting `if_nametoindex` in
the affected combination, and this build error in non-unity builds:
```
In file included from D:/my-cache/mingw32/i686-w64-mingw32/include/iprtrmib.h:9:0,
                 from D:/my-cache/mingw32/i686-w64-mingw32/include/iphlpapi.h:17,
                 from D:/a/curl/curl/lib/url.c:63:
D:/my-cache/mingw32/i686-w64-mingw32/include/mprapi.h:865:3: error: unknown type name 'CERT_NAME_BLOB'
   CERT_NAME_BLOB *certificateNames;
   ^~~~~~~~~~~~~~
D:/my-cache/mingw32/i686-w64-mingw32/include/mprapi.h:887:3: error: unknown type name 'CRYPT_HASH_BLOB'
   CRYPT_HASH_BLOB certBlob;
   ^~~~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/16497057672/job/46645264552?pr=18012#step:10:140

This combination is not normally tested in CI. It was caught in
the `dl-mingw, CM 6.4.0-i686 schannel !unity Win7` job while working
on another PR.

Follow-up to 0d71b18153c8edb996738f8a362373fc72d0013b #17413
Ref: #18009
Closes #18012