]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
5 days agovquic: use curl_getenv
David Zhuang [Mon, 4 Aug 2025 23:56:15 +0000 (16:56 -0700)] 
vquic: use curl_getenv

getenv isn't defined on all platforms, which prevents vquic from
building. I specifically ran into this issue building on PlayStation.

Closes #18170

5 days agoopenssl: output unescaped utf8 x509 issuer/subject DNs
Roberto Hidalgo [Tue, 5 Aug 2025 02:29:00 +0000 (20:29 -0600)] 
openssl: output unescaped utf8 x509 issuer/subject DNs

Closes #18171

5 days agomulti: change prefix for the network change bits to CURLMNWC_
Daniel Stenberg [Tue, 5 Aug 2025 09:39:32 +0000 (11:39 +0200)] 
multi: change prefix for the network change bits to CURLMNWC_

Because "CURLM_" is used for curl multi error codes and it is convenient
to use the prefix to identify the number family.

Closes #18176

5 days agocurl_multi_get_offt: language fix
Daniel Stenberg [Tue, 5 Aug 2025 09:32:21 +0000 (11:32 +0200)] 
curl_multi_get_offt: language fix

Closes #18175

5 days agocurl_multi_get_offt: add separate man pages for the options
Daniel Stenberg [Mon, 4 Aug 2025 22:09:18 +0000 (00:09 +0200)] 
curl_multi_get_offt: add separate man pages for the options

Follow-up to 1ad2009ad63478ace18977ec5314f597f45ad084

Closes #18168

5 days agowolfssl: rename ML-KEM hybrids to match IETF draft
Anthony Hu [Fri, 25 Jul 2025 17:27:33 +0000 (13:27 -0400)] 
wolfssl: rename ML-KEM hybrids to match IETF draft

Closes #18123

5 days agourldata: reduce two long struct fields to unsigned short
Daniel Stenberg [Mon, 4 Aug 2025 20:25:29 +0000 (22:25 +0200)] 
urldata: reduce two long struct fields to unsigned short

Closes #18173

5 days agohostip: cache negative name resolves
Daniel Stenberg [Sun, 3 Aug 2025 22:06:03 +0000 (00:06 +0200)] 
hostip: cache negative name resolves

Hold them for half the normal lifetime. Helps when told to transfer N
URLs in quick succession that all use the same non-resolving hostname.

Done by storing a DNS entry with a NULL pointer for 'addr'.

Previously an attempt was made in #12406 by Björn Stenberg that was
ultimately never merged.

Closes #18157

6 days agobuild: disable `TCP_NODELAY` for emscripten
Viktor Szakats [Sun, 3 Aug 2025 21:48:53 +0000 (23:48 +0200)] 
build: disable `TCP_NODELAY` for emscripten

In WebAssembly, using `TCP_NODELAY` fails with:
```
* Could not set TCP_NODELAY: Protocol not available
```

Add a new feature macro in `curl_setup.h` telling whether `TCP_NODELAY`
is known to be supported at runtime, when defined at compile-time.

Keep `TCP_NODELAY` guards at their current positions to ensure the
necessary headers (e.g. `netinet/tcp.h` and `netinet/in.h`) define it.

Reported-by: Jeroen Ooms
Fixes #17974
Closes #18155

6 days agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 4 Aug 2025 21:53:16 +0000 (23:53 +0200)] 
RELEASE-NOTES: synced

6 days agomulti: add new information extraction method
Stefan Eissing [Wed, 23 Jul 2025 07:18:59 +0000 (09:18 +0200)] 
multi: add new information extraction method

Adds `curl_off_t curl_multi_get_offt(CURLM *multi_handle, CURLMinfo_offt
info)` to the multi interface with enums:

