]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
13 days 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

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

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

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

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

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

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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks 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

2 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 12 Jan 2026 22:18:48 +0000 (23:18 +0100)] 
RELEASE-NOTES: synced

2 weeks agospacecheck: show line numbers of duplicate empty lines
Viktor Szakats [Mon, 12 Jan 2026 16:21:42 +0000 (17:21 +0100)] 
spacecheck: show line numbers of duplicate empty lines

Also:
- drop separate check for 3 or more consecutive empty lines.

Ref: https://github.com/curl/curl/pull/20266#issuecomment-3738955165

Closes #20269

2 weeks agoMakefile.am: drop stray VC project files from dist
Viktor Szakats [Mon, 12 Jan 2026 20:38:21 +0000 (21:38 +0100)] 
Makefile.am: drop stray VC project files from dist

Most files were removed 2 years ago, the remaining two do not work
without those.

Follow-up to 3d93d18dede1d0f7fa54c6aa57300f9de12c5476 #12288

Closes #20272

2 weeks agoMakefile.am: delete RPM targets referencing non-existent files
Viktor Szakats [Mon, 12 Jan 2026 18:57:06 +0000 (19:57 +0100)] 
Makefile.am: delete RPM targets referencing non-existent files

Follow-up to bae0d473f5912d38fc8da1f9850a70b015b53c9e #3331

Closes #20270

2 weeks agotool_cb_hdr: suppress header output when --out-null
Jay Satiro [Sun, 11 Jan 2026 19:56:24 +0000 (14:56 -0500)] 
tool_cb_hdr: suppress header output when --out-null

This change brings --out-null more in line with the documentation which
says --out-null is expected to behave like a portable -o /dev/null.

Prior to this change curl did not suppress the header output from --head
when --out-null was used to suppress output.

Assisted-by: Daniel Stenberg
Reported-by: Andrew Kvalheim
Ref: https://curl.se/docs/manpage.html#--out-null

Fixes https://github.com/curl/curl/discussions/20235
Closes https://github.com/curl/curl/pull/20256

2 weeks agobuild: add `curl-lint`/`lint` targets, `CURL_LINT` cmake option
Viktor Szakats [Sat, 3 Jan 2026 16:08:18 +0000 (17:08 +0100)] 
build: add `curl-lint`/`lint` targets, `CURL_LINT` cmake option

To run checksrc and spacecheck on the source tree. Also for cmake
to sync up with autotools' `checksrc` target.

- cmake: `curl-lint`
  With `-DCURL_LINT=ON`, checks run automatically for all targets.
- autotools: `lint`

Closes #20175

2 weeks agoGHA/checkdocs: drop duplicate spacecheck job
Viktor Szakats [Mon, 12 Jan 2026 15:19:14 +0000 (16:19 +0100)] 
GHA/checkdocs: drop duplicate spacecheck job

No longer necessary after making GHA/checksrc also run on `*.md` file
changes.

Reported-by: Daniel Stenberg
Bug: https://github.com/curl/curl/pull/20266#issuecomment-3738955165
Follow-up to 3800a26582af8b355e96cf80135ba7642e816ed6 #18935
Follow-up to 9acecc923df9ea8675f026ab173e8f2a6051822e #15423
Closes #20268

2 weeks agotool_filetime: sync dummy macro signature with function prototype
Patrick Monnerat [Sun, 11 Jan 2026 13:04:14 +0000 (14:04 +0100)] 
tool_filetime: sync dummy macro signature with function prototype

Closes #20265

2 weeks agortsp: match connection_check procedure with required signature
Patrick Monnerat [Sun, 11 Jan 2026 13:00:14 +0000 (14:00 +0100)] 
rtsp: match connection_check procedure with required signature

Follow-up to e3691612ea1acb2

Closes #20265

2 weeks agoGHA/non-native: disable FreeBSD arm CI jobs (upstream breakage)
Viktor Szakats [Mon, 12 Jan 2026 14:51:45 +0000 (15:51 +0100)] 
GHA/non-native: disable FreeBSD arm CI jobs (upstream breakage)

Package manager is not finding packages.

FreeBSD 15, moving to cmake, dropping impacket, stunnel, ldap, kerberos,
could not fix it.

Closes #20267

2 weeks agomimepost: allocate main struct on-demand
Daniel Stenberg [Mon, 12 Jan 2026 08:30:25 +0000 (09:30 +0100)] 
mimepost: allocate main struct on-demand

