]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
3 months agodynhds: drop duplicate includes
Viktor Szakats [Wed, 21 Jan 2026 15:35:19 +0000 (16:35 +0100)] 
dynhds: drop duplicate includes

Already included via `dynhds.h`.

Closes #20389

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

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

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

Closes #20359

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

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

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

Closes #20388

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

When the compiler supports C99.

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

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

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

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

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

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

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

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

Closes #20353

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

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

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

Closes #20383

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

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

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

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

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

Closes #20381

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

Closes #20380

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

Use non-deprecated CRT function variants on Windows.

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

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

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

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

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

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

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

Closes #20212

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

It contains names.

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

Closes #20378

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

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

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

Closes #20375

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

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

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

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

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

Closes #20372

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

Closes #20371

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

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

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

Closes #20370

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

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

Closes #20373

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

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

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

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

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

Closes #20363

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

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

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

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

Ref: #20363

Closes #20366

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

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

Follow-up to 8edc0338f30f458f812f9ea355de1240771fa343 #20351

Closes #20365

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

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

Closes #20361

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

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

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

Closes #20369

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

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

Closes #20364

3 months agoconfig2setopts: fix for --disable-aws build configuration
Maksim Ściepanienka [Tue, 20 Jan 2026 03:19:06 +0000 (04:19 +0100)] 
config2setopts: fix for --disable-aws build configuration

Closes #20368

3 months agoGHA/curl-for-win: add CPU to Linux minimal job name
Viktor Szakats [Tue, 20 Jan 2026 02:38:18 +0000 (03:38 +0100)] 
GHA/curl-for-win: add CPU to Linux minimal job name

3 months agotool_getparam: avoid `-Wcomma` with Apple clang in C89 mode
Viktor Szakats [Mon, 19 Jan 2026 22:21:30 +0000 (23:21 +0100)] 
tool_getparam: avoid `-Wcomma` with Apple clang in C89 mode

Seen with Apple clang 17:
```
curl/src/tool_getparam.c:3062:12: warning: possible misuse of comma operator here [-Wcomma]
 3062 |   for(i = 1, stillflags = TRUE; i < argc && !result; i++) {
      |            ^
curl/src/tool_getparam.c:3062:7: note: cast expression to void to silence warning
 3062 |   for(i = 1, stillflags = TRUE; i < argc && !result; i++) {
      |       ^~~~~
      |       (void)( )
```

Closes #20362

3 months agosigpipe: unset SA_SIGINFO since it is using sa_handler
tommy [Tue, 13 Jan 2026 04:48:17 +0000 (12:48 +0800)] 
sigpipe: unset SA_SIGINFO since it is using sa_handler

Closes #20278

Signed-off-by: tommy <tommyskypromax@gmail.com>
3 months agolib: separate scheme info from protocol implementation
Daniel Stenberg [Sun, 18 Jan 2026 23:15:41 +0000 (00:15 +0100)] 
lib: separate scheme info from protocol implementation

This allows builds know about all schemes - but only have the protocol
implementations for those actually built-in.

It further allows multiple protocols to reuse the same protocol setup
and functions for both TLS and non-TLS implementations instead of
needing two (or more) structs.

The scheme information is now in 'struct Curl_scheme' and all the
function pointers for each scheme/protocol implementation are in struct
Curl_protocol.

The URL API now always work with all known protocols.

Closes #20351

3 months agodocs/INSTALL: update configure details
Arnav-Purushotam-CUBoulder [Tue, 13 Jan 2026 22:12:42 +0000 (15:12 -0700)] 
docs/INSTALL: update configure details

Note the default libpsl requirement in INSTALL and polish the TLS
library wording.

Closes #20301

3 months agobuild: merge TrackMemory (`CURLDEBUG`) into debug-enabled option
Viktor Szakats [Thu, 15 Jan 2026 13:04:05 +0000 (14:04 +0100)] 
build: merge TrackMemory (`CURLDEBUG`) into debug-enabled option

Drop separate `TrackMemory` (aka `CURLDEBUG`) debug feature.

After recent changes (thread-safety,
193cb00ce9b47e75d42157c650cc3de3fd96d35d, and updates leading up to
it), `TrackMemory` is unlikely to cause build or runtime issues.

To simplify builds and debug options, enable `TrackMemory`
unconditionally for debug-enabled (aka `DEBUGBUILD`) builds. Before
this patch, this was already the default, with an option to disable
it, or enable it in non-debug-enabled builds.

Note, in practice these two debug options already went hand in hand. It
was not possible to toggle them separately for a long time due to bugs,
before 59dc9f7e69c399102e9ebe3670360ef52706ff23 (2024-05-28) fixed it.