* CURLMINFO_XFERS_CURRENT: current number of transfers
* CURLMINFO_XFERS_RUNNING: number of running transfers
* CURLMINFO_XFERS_PENDING: number of pending transfers
* CURLMINFO_XFERS_DONE: number of finished transfers to read
* CURLMINFO_XFERS_ADDED: total number of transfers added, ever

Add documentation for functions and info enums.

Add use in the curl command line tool to replace two static
variables counting the same "from the outside".

refs #17870
Closes #17992

6 days agowriteout: add %time{}
Daniel Stenberg [Thu, 31 Jul 2025 14:41:36 +0000 (16:41 +0200)] 
writeout: add %time{}

Output the current UTC time using strftime format. %f is an extra curl
specific flag to output the microsecond fraction of the current second.

Verified by test 1981

Closes #18119

6 days agolib: replace `getsock()` logic with pollsets
Stefan Eissing [Mon, 4 Aug 2025 14:17:37 +0000 (16:17 +0200)] 
lib: replace `getsock()` logic with pollsets

`getsock()` calls operated on a global limit that could
not be configure beyond 16 sockets. This is no longer adequate
with the new happy eyeballing strategy.

Instead, do the following:
- make `struct easy_pollset` dynamic. Starting with
  a minimal room for two sockets, the very common case,
  allow it to grow on demand.
- replace all protocol handler getsock() calls with pollsets
  and a CURLcode to return failures
- add CURLcode return for all connection filter `adjust_pollset()`
  callbacks, since they too can now fail.
- use appropriately in multi.c and multi_ev.c
- fix unit2600 to trigger pollset growth

Closes #18164

6 days agotool_paramhlp: fix secs2ms()
Petar Popovic [Mon, 4 Aug 2025 17:48:26 +0000 (19:48 +0200)] 
tool_paramhlp: fix secs2ms()

- remove one zero from digs[5]
- remove size of size

Closes #18167

6 days agocmake: enable `-Wall` for MSVC 1944
Viktor Szakats [Mon, 4 Aug 2025 14:33:18 +0000 (16:33 +0200)] 
cmake: enable `-Wall` for MSVC 1944

MSVC=1944 is now tested in CI. It did not trigger new `-Wall` compiler
warnings, thus safe to enable `-Wall` for.

Closes #18165

6 days agocurl: add --follow
Daniel Stenberg [Fri, 25 Apr 2025 11:09:00 +0000 (13:09 +0200)] 
curl: add --follow

Makes curl follow redirects an act on the response code and change a
custom method accordingly, contrary to --location.

Potential future command line to send QUERY and following a redirect
according to the status code:

    curl -d "request-body" -X QUERY --follow https://example.com

add test 794,796,797

Assisted-by: Daniel Böhmer <post@daniel-boehmer.de>
Closes #16543

6 days agosetopt: split out cookielist() and cookiefile()
Daniel Stenberg [Mon, 4 Aug 2025 12:47:33 +0000 (14:47 +0200)] 
setopt: split out cookielist() and cookiefile()

into their own sub functions

Closes #18162

6 days agoGHA/windows: give more time for Ubuntu installs
Viktor Szakats [Mon, 4 Aug 2025 13:41:41 +0000 (15:41 +0200)] 
GHA/windows: give more time for Ubuntu installs

Recently sometimes the Ubuntu package repository is very slow to access.
Remove the time limit for the install step, and bump the total limit,
aligning with Linux jobs.

In most cases the `install packages` steps takes 15-25 seconds.
Sometimes this goes up to 30-45 minutes.

Reported-by: nevakrien on github
Bug: https://github.com/curl/curl/discussions/14854#discussioncomment-13988574
Closes #18163

6 days agohostip: do DNS cache pruning in milliseconds
Daniel Stenberg [Mon, 4 Aug 2025 12:15:03 +0000 (14:15 +0200)] 
hostip: do DNS cache pruning in milliseconds

Instead of using integer seconds. Also: if the cache contains over
30,000 entries after first pruning, it makes anoter round and removes
all entries that are older than half the age of the oldest entry until
it goes below 30,000.