This makes the easy handle 432 bytes smaller (totally 5352 bytes on my
rather maximized Linux 64 bit build). The 440 byte mimepost struct is
now allocated only when needed.

Closes #20260

2 weeks agourldata: change 'keep_post' into three distinct bitfields
Daniel Stenberg [Mon, 12 Jan 2026 10:07:01 +0000 (11:07 +0100)] 
urldata: change 'keep_post' into three distinct bitfields

Closes #20262

2 weeks agoaltsvc: only accept 17 byte dates from files
Daniel Stenberg [Mon, 12 Jan 2026 07:05:49 +0000 (08:05 +0100)] 
altsvc: only accept 17 byte dates from files

Since the date format is fixed there is no need to accept more data.

Update test355 to verify reject of too long date in alt-svc file

This test case was originally supposed to verify alt-svc loading from a
file but never did because it was done incorrectly.

Now it verifies that a too long date in the input file makes curl
disregard the entry.

Closes #20259

2 weeks agotool_operate: split single_transfer into sub functions
Daniel Stenberg [Sun, 11 Jan 2026 16:47:49 +0000 (17:47 +0100)] 
tool_operate: split single_transfer into sub functions

To make it more manageable and less complex

Closes #20258

2 weeks agolibssh: simplify myssh_statemach_act()
Daniel Stenberg [Sun, 11 Jan 2026 10:15:00 +0000 (11:15 +0100)] 
libssh: simplify myssh_statemach_act()

Reduce complexity by splitting out sub functions.

Made myssh_quote_error() to reduce code duplication.

Closes #20252

2 weeks agoGHA: delete disable-man-db hack, runners doing it by default now
Viktor Szakats [Sun, 11 Jan 2026 14:28:14 +0000 (15:28 +0100)] 
GHA: delete disable-man-db hack, runners doing it by default now

Refs:
https://github.com/actions/runner-images/commit/1f107542aed3879d2565b59d48cb3cb7776b342f
https://github.com/actions/runner-images/pull/13268
https://github.com/actions/runner-images/issues/13213

Follow-up to 5acba8bc367c0248e3cacb05e60aba209c0821c9 #17181

Closes #20254

2 weeks agoGHA: delete new apt sources adding the flaky distro source
Viktor Szakats [Sun, 11 Jan 2026 13:53:41 +0000 (14:53 +0100)] 
GHA: delete new apt sources adding the flaky distro source

CI workflows deleted apt package source `microsoft-prod.list` due to
flakiness seen in the past with those sources. Sources are still flaky
and they are now also used from `azure-cli.sources` which is included
by default by the runner images. Add it to the delete list.

Also: remove another new, unnecessary (for curl CI) package source seen
on the `ubuntu-24.04-arm` runner, for good measure, and performance.

Fixing:
```
Reading package lists...
E: Failed to fetch https://packages.microsoft.com/repos/azure-cli/dists/noble/InRelease  403  Forbidden [IP: 13.107.246.66 443]
E: The repository 'https://packages.microsoft.com/repos/azure-cli noble InRelease' is no longer signed.
Error: Process completed with exit code 100.
```
Ref: https://github.com/curl/curl/actions/runs/20896127602/job/60034941964?pr=20142#step:2:79

Follow-up to 303bb8785c45fcad879c9c1c86e9c7e09ff68097 #13473

Closes #20253

2 weeks agowolfssl: fix build without USE_BIO_CHAIN
Daniel Stenberg [Sun, 11 Jan 2026 09:50:19 +0000 (10:50 +0100)] 
wolfssl: fix build without USE_BIO_CHAIN

Reported-by: Megamouse on github
Fixes #20250
Closes #20251

2 weeks agoaltsvc: move logic from setopt into Curl_altsvc_ctrl()
Daniel Stenberg [Sat, 10 Jan 2026 22:17:58 +0000 (23:17 +0100)] 
altsvc: move logic from setopt into Curl_altsvc_ctrl()

To keep it all in one place.

Closes #20247

2 weeks agoGHA: include runner CPU arch in cache keys (revert)
Viktor Szakats [Sun, 11 Jan 2026 00:07:43 +0000 (01:07 +0100)] 
GHA: include runner CPU arch in cache keys (revert)

Turns out in practice the internal cache name contains the arch where it
matters (arm or dual-arch local builds), which is part of the cache key
string. Drop `runner.arch` to avoid two arch strings in the key.

Cache keys without an explicit arch designator mean intel.

Revert ff78af5752fdf580e5beef743f932cc1625228c3 #20234

Closes #20249