This patch also removes/deprecates separate knobs and feature flags for
`TrackMemory`:
- autotools: `--enable-curldebug`/`--disable-curldebug`
- cmake: `-DENABLE_CURLDEBUG=ON`/`OFF`
- C macro: `CURLDEBUG`
- libcurl: `CURL_VERSION_CURLDEBUG` symbol deprecated in favor
  of `CURL_VERSION_DEBUG`. They always return the same value after this
  patch.

Also:
- drop `TrackMemory` from `curl -V` output.
- rename internal `CURLDEBUG` macro to `CURL_MEMDEBUG` internally.
  To avoid confusion with `DEBUGBUILD`, but to keep guarding
  `TrackMemory`-related internals for readability.
- runtests: bind `TrackMemory` to debug feature. Keep it a separate
  test feature requirement, for clarity.
- CI: drop test builds for combinations of the two options.
- GHA/linux: no longer disable TrackMemory in the TSAN job.

Ref: https://github.com/curl/curl/pull/20328#issuecomment-3754528407

Closes #20331

3 months agoimap: simplify imap_is_bchar() with strchr()
Daniel Stenberg [Mon, 19 Jan 2026 15:01:57 +0000 (16:01 +0100)] 
imap: simplify imap_is_bchar() with strchr()

Closes #20358

3 months agoGHA/non-native: fix size/file listing for Android shared lib
Viktor Szakats [Mon, 19 Jan 2026 15:23:03 +0000 (16:23 +0100)] 
GHA/non-native: fix size/file listing for Android shared lib

Follow-up to 4cf43508e8e60d0d8acef1beecb0f76040609543 #20355

3 months agoCI: show curl tool and libcurl sizes
Viktor Szakats [Mon, 19 Jan 2026 11:53:40 +0000 (12:53 +0100)] 
CI: show curl tool and libcurl sizes

To see how they change throughout code and/or build changes.

Also:
- improve `file` output.
- tidy-ups.

Closes #20355

3 months agolib: make sigpipe handling more lazy
Stefan Eissing [Thu, 15 Jan 2026 12:24:05 +0000 (13:24 +0100)] 
lib: make sigpipe handling more lazy

Define `struct Curl_sigpipe_ctx` that can be passed as argunent
to "lower" functions so that applying a transfers 'no_signal'
setting can be delayed as much as possible and sometimes avoided
alltogether.

Fixes #20326
Closes #20329
Reported-by: Dag Haavi Finstad
3 months agoINSTALL-CMAKE.md: document Apple framework options
Viktor Szakats [Mon, 19 Jan 2026 07:00:05 +0000 (08:00 +0100)] 
INSTALL-CMAKE.md: document Apple framework options

Also document when they are used.

Closes #20350

3 months agocmake: fix variable name for Apple Security framework
Viktor Szakats [Mon, 19 Jan 2026 06:34:33 +0000 (07:34 +0100)] 
cmake: fix variable name for Apple Security framework

Follow-up to eefd03c572996e5de4dec4fe295ad6f103e0eefc #18703

Closes #20349

3 months agoREUSE: drop broken reference to `MAIL-ETIQUETTE`
Viktor Szakats [Mon, 19 Jan 2026 06:24:48 +0000 (07:24 +0100)] 
REUSE: drop broken reference to `MAIL-ETIQUETTE`

It has been renamed and converted to Markdown.

Follow-up to 271896ab337cf9ea1c7a386306df3728eff7c661 #13247

Closes #20348

3 months agoINSTALL.md: suggest `-Wl,-dead_strip` for Apple targets
Viktor Szakats [Sun, 18 Jan 2026 17:06:33 +0000 (18:06 +0100)] 
INSTALL.md: suggest `-Wl,-dead_strip` for Apple targets

For reducing binary size. Also to remove (or greatly mitigate)
the side-effect of using "unity" builds. Similar to `-Wl,--gc-sections`
on non-Apple platforms.

For example with curl-for-win builds, macOS arm+intel:

curl (unity):                      7.7MB -> 6.8MB
libcurl.dylib (unity):             7.2MB -> 6.4MB
trurl /w static libcurl (!unity):  535KB -> 251KB (same size with unity)

Ref: https://github.com/curl/curl-for-win/commit/c4008d658ad82aed7d70e410a91f6d14273ebb0f

Closes #20346

3 months agoMQTT.md: remove no TLS (mqtts) support
Sascha Frinken [Sun, 18 Jan 2026 05:39:40 +0000 (06:39 +0100)] 
MQTT.md: remove no TLS (mqtts) support

