]> git.feebdaed.xyz Git - 0xmirror/curl.git/log
0xmirror/curl.git
5 days agoCURLOPT_HAPROXY_CLIENT_IP.md: emphasize reused connection use
Daniel Stenberg [Mon, 22 Dec 2025 21:36:23 +0000 (22:36 +0100)]
CURLOPT_HAPROXY_CLIENT_IP.md: emphasize reused connection use

Closes #20075

5 days agocontent_encoding: avoid strcpy
Daniel Stenberg [Mon, 22 Dec 2025 10:36:42 +0000 (11:36 +0100)]
content_encoding: avoid strcpy

Build list with dynbuf.

Closes #20072

5 days agocurlx: rename `Curl_`-prefixed symbols to `curlx_`
Viktor Szakats [Sun, 21 Dec 2025 23:48:33 +0000 (00:48 +0100)]
curlx: rename `Curl_`-prefixed symbols to `curlx_`

Closes #20069

5 days agobinmode: delete extra nop instruction from fallback macro
Viktor Szakats [Sun, 21 Dec 2025 22:42:21 +0000 (23:42 +0100)]
binmode: delete extra nop instruction from fallback macro

Follow-up to 250d613763dfc29f73010696ee7948f19d07dba9 #15787

Closes #20068

6 days agochecksrc: ensure using `ifdef`/`ifndef` when possible, fix fallouts
Viktor Szakats [Sun, 21 Dec 2025 14:45:53 +0000 (15:45 +0100)]
checksrc: ensure using `ifdef`/`ifndef` when possible, fix fallouts

Follow-up to 89771d19d58d16cfe6e1d7fda7acd65a0a316eba #18018

Closes #20065

6 days agolib: drop, or replace `sendf.h` with `curl_trc.h` where possible
Viktor Szakats [Sun, 21 Dec 2025 01:40:10 +0000 (02:40 +0100)]
lib: drop, or replace `sendf.h` with `curl_trc.h` where possible

- replace `sendf.h` with `curl_trc.h` where it was included just for it.
- drop unused `curl_trc.h` includes.
- easy: delete obsolete comment about `send.h` include reason.

Also:
- move out `curl_trc.h` include from `sendf.h` and include it directly
  in users, where not done already. To flatten the include tree and
  to less rely on indirect includes.
- stop including `sendf.h` from other headers, replace it with forward
  declaration of `Curl_easy`, as done already elsewhere.

Verified with an all non-unity CI run.

Closes #20061

6 days agotest96: fix to accept non-unity memdump content with MSVC
Viktor Szakats [Sun, 21 Dec 2025 10:28:42 +0000 (11:28 +0100)]
test96: fix to accept non-unity memdump content with MSVC

In unity builds the source filename (via `__FILE__`) has no path (or
uses slashes?), while in non-unity ones it does contain backslashes
on Windows, with MSVC. Fix the test to recognize backslashes in the
`stripfile` regexp.

Seen in MSVC jobs in CI:
```diff
-MEM tool_cfgable.c[LF]
-MEM tool_paramhlp.c[LF]
-MEM tool_cfgable.c[LF]
-MEM tool_cfgable.c[LF]
-MEM tool_cfgable.c[LF]
-MEM tool_cfgable.c[LF]
+MEM D:\a\curl\curl\src\tool_cfgable.c[LF]
+MEM D:\a\curl\curl\src\tool_paramhlp.c[LF]
+MEM D:\a\curl\curl\src\tool_cfgable.c[LF]
+MEM D:\a\curl\curl\src\tool_cfgable.c[LF]
+MEM D:\a\curl\curl\src\tool_cfgable.c[LF]
+MEM D:\a\curl\curl\src\tool_cfgable.c[LF]
```
Ref: https://github.com/curl/curl/actions/runs/20408366058/job/58641468316?pr=20061#step:13:303
Ref: https://github.com/curl/curl/actions/runs/20408522070/job/58641826216?pr=20064#step:13:298

Closes #20064

6 days agox509asn1: drop unused `hostcheck.h`, `vtls_int.h` includes
Viktor Szakats [Sun, 21 Dec 2025 09:57:05 +0000 (10:57 +0100)]
x509asn1: drop unused `hostcheck.h`, `vtls_int.h` includes

Closes #20063

6 days agolib: include `curlx/warnless.h` from `curl_setup.h`
Viktor Szakats [Sat, 20 Dec 2025 23:40:32 +0000 (00:40 +0100)]
lib: include `curlx/warnless.h` from `curl_setup.h`

To make it available for all files. Drop includes from individual
sources. This header was already included from most sources and not
specific to any internal subsystem.

Also to ensure that two system symbol redefines on Windows (`read()` and
`write()`) get applied to all sources. Move them to `curl_setup.h`.

Closes #20056

6 days agolib: drop unused `vssh/ssh.h` includes
Viktor Szakats [Sun, 21 Dec 2025 00:28:49 +0000 (01:28 +0100)]
lib: drop unused `vssh/ssh.h` includes

Closes #20060

6 days agotransfer: drop unused `vquic/vquic.h` include
Viktor Szakats [Sun, 21 Dec 2025 00:25:14 +0000 (01:25 +0100)]
transfer: drop unused `vquic/vquic.h` include

Closes #20059

6 days agocurl_ntlm_core: move `vauth/vauth.h` include from header to source
Viktor Szakats [Sun, 21 Dec 2025 00:22:26 +0000 (01:22 +0100)]
curl_ntlm_core: move `vauth/vauth.h` include from header to source

To not include it implicitly for all `curl_ntlm_core.h` users.

Closes #20058

6 days agotidy-up: `curlx/nonblock.h` includes
Viktor Szakats [Sat, 20 Dec 2025 23:08:44 +0000 (00:08 +0100)]
tidy-up: `curlx/nonblock.h` includes

Delete where unused, include where to used to avoid relying on
side-effect of other headers.

Also: delete "for curlx_nonblock" comments. That's the only symbol
offered by this header.

Closes #20055