2 weeks agoGHA/linux: fix 'mbedtls' internal name confusion
Viktor Szakats [Sat, 10 Jan 2026 23:05:43 +0000 (00:05 +0100)] 
GHA/linux: fix 'mbedtls' internal name confusion

`mbedtls-arm` and `mbedtls-prev` were matching `contains()` expressions
looking for `mbedtls`. It caused an unnecessary cache restore and an
redundant mbedtls build on bumps, and made the build flavors require
different local directory names to avoid this accidental collision.

Also drop `-threadsafe` from internal names. All local builds are.

Follow-up to 88060353440df4e1b7167c180b39074fd2ab457a #20240
Follow-up to 3a305831d1a9d10b2bfd4fa3939ed41275fee7f7 #19077

Closes #20248

2 weeks agoGHA/linux: move 6 jobs with locally built dependencies to arm
Viktor Szakats [Sat, 10 Jan 2026 21:47:41 +0000 (22:47 +0100)] 
GHA/linux: move 6 jobs with locally built dependencies to arm

All libresll jobs, wolfssl-all, and one mbedtls job.

As noted earlier, arm jobs run faster than intel ones, especially
valgrind steps that run almost twice as fast. Package install runs
slower, but this is offset by faster build and test steps, even in
non-valgrind jobs.

Follow-up to ff78af5752fdf580e5beef743f932cc1625228c3 #20234
Follow-up to 2b0d8dcc16c531d3154ab54347a3eaabf9bd2c7d #20231

Closes #20246

2 weeks agoGHA: include runner CPU arch in cache keys
Viktor Szakats [Fri, 9 Jan 2026 17:41:06 +0000 (18:41 +0100)] 
GHA: include runner CPU arch in cache keys

To clarify the arch for cache entries, also to allow building/caching
multiple archs in parallel if necessary.

Closes #20234

2 weeks agoplan9: drop special build and orphaned references
Viktor Szakats [Sat, 10 Jan 2026 13:42:19 +0000 (14:42 +0100)] 
plan9: drop special build and orphaned references

Would need 64-bit support.

Ref: https://github.com/curl/curl/pull/20233#issuecomment-3732556015
Follow-up to 0159100f4f782432fa3d27998dbea7b827ffba2d #20233

Closes #20243

2 weeks agourldata: restore bitfield to unsigned int
Daniel Stenberg [Sat, 10 Jan 2026 21:22:27 +0000 (22:22 +0100)] 
urldata: restore bitfield to unsigned int

Bug: https://github.com/curl/curl/pull/20209#pullrequestreview-3647160739

Reported-by: Patrick Monnerat
Follow-up to e3691612ea1acb2
Closes #20244

2 weeks agocmake: drop unused `LONG_LONG` reference from Windows prefills
Viktor Szakats [Sat, 10 Jan 2026 12:29:02 +0000 (13:29 +0100)] 
cmake: drop unused `LONG_LONG` reference from Windows prefills

It's no longer used in curl.

Follow-up to 0159100f4f782432fa3d27998dbea7b827ffba2d #20233

Closes #20241

2 weeks agotool: improve error/warning messages when output filename sanitization fails
Viktor Szakats [Tue, 30 Dec 2025 10:21:05 +0000 (11:21 +0100)] 
tool: improve error/warning messages when output filename sanitization fails

On MS-DOS (OOM and bad filename) and Windows (OOM only).

Given the rarity of both platform and error, we make a compromise and
return an unrelated libcurl error (43) in case of a bad output filename
on MS-DOS.

After:
```
$ CURL_FN_SANITIZE_OOM=1 wine curl.exe https://curl.se/ --output out.txt
curl: (27) Out of memory

$ CURL_FN_SANITIZE_BAD=1 wine curl.exe https://curl.se/ --output out.txt
Warning: bad output filename
curl: (43) A libcurl function was given a bad argument

$ CURL_FN_SANITIZE_OOM=1 wine curl.exe https://curl.se/index.html --globoff -O
curl: (27) Out of memory

$ CURL_FN_SANITIZE_BAD=1 wine curl.exe https://curl.se/index.html --globoff -O
curl: bad output filename
curl: (43) A libcurl function was given a bad argument
```