As curl now supports TLS (mqtts), it is no longer necessary to list it
as a limitation in the docs.

Closes #20343

3 months agohostip: fix unreachable code in rare build configuration
Viktor Szakats [Sun, 18 Jan 2026 06:19:47 +0000 (07:19 +0100)] 
hostip: fix unreachable code in rare build configuration

with cmake options:
```
-DCMAKE_UNITY_BUILD=OFF -DCURL_DISABLE_HTTP=ON -DENABLE_THREADED_RESOLVER=OFF
```

Fixing (seen with Apple clang 17):
```
lib/hostip.c:939:16: error: code will never be executed [-Werror,-Wunreachable-code]
  940 |       *entry = dns;
      |                ^~~
```

Closes #20344

3 months agoautotools: fix indentation in help output for two options
Viktor Szakats [Sat, 17 Jan 2026 23:26:03 +0000 (00:26 +0100)] 
autotools: fix indentation in help output for two options

By using weird indentation in the autoconf source.

Fixing:
```
  --enable-sspi           Enable SSPI
    --disable-sspi          Disable SSPI
[...]
  --enable-websockets     Enable WebSockets support
    --disable-websockets    Disable WebSockets support
```

Follow-up to 923db3515d3f3a707fd4cad6f05f9538899536d7 #18116
Follow-up to d78e129d50b2d190f1c1bde2ad1f62f02f152db0 #14936

Closes #20342

3 months agotool: support fractions for --limit-rate and --max-filesize
Daniel Stenberg [Sat, 17 Jan 2026 22:11:07 +0000 (23:11 +0100)] 
tool: support fractions for --limit-rate and --max-filesize

Allow 2.5k or 3.7M etc. Add mention in documentation.

Verify in test case 1623.

Closes #20266

3 months agovquic: drop support for OpenSSL-QUIC 20226/head
Daniel Stenberg [Sat, 17 Jan 2026 21:49:28 +0000 (22:49 +0100)] 
vquic: drop support for OpenSSL-QUIC

- It is slower and uses more memory than the alternatives and is only
  experimental in curl.
- We disable a few tests for OpenSSL-QUIC because of flakiness
- It gets little attention from OpenSSL and we have no expectation of the
  major flaws getting corrected anytime soon.
- No one has spoken up for keeping it
- curl users building with vanilla OpenSSL can still use QUIC through the
  means of ngtcp2

Closes #20226

3 months agomqtt: initial support for MQTTS
Daniel Stenberg [Sat, 17 Jan 2026 16:23:44 +0000 (17:23 +0100)] 
mqtt: initial support for MQTTS

Closes #19418

3 months agowindows: add build option to use the native CA store
Viktor Szakats [Wed, 13 Aug 2025 22:48:00 +0000 (00:48 +0200)] 
windows: add build option to use the native CA store

With the same semantics as Apple SecTrust, in both libcurl and the curl
tool, when using non-Schannel TLS backends. In practice it means that
it makes TLS work without manually or implicitly configuring a CA bundle
`.crt` file, such as `curl-ca-bundle.crt`.

To enable:
- autotools: `--enable-ca-native`
- cmake: `-DCURL_CA_NATIVE=ON`
- CPPFLAGS: `-DCURL_CA_NATIVE`

When enabled:
- enables `CURLSSLOPT_NATIVE_CA` (libcurl) / `--ca-native`
  and `--proxy-ca-native` (curl tool) options by default.
- unsafe search for an on-disk CA bundle gets disabled by default.
  Equivalent to `--disable-ca-search` with autotools,
  `-DCURL_DISABLE_CA_SEARCH=ON` with CMake.
- build-time detection of CA bundle and CA path gets disabled. As with
  Apple SecTrust. This was already the default for Windows.
- native CA can be disabled at run-time with the `--no-ca-native`
  and/or `--no-proxy-ca-native` command-line options.

Rationale: This build option:
- has a repeat and active interest from packagers and users.
- helps integrating curl with Windows for those who need this.
- it also applies to macOS: #17525
  Shipped in curl 8.17.0.
- makes it trivial to use custom certs configured on the OS.
- frees applications/packagers/users from the task of securely
  distributing, and keeping up-to-date, a CA bundle.
- frees potentially many curl tool from configuring a CA bundle manually
  to access HTTPS (and other TLS) URLs. This is traditionally difficult
  on Windows because there is no concept of a universal, protected,
  non-world-writable, location on the file system to securely store
  a CA bundle.
- allows using modern features regardless of Windows version. Some of
  these features are not supported with Schannel (e.g. HTTP/3, ECH) on
  any Windows version.