6 days agolib: drop unused `vtls/vtls.h` includes
Viktor Szakats [Sun, 21 Dec 2025 00:11:06 +0000 (01:11 +0100)]
lib: drop unused `vtls/vtls.h` includes

Closes #20057

6 days agolib: drop unused curlx headers
Viktor Szakats [Sat, 20 Dec 2025 23:02:40 +0000 (00:02 +0100)]
lib: drop unused curlx headers

`curlx/base64.h` and `curlx/strparse.h`.

Closes #20054

7 days agolib: drop includes unused or duplicate
Viktor Szakats [Sat, 20 Dec 2025 16:16:10 +0000 (17:16 +0100)]
lib: drop includes unused or duplicate

Closes #20051

7 days agosocks.h: delete obsolete, unused, macros
Viktor Szakats [Sat, 20 Dec 2025 18:21:19 +0000 (19:21 +0100)]
socks.h: delete obsolete, unused, macros

Unused since dafdb20a26d0c890e83dea61a104b75408481ebd #9855

Cherry-picked from #20051

Closes #20053

7 days agolib: use `SOCKET_WRITABLE()`/`SOCKET_READABLE()` where possible
Viktor Szakats [Sat, 20 Dec 2025 17:50:12 +0000 (18:50 +0100)]
lib: use `SOCKET_WRITABLE()`/`SOCKET_READABLE()` where possible

Closes #20052

7 days agocontrithanks.sh: adopt the stricter by: check from contributors.sh
Daniel Stenberg [Sat, 20 Dec 2025 16:45:15 +0000 (17:45 +0100)]
contrithanks.sh: adopt the stricter by: check from contributors.sh

7 days agocontributors.sh: even stricter requirements for the -by: line
Daniel Stenberg [Sat, 20 Dec 2025 16:44:18 +0000 (17:44 +0100)]
contributors.sh: even stricter requirements for the -by: line

7 days agombedTLS: cleanup insecure/deprecated code
Wyatt O'Day [Mon, 15 Dec 2025 17:17:13 +0000 (12:17 -0500)]
mbedTLS: cleanup insecure/deprecated code

1. With `MBEDTLS_SSL_PROTO_TLS1_2` not enabled, the mbedTLS code was not
able to connect to any server due to broken logic in curl's
`mbed_set_ssl_version_min_max()`. Now it correctly sets the minimum
supported TLS version based on what is compiled in the library.

2. If debugging is enabled, move the debugging enabling earlier in the
`mbed_connect_step1()` so that verbose errors are actually displayed if
failures happen (see the previous point -- it would've made debugging
that issue easier).

3. Remove the constant `mbedtls_x509_crt_profile_fr` and instead use
mbedTLS-included profile `mbedtls_x509_crt_profile_next` with
`mbedtls_ssl_conf_cert_profile()`. This will follow the latest standards
as new mbedTLS versions are released (rather than being stuck-in-time
until someone comes along to fix what was hard-coded here). This has the
immediate benefit of no longer supporting SHA1 certs and insecure RSA
key-lengths (1024). This fix immediately prevents previously possible
MITM attacks (SHA1 hashes and RSA-1024 keys can be forged relatively
easily by nation-state actors and criminal organizations with
deep-pockets).