Before:
```
$ CURL_FN_SANITIZE_OOM=1 wine curl.exe https://curl.se/ --output out.txt
Warning: bad output glob
curl: (27) Out of memory

$ CURL_FN_SANITIZE_BAD=1 wine curl.exe https://curl.se/ --output out.txt
Warning: bad output glob
curl: (3) URL using bad/illegal format or missing URL

$ CURL_FN_SANITIZE_OOM=1 wine curl.exe https://curl.se/index.html --globoff -O
curl: Failed to extract a filename from the URL to use for storage
curl: (27) Out of memory

$ CURL_FN_SANITIZE_BAD=1 wine curl.exe https://curl.se/index.html --globoff -O
curl: Failed to extract a filename from the URL to use for storage
curl: (3) URL using bad/illegal format or missing URL
```

Ref: #20116 (simpler reboot of)
Ref: #20113 #20121
Ref: 40c1748af503cf54443e17db5f537b548faa9328 #20198
Ref: eb7f5b71e5b3fe1e73f6065c78ad0143ff580916 #20143
Ref: 8c02407bef55baaee8d721a7e5f7f0ba8d91dd47 #20125
Fixes #20044
Closes #20199

2 weeks agoKNOWN_BUGS.md: absolute Unix domain filename for SOCKS on Windows
Daniel Stenberg [Fri, 9 Jan 2026 22:20:11 +0000 (23:20 +0100)] 
KNOWN_BUGS.md: absolute Unix domain filename for SOCKS on Windows

Closes #20236
Closes #19825

2 weeks agoGHA: update awslabs/aws-lc to v1.66.2
renovate[bot] [Sat, 10 Jan 2026 01:08:30 +0000 (01:08 +0000)] 
GHA: update awslabs/aws-lc to v1.66.2

Closes #20238

2 weeks agolib: use (u)int64_t instead of long long
Daniel Stenberg [Fri, 9 Jan 2026 16:49:26 +0000 (17:49 +0100)] 
lib: use (u)int64_t instead of long long

Remove config-plan9.h because it does not support 64 bit, meaning it has
not been working for years.

Closes #20233

2 weeks agoGHA/linux: fix 'libressl' internal name confusion
Viktor Szakats [Sat, 10 Jan 2026 10:47:56 +0000 (11:47 +0100)] 
GHA/linux: fix 'libressl' internal name confusion

`libressl-filc` was matching `contains()` expressions looking for
`libressl`, causing build confusion and failure in specific cases.

Rename `libressl` to `libressl-c` to avoid this. Also rename the cache
id for consistency, though not necessary for the fix.

Bug: https://github.com/curl/curl/actions/runs/20860412340/job/59938315276
Follow-up to c2624818739916652a041164939afaba5bb5ee73 #19407
Cherry-picked from #20234

Closes #20240

3 weeks agocmake: reference OpenSSL and ZLIB imported targets only when enabled
Joshua Vandaële [Wed, 7 Jan 2026 23:55:45 +0000 (00:55 +0100)] 
cmake: reference OpenSSL and ZLIB imported targets only when enabled

This otherwise broke building on a parent with a static library which is
available but disabled (e.g. CURL_ZLIB is set to OFF but ZLIB::ZLIB
exists)

Closes #20217

3 weeks agoGHA: switch 12 Linux jobs to arm64
Viktor Szakats [Fri, 9 Jan 2026 14:51:04 +0000 (15:51 +0100)] 
GHA: switch 12 Linux jobs to arm64

More cost-effective and seems as fast or faster than Intel.

In particular, valgrind seems to be almost 2x fast. So fast the job pair
could fit under 10 minutes if merged again (but would be the longest in
GHA/Linux.)

Installing packages is slightly slower. The package repo is Ubuntu's
which is slower than the Azure mirror used on Intel (unless Azure is
broken, which happened a lot last year).

To add to more jobs, the locally built deps also need to be migrated.

Also:
- add workaround for failing sshd server on Linux arm runners, caused by
  world-writable `HOME` directory.

Closes #20231

3 weeks agocmake: silence useless compiler warnings triggered by the FASTBuild generator
Viktor Szakats [Thu, 8 Jan 2026 13:28:02 +0000 (14:28 +0100)] 
cmake: silence useless compiler warnings triggered by the FASTBuild generator

Silencing all of these:
```
11>/tmp/_fbuild.tmp/0x0752c383/core_2/70816E19/krb5_sspi.c:1:5: error: this style of line directive is a GNU extension [-Werror,-Wgnu-line-marker]
    1 | # 1 "<built-in>"
      |     ^
/path/to/curl/lib/vauth/krb5_sspi.c:29:6: error: this style of line directive is a GNU extension [-Werror,-Wgnu-line-marker]
   29 | # 26 "/path/to/curl/lib/vauth/krb5_sspi.c"
      |      ^
[...]
```