- is necessary for HTTP/3 builds, where bootstrapping a CA bundle is not
  possible with Schannel, because MultiSSL is not an option, and HTTP/3
  is not supported with Schannel.

Ref: #16181 (previous attempt)
Ref: https://github.com/curl/curl/discussions/9348
Ref: https://github.com/curl/curl/issues/9350
Ref: https://github.com/curl/curl/pull/13111
Ref: https://github.com/microsoft/vcpkg/pull/46459#issuecomment-3162068701
Ref: 22652a5a4cb6a4cc1c0f4ff3ebc4f9768f6663cd #14582
Ref: eefd03c572996e5de4dec4fe295ad6f103e0eefc #18703

Closes #18279

3 months agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 17 Jan 2026 15:48:15 +0000 (16:48 +0100)] 
RELEASE-NOTES: synced

bump pending version to 8.19.0

3 months agomsvc: drop exception, make `BIT()` a bitfield with Visual Studio
Viktor Szakats [Thu, 1 Jan 2026 15:38:56 +0000 (16:38 +0100)] 
msvc: drop exception, make `BIT()` a bitfield with Visual Studio

Add casts to `bool`, or use `bit` type in local variables, where
neccessary to avoid MSVC compiler warnings C4242.

Note: There may remain places needing the above updates, where not
tested in CI, and missed in manual review.

Also:
- urldata: convert struct field `connect_only` to bitfield to match its
  counterpart in another struct.
- rename curl-specific `bit` type to `curl_bit`.

Closes #20142

3 months agodns: flatten the include tree
Viktor Szakats [Sun, 28 Dec 2025 15:48:32 +0000 (16:48 +0100)] 
dns: flatten the include tree

Closes #20106

3 months agowindows: bump minimum to Vista (from XP)
Viktor Szakats [Thu, 24 Jul 2025 01:06:39 +0000 (03:06 +0200)] 
windows: bump minimum to Vista (from XP)

After this patch curl requires targeting Vista or newer, and a toolchain
with Vista support.

Supported MSVC compilers (VS2010+) all support Vista:
- VS2012+ target Win8 (or later) by default.
- VS2010 targets Win7 by default.

Supported mingw-w64 versions (v3+) all support Vista:
- mingw-w64 v9+ target Win10 by default.
- mingw-w64 v8 and older target Server 2003 (~XP) by default.
  After this patch it may be necessary to override the default Windows
  target version to Vista (or newer) via:
  autotools: `CPPFLAGS=-D_WIN32_WINNT=0x0600`
  cmake: `-DCURL_TARGET_WINDOWS_VERSION=0x0600`
- mingw-w64 v6+ allow changing the default at toolchain build-time.

Notes:
- For non-MSVC, non-mingw-w64 toolchains, `if_nametoindex` needs to be
  allowlisted in `curl_setup.h`, if they do support it.

Fixes #17985 (discussion)
Closes #18009

3 months agosocketpair: cleaner interface
Stefan Eissing [Fri, 16 Jan 2026 12:59:03 +0000 (13:59 +0100)] 
socketpair: cleaner interface

Declutter the ifdefs in socketpair.h. Introduce Curl_wakeup_*()
function that encapsulate the details about how the socketpair
is implemented.

This moves the EVENTFD specials from the using code into socketpair
implemenatation, avoiding duplications in three places.

Closes #20340

3 months agoratelimit: download finetune
Stefan Eissing [Thu, 15 Jan 2026 10:58:56 +0000 (11:58 +0100)] 
ratelimit: download finetune

When a download size is known and rate limiting is in effect, adjust the
duration of each measurement step and its rate for maximum precision.

Since it is unpredictable how long the last bytes of a download will
take, download speed can be thrown off if the "last bytes" are a
significant amount of the total download. Make the "last bytes" small in
comparision to the rest and "stretch" the rate limit intervals to
accommodate the difference.

Fix ngtcp2 receive data acknowldgements to be based on a local window
size tracking. This allows window updates controlled by rate limits.

Fix ratelimit wait time calculation to accomodate negative tokens.

h3 rate limit, update timeers

Make download rate limits work correctly in ngtcp2. Fix multi handling
of rate limits to set a timer for when limits will update again.

Without running the transfer on limit updates, protocols like h2/h3 may
stall if the server does not send due to stream windows being too small.

scorecard: measure download speedlimits

When running scorecard with --limit-rate=n, show the reported download
speed averages plus percentage deviation from the limit.

Closes #20228

3 months agoGHA: silence fresh zizmor 1.21.0 warnings
Viktor Szakats [Fri, 16 Jan 2026 12:13:27 +0000 (13:13 +0100)] 
GHA: silence fresh zizmor 1.21.0 warnings