Closes #18160

6 days agoGHA/windows: show disk space used in each job
Viktor Szakats [Sun, 3 Aug 2025 15:21:41 +0000 (17:21 +0200)] 
GHA/windows: show disk space used in each job

Also:
- make the dl-minge 6.4.0 job shared. To save 761MB of disk space, and
  speed up examples build step by 50% (10 seconds).

Closes #18150

6 days agoruntests: add `--ci` option, show `Env:` only when non-empty
Viktor Szakats [Sat, 2 Aug 2025 11:15:28 +0000 (13:15 +0200)] 
runtests: add `--ci` option, show `Env:` only when non-empty

To reduce log noise in local test runs:
- move the `buildinfo.txt` dump and header info lines
  `OS:`, `Perl:`, `diff:` behind a `--ci` `runtests.pl` option.
- enable this option for the CI test targets.
- hide `Env:` header info line if empty.
- merge `Env:` output into a single `logmsg()` call.

Closes #18147

6 days agounit2604: avoid `UNCONST()`
Viktor Szakats [Sat, 2 Aug 2025 10:15:31 +0000 (12:15 +0200)] 
unit2604: avoid `UNCONST()`

Closes #18143

6 days agolibtests: use `FMT_SOCKET_T`, drop more casts
Viktor Szakats [Sat, 2 Aug 2025 00:01:20 +0000 (02:01 +0200)] 
libtests: use `FMT_SOCKET_T`, drop more casts

Follow-up to 37913c01a51653d257dc7d57f676504cedbf16f6 #18106

Closes #18142

6 days agoconfigure: if no perl, disable unity and shell completion, related tidy ups
Viktor Szakats [Fri, 1 Aug 2025 22:18:12 +0000 (00:18 +0200)] 
configure: if no perl, disable unity and shell completion, related tidy ups

Also:
- GHA/linux, macos: test `install` with autotools too.
- GHA/linux, macos: enable fish and zsh completion in an autotools job.
- scripts: drop dynamic perl checks redundant after this patch.
- scripts: drop two interim variables.
- autotools: make `build-certs` target check perl first.
- autotools: replace `$(PERL)` with `@PERL@` to match the pattern used
  in most automake scripts. For consistency. This makes `PERL` be
  defined at configure-time, as opposed to make-time, for these cases
  now.

Closes #18141

6 days agocurl-config: remove X prefix use
Daniel Stenberg [Mon, 4 Aug 2025 07:04:23 +0000 (09:04 +0200)] 
curl-config: remove X prefix use

That shellcheck now annoyingly and uselessly complains about.

Closes #18158

7 days agocmake: fix to restrict `SystemConfiguration` to macOS
Viktor Szakats [Sun, 3 Aug 2025 20:14:02 +0000 (22:14 +0200)] 
cmake: fix to restrict `SystemConfiguration` to macOS

Also fix indentation and tidy up to use `STREQUAL` when checking for
Darwin.

Reported-by: Waldemar Kornewald
Fixes #18149
Regression from 739ef9804d8e1e9b4a8d2a610896babc62c5524b #13713
Closes #18153

7 days agosplay: rename KEY_NOTUSED TO SPLAY_SUBNODE
Daniel Stenberg [Sun, 3 Aug 2025 19:15:18 +0000 (21:15 +0200)] 
splay: rename KEY_NOTUSED TO SPLAY_SUBNODE

- explains its purpose better
- make it global static const
- added an assert for a condition that should never happen (that we
  also catch run-time)

Closes #18152

7 days agounit2600: add another case
Stefan Eissing [Sat, 2 Aug 2025 10:55:11 +0000 (12:55 +0200)] 
unit2600: add another case

Add a case with 1 ipv4 and 3 ipv6 and check that all are attempted with
the correct minimum duration before failures. To check that more ipv6
than ipv4 lead to the correct behaviour.

