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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

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

4 months 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.

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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'

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

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

4 months agotests: add a standard log line for alloc failures 19995/head
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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months 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

4 months agoschannel: cap the maximum allowed size for loading cert
Daniel Stenberg [Sat, 13 Dec 2025 23:13:27 +0000 (00:13 +0100)] 
schannel: cap the maximum allowed size for loading cert

To avoid problems with mistakes or abuse, cap the largest allowed
certificate size to load to CURL_MAX_INPUT_LENGTH bytes (8MB).

Closes #19964

4 months agotests: verify new header undfolder
Daniel Stenberg [Thu, 11 Dec 2025 22:28:51 +0000 (23:28 +0100)] 
tests: verify new header undfolder

test 798 - incoming cookie header in a folded line

test 1665 - verify HTTP headers without final CRLF. Make sure all complete
headers are delivered even if the reponse is partial

4 months agohttp: unfold response headers earlier
Daniel Stenberg [Fri, 12 Dec 2025 15:36:08 +0000 (16:36 +0100)] 
http: unfold response headers earlier

Make the low-level HTTP header "builder" unfold headers so that
everything else can keep pretending folding does not exist.

This code no longer tries to reduce repeated leading whitespace (in the
continued folded header) to a single one. To avoid having to have a
special state for that.

Adjusted two test cases accordingly

Closes #19949

4 months agoGHA/checksrc: fix `-z` position, also use `--output` with `xmllint`
Viktor Szakats [Sat, 13 Dec 2025 11:35:36 +0000 (12:35 +0100)] 
GHA/checksrc: fix `-z` position, also use `--output` with `xmllint`

Fixing:
```
fatal: option '-z' must come before non-option arguments
```
Ref: https://github.com/curl/curl/actions/runs/20183280533/job/57948203944#step:4:5

Follow-up to b5ea0736bbeeae717925d8eccbdb15057d8e88e9 #19946
Closes #19958

4 months agotool_urlglob: support globs as long as config line lengths
Daniel Stenberg [Sat, 13 Dec 2025 12:48:59 +0000 (13:48 +0100)] 
tool_urlglob: support globs as long as config line lengths

libcurl supports up to 8MB string inputs, the config file accepts up to
10MB line lengths. It did not make sense to limit the globs to a maximum
of one megabyte.

Closes #19960

4 months agotests: fix perl scalar warning
Dan Fandrich [Fri, 12 Dec 2025 23:36:40 +0000 (15:36 -0800)] 
tests: fix perl scalar warning

Fixes the warning "Scalar value @xml[0] better written as $xml[0]"

Follow-up to b5ea0736bbeeae717925d8eccbdb15057d8e88e9

Ref: #19946

4 months agoGHA: update actions
renovate[bot] [Fri, 12 Dec 2025 22:02:09 +0000 (22:02 +0000)] 
GHA: update actions

- actions/cache action to v5.0.1
- actions/download-artifact to v7.0.0
- actions/upload-artifact to v6.0.0

Closes #19952
Closes #19953

4 months agoGHA: enable libssh and libssh2 in 10 more Linux jobs
Viktor Szakats [Fri, 12 Dec 2025 02:59:21 +0000 (03:59 +0100)] 
GHA: enable libssh and libssh2 in 10 more Linux jobs

To run more pytest sshd tests, and for more static analysis.

Also:
- drop redundant option from `openssl libssh2 ...` config.
- GHA/linux: enable pytest in the LTO job (to test libssh2).
- avoid both with local builds of OpenSSL-forks, due to crypto lib
  mixups causing a mixture of build error, crashes, test failures.

Follow-up to eb39fee40be6a8e68be2551e36b6fcb94170aaed #19934

Closes #19943

4 months agotests/data: delete stray comments
Viktor Szakats [Fri, 12 Dec 2025 16:16:56 +0000 (17:16 +0100)] 
tests/data: delete stray comments

Closes #19950

4 months agotests/data: add XML prolog to test files
Viktor Szakats [Fri, 12 Dec 2025 12:43:55 +0000 (13:43 +0100)] 
tests/data: add XML prolog to test files

To formalize they are now XML-compliant (with some asterisks.)