- MSYS2/Cygwin bash shells are now tagged "misfeature".
  It is not something we can fix. We need these shells, and using
  documented/necessary settings to use these environments should be
  allowed without workarounds.

- untagged actions within curl's own organization are now also flagged
  as "action is not pinned to a hash (required by blanket policy)". This
  seems overkill. Making internal releases would not be helpful or
  practical. Also considering that the referred internal action uses an
  unpinned external action anyway (google/oss-fuzz/infra/cifuzz), with
  near-zero chance to fix.

Ref: https://github.com/zizmorcore/zizmor/pull/1517#issuecomment-3759740853

Closes #20339

3 months agolib: use STRCONST() when possible in curlx_strcopy() calls
Daniel Stenberg [Fri, 16 Jan 2026 09:36:07 +0000 (10:36 +0100)] 
lib: use STRCONST() when possible in curlx_strcopy() calls

Follow-up to a535be4ea0960cfaeeaf74412

Closes #20335

3 months agohostip6: remove debug-only code
Daniel Stenberg [Fri, 16 Jan 2026 09:26:24 +0000 (10:26 +0100)] 
hostip6: remove debug-only code

Introduced in 021e786c7108bc60. Not used these days.

Closes #20334

3 months agombedtls: remove newline from failf() call
Daniel Stenberg [Fri, 16 Jan 2026 07:29:38 +0000 (08:29 +0100)] 
mbedtls: remove newline from failf() call

Follow-up from 1dc6ddde06e

Closes #20333

3 months agoeasy: fix build with --disable-form-api and --disable-mime
Daniel Stenberg [Thu, 15 Jan 2026 22:08:50 +0000 (23:08 +0100)] 
easy: fix build with --disable-form-api and --disable-mime

Follow-up to 44312b4b11094e0

Closes #20332

3 months agoTODO: add point about improving SIGPIPE handling
Stefan Eissing [Thu, 15 Jan 2026 14:02:23 +0000 (15:02 +0100)] 
TODO: add point about improving SIGPIPE handling

Closes #20330

3 months agombedtls: no pinnedpubkey wo MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
Michał Antoniak [Wed, 14 Jan 2026 14:40:57 +0000 (15:40 +0100)] 
mbedtls: no pinnedpubkey wo MBEDTLS_SSL_KEEP_PEER_CERTIFICATE

Behavior similar to when MBEDTLS_PK_WRITE_C is not defined.

Closes #20319

3 months agoimap: skip literals inside quoted strings
calm329 [Wed, 14 Jan 2026 17:12:20 +0000 (09:12 -0800)] 
imap: skip literals inside quoted strings

Fixes #20320
Closes #20322

3 months agoGOVERNANCE.md: Post-Daniel BDFL
Daniel Stenberg [Thu, 15 Jan 2026 08:33:58 +0000 (09:33 +0100)] 
GOVERNANCE.md: Post-Daniel BDFL

Some words on what happens at the point in a future when Daniel steps
away from the project

Closes #20325

3 months agolib: fix two `CURLDEBUG` guards to be `DEBUGBUILD`
Viktor Szakats [Thu, 15 Jan 2026 10:59:31 +0000 (11:59 +0100)] 
lib: fix two `CURLDEBUG` guards to be `DEBUGBUILD`

Both guard the use of `CURL_DNS_SERVER` debug env.

Follow-up to df2b4ccc229c9de61dd798e4b3a7cf74a073144e #18157
Follow-up to 02e9690c3ee2feb7c78c93c1c544c898df733383 #17015
Follow-up to 59dc9f7e69c399102e9ebe3670360ef52706ff23 #13718

Closes #20328

3 months agotidy-up: miscellaneous
Viktor Szakats [Fri, 2 Jan 2026 00:34:05 +0000 (01:34 +0100)] 
tidy-up: miscellaneous

- tool_bname: scope an include.
- `endif` comments.
- Markdown fixes.
- comment tidy-ups.
- whitespace, newlines, indent.

Closes #20309

3 months agochecksrc: do not apply `BANNEDFUNC` to struct member functions
Viktor Szakats [Wed, 14 Jan 2026 22:50:42 +0000 (23:50 +0100)] 
checksrc: do not apply `BANNEDFUNC` to struct member functions

Omit this warning, when `close()` is banned:
```
./lib/vtls/vtls.c:947:13: warning: use of close is banned (BANNEDFUNC)
   Curl_ssl->close(cf, data);
             ^
```
Ref: https://github.com/curl/curl/actions/runs/21012427938/job/60410334312?pr=20212#step:3:6