Closes #18144

8 days agocmake: re-add simple test target, and name it `tests`
Viktor Szakats [Sat, 2 Aug 2025 11:10:05 +0000 (13:10 +0200)] 
cmake: re-add simple test target, and name it `tests`

Before this patch there was no (easy) way to run tests without various
verbose options, hindering readability of the output due its length.

Unfortunately CMake reserves `test` as a target name, which was
the reason for its removal earlier. Re-add it with the name `tests`,
to have the functionality without the name collision.

Also add a `tests` target as an alias to `test` for autotools.

Ref: https://cmake.org/cmake/help/v4.1/policy/CMP0037.html
Follow-up to cfea4f2f4dc316c38694440ef2eed899a3e7d207 #6258
Closes #18145

9 days agodocs: add CURLOPT type change history, drop casts where present
Viktor Szakats [Fri, 1 Aug 2025 10:49:40 +0000 (12:49 +0200)] 
docs: add CURLOPT type change history, drop casts where present

Some CURLOPT constants defined in the curl public headers were initially
enums (= ints), or macros with bare numeric values. Recent curl releases
upgraded them to `long` constants, to make them pass correctly to
`curl_easy_setop()` by default, i.e. without requiring a `(long)` cast.

This patch drops such casts from the examples embedded in the docs. At
the same time it documents which curl release made them `long` types,
to keep them useful when working with previous libcurl versions.

Also:
- drop a `(long)` cast that was never necessary.
- CURLOPT_ALTSVC_CTRL.md: bump local copy of macros to long.
- test1119: make it ignore symbols ending with an underscore, to skip
  wildcard, e.g. `**CURLAUTH_***`.

Closes #18130

9 days agoCURLOPT: replace `(long)` cast with `L` suffix for `CURLHSTS_*` macros
Viktor Szakats [Fri, 1 Aug 2025 10:54:18 +0000 (12:54 +0200)] 
CURLOPT: replace `(long)` cast with `L` suffix for `CURLHSTS_*` macros

In curl/curl.h and the man page. To match the rest of CURLOPT macros.

Cherry-picked from #18130

9 days agobuild: if no perl, fix to use the pre-built hugehelp, if present
Viktor Szakats [Thu, 31 Jul 2025 14:38:34 +0000 (16:38 +0200)] 
build: if no perl, fix to use the pre-built hugehelp, if present

- cmake: Before this patch a missing perl disabled the curl manual.
  After this patch, it automatically picks up a pre-built hugehelp,
  if present (= when building from a release tarball).
  Follow-up to 0035ff45c59437db1a8ffe960b40905c8582b149 #16081

- autotools: Rework behavior when perl is missing. Before this patch
  it caused a hard error when docs/manual/ca-embed were enabled.
  Of these, docs were enabled by default. After this patch, doc
  generation is automatically skipped, with a warning. Manual generation
  falls back to using a pre-built hugehelp, or a stub if that's missing.
  CA-embed is automatically skipped, with a warning.
  Slight difference from cmake: When built with no perl and no pre-built
  hugehelp, the manual is enabled, but the content is empty; with cmake
  it's disabled proper.
  Follow-up to 137aecfbf1e933e7228a4f62cc977eabffb2afbf #13514
  Follow-up to 541321507e386744c3ea1200cc83cc98338e27d7 #12857

Also:
- GHA/distcheck: verify if the pre-built hugehelp makes it into curl.
- GHA/distcheck: streamline disabling perl with autotools.
- GHA/distcheck: `--disable-docs` no longer required to build without perl.
  Passing it also implicitly disables the curl manual, which is
  undesired in these tests.
- cmake: drop redundant `HAVE_MANUAL_TOOLS` interim variable.
- cmake: move two `set()` lines close to their counterparts.

Follow-up to 25119fbaaa76a182d4b08d64853d0a8db9181219 #18104