Also to help syntax highlighters work on them to make their content more
readable.

Also:
- Delete empty comment decorations.
- GHA/checksrc: simplify XML check.
- runtests: fail to load test data with XML prolog missing.

Follow-up to bfe6eb1c06f295a45c4d2c9c7aa8f09895706313 #19927
Follow-up to 87ba80a6df1dfd7ceaaa52352c9f23afff0ed513

Closes #19946

4 months agotest567: add a header separating CRLF
Daniel Stenberg [Fri, 12 Dec 2025 15:37:27 +0000 (16:37 +0100)] 
test567: add a header separating CRLF

To make it a valid response.

Closes #19948

4 months agoGHA/windows: move dl-mingw tests from 9.5.0 to 15.1.0
Viktor Szakats [Fri, 12 Dec 2025 13:04:37 +0000 (14:04 +0100)] 
GHA/windows: move dl-mingw tests from 9.5.0 to 15.1.0

To see if it's less flaky. Also to finish 1m faster due to faster builds.

Closes #19947

4 months agotest568: fix codespell, catch it next time early in CI
Viktor Szakats [Fri, 12 Dec 2025 11:30:51 +0000 (12:30 +0100)] 
test568: fix codespell, catch it next time early in CI

Also:
- GHA/checksrc: do not exclude `tests/data/*` changes.

Follow-up to 407d2f3d574f68bfe986b621282a61016ca45c63 #19944

Closes #19945

4 months agocmake: update a comment
Viktor Szakats [Fri, 12 Dec 2025 12:09:37 +0000 (13:09 +0100)] 
cmake: update a comment

4 months agobuild: disable typecheck for analyzers and Fil-C
Viktor Szakats [Fri, 12 Dec 2025 00:05:21 +0000 (01:05 +0100)] 
build: disable typecheck for analyzers and Fil-C

- cmake: automatically disable typecheck when running clang-tidy,
  to avoid possible interference, and to improve performance.

- INSTALL-CMAKE: document both this, and unity=off for clang-tidy.

- GHA/linux: disable for some static analyzers CI jobs to avoid possible
  interference.

- GHA/linux: disable in Fil-C job to improve build performance.

Follow-up to 9e6f1c5efb7a70e1f33e467a738f3e3f652f3174 #19637
Follow-up to fd2ca2399e79e0b821af34c7c164c830c9c6574d #17955

Closes #19941

4 months agoruntests: add options to set minimum number of tests, use them
Viktor Szakats [Fri, 12 Dec 2025 00:55:30 +0000 (01:55 +0100)] 
runtests: add options to set minimum number of tests, use them

To detect mistakes made in the runtests framework that reduce
the number of test runs. Before this patch it could go undetected with
a green CI.

The minimum thresholds will need light maintenance going forward (either
bumping them periodically, or adjust if some may fell below minimums for
justified reasons). We may also make minimums tighter or looser, or more
job-specific.

Latest number of test runs for each job can be seen at Test Clutch:
https://testclutch.curl.se/static/reports/feature-matrix.html

Also:
- GHA: set minimums.

Assisted-by: Dan Fandrich
Follow-up to f2a75a14dd95e06cf9121c7d3bd5dc559748f350
Follow-up to bb1391f94394e635c1a5c58253e7a3d3b36bde57 #19510

Closes #19942

4 months agopytest: add tests using sshd
Stefan Eissing [Thu, 11 Dec 2025 15:02:41 +0000 (16:02 +0100)] 
pytest: add tests using sshd

With either /usr/sbin/sshd found or configured via --with-test-sshd=path
add tests for SCP down- and uploads, insecure, with known hosts or not,
with authorized user key or unauthorized one.

Working now with libssh and libssh2, using a hashed known_hosts file.

Closes #19934

4 months agotest568: remove what looks like an email and a URL
Daniel Stenberg [Fri, 12 Dec 2025 10:04:23 +0000 (11:04 +0100)] 
test568: remove what looks like an email and a URL

Closes #19944

4 months agotidy-up: miscellaneous
Viktor Szakats [Sun, 7 Dec 2025 15:49:55 +0000 (16:49 +0100)] 
tidy-up: miscellaneous