Ref: #20212

Closes #20323

3 months agobuild: drop more forward function declarations
Viktor Szakats [Wed, 14 Jan 2026 16:11:55 +0000 (17:11 +0100)] 
build: drop more forward function declarations

Most by moving functions around. Also delete unused ones.
Reducing their number from 83 to 33.

Remaining ones due to:
- circular dependencies.
- H3 code, that I did not attempt to update and likely the above applies.
- static declarations with attributes (`CURL_PRINTF`, `WARN_UNUSED_RESULT`).
- OS400 code.

Closes #20321

3 months agocmake: avoid setting custom property on built-in interface targets
Viktor Szakats [Wed, 14 Jan 2026 12:04:18 +0000 (13:04 +0100)] 
cmake: avoid setting custom property on built-in interface targets

In some cases `ZLIB::ZLIB` and/or `OpenSSL::SSL` may be aliases, which
prevents setting a curl-specific property (.pc module name) in them:
```
CMake Error at [...]/curl/CMakeLists.txt:910 (set_target_properties):
  set_target_properties can not be used on an ALIAS target.
```

Fix by special-casing these built-in targets and manually converting
them to .pc module names, without using the targets themselves
to carry this information throughout curl's internal build logic.

Reported-by: Tomáš Malý
Fixes #20313
Follow-up to 16f073ef49f94412000218c9f6ad04e3fd7e4d01 #16973
Closes #20316

3 months agotool_cb_hdr: move etag and content-disposition logic into funcs
Daniel Stenberg [Tue, 13 Jan 2026 13:02:49 +0000 (14:02 +0100)] 
tool_cb_hdr: move etag and content-disposition logic into funcs

Co-authored-by: Jay Satiro
Closes #20288

3 months agotool_doswin: document `ENABLE_VIRTUAL_TERMINAL_PROCESSING` toolchain support
Viktor Szakats [Wed, 14 Jan 2026 00:12:08 +0000 (01:12 +0100)] 
tool_doswin: document `ENABLE_VIRTUAL_TERMINAL_PROCESSING` toolchain support

Closes #20315

3 months agobuild: drop stray `ifndef` guards for local/internal macros
Viktor Szakats [Tue, 13 Jan 2026 18:44:56 +0000 (19:44 +0100)] 
build: drop stray `ifndef` guards for local/internal macros

For:
- lib/vtls: `MAX_PINNED_PUBKEY_SIZE`.
- src: `UNPRINTABLE_CHAR`.
- tests/server/tftpd: `PKTSIZE`.

Closes #20314

3 months agotool_doswin: merge `if` blocks, drop forward declarations
Viktor Szakats [Wed, 14 Jan 2026 09:09:37 +0000 (10:09 +0100)] 
tool_doswin: merge `if` blocks, drop forward declarations

Closes #20311

3 months agobuild: drop redundant unused variable suppressions
Viktor Szakats [Wed, 14 Jan 2026 02:46:19 +0000 (03:46 +0100)] 
build: drop redundant unused variable suppressions

Also:
- digest_sspi: merge some `ifdef`s.

Closes #20310

3 months agodigest: handle quotes in the path
Daniel Stenberg [Tue, 13 Jan 2026 14:31:06 +0000 (15:31 +0100)] 
digest: handle quotes in the path

- The 'uri' component needs to be escaped as well
- Rewrote the quote function to use dynbuf
- Build the digest at least partly with dynbuf
- Use goto as a general error mechanism
- Make test 64 use a double quote in the URL

Closes #20295

3 months agobadwords: fix typos found
Viktor Szakats [Wed, 14 Jan 2026 01:07:23 +0000 (02:07 +0100)] 
badwords: fix typos found

Not caught in CI.

Closes #20308

3 months agobadwords: catch and fix more variants of `NN-bit`
Viktor Szakats [Sun, 11 Jan 2026 13:50:27 +0000 (14:50 +0100)] 
badwords: catch and fix more variants of `NN-bit`

Closes #20304

3 months agocmake: replace an outlier `set(var)` with `set(var, "")`
Viktor Szakats [Fri, 9 Jan 2026 15:27:51 +0000 (16:27 +0100)] 
cmake: replace an outlier `set(var)` with `set(var, "")`

For consistency with the rest of these expressions and readability.

Closes #20305

3 months agobuild: drop duplicate C includes
Viktor Szakats [Tue, 13 Jan 2026 22:44:10 +0000 (23:44 +0100)] 
build: drop duplicate C includes

- `stdlib.h` and `string.h` is included via `curl_setup_once.h`,
  allowing to drop from `tests/server` sources and `tool_doswin.c`.