4. Added [predictive
resistance](https://mbed-tls.readthedocs.io/en/latest/kb/how-to/add-a-random-generator/#enabling-prediction-resistance)
to the random number generator (adding more entropy to the RNG).

5. Split the random number generator into initialization, the actual
random generation, and the "freeing" of the resources. This
significantly reduces the overhead of using the RNG.

6. Removed the separate RNG function in the TLS connect stage (instead
use the "main" one) and remove the ad-hoc threading support. Instead
properly document how to enable threading in mbedTLS. As it was, other
internals of mbedTLS could have race conditions (in the RSA module in
particular) if `MBEDTLS_THREADING_C` was *not* enabled. And if it is
enabled, then these race-conditions cannot happen. And also, if
MBEDTLS_THREADING_C is enabled then the RNG functions [are fully
thread-safe](https://mbed-tls.readthedocs.io/en/latest/kb/development/thread-safety-and-multi-threading/).

   So, the previous ad-hoc threading support was both partial and broken.

7. Enable support for disabling `MBEDTLS_PEM_PARSE_C`.

8. Add support for `CURLOPT_SSLCERTTYPE` so user can specify `PEM` or
`DER` and get faster execution.

Closes #19983

7 days agomulti-notify: add check macro
Stefan Eissing [Fri, 19 Dec 2025 11:52:30 +0000 (12:52 +0100)]
multi-notify: add check macro

Since Curl_mntfy_dispatch_all() is called with high frequency and
mostly unnecessary, add a check macro to avoid the call when not
needed.

Closes #20034

7 days agohttp: minor cleanup after the unfold rework
Daniel Stenberg [Fri, 19 Dec 2025 13:21:19 +0000 (14:21 +0100)]
http: minor cleanup after the unfold rework

Closes #20037

7 days agocurlx: add `curlx_rename()`, fix to support long filenames on Windows
Viktor Szakats [Sat, 20 Dec 2025 00:44:46 +0000 (01:44 +0100)]
curlx: add `curlx_rename()`, fix to support long filenames on Windows

Move existing `Curl_rename()` `rename()` wrapper from lib to
curlx/fopen, and make it a curlx macro/function. To allow using
the local worker function to fixup long filenames on Windows.

Then fix the Windows-specific rename implementation to support long
filenames. This operation may happen when using a cookie jar, HSTS cache
or alt-svc cache, via libcurl or the curl tool.

Before this patch, when passing a long filename to the above options,
a `<random>.tmp` file was left on the disk without renaming it to the
filename passed to curl. There was also 1 second delay for each
attempted rename operation.

Also:
- checksrc: ban raw `rename()` and `MoveFileEx*()` functions.
- Note: `Curl_rename()` returned 1 on failure before this patch, while
  `curlx_rename()` returns -1 after, to match POSIX `rename()`.

Refs:
https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-movefileexa
https://learn.microsoft.com/windows/win32/fileio/maximum-file-path-limitation

Ref: #20040

Closes #20042

7 days agoGHA/http3-linux: set minimum number of runtest tests
Viktor Szakats [Sat, 20 Dec 2025 14:00:49 +0000 (15:00 +0100)]
GHA/http3-linux: set minimum number of runtest tests

Tailored for each job with a relatively tight limits. Also with no
tolerance in valgrind tests: 4 of the 4 has to be run.

Based on Test Clutch feature matrix which displays the minimum and
actual number of tests:
https://testclutch.curl.se/static/reports/feature-matrix.html

Also:
- runtests.pl: include total number of tests in the error message shown
  when the limit was not met.

Assisted-by: Dan Fandrich
Follow-up to 3f1cd809eeae05f39fec72fe780f3a69d21972fb #19942

Closes #20050

7 days agowindows: fix `CreateFile()` calls to support long filenames
Viktor Szakats [Fri, 19 Dec 2025 22:26:10 +0000 (23:26 +0100)]
windows: fix `CreateFile()` calls to support long filenames

It makes them work in Schannel's CA bundle loader, and curl tool's
set/get file timestamp operations (e.g. in `-R`/`--remote-time`). Also
to match file open operations, that already support long filenames.

E.g. when using `--remote-time`, fixing:
```
Warning: Failed to set filetime 1741363917 on outfile: CreateFile failed:
Warning: GetLastError 0x00000003
```

The special long filename logic is necessary to support Windows releases
prior to Windows 10 v1607. With the latter, it's possible to opt-in to
this behavior via a manifest setting. Note that Windows itself also needs
to opt-in to support this. Finally note that curl itself needs passing
`--globoff` to let long filenames through, pending #20044 and #20046.

Refs:
https://learn.microsoft.com/windows/win32/api/fileapi/nf-fileapi-createfilea
https://learn.microsoft.com/windows/win32/fileio/maximum-file-path-limitation

Ref: #8361
Inspired by: #19286
Inspired-by: Mathesh V
Closes #19286
Closes #20040

7 days agoopenssl: drop includes unused or duplicate
Viktor Szakats [Sat, 20 Dec 2025 11:38:19 +0000 (12:38 +0100)]
openssl: drop includes unused or duplicate

Also:
- vquic-tls.h: do not include unused headers for non-H3 builds.
- autotools: stop looking for `openssl/x509.h` header.
- cmp-config.pl: delete exception for `openssl/x509.h`.
- examples: format/comment sync between the two touched files.
- openssl: drop unused `curlx/wait.h` include.

Closes #20049

7 days agolib: drop unused `rand.h` includes
Viktor Szakats [Sat, 20 Dec 2025 11:18:34 +0000 (12:18 +0100)]
lib: drop unused `rand.h` includes

Closes #20047

7 days agocurl_ntlm_core: drop unused OpenSSL/wolfSSL headers
Viktor Szakats [Sat, 20 Dec 2025 11:23:21 +0000 (12:23 +0100)]
curl_ntlm_core: drop unused OpenSSL/wolfSSL headers

`openssl/rand.h` and `openssl/ssl.h`.

Closes #20048

7 days agocurlx: use curl alloc in `curlx_win32_stat()` (Windows)
Viktor Szakats [Sat, 20 Dec 2025 00:54:35 +0000 (01:54 +0100)]
curlx: use curl alloc in `curlx_win32_stat()` (Windows)

It's safe because we do not call `curlx_win32_stat()` from memdebug.c.

Closes #20043

7 days agotool_urlglob: constify an argument
Viktor Szakats [Sat, 20 Dec 2025 03:41:02 +0000 (04:41 +0100)]
tool_urlglob: constify an argument

Also: add argument names to prototypes.

Closes #20045

7 days agocmake: match filename suffixes with file content
Viktor Szakats [Fri, 19 Dec 2025 13:57:10 +0000 (14:57 +0100)]
cmake: match filename suffixes with file content

To:
- simplify recognizing CMake sources.
- ensure syntax highlighters use the correct file type.
- sync .h template filename with its autotools counterpart.

Also:
- cmakelint.sh: simplify, alpha sort the filelist.
- perlcheck.sh: simplify.

Closes #20039

8 days agocmake: delete unused file `CMake/CMakeConfigurableFile.in`
Viktor Szakats [Fri, 19 Dec 2025 14:10:15 +0000 (15:10 +0100)]
cmake: delete unused file `CMake/CMakeConfigurableFile.in`

Follow-up to 8cb010144964019b865fa224e166eb37f4e1d169

Closes #20038

8 days agoscorecard: more upload options
Stefan Eissing [Fri, 19 Dec 2025 12:06:34 +0000 (13:06 +0100)]
scorecard: more upload options

`--upload-no-cl` for uploads without "Content-Length:"
`--upload-parallel=1` for testing only serial uploads

Closes #20035

8 days agongtcp2: retune window sizes
Stefan Eissing [Fri, 19 Dec 2025 10:53:51 +0000 (11:53 +0100)]
ngtcp2: retune window sizes

With 24b36fd stream flow control window sizes have been set too
restrictive, crippling transfer rates when no rate limit is in effect.

Disable ngtcp3 stream window auto-tuning and extend the stream window
from the small initial size to the effective rate limit. If no rate
limit is configured, extend stream window to maximum value right away.

This cannot shrink the stream window later, however. But growing the
limit or removing it, will work mid download.

Fixes #20030
Reported-by: koujaz on github
Closes #20033

8 days agohttp: more unfold fixing
Daniel Stenberg [Fri, 19 Dec 2025 12:22:29 +0000 (13:22 +0100)]
http: more unfold fixing

Extended test 798 with some mini-sleeps to better trigger a problem that
was

Reported-by: Stefan Eissing
Closes #20036

8 days agosocketpair: drop redundant `_WIN32` branch and include
Viktor Szakats [Fri, 19 Dec 2025 10:00:53 +0000 (11:00 +0100)]
socketpair: drop redundant `_WIN32` branch and include

`io.h` already included via `curl_setup.h`, the other headers are
already guarded off for Windows. `INADDR_LOOPBACK` fallback remains
a no-op on Windows.

Closes #20032

8 days agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 19 Dec 2025 10:07:40 +0000 (11:07 +0100)]
RELEASE-NOTES: synced

8 days agocontributors.sh: only check -by: lines for names
Daniel Stenberg [Fri, 19 Dec 2025 10:06:41 +0000 (11:06 +0100)]
contributors.sh: only check -by: lines for names

Avoid catching lines that otherwise just says "by:" something.

8 days agobuild: drop duplicate include `curl/curl.h` and others
Viktor Szakats [Fri, 19 Dec 2025 01:09:15 +0000 (02:09 +0100)]
build: drop duplicate include `curl/curl.h` and others

- curl_range: replace `sendf.h` with direct header dependency
  `curl_trc.h`.
- drop `curl/curl.h` includes from internal sourcees in favor of the
  include made from `curl_setup.h`. Replace it with the latter where
  it's the only include.
- include `curl_setup.h` before using macros, where missing.
- drop redundant `stdlib.h`, `string.h` includes, in favor of
  `curl_setup_once.h` including them.
- drop redundant `limits.h` in favor of `curl_setup.h` including it.
- fake_addrinfo.h: fix typo in comment.
- curl_setup_once.h: drop `stdio.h` in favor of earlier include in
  `curl_setup.h`.
- drop stray, unused, `stddef.h` includes.
- memdebug.h: add missing `stddef.h` include. (relying on accidental
  includes via other headers before this patch.)
- stddef.h: document why it's included.
- strerr: drop `curl/mprintf.h` in favor of `curl/curl.h` including it
  via `curl_setup.h`.

Closes #20027

8 days agohttp: fix for unfolding line starting with TAB
Daniel Stenberg [Fri, 19 Dec 2025 08:15:40 +0000 (09:15 +0100)]
http: fix for unfolding line starting with TAB

It should still insert a (single) space when unfolding

Follow-up to 9941e7c95bf26f00fd87888a3 following up to 67ae101666f10232.

Updated test 1274 and 1940 accordingly.

Closes #20029

8 days agoCURLOPT_ACCEPT_ENCODING.md: warn about the expansion
Daniel Stenberg [Fri, 19 Dec 2025 09:14:14 +0000 (10:14 +0100)]
CURLOPT_ACCEPT_ENCODING.md: warn about the expansion

also mention it in KNOWN_RISKS.md

Closes #20031

8 days agocompressed.md: might generate a huge amount of bytes
Daniel Stenberg [Fri, 19 Dec 2025 08:04:16 +0000 (09:04 +0100)]
compressed.md: might generate a huge amount of bytes

Make sure this is not a surprise

Closes #20028

8 days agobuild: drop unused includes
Viktor Szakats [Thu, 18 Dec 2025 23:56:34 +0000 (00:56 +0100)]
build: drop unused includes

`curl_endian.h`, `easyif.h`, `llist.h`, `progress.h`, `slist.h`.

Also:
- multi_ev.h: delete unused include, add a missing direct one.

Closes #20025

8 days agobuild: drop unused `multiif.h` includes
Viktor Szakats [Thu, 18 Dec 2025 23:37:13 +0000 (00:37 +0100)]
build: drop unused `multiif.h` includes

Closes #20023

8 days agocurl_trc: delete unused DoH remains
Viktor Szakats [Fri, 19 Dec 2025 00:09:45 +0000 (01:09 +0100)]
curl_trc: delete unused DoH remains

Closes #20026

8 days agobuild: drop unused `curlx/inet_pton.h` includes
Viktor Szakats [Thu, 18 Dec 2025 23:48:39 +0000 (00:48 +0100)]
build: drop unused `curlx/inet_pton.h` includes

Closes #20024

8 days agobuild: drop unused `curl_share.h` includes
Viktor Szakats [Thu, 18 Dec 2025 23:27:59 +0000 (00:27 +0100)]
build: drop unused `curl_share.h` includes

Closes #20022

8 days agotimeval: scope a variable, merge two PP branches
Viktor Szakats [Thu, 18 Dec 2025 22:14:27 +0000 (23:14 +0100)]
timeval: scope a variable, merge two PP branches

Closes #20021

8 days agoTIME-KEEPING.md: fold long lines
Viktor Szakats [Thu, 18 Dec 2025 22:00:06 +0000 (23:00 +0100)]
TIME-KEEPING.md: fold long lines

9 days agotime-keeping: keep timestamp in multi, always update
Stefan Eissing [Thu, 18 Dec 2025 12:55:07 +0000 (13:55 +0100)]
time-keeping: keep timestamp in multi, always update

Always use curlx_now() when calling Curl_pgrs_now(data). Tests with the
"manual" updates to now proved differ more then 100ms in parallel testing.

Add `curlx_nowp()` to set current time into a struct curltime.
Add `curlx_ptimediff_ms() and friends, passing pointers.

Update documentation.

Closes #19998

9 days agotidy-up: miscellaneous
Viktor Szakats [Fri, 12 Dec 2025 19:51:52 +0000 (20:51 +0100)]
tidy-up: miscellaneous

- apply more clang-format.
- lib/version: use `CURL_ARRAYSIZE()`.
- INSTALL-CMAKE.md: sync-up an option description with others.
- examples: delete unused main args.
- examples/ftpgetinfo: document `_CRT_SECURE_NO_WARNINGS` symbol.
- delete remaining stray duplicate lines.
- acinclude.m4: drop an unnecessary x-hack.
- vtls/mbedtls: join a URL split into two lines.
- src/tool_cb_see: add parentheses around macro expressions.
- src/tool_operate: move literals to the right side of comparisons.
- libtests: sync up fopen/fstat error messages between tests.
- curl_setup.h: replace `if ! defined __LP64` with `ifndef __LP64`.
  I assume it makes no difference on Tandem systems, as the latter form
  is already used in `include/curl/system.h`.

Closes #20018

9 days agoINSTALL-CMAKE.md: add recently added targets
Viktor Szakats [Thu, 18 Dec 2025 20:14:31 +0000 (21:14 +0100)]
INSTALL-CMAKE.md: add recently added targets

Follow-up to d7bde803ee839eb438c95a1142411ceff2a11672 #20014

Closes #20020

9 days agohttp: when unfolding, leave single-space for new header line
Daniel Stenberg [Thu, 18 Dec 2025 12:58:22 +0000 (13:58 +0100)]
http: when unfolding, leave single-space for new header line

Restore the unfolding behavior from before 67ae101666f10232. This change
(leaving more whitespace in the delivered headers) turned out causing
some friction in the git project so presumably others might also find it
a little surprising.

Reported-by: Jeff King
Ref: https://marc.info/?l=git&m=176606332701171&w=2
Closes #20016

9 days agocmake/FindRustls: merge two `if`s
Viktor Szakats [Thu, 18 Dec 2025 13:31:05 +0000 (14:31 +0100)]
cmake/FindRustls: merge two `if`s

Closes #20017

9 days agocmake: add `curl-optiontable`, `curl-listhelp`, `curl-listcats` targets
Viktor Szakats [Thu, 18 Dec 2025 01:33:31 +0000 (02:33 +0100)]
cmake: add `curl-optiontable`, `curl-listhelp`, `curl-listcats` targets

To match autotools `optiontable`, `listhelp`, `listcats` targets.

Closes #20014

9 days agobuild: replace `-pedantic` with `-Wpedantic` when supported
Viktor Szakats [Wed, 17 Dec 2025 14:13:12 +0000 (15:13 +0100)]
build: replace `-pedantic` with `-Wpedantic` when supported

To use the modern form when possible. The modern option also allows
using the `no-` prefix to disable.

Supported by: gcc 4.8+, clang 3.2+ (= appleclang 4.2+)

This also automatically changes `-clang:-pedantic` to `-Wpedantic` in
clang-cl builds.

Refs:
https://github.com/llvm/llvm-project/commit/9877f689f282b19ca697aa8c6fecd752a84dbddd
https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/Warning-Options.html

Closes #20010

10 days agocmake: replace deprecated `OPENSSL_FOUND` with `OpenSSL_FOUND`
Viktor Szakats [Wed, 17 Dec 2025 14:57:10 +0000 (15:57 +0100)]
cmake: replace deprecated `OPENSSL_FOUND` with `OpenSSL_FOUND`

Used in `CMake/FindLibrtmp.cmake`.

`OpenSSL_FOUND` available since CMake v3.3.
`OPENSSL_FOUND` deprecated since v4.2.

Ref: https://cmake.org/cmake/help/v4.2/module/FindOpenSSL.html

Closes #20012

10 days agocmake: replace deprecated `PERL_FOUND` with `Perl_FOUND`
Viktor Szakats [Wed, 17 Dec 2025 14:51:24 +0000 (15:51 +0100)]
cmake: replace deprecated `PERL_FOUND` with `Perl_FOUND`

`Perl_FOUND` available since CMake v3.3.
`PERL_FOUND` deprecated since v4.2.

Ref: https://cmake.org/cmake/help/v4.2/module/FindPerl.html

Closes #20011

10 days agoopenssl: toggling CURLSSLOPT_NO_PARTIALCHAIN makes a different CA cache
Daniel Stenberg [Wed, 17 Dec 2025 09:54:16 +0000 (10:54 +0100)]
openssl: toggling CURLSSLOPT_NO_PARTIALCHAIN makes a different CA cache

Reported-by: Stanislav Fort
Closes #20009

10 days agowolfssl: proof use of wolfSSL_i2d_SSL_SESSION
Stefan Eissing [Wed, 17 Dec 2025 10:20:42 +0000 (11:20 +0100)]
wolfssl: proof use of wolfSSL_i2d_SSL_SESSION

While wolfSSL_i2d_SSL_SESSION() does not change the passed pointer, like
OpenSSL does, it may one day decide to do so. Pass a copy instead to be
future-proof to such a change in wolfSSL's implementation.

Closes #20008

10 days agomulti: remove useless assignment
Daniel Stenberg [Wed, 17 Dec 2025 06:51:08 +0000 (07:51 +0100)]
multi: remove useless assignment

Pointed out by CodeSonar

Closes #20006

10 days agodocs: rename CURLcode variables to 'result'
Daniel Stenberg [Tue, 16 Dec 2025 14:54:06 +0000 (15:54 +0100)]
docs: rename CURLcode variables to 'result'

10 days agodocs: use mresult as variable name for CURLMcode
Daniel Stenberg [Tue, 16 Dec 2025 12:47:45 +0000 (13:47 +0100)]
docs: use mresult as variable name for CURLMcode

10 days agotests: rename CURLMcode variables to mresult
Daniel Stenberg [Tue, 16 Dec 2025 12:40:02 +0000 (13:40 +0100)]
tests: rename CURLMcode variables to mresult

10 days agolib: name the main CURLMcode variable 'mresult'
Daniel Stenberg [Tue, 16 Dec 2025 12:06:20 +0000 (13:06 +0100)]
lib: name the main CURLMcode variable 'mresult'

To make it distinctly different from 'result' and keep consistency
betwen functions.

Closes #19997

10 days agoGHA: bump pip-dependencies
dependabot[bot] [Tue, 16 Dec 2025 23:37:45 +0000 (23:37 +0000)]
GHA: bump pip-dependencies

- update `filelock` from 3.20.0 to 3.20.1 (CVE-2025-68146) (used in pytests)
- update `pytest` from 9.0.1 to 9.0.2
- update `ruff` from 0.14.8 to 0.14.9

Closes #20004

10 days agoexamples/threaded-ssl: delete in favor of `examples/threaded`
Viktor Szakats [Tue, 16 Dec 2025 20:32:29 +0000 (21:32 +0100)]
examples/threaded-ssl: delete in favor of `examples/threaded`

After applying a recent fix made to `threaded.c` (formerly
`multithread.c`) to `threaded-ssl.c`, syncing and updating comments,
the two examples turned out to be identical except their test URLs.

Delete one of them to avoid duplication.

Also:
- examples/threaded: scope a variable.
- examples/threaded: merge comments from its deleted sibling.

Follow-up to 61273f58125c41a84febe90a50238ee7fb12a9ad #20001
Follow-up to 971e8d661c68ce8859885c3ae865ff9441b62f0e #19526 #19524

Closes #20002

10 days agoHISTORY: add current website stats
Daniel Stenberg [Tue, 16 Dec 2025 22:33:54 +0000 (23:33 +0100)]
HISTORY: add current website stats

11 days agotests: add a standard log line for alloc failures
Dan Fandrich [Tue, 16 Dec 2025 08:26:25 +0000 (00:26 -0800)]
tests: add a standard log line for alloc failures

This type of test failure requires a test status line in order to be
consistent with other failures and to be parsed properly by Test Clutch.
This is the same style as an exit or postcheck failure.

Closes #19995

11 days agobadwords: catch and fix threading-related words
Viktor Szakats [Tue, 16 Dec 2025 19:01:16 +0000 (20:01 +0100)]
badwords: catch and fix threading-related words

Also:
- sync newlines between the two threaded examples.

Closes #20001

11 days agoschannel: use Win8 `CERT_NAME_SEARCH_ALL_NAMES_FLAG` with old SDKs
Viktor Szakats [Tue, 16 Dec 2025 16:26:46 +0000 (17:26 +0100)]
schannel: use Win8 `CERT_NAME_SEARCH_ALL_NAMES_FLAG` with old SDKs

Define `CERT_NAME_SEARCH_ALL_NAMES_FLAG` macro if missing.
To allow using a runtime branch regardless of build-time SDK version,
when running on Windows 8+.

In practice it enables this branch for builds using mingw-w64 v3, and
MSVC with Windows SDK <8.

Also reducing build variations.

Follow-up to 29e40a6d8a70630dd8eaa15beded205792342d08 #4761 #3711
Follow-up to 899630021153b2a26a43008cccc6620b6c3f9bbf #1325
Follow-up to 172b2beba6b89b632c09be7a88645e3a0607cfe9 #264 (comment)

Closes #20000

11 days agolib: create unitprotos.h in the builddir, not srcdir
Dan Fandrich [Tue, 16 Dec 2025 07:32:59 +0000 (23:32 -0800)]
lib: create unitprotos.h in the builddir, not srcdir

The make rule confused automake by changing directories before creating
the file, causing unitprotos.h to be created in the srcdir instead of
the builddir. This results in a stale file and confusing compile errors
in out-of-tree builds.

Fixes #19966
Closes #19993

11 days agocf-socket: enable Win10 `TCP_KEEP*` options with old SDKs
Viktor Szakats [Tue, 16 Dec 2025 15:41:05 +0000 (16:41 +0100)]
cf-socket: enable Win10 `TCP_KEEP*` options with old SDKs

Define `TCP_KEEP*` macros if they are missing in Windows builds.
To allow using these runtime `setsockopt()` options regardless of
build-time SDK version, when running on Windows 10.0.16299+.

In practice in enables them for builds using mingw-w64 <12, and
MSVC with Windows SDK <10.

Before this patch these runtime options required building curl with
a recent toolchain.

Follow-up to f0de14168a4d1c3a4ed43a04af92c5755c84b9fc #19559

Closes #19999

11 days agoidn: clarify null-termination on Windows
Viktor Szakats [Mon, 15 Dec 2025 15:49:04 +0000 (16:49 +0100)]
idn: clarify null-termination on Windows

Add comments to clarify that a terminating null is always present in
the buffers returned to the caller.

The curl APIs `win32_idn_to_ascii()` or `win32_ascii_to_idn()` receive
a null-terminated UTF-8 string as input. They first convert it to wide
chars by first asking `MultiByteToWideChar()` to calculate the length,
by passing -1. This API returns the length with the null char included
(= `strlen() + 1`), does the conversion, with the output also
null-terminated. `IdnTo*()` preserve this null character as documented.
Then we pass this null-terminated, fixed-length buffer ito
`WideCharToMultiByte()`, which keeps preserving the null, ending up in
the buffer returned to the caller.

Refs:
https://learn.microsoft.com/windows/win32/api/stringapiset/nf-stringapiset-multibytetowidechar
https://learn.microsoft.com/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte
https://learn.microsoft.com/windows/win32/api/winnls/nf-winnls-idntoascii
https://learn.microsoft.com/windows/win32/api/winnls/nf-winnls-idntounicode

WINE source code:
https://gitlab.winehq.org/wine/wine/-/blob/wine-10.20/dlls/kernelbase/locale.c
https://gitlab.winehq.org/wine/wine/-/blob/wine-10.20/dlls/ntdll/locale.c
https://gitlab.winehq.org/wine/wine/-/blob/wine-10.20/dlls/ntdll/locale_private.h

Ref: https://github.com/curl/curl/pull/19976#issuecomment-3656005765
Follow-up to 6694a42aa0e820a6fe1e59d85ff8597b6d768d8d #19798

Closes #19980

11 days agolocaltime: detect thread-safe alternatives and use them
Viktor Szakats [Sat, 13 Dec 2025 03:27:41 +0000 (04:27 +0100)]
localtime: detect thread-safe alternatives and use them

- add local API `toolx_localtime()` to wrap the banned function
  `localtime()`. Used from libcurl, libtests and test servers.
- auto-detect and use `localtime_r()` where available (e.g. Linux).
  Also to support multi-threading.
- use `localtime_s()` on Windows. It requires MSVC or mingw-w64 v4+.
  Also to support multi-threading.
  Use local workaround to also support mingw-w64 v3.
- add `src/toolx` to keep internal APIs used by the curl tool and tests,
  but not by libcurl. `toolx_localtime()` is the first API in it.
- replace `localtime()` calls with `toolx_localtime()`.
  Except in examples.
- note Windows XP's default `msvcrt.dll` doesn't offer secure CRT APIs.
  XP likely needs a newer version of this DLL, or may not run.
- note that `localtime()` mirrors `gmtime()`, with the difference that
  `gmtime()`'s internal wrapper lives in curlx.

Also:
- drop redundant `int` casts.

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/localtime-localtime32-localtime64
https://learn.microsoft.com/cpp/c-runtime-library/reference/localtime-s-localtime32-s-localtime64-s
https://pubs.opengroup.org/onlinepubs/9799919799/functions/localtime.html
https://linux.die.net/man/3/localtime_r

Ref: #19955 (for `gmtime_r()`)
Follow-up to 54d9f060b4b0a8fb5fa006813e4db1ca5c1a07e8
Closes #19957

11 days agocurlx: move `Curl_gmtime()`, use `gmtime_s()` on Windows
Viktor Szakats [Fri, 12 Dec 2025 23:16:58 +0000 (00:16 +0100)]
curlx: move `Curl_gmtime()`, use `gmtime_s()` on Windows

Move `Curl_gmtime()` to curlx and rename to `curlx_gmtime()`. Then call
the internal wrapper also from the curl tool, to avoid using the banned
`gmtime()` directly, and using better, thread-safe alternatives when
available.

Windows `gmtime_s()` requires mingw-w64 v4+ or MSVC. Use local
workaround to also support mingw-w64 v3. `gmtime_s()` also makes
defining `_CRT_SECURE_NO_WARNINGS` unnecessary.

Also:
- lib: drop unused `parsedate.h` includes.
- drop redundant cast from `gmtime_r()` result.
- autotools: reverse condition in the proto detection to avoid
  misleading readers. (the condition plays no role in detection.)
- note Windows XP's default `msvcrt.dll` doesn't offer secure CRT APIs.
  XP likely needs a newer version of this DLL, or may not run.

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/gmtime-gmtime32-gmtime64
https://learn.microsoft.com/cpp/c-runtime-library/reference/gmtime-s-gmtime32-s-gmtime64-s
https://pubs.opengroup.org/onlinepubs/9799919799/functions/gmtime.html
https://linux.die.net/man/3/gmtime_r

Ref: #19957 (for `localtime_r()`)
Follow-up to 54d9f060b4b0a8fb5fa006813e4db1ca5c1a07e8
Closes #19955

11 days agoruntests: log the required minimum number of tests in CI
Viktor Szakats [Mon, 15 Dec 2025 22:26:34 +0000 (23:26 +0100)]
runtests: log the required minimum number of tests in CI

For Test Clutch.

If set (via env or tflags), include the minimum number of tests required
in runtests' log output:
```
* Min tests: 1750
```

Follow-up to 3f1cd809eeae05f39fec72fe780f3a69d21972fb #19942

Closes #19987

11 days agobuild: unix socket tidy-ups
Viktor Szakats [Tue, 16 Dec 2025 00:37:10 +0000 (01:37 +0100)]
build: unix socket tidy-ups

- lib: delete two unused `<sys/un.h>` includes.

- lib: drop interim macro `WIN32_SOCKADDR_UN`.
  Follow-up to 0fe9018e1a1af0d906dfe934efe2f2b1ba48f060 #7737
  Also fixing a potential issue of leaving unix socket support disabled
  if any header would include Windows' `afunix.h`, and define
  `UNIX_PATH_MAX` on its own.

- connect: honor unix socket disable option.

- connect: simplify unix socket PP condition.
  `USE_UNIX_SOCKETS` already means the necessary header/type are
  available, guaranteed by configure. `AF_UNIX` is already used
  elsewhere in the code without explicit checks.

- curl_setup.h: document availability of `afunix.h` on Windows more.
  It requires mingw-w64 10+ or MS SDK 10.17763.0 VS2017 15.8+.

- curl_setup.h: use `afunix.h` with mingw-w64 v10+ to start avoiding
  the local workaround if possible.

- GHA/windows: test disable unix socket option on Windows.

Ref: https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/

Closes #19989

11 days agopytest: do not ignore server issues
Stefan Eissing [Tue, 16 Dec 2025 09:12:07 +0000 (10:12 +0100)]
pytest: do not ignore server issues

When a test server is found or configured, do not silently ignore
errors to start and disable them when checking their version.

This forces pytest to fail when a server is not operating
as it should.

Closes #19996

11 days agocookie. return proper error on OOM
Daniel Stenberg [Tue, 16 Dec 2025 08:11:22 +0000 (09:11 +0100)]
cookie. return proper error on OOM

Follow-up to a78a07d3a9dc808a51

Closes #19992

11 days agolib: keep timestamp in easy handle
Stefan Eissing [Mon, 15 Dec 2025 13:28:09 +0000 (14:28 +0100)]
lib: keep timestamp in easy handle

Use `data->progress.now` as the timestamp of proecssing a transfer.
Update it on significant events and refrain from calling `curlx_now()`
in many places.

The problem this addresses is
a) calling curlx_now() has costs, depending on platform. Calling it
   every time results in 25% increase `./runtest` duration on macOS.
b) we used to pass a `struct curltime *` around to save on calls, but
   when some method directly use `curx_now()` and some use the passed
   pointer, the transfer experienes non-linear time. This results in
   timeline checks to report events in the wrong order.

By keeping a timestamp in the easy handle and updating it there, no
longer invoking `curlx_now()` in the "lower" methods, the transfer
can observer a steady clock progression.

Add documentation in docs/internals/TIME-KEEPING.md

Reported-by: Viktor Szakats
Fixes #19935
Closes #19961

11 days agocurl_sasl: username cleanups
Daniel Stenberg [Mon, 15 Dec 2025 16:16:54 +0000 (17:16 +0100)]
curl_sasl: username cleanups

Remove 'user' from the sasl_ctx struct and instead refer to conn->user.

conn->user is always non-NULL, so remove the checks for that.

Closes #19981

11 days agoGHA/non-native: fix passing some envs to the VMs
Viktor Szakats [Mon, 15 Dec 2025 22:42:39 +0000 (23:42 +0100)]
GHA/non-native: fix passing some envs to the VMs

Also increase the minimum for FreeBSD.

Ref: #19987
Follow-up to 3f1cd809eeae05f39fec72fe780f3a69d21972fb #19942
Closes #19988

11 days agogetenv: drop internal 1-to-1 wrapper
Viktor Szakats [Mon, 15 Dec 2025 12:19:30 +0000 (13:19 +0100)]
getenv: drop internal 1-to-1 wrapper

Closes #19984

12 days agodocs: fix time_posttransfer output unit as seconds
Sergey Katsubo [Mon, 15 Dec 2025 21:04:14 +0000 (00:04 +0300)]
docs: fix time_posttransfer output unit as seconds

Closes #19986

12 days agovquic: ignore 0-length UDP packets
Stefan Eissing [Mon, 15 Dec 2025 10:15:38 +0000 (11:15 +0100)]
vquic: ignore 0-length UDP packets

When someone gives us 0-length UDP packets, ignore
them as they cannot be valid QUIC packets. This also
prevents us from messing up any GSO calculations.

Reported-by: Stanislav Fort
Closes #19978

12 days agoGHA/linux: update dependency pizlonator/fil-c to v0.677
renovate[bot] [Mon, 15 Dec 2025 05:13:42 +0000 (05:13 +0000)]
GHA/linux: update dependency pizlonator/fil-c to v0.677

Closes #19974

12 days agoTODO: consider a multi-threaded curl tool
Daniel Stenberg [Sun, 14 Dec 2025 10:58:01 +0000 (11:58 +0100)]
TODO: consider a multi-threaded curl tool

Closes #19971

12 days agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 15 Dec 2025 06:50:51 +0000 (07:50 +0100)]
RELEASE-NOTES: synced

12 days agotests/server: fix initialization on Windows Vista+
Viktor Szakats [Sun, 14 Dec 2025 23:05:15 +0000 (00:05 +0100)]
tests/server: fix initialization on Windows Vista+

Make sure to call `curlx_now_init()` before the first call to
`curlx_now()`.

Before this patch the first `curlx_now()` used the non-Vista code path
calling `GetTickCount()` on Vista+. This is harmless, but the upcoming
PR #18009 is going to drop the non-Vista code path, causing a division
by zero at startup in test servers, without this fix.

Bug: https://github.com/curl/curl/pull/18009#issuecomment-3652154307

Closes #19973

12 days agotidy-up: replace banned `printf()` with `puts()`
Viktor Szakats [Sun, 14 Dec 2025 18:16:57 +0000 (19:16 +0100)]
tidy-up: replace banned `printf()` with `puts()`

In `curlinfo` and CMake integration test app.

Closes #19972

12 days agorenovate: try bumping Fil-C on releases, not tags
Viktor Szakats [Mon, 15 Dec 2025 00:53:16 +0000 (01:53 +0100)]
renovate: try bumping Fil-C on releases, not tags

CI needs the binary packages attached to the release, which appears some
time after tagging. Hopefully this patch helps getting a clean build
by the time Renovate opens its PR.

Ref: https://docs.renovatebot.com/modules/datasource/github-releases/
Ref: #19905, #19974
Closes #19975

12 days agoeasy: fix debug ev poll builds
Gabriel Marin [Sat, 13 Dec 2025 21:09:04 +0000 (22:09 +0100)]
easy: fix debug ev poll builds

Prior to this change the wrong variable name was used for one of the
debug messages.

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

13 days agoruntests: improve XML prolog check, enable `-w` permanently, fix two tests
Viktor Szakats [Sun, 14 Dec 2025 08:42:59 +0000 (09:42 +0100)]
runtests: improve XML prolog check, enable `-w` permanently, fix two tests

To really verify the presence of the XML prolog, also in CI.

- move the prolog check from `loadtest` to `checktest`.
  (load did a soft error, silently skipping the test instead of failing)
- runtests: enable `-w` functionality permanently for all test targets,
  drop the option. It has no measurable performance impact.
- test 798, 1665: add XML prolog.
  Follow-up to f0d277cb0e3712ae4edf8f51822ffa99e9b3ec54

Follow-up to b5ea0736bbeeae717925d8eccbdb15057d8e88e9 #19946
Follow-up to 904e7ecb66519951681377758fe6b07dde28ce36 #19347

Closes #19970

13 days agosynctime: tidy up, make it work on all platforms
Viktor Szakats [Sun, 14 Dec 2025 07:12:01 +0000 (08:12 +0100)]
synctime: tidy up, make it work on all platforms

The `--synctime` option remains non-UWP-Windows-specific.

Also:
- replace default URL with `ntp.org`.
- delete unused example URL.

Closes #19965

13 days agoGHA: update actions
renovate[bot] [Sat, 13 Dec 2025 19:51:34 +0000 (19:51 +0000)]
GHA: update actions

- update actions/checkout action to v6.0.1
- update github/codeql-action action to v4.31.8
- update msys2/setup-msys2 action to v2.30.0

Closes #19962
Closes #19967
Closes #19968

13 days agorenovate: try to disable GitHub Actions updates differently
Viktor Szakats [Sun, 14 Dec 2025 08:10:58 +0000 (09:10 +0100)]
renovate: try to disable GitHub Actions updates differently

Follow-up to a9b1be555a26aeca623721b0826ea66d6b8c0929 #19954

Closes #19969

13 days agoexamples: delete unresponsive example URL
Viktor Szakats [Sat, 13 Dec 2025 11:45:09 +0000 (12:45 +0100)]
examples: delete unresponsive example URL

Also:
- sync header layout with rest of examples.
- replace rest of arbitrary website links with example ones.

Closes #19959

13 days agorenovate: leave bumping GitHub Actions to Dependabot
Viktor Szakats [Fri, 12 Dec 2025 22:30:45 +0000 (23:30 +0100)]
renovate: leave bumping GitHub Actions to Dependabot

To avoid update noise. Renovate bumps everything instantly, meaning
a major version a couple hours after release, then all minor bugfix
releases throughout the next 1-2 days. Also putting major versions in
a different group than the bugfix release, and there is no support for
a cooldown period.

After this patch GitHub's Dependabot remains the single tool responsible
to bump GitHub Actions, once a month, grouped, with a cooldown period.
In sync with most other curl repos.

Both Renovate and Dependabot keep bumping pinned pips for now. Also
Renovate keeps updating C dependencies and Dockerfile.

Closes #19954