Closes #18118

9 days agomanagen: reset text mode at end of table marker
Daniel Stenberg [Fri, 1 Aug 2025 16:03:36 +0000 (18:03 +0200)] 
managen: reset text mode at end of table marker

It previously mostly ignored it which lead to bad format after a table
has ended with "##".

Closes #18139

9 days agourlapi: allow more path characters "raw" when asked to URL encode
Daniel Stenberg [Thu, 24 Jul 2025 16:36:28 +0000 (18:36 +0200)] 
urlapi: allow more path characters "raw" when asked to URL encode

Setting the path component to contain the letters:

    ! $ & ' ( ) { } [ ] * + , ; = : @

now leaves them un-encoded when CURLU_URLENCODE is used.

Amended test 1560 to verify.

Reported-by: Jeroen Ooms
Fixes #17977
Closes #18024

9 days agoexamples: drop long cast for `CURLALTSVC_*`
Viktor Szakats [Fri, 1 Aug 2025 16:54:14 +0000 (18:54 +0200)] 
examples: drop long cast for `CURLALTSVC_*`

Follow-up to d45b85d79198a0259123923a6aa186ded2aaca6c #18063

9 days agoCURLOPT: bump remaining macros to `long`
Viktor Szakats [Fri, 1 Aug 2025 14:27:15 +0000 (16:27 +0200)] 
CURLOPT: bump remaining 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:

- CURLGSSAPI_DELEGATION_FLAG
- CURLGSSAPI_DELEGATION_NONE
- CURLGSSAPI_DELEGATION_POLICY_FLAG

- CURLMIMEOPT_FORMESCAPE

- CURLSSH_AUTH_AGENT
- CURLSSH_AUTH_ANY
- CURLSSH_AUTH_DEFAULT
- CURLSSH_AUTH_GSSAPI
- CURLSSH_AUTH_HOST
- CURLSSH_AUTH_KEYBOARD
- CURLSSH_AUTH_NONE
- CURLSSH_AUTH_PASSWORD
- CURLSSH_AUTH_PUBLICKEY

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

Closes #18134

9 days agoCURLOPT: bump `CURLPROTO_*` macros to `long`
Viktor Szakats [Fri, 1 Aug 2025 14:47:41 +0000 (16:47 +0200)] 
CURLOPT: bump `CURLPROTO_*` 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:

- CURLPROTO_HTTP
- CURLPROTO_HTTPS
- CURLPROTO_FTP
- CURLPROTO_FTPS
- CURLPROTO_SCP
- CURLPROTO_SFTP
- CURLPROTO_TELNET
- CURLPROTO_LDAP
- CURLPROTO_LDAPS
- CURLPROTO_DICT
- CURLPROTO_FILE
- CURLPROTO_TFTP
- CURLPROTO_IMAP
- CURLPROTO_IMAPS
- CURLPROTO_POP3
- CURLPROTO_POP3S
- CURLPROTO_SMTP
- CURLPROTO_SMTPS
- CURLPROTO_RTSP
- CURLPROTO_RTMP
- CURLPROTO_RTMPT
- CURLPROTO_RTMPE
- CURLPROTO_RTMPTE
- CURLPROTO_RTMPS
- CURLPROTO_RTMPTS
- CURLPROTO_GOPHER
- CURLPROTO_SMB
- CURLPROTO_SMBS
- CURLPROTO_MQTT
- CURLPROTO_GOPHERS
- CURLPROTO_ALL

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

Closes #18136

9 days agoCURLOPT: bump `CURL_SSLVERSION_*` macros to `long`
Viktor Szakats [Fri, 1 Aug 2025 14:43:33 +0000 (16:43 +0200)] 
CURLOPT: bump `CURL_SSLVERSION_*` 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_SSLVERSION_DEFAULT
- CURL_SSLVERSION_SSLv2
- CURL_SSLVERSION_SSLv3
- CURL_SSLVERSION_TLSv1
- CURL_SSLVERSION_TLSv1_0
- CURL_SSLVERSION_TLSv1_1
- CURL_SSLVERSION_TLSv1_2
- CURL_SSLVERSION_TLSv1_3

