]> git.feebdaed.xyz Git - 0xmirror/curl.git/log
0xmirror/curl.git
25 hours agotidy-up: miscellaneous
Viktor Szakats [Sat, 20 Dec 2025 13:32:49 +0000 (14:32 +0100)]
tidy-up: miscellaneous

- asyn-thrdd.c: scope an include.
- apply more clang-format suggestions.
- tidy-up PP guard comments.
- delete empty line from the top of headers.
- add empty line after `curl_setup.h` include where missing.
- fix indent.
- CODE_STYLE.md: add `strcpy`.
  Follow-up to 8636ad55dfbdbcc2809a61e65c3511baf5e7b0e8 #20088
- lib1901.c: drop unnecessary line.
  Follow-up to 436e67f65b9dee1e80aa063c39450f0d1df6ac72 #20076

Closes #20070

36 hours agoftp: return better on OOM in two places
Daniel Stenberg [Thu, 25 Dec 2025 22:17:24 +0000 (23:17 +0100)]
ftp: return better on OOM in two places

Found with strict torture testing.

Closes #20099

36 hours agomemdebug: stop tracking send and recv
Daniel Stenberg [Thu, 25 Dec 2025 22:21:34 +0000 (23:21 +0100)]
memdebug: stop tracking send and recv

- they rarely catch any problems
- we have other ways to test different send/recv problems
- the number of such calls vary much more per invoke than others, making
  memdebugging harder
- reducing the total number of fallible functions per test is good
- they were not used as intended anyway

Closes #20097

2 days agocurl_threads: don't do another malloc if the first fails
Daniel Stenberg [Thu, 25 Dec 2025 17:06:37 +0000 (18:06 +0100)]
curl_threads: don't do another malloc if the first fails

Closes #20095

2 days agosrc: drop unused includes
Viktor Szakats [Thu, 25 Dec 2025 17:05:53 +0000 (18:05 +0100)]
src: drop unused includes

Also replace some indirect includes with direct ones.

Closes #20096

2 days agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 25 Dec 2025 11:13:55 +0000 (12:13 +0100)]
RELEASE-NOTES: synced

2 days agocookie: flush better
Daniel Stenberg [Thu, 25 Dec 2025 09:53:11 +0000 (10:53 +0100)]
cookie: flush better

The cookie flushing (saving to a cookie jar) should only be done if a
transfer has been started. This is now done by checking the
cookies->running field, which is not reset in curl_easy_reset() so the
saving works correctly even after a call to that.

Follow-up to fd6eb8d6e77d95e71c

Verified by test 1920

Reported-by: Alexander Batischev
Fixes #20090
Closes #20094

2 days agolib: drop unused protocol headers
Viktor Szakats [Wed, 24 Dec 2025 23:26:48 +0000 (00:26 +0100)]
lib: drop unused protocol headers

- drop unused `http.h` includes.
- drop unused `http1.h` include.
- drop unused `http2.h` includes.
- vssh/ssh.h: drop unused `vssh.h` include.
- urldata.h: drop unused protocol includes.
- url: include `smtp.h` directly.
- rtsp.h: include directly where used.
- imap, smtp: drop redundant include, move another from .h to .c.

Verified with an all non-unity CI run.

Closes #20093

2 days agolibssh: set both knownhosts options to the same file
Daniel Stenberg [Wed, 24 Dec 2025 16:47:03 +0000 (17:47 +0100)]
libssh: set both knownhosts options to the same file

Reported-by: Harry Sintonen
Closes #20092

2 days agoos400sys: replace `strcpy()` with `memcpy()`
Viktor Szakats [Wed, 24 Dec 2025 00:13:19 +0000 (01:13 +0100)]
os400sys: replace `strcpy()` with `memcpy()`

Source and target are the same size, null-terminator is already present
in the target buffer.

Closes #20089

3 days agocurl_ntlm_core: fix DES_* symbols for some wolfSSL builds
Daniel Stenberg [Tue, 23 Dec 2025 21:22:37 +0000 (22:22 +0100)]
curl_ntlm_core: fix DES_* symbols for some wolfSSL builds

Recent wolfSSL with OPENSSL_COEXIST enabled does not provide the DES_*
symbols, so we do.

Reported-by: Daniel Pouzzner
Closes #20083

3 days agoescape: add a length check in curl_easy_escape
Daniel Stenberg [Tue, 23 Dec 2025 23:09:37 +0000 (00:09 +0100)]
escape: add a length check in curl_easy_escape

Only accept up to SIZE_MAX/16 input bytes. To avoid overflows, mistakes
and abuse.

Follow-up to 9bfc7f923479235b2fdf0e