- `stdlib.h` is also included via `setup-vms.h` (earlier than above),
  allowing to drop it from `curl_addrinfo.h` on VMS.

Closes #20303

3 months agoldap: silence potential unused variable warning (OS400)
Viktor Szakats [Tue, 6 Jan 2026 11:15:05 +0000 (12:15 +0100)] 
ldap: silence potential unused variable warning (OS400)

Also:
- add `endif` comment.
- unfold a line.

Follow-up to 64350280d3b9aca54856f73d109aab8f49615de3 #20197

Closes #20302

3 months agobuild: globally suppress DJGPP warnings in `FD_SET()`
Viktor Szakats [Tue, 13 Jan 2026 21:07:53 +0000 (22:07 +0100)] 
build: globally suppress DJGPP warnings in `FD_SET()`

Replacing the many local `#pragma` used before this patch,
reducing the number of `__DJGPP__` guards from 58 to 13.

Closes #20299

3 months agoGHA: bump pip-dependencies
dependabot[bot] [Tue, 13 Jan 2026 22:04:33 +0000 (22:04 +0000)] 
GHA: bump pip-dependencies

- update `ruff` from 0.14.10 to 0.14.11
- update `filelock` from 3.20.1 to 3.20.3 (CVE-2026-22701) (used in pytests)
- update `psutil` from 7.2.0 to 7.2.1

Closes #20300

3 months agomime: drop fallback for unused `R_OK` macro
Viktor Szakats [Tue, 13 Jan 2026 18:47:24 +0000 (19:47 +0100)] 
mime: drop fallback for unused `R_OK` macro

Follow-up to fc81bf42bea37d1381c9796311df014b09ac3b30 #13497

Closes #20298

3 months agobuild: omit forward declarations
Viktor Szakats [Tue, 13 Jan 2026 14:40:09 +0000 (15:40 +0100)] 
build: omit forward declarations

- drop redundant forward declarations.
- reorder local functions to not need forward declarations.
- tftpd: merge two `ifdef` blocks.

Closes #20297

3 months agoexamples: omit forward declarations, apply misc fixes
Viktor Szakats [Tue, 13 Jan 2026 17:17:42 +0000 (18:17 +0100)] 
examples: omit forward declarations, apply misc fixes

- reorder functions to not need forward declarations.
- sync `ephiperfifo.c` and `evhiperfifo.c`.
- drop redundant casts for `calloc()` return value.
- ephiperfifo: silence unused variable warning.
- fix indent and apply clang-format more.

Closes #20296

3 months agourl.h: fix `-Wdocumentation`
Viktor Szakats [Tue, 13 Jan 2026 16:56:02 +0000 (17:56 +0100)] 
url.h: fix `-Wdocumentation`

Seen when testing `-Weverything`:
```
lib/url.h:84:11: warning: parameter 'nowp' not found in the function declaration [-Wdocumentation]
   84 |  * @param nowp      NULL or pointer to time being checked against.
      |           ^~~~
```

Follow-up to 2de22a00c7adb81b4e5cbc90785e29b4b083c1ed #19961

Closes #20294

3 months agoopenldap: avoid forward declarations in ldaps code
Viktor Szakats [Tue, 13 Jan 2026 16:51:59 +0000 (17:51 +0100)] 
openldap: avoid forward declarations in ldaps code

Follow-up to b85cb8cb4e143d1615d4fcc1ce8f2f7b66453995 #18485

Closes #20293

3 months agomod_curltest: silence unused argument compiler warning
Viktor Szakats [Tue, 13 Jan 2026 15:10:22 +0000 (16:10 +0100)] 
mod_curltest: silence unused argument compiler warning

Closes #20292

3 months agomd4, md5: drop redundant forward declarations
Viktor Szakats [Tue, 13 Jan 2026 14:53:09 +0000 (15:53 +0100)] 
md4, md5: drop redundant forward declarations

Closes #20291

3 months agolib: reorder protocol functions to avoid forward declarations (ssh)
Viktor Szakats [Tue, 13 Jan 2026 15:30:20 +0000 (16:30 +0100)] 
lib: reorder protocol functions to avoid forward declarations (ssh)

Move protocol handler table to the end of sources, rearrange static
functions in reverse dependency order as necessary.

Closes #20290

3 months agolib: reorder protocol functions to avoid forward declarations (misc cont.)
Viktor Szakats [Tue, 13 Jan 2026 14:27:36 +0000 (15:27 +0100)] 
lib: reorder protocol functions to avoid forward declarations (misc cont.)

For protocols: ldap, openldap, rtmp, rtsp, telnet