- CURL_SSLVERSION_MAX_DEFAULT
- CURL_SSLVERSION_MAX_NONE
- CURL_SSLVERSION_MAX_TLSv1_0
- CURL_SSLVERSION_MAX_TLSv1_1
- CURL_SSLVERSION_MAX_TLSv1_2
- CURL_SSLVERSION_MAX_TLSv1_3

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

Closes #18135

9 days agoCURLOPT: bump `CURLWS_NOAUTOPONG`, `CURLWS_RAW_MODE` macros to `long`
Viktor Szakats [Fri, 1 Aug 2025 15:35:42 +0000 (17:35 +0200)] 
CURLOPT: bump `CURLWS_NOAUTOPONG`, `CURLWS_RAW_MODE` 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:

- CURLWS_NOAUTOPONG
- CURLWS_RAW_MODE

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

Closes #18137

9 days agolib2700: use `testnum`
Viktor Szakats [Fri, 1 Aug 2025 15:39:35 +0000 (17:39 +0200)] 
lib2700: use `testnum`

Follow-up to 02dd471bbf8e04fc595ad0f28c965c278ffcefd0 #17591
Follow-up to d3594be6531df3d5eafcdd09f84ad9dee1777028 #17136

Closes #18138

9 days agoopenssl: check SSL_write() length on retries
Stefan Eissing [Fri, 1 Aug 2025 12:55:52 +0000 (14:55 +0200)] 
openssl: check SSL_write() length on retries

When an SSL_write() blocks we need to retry it with the
same length as before or stupid OpenSSL freaks out. Remember
it, limit any longer sends and fail shorter ones.

Fixes #18121
Reported-by: adamse on github
Closes #18132

9 days agorelease-notes: fix warning
Daniel Stenberg [Fri, 1 Aug 2025 13:41:31 +0000 (15:41 +0200)] 
release-notes: fix warning

Follow-up to 2ec54556d4e3f3ab551b5

Closes #18133

9 days agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 1 Aug 2025 13:40:53 +0000 (15:40 +0200)] 
RELEASE-NOTES: synced

9 days agopytest: test very long urls
Stefan Eissing [Fri, 1 Aug 2025 09:01:55 +0000 (11:01 +0200)] 
pytest: test very long urls

test_02_36 tests h1/h2/h3 with urls longer than 1/16/32/64K.

Protocols behave the same until the size exceed 64k when h2 frame limits
bite and h3 exhibits a different http status.

Failed attempt to reproduce #18121
Closes #18129

9 days agocli_hx_download: fix compiler warnings about format strings
Stefan Eissing [Fri, 1 Aug 2025 08:33:12 +0000 (10:33 +0200)] 
cli_hx_download: fix compiler warnings about format strings

Follow-up to ba9ddb935794a9fdd6906f

Closes #18127

9 days agocurl_easy_ssls_export: make the example more clear
Stefan Eissing [Thu, 31 Jul 2025 13:13:49 +0000 (15:13 +0200)] 
curl_easy_ssls_export: make the example more clear

As mentioned in #18031
Closes #18117

9 days agotls: CURLINFO_TLS_SSL_PTR testing
Stefan Eissing [Wed, 23 Jul 2025 09:21:36 +0000 (11:21 +0200)] 
tls: CURLINFO_TLS_SSL_PTR testing

Add tests of CURLINFO_TLS_SSL_PTR and its returned value in test client
'hx-download'. Use obtained pointer to look up the negotiated TLS
version.

Update manpage of CURLINFO_TLS_SSL_PTR to also describe the behaviour of
wolfSSL similar to OpenSSL. Fix the wolfSSl implementation for TCP to
behave like that. Update the QUIC queries.