FASTBuild is slightly faster than Ninja in basic (single-machine, build
from scratch) cases (and can be more faster in other build cases). It
doesn't support unity builds. Maybe it can bring slightly better
performance to non-unity cmake CI jobs, in jobs having an 'install
prereq' phase already, and installing the fastbuild package being faster
than this gain. It overall seems marginal if any in curl CI. At least
for now. But it doesn't hurt if it works, and may be useful for some.

Requires CMake 4.2+.

That said this workaround may have a better place within CMake.

Refs:
https://www.kitware.com/cmake-fastbuild-distributed-cached-and-fast/
https://cmake.org/cmake/help/latest/generator/FASTBuild.html
https://github.com/fastbuild/fastbuild
https://fastbuild.org/docs/home.html

Closes #20230

3 weeks agoGHA: update dependency cloudflare/quiche to v0.24.7
renovate[bot] [Fri, 9 Jan 2026 14:49:46 +0000 (14:49 +0000)] 
GHA: update dependency cloudflare/quiche to v0.24.7

Closes #20224

3 weeks agopytest: bump quiche version check update
Stefan Eissing [Fri, 9 Jan 2026 14:23:36 +0000 (15:23 +0100)] 
pytest: bump quiche version check update

Since the Lazy Lucas did not manage to get the fix merged in 0.24.7,
increase the pytest version check number in the hope that it will happen
in the next release.

Closes #20229

3 weeks agobuild: detect and include `inttypes.h` again (revert)
Viktor Szakats [Thu, 8 Jan 2026 14:54:17 +0000 (15:54 +0100)] 
build: detect and include `inttypes.h` again (revert)

Since not using `PRI*` macros, it isn't needed.

Follow-up to 13c1a934144e98d06214a043ff4538791c7d9583 #20215
Revert 4c9e4e99c107b8d0bda5b204c5b69a50425567b9 #20208

Closes #20225

3 weeks agourldata: convert 'long' fields to fixed variable types
Daniel Stenberg [Thu, 8 Jan 2026 22:57:58 +0000 (23:57 +0100)] 
urldata: convert 'long' fields to fixed variable types

Makes sure they work identically cross-platform, as long varies in size
between Windows vs non-Windows. Makes Curl_easy 16 bytes smaller on 64
bit Linux.

This reduces support for the RTSP cseq counters to 32 bit (down from 63
bit previously on 64 bit non-Windows), but it is probably safe.
Implementations probably rarely support anything above 32 bits anyway
and this is how curl has worked on Windows since always.

There is now only one 'long' left in urldata.h (in the ssl_config_data
struct). That field, certverifyresult, is used to store the response
code from TLS backend code and in the OpenSSL case that function returns
an actual 'long'.

Closes #20227

3 weeks agospacecheck: exclude `RELEASE-NOTES` from a check
Viktor Szakats [Fri, 9 Jan 2026 08:45:30 +0000 (09:45 +0100)] 
spacecheck: exclude `RELEASE-NOTES` from a check

3 weeks agocurl: limit Windows-specific code to Windows builds, other tidy-ups
Viktor Szakats [Wed, 7 Jan 2026 19:26:28 +0000 (20:26 +0100)] 
curl: limit Windows-specific code to Windows builds, other tidy-ups

Prior to this patch, some Windows logic, including a Windows-specific
warning message was compiled in for all platforms.

Also:
- fix double space in warning message on UWP.
- formatting.

Follow-up to 9a2663322c330ff11275abafd612e9c99407a94a #17572

Closes #20213

3 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 9 Jan 2026 06:54:36 +0000 (07:54 +0100)] 
RELEASE-NOTES: synced

Bump to 8.18.1 tentatively

3 weeks agoCOPYING: bump copyright year range to 1996 - 2026
Daniel Stenberg [Thu, 8 Jan 2026 22:19:44 +0000 (23:19 +0100)] 
COPYING: bump copyright year range to 1996 - 2026

3 weeks agongtcp2: stabilize recv
Stefan Eissing [Thu, 8 Jan 2026 10:19:39 +0000 (11:19 +0100)] 
ngtcp2: stabilize recv

When receiving on a stream that already failed or has already been closed,
return the matching error code without touching the connection. In case
the connection shows errors, e.g. the server closed, those errors should
not have impact on an already failed/closed stream.

This might mitigate flakiness in pytest 07_13 where unexpected errors
occur after a successful upload.

Closes #20220