Move protocol handler table to the end of sources, rearrange static
functions in reverse dependency order as necessary.

Closes #20289

3 months agoimap: check `imap_sendf()` printf masks at compile-time
Viktor Szakats [Tue, 13 Jan 2026 13:01:38 +0000 (14:01 +0100)] 
imap: check `imap_sendf()` printf masks at compile-time

Closes #20287

3 months agotests/server: use `CURL_PRINTF()`, drop `-Wformat-nonliteral` workaround
Viktor Szakats [Tue, 13 Jan 2026 12:44:43 +0000 (13:44 +0100)] 
tests/server: use `CURL_PRINTF()`, drop `-Wformat-nonliteral` workaround

Closes #20286

3 months agocurl_easy_nextheader.md: a new transfer invalidates 'prev'
Daniel Stenberg [Tue, 13 Jan 2026 12:29:30 +0000 (13:29 +0100)] 
curl_easy_nextheader.md: a new transfer invalidates 'prev'

Closes #20285

3 months agotftp: correct the filename length check
Daniel Stenberg [Tue, 13 Jan 2026 07:02:19 +0000 (08:02 +0100)] 
tftp: correct the filename length check

Reported-by: z2_
Bug: https://hackerone.com/reports/3508321
Closes #20283

3 months agosetopt: split up setopt_long and setopt_cptr
Daniel Stenberg [Mon, 12 Jan 2026 23:19:27 +0000 (00:19 +0100)] 
setopt: split up setopt_long and setopt_cptr

- Split setopt_long() into multiple functions
  (setopt_long_bool/net/http/proxy/ssl/proto/misc) and dispatch them
  using a small function table

- Extract proxy string option handling into setopt_cptr_proxy() and call
  it early from setopt_cptr()

- Reorder options to simplify #ifdef blocks and reduce per-function size

- Updates code paths to return CURLE_UNKNOWN_OPTION from helper defaults
  so dispatching can continue cleanly

Closes #20280

3 months agochecksrc: warn for leading spaces before the preprocessor hash
Daniel Stenberg [Tue, 13 Jan 2026 08:23:21 +0000 (09:23 +0100)] 
checksrc: warn for leading spaces before the preprocessor hash

Fix the 40+ fallouts

Closes #20282

3 months agomqtt: better too-big-message-check
Daniel Stenberg [Tue, 13 Jan 2026 07:20:12 +0000 (08:20 +0100)] 
mqtt: better too-big-message-check

Reported-by: gudyuu on hackerone
Reviewed-by: Daniel Gustafsson
Bug: https://hackerone.com/reports/3508500
Closes #20281

3 months agotop-complexity: always show the top-25
Daniel Stenberg [Mon, 12 Jan 2026 23:13:59 +0000 (00:13 +0100)] 
top-complexity: always show the top-25

Accept argument as a custom amount. Previously it showed all functions
with a complexity score above 57. This way it adapts better as we
gradually decrease complexity in functions.

Closes #20273

3 months agolib: reorder protocol functions to avoid forward declarations (ftp)
Viktor Szakats [Mon, 12 Jan 2026 23:51:21 +0000 (00:51 +0100)] 
lib: reorder protocol functions to avoid forward declarations (ftp)

There remains 4 forward declarations.

Move protocol hander table to the end of sources, rearrange static
functions is reverse dependency order as possible.

Closes #20276

3 months agolib: reorder protocol functions to avoid forward declarations (email)
Viktor Szakats [Sun, 21 Dec 2025 15:33:06 +0000 (16:33 +0100)] 
lib: reorder protocol functions to avoid forward declarations (email)

For protocols: imap, pop3, smtp.

Move protocol hander table to the end of sources, rearrange static
functions is reverse dependency order as necessary.

Closes #20275

3 months agolib: reorder protocol functions to avoid forward declarations (misc)
Viktor Szakats [Sun, 21 Dec 2025 15:19:52 +0000 (16:19 +0100)] 
lib: reorder protocol functions to avoid forward declarations (misc)

For protocols: dict, file, gopher, tftp, http, mqtt, smb.

Move protocol hander table to the end of sources, rearrange static
functions is reverse dependency order as necessary.

Closes #20274

3 months agotidy-up: merge root `packages` directory into `projects`
Viktor Szakats [Mon, 12 Jan 2026 18:44:14 +0000 (19:44 +0100)] 
tidy-up: merge root `packages` directory into `projects`

To simplify the directory layout.

- OS400 and vms support move from `packages` to `projects`.

- Windows README and `generate.bat` files move from `projects`
  to `projects/Windows`.

Closes #20271