Fix rustls `get_internals()` to return the rustls_connection* and not
the address of the pointer.

Assisted-by: Viktor Szakats
Closes #18066

9 days agoip happy eyeballing: keep attempts running
Stefan Eissing [Thu, 31 Jul 2025 08:23:35 +0000 (10:23 +0200)] 
ip happy eyeballing: keep attempts running

When `CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS` expires, start the next ip
connect attempt, but keep all ongoing attempts alive.

Separate happy-eyeballs connection filter into own source files.

Closes #18105

10 days agocurl: add --parallel-max-host to limit concurrent connections per host
Daniel Stenberg [Mon, 28 Jul 2025 08:41:20 +0000 (10:41 +0200)] 
curl: add --parallel-max-host to limit concurrent connections per host

Where 'host' is protocol + hostname + portnumber.

Closes #18052

10 days agospacecheck.pl: when detecting unicode, mention line number
Daniel Stenberg [Thu, 31 Jul 2025 15:10:12 +0000 (17:10 +0200)] 
spacecheck.pl: when detecting unicode, mention line number

Closes #18120

10 days agowindows: document toolchain support for `CERT_NAME_SEARCH_ALL_NAMES_FLAG`
Viktor Szakats [Thu, 31 Jul 2025 18:32:55 +0000 (20:32 +0200)] 
windows: document toolchain support for `CERT_NAME_SEARCH_ALL_NAMES_FLAG`

Follow-up to 5f99b45693e9d649397b7b7781f498d9c175bfa2 #18113
Follow-up to 3bfcfe82b9e7fe18cdbd3a06b219a8ce40188a23 #18085

10 days agoschannel: not supported with UWP, drop redundant code
Viktor Szakats [Thu, 31 Jul 2025 05:44:35 +0000 (07:44 +0200)] 
schannel: not supported with UWP, drop redundant code

Schannel is not supported by UWP. SSPI is also required by Schannel in
curl, and SSPI also isn't supported by UWP.

mingw-w64 is able to create such build regardless (my guess: due to API
parts not accurately marked as UWP-only), but the binary is unlikely
to work. With MSVC the failure happens at build-time.

Ref: https://learn.microsoft.com/windows/win32/api/sspi/nf-sspi-initsecurityinterfacea#requirements
Ref: https://learn.microsoft.com/windows/win32/secauthn/initializesecuritycontext--schannel#requirements

Drop all UWP-related logic, including two related feature checks, that
can now be permanently enabled.

Also:
- build: show fatal error for Schannel in UWP mode.
- build: do not allow enabling SSPI in UWP mode.
- drop undocumented option `DISABLE_SCHANNEL_CLIENT_CERT`. Added without
  mention in an unrelated commit. The PR text says to save size. On x64
  this is 0.3%, or 4KB out of 1.3MB. The tiny gain doesn't justify
  an extra build variant. Ref: 8beff4355956e3d18ceb3afc21c1f3edec82543c
- move `MPROTO_SCHANNEL_CERT_SHARE_KEY` closer to its use.
- replace commented block with `#if 0`.

Reviewed-by: Jay Satiro
Follow-up to cd0ec4784c1c0f873939f33ec1a73c8739f276b9 #17089
Closes #18116

10 days agowindows: drop two interim, single-use macros
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

10 days 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

10 days 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

10 days 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

10 days 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

10 days 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

10 days 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

11 days 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

11 days 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

11 days 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

11 days 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

11 days 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

11 days 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

11 days 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

11 days 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

11 days 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

11 days 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

11 days 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

11 days 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

11 days 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

11 days 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

11 days 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

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

11 days 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

11 days 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

11 days 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

11 days 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

11 days 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

11 days 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

12 days 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

12 days 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

12 days 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

12 days 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

12 days 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

13 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

13 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

13 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

13 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

13 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

13 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