Reported-by: Daniel Santos
Closes #20086

3 days agochecksrc: ban `strcpy`
Viktor Szakats [Wed, 24 Dec 2025 00:08:58 +0000 (01:08 +0100)]
checksrc: ban `strcpy`

No longer used in the codebase. Replacement is `curlx_strcopy()`, possibly
`memcpy()` or dynbuf.

Also:
- OS400: allow three calls.

Closes #20088

3 days agobuild: stop disabling `strcpy` checks with clang-tidy
Viktor Szakats [Tue, 23 Dec 2025 11:16:52 +0000 (12:16 +0100)]
build: stop disabling `strcpy` checks with clang-tidy

Follow-up to 436e67f65b9dee1e80aa063c39450f0d1df6ac72 #20076

Closes #20084

4 days agotests: replace `strcpy()` with `curlx_strcopy()`
Viktor Szakats [Tue, 23 Dec 2025 10:59:59 +0000 (11:59 +0100)]
tests: replace `strcpy()` with `curlx_strcopy()`

Also:
- examples/hsts-preload: apply the same change as it's based on lib1915
  in tests. Make a local clone of `curlx_strcopy()`. Then drop the
  `_CRT_SECURE_NO_WARNINGS` hack, that's no longer necessary.
- curl_setup.h: delete `strcpy()` from the `_CRT_SECURE_NO_WARNINGS`
  list.

Closes #20076

4 days agolib547, 555: fix off-by-one null-terminator in read callback
Viktor Szakats [Tue, 23 Dec 2025 11:03:10 +0000 (12:03 +0100)]
lib547, 555: fix off-by-one null-terminator in read callback

`strcpy()` wrote an unnecessary null-terminator past the available read
buffer.

test551 was also affected because it reuses lib547.

Cherry-picked from #20076
Closes #20082

4 days agocf-h1-proxy: support folded headers in CONNECT responses
Daniel Stenberg [Tue, 23 Dec 2025 12:54:12 +0000 (13:54 +0100)]
cf-h1-proxy: support folded headers in CONNECT responses

Update test 1941 to verify this

Remove unused code from dynhds for handling folded headers, and the
associated unit tests of those functions in test 2602 and 2603.

Closes #20080

4 days agoGHA: update ngtcp2/nghttp3 to v1.14.0
renovate[bot] [Tue, 23 Dec 2025 12:35:07 +0000 (12:35 +0000)]
GHA: update ngtcp2/nghttp3 to v1.14.0

Closes #20078

4 days agoGHA: update ngtcp2/ngtcp2 to v1.19.0
renovate[bot] [Tue, 23 Dec 2025 12:35:13 +0000 (12:35 +0000)]
GHA: update ngtcp2/ngtcp2 to v1.19.0

Closes #20079

4 days agovquic: initialize new callback in nghttp3 1.14.0+
Viktor Szakats [Tue, 23 Dec 2025 11:24:30 +0000 (12:24 +0100)]
vquic: initialize new callback in nghttp3 1.14.0+

Fixing (seen in curl-for-win production build):
```
lib/vquic/curl_ngtcp2.c:1257:1: error: missing field 'recv_settings2' initializer [-Werror,-Wmissing-field-initializers]
 1257 | };
      | ^
1 error generated.
```
Ref: https://ci.appveyor.com/project/curlorg/curl-for-win/builds/53281785#L6752
Ref: https://github.com/curl/curl/actions/runs/20459295003/job/58788229134#step:3:5513

Also:
- Mark previous callback deprecated.
- Document ngtcp2, nghttp3 versions for callback entry feature guards.

Refs:
https://github.com/ngtcp2/nghttp3/releases/tag/v1.14.0
https://github.com/ngtcp2/nghttp3/pull/432
https://github.com/ngtcp2/nghttp3/commit/1616ab835061d7cdd2ef114bc3ddb917ce269611

Closes #20077

5 days agocurlx: curlx_strcopy() instead of strcpy()
Daniel Stenberg [Sun, 21 Dec 2025 22:40:24 +0000 (23:40 +0100)]
curlx: curlx_strcopy() instead of strcpy()

This function REQUIRES the size of the target buffer as well as the
length of the source string. Meant to make it harder to do a bad
strcpy().

Removes 23 calls to strcpy().

Closes #20067

5 days agoapple sectrust: fix ancient evaluation
Stefan Eissing [Wed, 17 Dec 2025 11:31:39 +0000 (12:31 +0100)]
apple sectrust: fix ancient evaluation

On versions before macOS 10.14, ios 12 and watchos 5, check the
evaluation code to return the error from evaluation.

Reported-by: Stanislav Fort
Closes #20074

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

9 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