- drop stray duplicate empty lines in docs, scripts, test data, include,
  examples, tests.
- drop duplicate PP parenthesis.
- curl-functions.m4: move literals to the right side in if expressions,
  to match rest of the source code.
- FAQ.md: delete language designator from an URL.
- packages: apply clang-format (OS400, VMS).
- scripts/schemetable.c: apply clang-format.
- data320: delete duplicate empty line that doesn't change the outcome.
- spacecheck: extend to check for duplicate empty lines
  (with exceptions.)
- fix whitespace nits

Closes #19936

4 months agoGHA: update actions/cache action to v5
renovate[bot] [Thu, 11 Dec 2025 22:24:51 +0000 (22:24 +0000)] 
GHA: update actions/cache action to v5

Closes #19940

4 months agomdlinkcheck: only look for markdown links in markdown files
Daniel Stenberg [Thu, 11 Dec 2025 16:16:37 +0000 (17:16 +0100)] 
mdlinkcheck: only look for markdown links in markdown files

It finds debug outputs in source code otherwise.

Output the whitelist "warnings" to stderr to better allow us to count
URLs with `./mdlinkcheck --dry-run | wc -l`.

Closes #19938

4 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 11 Dec 2025 14:38:00 +0000 (15:38 +0100)] 
RELEASE-NOTES: synced

4 months agotransfer: remove @param for err for xfer_recv_resp function.
Christian Schmitz [Thu, 11 Dec 2025 13:37:13 +0000 (14:37 +0100)] 
transfer: remove @param for err for xfer_recv_resp function.

The err parameter in xfer_recv_resp doesn't exist anymore. Removed in
cb2bcb681fc9044d2a7adaaa621.

Closes #19937

4 months agoGHA/checkdocs: re-enable proselint, update setup, fix issues found
Viktor Szakats [Thu, 11 Dec 2025 01:46:24 +0000 (02:46 +0100)] 
GHA/checkdocs: re-enable proselint, update setup, fix issues found

- update configuration and invocation.
- install via pip.
- drop a file exception.
- alpha sort proselint settings.
- FILEFORMAT: update text about XML compliance.
- CI job takes 22 seconds total.

Ref: https://github.com/amperser/proselint/releases/tag/v0.16.0

Follow-up to 38bfe1c2aa2a6c8af29d525eb231ad66861199b1 #15314

Closes #19931

4 months agodocs: fold long lines
Viktor Szakats [Thu, 11 Dec 2025 01:13:46 +0000 (02:13 +0100)] 
docs: fold long lines

Also:
- replace a 'will' found by badwords.
- drop duplicate empty lines.

Closes #19930

4 months agotest1165: drop reference to deleted `CURL_DISABLE_TESTS`
Viktor Szakats [Thu, 11 Dec 2025 00:52:58 +0000 (01:52 +0100)] 
test1165: drop reference to deleted `CURL_DISABLE_TESTS`

Follow-up to bf823397bad09791277e983e44e8f0edc3c089b2 #16134

Closes #19929

4 months agoautotools: drop reference to deleted `CURL_CHECK_CURLDEBUG`
Viktor Szakats [Thu, 11 Dec 2025 00:43:21 +0000 (01:43 +0100)] 
autotools: drop reference to deleted `CURL_CHECK_CURLDEBUG`

The referred function has been deleted earlier.

Also:
- drop commented reference to deleted `CURL_CHECK_OPTION_THREADS`.
  0d4fdbf15d8eec908b3e63b606f112b18a63015e #16054

Follow-up to 96a1a05f662677af64b16d862c4126ed52ea4b30 #14096

Closes #19928

4 months agotests: verify setting bearer and doing redirects
Daniel Stenberg [Wed, 10 Dec 2025 09:49:54 +0000 (10:49 +0100)] 
tests: verify setting bearer and doing redirects

Test 778, 779 and 795

4 months agocurl_sasl: if redirected, require permission to use bearer
Daniel Stenberg [Wed, 10 Dec 2025 10:40:47 +0000 (11:40 +0100)] 
curl_sasl: if redirected, require permission to use bearer

Closes #19933