]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
5 days agoalt-svc: more flexibility on same destination
Stefan Eissing [Mon, 8 Dec 2025 12:36:19 +0000 (13:36 +0100)] 
alt-svc: more flexibility on same destination

When the Alt-Svc points to the same host and port, add the destination
ALPN to the `wanted` versions and set it also as the `preferred` version
in negotiations.

This allows Alt-Svc for h3 to point to h2 and have it tried first. Also,
this allows Alt-Svc to say http/1.1 is preferred and changes the ALPN
protocol ordering for the TLS handshake.

Add tests in various combination to verify this works.

Reported-by: yushicheng7788 on github
Fixes #19740
Closes #19874

6 days agoGHA/windows: re-enable `taskkill`
Viktor Szakats [Tue, 9 Dec 2025 13:27:44 +0000 (14:27 +0100)] 
GHA/windows: re-enable `taskkill`

Nothing conclusive for the last ~30 days when `taskkill` was made
a no-op. Jobs remained flaky with all known failure modes. Sometimes
they finish green on the first run, sometimes they fail. Hard to say
more without comparing detailed stats for this period and the
preceding (or upcoming) one.

In almost all runs, the PID to be killed did not exist at the time of
check.

Follow-up to 2701ac6a4d16a62130dad05be1c484903b8545c7 #19421
Closes #19897

6 days agogtls: Call keylog_close in cleanup
Yedaya Katsman [Tue, 2 Dec 2025 19:59:53 +0000 (21:59 +0200)] 
gtls: Call keylog_close in cleanup

6 days agotest: add test 2090 for SSLKEYLOGFILE structure
Yedaya Katsman [Tue, 2 Dec 2025 17:40:07 +0000 (19:40 +0200)] 
test: add test 2090 for SSLKEYLOGFILE structure

Only the TLS 1.2 structure for now since it's simpler, and only has a
single label type. This has the bonus of also testing libressl that only
supports logging keys in TLS 1.2

Closes #19816

6 days agoexamples: use 64-bit `fstat` on Windows
Viktor Szakats [Tue, 9 Dec 2025 11:55:26 +0000 (12:55 +0100)] 
examples: use 64-bit `fstat` on Windows

Closes #19896

6 days agoTODO: remove ancient entries no longer considered
Daniel Stenberg [Tue, 9 Dec 2025 10:53:45 +0000 (11:53 +0100)] 
TODO: remove ancient entries no longer considered

- TCP Fast Open support on Windows

TFO doesn't really work on the internet and isn't really used anywhere.
We use QUIC now.

- get rid of PATH_MAX

Not a priority and when using 3rd party libraries not really up to us.

- auto-detect proxy

A dream we can just stop having.

- config file parsing

Let's not do that in our library.

- add asynch getaddrinfo support

Let's not add a limited glibc specific backend with bad API

- FTP HOST

If we managed this far without name based vhost FTP, let's not.

Closes #19890

6 days agotest1025, 1221: fold long command-lines
Viktor Szakats [Tue, 9 Dec 2025 11:18:31 +0000 (12:18 +0100)] 
test1025, 1221: fold long command-lines

Closes #19893

6 days agotest1464: mark XML-compliant
Viktor Szakats [Tue, 9 Dec 2025 11:14:21 +0000 (12:14 +0100)] 
test1464: mark XML-compliant

Closes #19892

6 days agoDockerfile: update debian:bookworm-slim digest to e899040
renovate[bot] [Tue, 9 Dec 2025 11:03:54 +0000 (11:03 +0000)] 
Dockerfile: update debian:bookworm-slim digest to e899040

Closes #19891

6 days agoDockerfile: update debian:bookworm-slim digest to 1371f81
renovate[bot] [Tue, 9 Dec 2025 04:48:05 +0000 (04:48 +0000)] 
Dockerfile: update debian:bookworm-slim digest to 1371f81

Closes #19883

6 days agoFAQ: fix minor link syntax mistake
Daniel Stenberg [Tue, 9 Dec 2025 10:13:31 +0000 (11:13 +0100)] 
FAQ: fix minor link syntax mistake

6 days agoFAQ/TODO/KNOWN_BUGS: convert to markdown
Daniel Stenberg [Mon, 8 Dec 2025 12:07:49 +0000 (13:07 +0100)] 
FAQ/TODO/KNOWN_BUGS: convert to markdown

- convert to markdown
- auto-generate the TOCs on the website, remove them from the docs
- cleanups
- spellchecked
- updated links

Closes #19875

6 days agoimap: check buffer length before accessing it
Daniel Stenberg [Tue, 9 Dec 2025 09:04:34 +0000 (10:04 +0100)] 
imap: check buffer length before accessing it

Pointed out by ZeroPath

Closes #19887

6 days agoheaders: add length argument to Curl_headers_push()
Daniel Stenberg [Tue, 9 Dec 2025 08:58:48 +0000 (09:58 +0100)] 
headers: add length argument to Curl_headers_push()

- the length is already known by parent functions
- avoids strlen() calls
- avoids strchr() calls for trimming off newline characters

Closes #19886

6 days agotests/data: move section data to external files
Viktor Szakats [Tue, 9 Dec 2025 00:15:29 +0000 (01:15 +0100)] 
tests/data: move section data to external files

To make the test files XML-compliant, and the expected results
possibly easier to manage by keeping them in `.md`, `.html`, `.1`
and `.txt` files.

Non-XML-compliant files are down to 31 (1.6%) after this patch.

Closes #19882

6 days agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 9 Dec 2025 08:23:35 +0000 (09:23 +0100)] 
RELEASE-NOTES: synced

6 days agocurl_setup.h: fix `FMT_SOCKET_T` to be unsigned on Windows
Viktor Szakats [Thu, 21 Aug 2025 11:59:46 +0000 (13:59 +0200)] 
curl_setup.h: fix `FMT_SOCKET_T` to be unsigned on Windows

To match the Windows socket type.

Ref: https://learn.microsoft.com/windows/win32/winsock/socket-data-type-2

Cherry-picked from #18343
Closes #19881

6 days agotests/data: use more `%TESTNUMBER` macro for previous patch
Viktor Szakats [Tue, 9 Dec 2025 00:46:06 +0000 (01:46 +0100)] 
tests/data: use more `%TESTNUMBER` macro for previous patch

Follow-up to d75716e4e55c7074566f48d8c03bfd721461e105 #19799
Cherry-picked from #19882
Closes #19885

6 days agotests/data: move `--libcurl` output to external data files
Viktor Szakats [Mon, 1 Dec 2025 12:31:42 +0000 (13:31 +0100)] 
tests/data: move `--libcurl` output to external data files

To make the test files XML-compliant, and the expected results
possibly easier to manage by keeping them in `.c` files.

Non-XML-compliant files are down to 36 after this patch.

Also:
- make all macro expansions apply to `%includetext` contents.

Closes #19799

6 days agotidy-up: URLs
Viktor Szakats [Mon, 8 Dec 2025 15:44:29 +0000 (16:44 +0100)] 
tidy-up: URLs

- to avoid dupes.
- missing slashes.
- drop `.git` suffix from GitHub git repo URLs for a few outliers.
- use short YouTube URL like curl-www does.
- sync two RFC doc URLs with others.

Closes #19879

6 days agomk-ca-bundle.md: the file format docs URL is permaredirected
Daniel Stenberg [Mon, 8 Dec 2025 14:50:48 +0000 (15:50 +0100)] 
mk-ca-bundle.md: the file format docs URL is permaredirected

Closes #19877

6 days agoKNOWN_BUGS: remove link to codepoints.net
Daniel Stenberg [Mon, 8 Dec 2025 14:54:38 +0000 (15:54 +0100)] 
KNOWN_BUGS: remove link to codepoints.net

The site is so slow it often triggers a failure for the link checker.

Closes #19878

6 days agoIPFS.md: wrap long lines
Viktor Szakats [Mon, 8 Dec 2025 16:02:26 +0000 (17:02 +0100)] 
IPFS.md: wrap long lines

Closes #19880

6 days agoGHA: bump pip-dependencies ruff, psutil, pytest
dependabot[bot] [Mon, 8 Dec 2025 14:20:54 +0000 (14:20 +0000)] 
GHA: bump pip-dependencies ruff, psutil, pytest

- update `ruff` from 0.14.5 to 0.14.8
- update `psutil` from 7.1.2 to 7.1.3
- update `pytest` from 8.4.2 to 9.0.1

Closes #19876

7 days agoCI/windows: add torture tests with Schannel
Viktor Szakats [Sun, 7 Dec 2025 16:36:54 +0000 (17:36 +0100)] 
CI/windows: add torture tests with Schannel

With Schannel and Unicode, `-shallow=13`. It finishes in 12 minutes,
making it the slowest Windows job. It's still on par with torture jobs
on other platforms (though they manage to fit `-shallow=25`).

Also `-shallow=13` still caught leaks in multiple tests.

Also:
- test2300: exclude from CI Windows torture tests.
- experimental.

The downside of going with deeper torture tests, is that it requires
increasing the job timeout. This in turns means that a hung job takes
more minutes to be killed (due to GitHub bugs where a hung step does not
honor the per-step timeout on Windows, another bug where a hung job gets
killed +5 minutes above the workflow timeout, and another bug (or
feature?) where other failed/hung jobs in the the workflow cannot be
restarted till the last job finishes or gets killed. And all this
probably related to a Perl bug which makes it hang on fork errors, which
is turn related to Cygwin/MSYS2 runtime bugs which breaks fork in case
of curl's mixed MSYS2-Perl/native-curl-binaries environment.)
The end result in longer forced waits before being able to restart flaky
jobs, which slows down iterations and annoying.

Also tried:
- non-c-ares job: detected known issues much less often.
- replaced libidn2 with WinIDN: detected known issues much less often.
- runtests -j9-j20 values: did not make a difference.
- other `-shallow` values: 20 is the max feasible, but comes with the
  downside described above.

Ref: #19675 (reboot of)
Follow-up to f08417c4259a3b9a2e4d72a48fa02ce6502cb587 #19863

Closes #19865

7 days agodocs: switch more URLs to https://
Daniel Stenberg [Mon, 8 Dec 2025 10:11:02 +0000 (11:11 +0100)] 
docs: switch more URLs to https://

Normalize using https:// almost everywhere instead of http://

Closes #19872

7 days agomdlinkcheck: ignore IP numbers, allow '@' in raw URLs
Daniel Stenberg [Mon, 8 Dec 2025 10:16:18 +0000 (11:16 +0100)] 
mdlinkcheck: ignore IP numbers, allow '@' in raw URLs

7 days agoGHA/linux: update dependency pizlonator/fil-c to v0.675
renovate[bot] [Mon, 8 Dec 2025 11:07:26 +0000 (11:07 +0000)] 
GHA/linux: update dependency pizlonator/fil-c to v0.675

Closes #19873

7 days agoGHA/linux: blind try to make Renovate detect Fil-C releases
Viktor Szakats [Mon, 8 Dec 2025 10:06:49 +0000 (11:06 +0100)] 
GHA/linux: blind try to make Renovate detect Fil-C releases

0.675 has been out for 2 weeks, Renovate did not detect it with
`semver-partial`. Try with `semver-coerced`.

Refs:
https://docs.renovatebot.com/modules/versioning/semver-coerced/
https://docs.renovatebot.com/modules/versioning/semver-partial/

Follow-up to 16c6ea36cca6684aacbcb33578af61b28e3fee0d #19391

7 days agoDISTROS: fix a Mageia URL
Daniel Stenberg [Mon, 8 Dec 2025 10:43:12 +0000 (11:43 +0100)] 
DISTROS: fix a Mageia URL

Since we check the provided URLs now, use the direct, working URL.

7 days agognutls: add PROFILE_MEDIUM as default
Stefan Eissing [Fri, 5 Dec 2025 14:38:12 +0000 (15:38 +0100)] 
gnutls: add PROFILE_MEDIUM as default

Raise the default GnuTLS priority settings by adding PROFILE_MEDIUM for
more secure connection handling.

Reported-by: Harry Sintonen
Closes #19853

7 days agotest1475: consistently use %CR in headers
Fabian Keil [Sun, 7 Dec 2025 14:23:00 +0000 (15:23 +0100)] 
test1475: consistently use %CR in headers

Gets the test working when using Privoxy as proxy.

Closes #19870

7 days agohostcheck: fail wildcard match if host starts with a dot
Daniel Stenberg [Mon, 8 Dec 2025 09:20:04 +0000 (10:20 +0100)] 
hostcheck: fail wildcard match if host starts with a dot

A hostname cannot start with a dot when DNS is used, but there are other
ways.

Amend unit test 1397

Closes #19869

7 days agosspi: fix memory leaks on error paths in `Curl_create_sspi_identity()`
Viktor Szakats [Sun, 7 Dec 2025 19:03:38 +0000 (20:03 +0100)] 
sspi: fix memory leaks on error paths in `Curl_create_sspi_identity()`

Detected by Windows torture test 1072 (with `-shallow=20/13`),
test 579 (with `-shallow=18/14/13`), and test 1286 (with `-shallow=15`).

```
** MEMORY FAILURE
Leak detected: memory still allocated: 20 bytes
At 1a1e8136328, there is 18 bytes.
 allocated by D:/a/curl/curl/lib/curl_sspi.c:133
At 1a1e8139368, there is 2 bytes.
 allocated by D:/a/curl/curl/lib/curl_sspi.c:143
 1072: torture FAILED: function number 207 in test.
 invoke with "-t207" to repeat this single case.
Warning: http2 server unexpectedly alive
```
Ref: https://github.com/curl/curl/actions/runs/20008523913/job/57374427439?pr=19865

Also simplify the code a little.

Cherry-picked from #19865
Closes #19866

7 days agocookie: cleanups and improvements
Daniel Stenberg [Sun, 7 Dec 2025 22:44:31 +0000 (23:44 +0100)] 
cookie: cleanups and improvements

- Stricter cookie validation with earlier rejection of empty/invalid
  cookie names

- secure and httponly attributes no longer accept = with empty values
  (only bare keywords)

- Validation checks (length, TAB, prefixes) moved into the first
  name/value pair block for better code organization

- Deferred time(NULL) calls for better performance when expires/max-age
  aren't used

- Simplified loop control flow by removing done flag

- The cookie size restriction now only applies to name + value, not other
  parts of the header line.

- Fixed a gcc 4.8.1 quirk

Closes #19868

7 days agocookie: only keep and use the canonical cleaned up path
Daniel Stenberg [Sun, 7 Dec 2025 15:09:13 +0000 (16:09 +0100)] 
cookie: only keep and use the canonical cleaned up path

Instead of keeping both versions around.

Closes #19864

7 days agocookie: when parsing a cookie header, delay all allocations until okay
Daniel Stenberg [Sun, 7 Dec 2025 12:49:33 +0000 (13:49 +0100)] 
cookie: when parsing a cookie header, delay all allocations until okay

To avoid wasting time allocating data for incoming cookies that are
discarded for one reason or another, delay allocations until after
verifications are done.

Closes #19864

7 days agocookie: allocate the main struct once cookie is fine
Daniel Stenberg [Sun, 7 Dec 2025 12:17:24 +0000 (13:17 +0100)] 
cookie: allocate the main struct once cookie is fine

This delays the allocating of the cookie struct until after all the
checks have been done, as many cookies are received and discarded
instead of accepted and this then saves one allocation for every
discarded cookie.

Closes #19864

7 days agorunner.pm: run memanalyzer as a Perl module
Viktor Szakats [Sun, 7 Dec 2025 15:58:34 +0000 (16:58 +0100)] 
runner.pm: run memanalyzer as a Perl module

To improve performance of torture tests.

Also on Windows, where this patch may make those viable for CI.

Linux   !FTP    4m47 ->  4m24 (-shallow=25)
Linux    FTP    2m30 ->  2m23 (-shallow=25)
macOS   !FTP   14m30 -> 13m07 (-shallow=25)
macOS    FTP    3m57 ->  3m59 (-shallow=25)
Windows !FTP  >25m   ->  4m47 to 14m45 (-shallow=5 to 25) (not in CI)

Linux
Before: https://github.com/curl/curl/actions/runs/20006771767/job/57370205514
After: https://github.com/curl/curl/actions/runs/20006783210/job/57370236911?pr=19863

macOS:
Before: https://github.com/curl/curl/actions/runs/20006771786/job/57370205769
After: https://github.com/curl/curl/actions/runs/20006783177/job/57370236995?pr=19863

Windows:
Before: https://github.com/curl/curl/actions/runs/19667198537/job/56326962912?pr=19675
After: https://github.com/curl/curl/actions/runs/20007175773/job/57371768734?pr=19863
After shallow=25: https://github.com/curl/curl/actions/runs/20008523913/job/57374427449?pr=19865

Ref: #19675
Follow-up to 472bc9032374f98f48f7a2df6c644cff91fe142c #19821
Closes #19863

7 days agowolfssl: fix possible assert with `!HAVE_NO_EX` wolfSSL builds
Viktor Szakats [Fri, 5 Dec 2025 13:53:35 +0000 (14:53 +0100)] 
wolfssl: fix possible assert with `!HAVE_NO_EX` wolfSSL builds

Without this option `wolfSSL_get_app_data()` always returns NULL.
Disable codepaths using it (and its `set` pair) when curl is built
against a wolfSSL library with this option missing.

Fixing:
```
curl: ../../lib/vtls/wolfssl.c:486: wssl_vtls_new_session_cb: Assertion `cf != ((void *)0)' failed.
```

wolfSSL can be built with the `--enable-context-extra-user-data` or
`-DWOLFSSL_EX_DATA` option to enable this feature. Some higher-level
features also enable it automatically like QUIC, ASIO.

Reported-by: Yedaya Katsman
Bug: https://github.com/curl/curl/pull/19816#issuecomment-3606447845
Ref: https://github.com/curl/curl/actions/runs/19871780796/job/56949160740

Closes #19852

8 days agohttp: return OOM errors from hsts properly
Daniel Stenberg [Sun, 7 Dec 2025 11:35:42 +0000 (12:35 +0100)] 
http: return OOM errors from hsts properly

When Curl_hsts_parse() fails with out of memory, return it to parent.

Closes #19862

8 days agohsts: use one malloc instead of two per entry
Daniel Stenberg [Sun, 7 Dec 2025 11:24:33 +0000 (12:24 +0100)] 
hsts: use one malloc instead of two per entry

Closes #19861

8 days agonoproxy: fix build on systems without IPv6
Daniel Stenberg [Sat, 6 Dec 2025 23:03:56 +0000 (00:03 +0100)] 
noproxy: fix build on systems without IPv6

Follow-up to ff2aaed9ba6f186feb57f89fc6854
Reported-by: Harry Sintonen
Closes #19860

8 days agoasyn-thrdd: fix Curl_async_getaddrinfo() on systems without getaddrinfo
Daniel Stenberg [Sat, 6 Dec 2025 22:45:06 +0000 (23:45 +0100)] 
asyn-thrdd: fix Curl_async_getaddrinfo() on systems without getaddrinfo

Follow-up to ce06fe77710525
Bug: https://github.com/curl/curl/commit/ce06fe7771052549ff430c86173b2eaca91f8a9c#r172215567
Reported-by: Harry Sintonen
Closes #19859

8 days agoaltsvc: make it one malloc instead of three per entry
Daniel Stenberg [Sat, 6 Dec 2025 17:01:09 +0000 (18:01 +0100)] 
altsvc: make it one malloc instead of three per entry

Also return OOM correctly.

Closes #19857

8 days agoformdata: validate callback is non-NULL before use
Robert W. Van Kirk [Sat, 6 Dec 2025 18:00:00 +0000 (12:00 -0600)] 
formdata: validate callback is non-NULL before use

curl_formget() accepts a user-provided callback function but does not
validate it is non-NULL before calling it. If a caller passes NULL,
the function will crash with SIGSEGV.

Add NULL check at the start of the function to return an appropriate
error code instead of crashing.

Signed-off-by: Robert W. Van Kirk <robert@rwvk.tech>
Closes #19858

8 days agoftp: make EPRT connections non-blocking
Stefan Eissing [Fri, 5 Dec 2025 13:12:47 +0000 (14:12 +0100)] 
ftp: make EPRT connections non-blocking

On platforms where neither accept4 nor fcntl was available, an
EPRT connection did not send the accepted socket as non-blocking.

This became apparent when TLS was in use and the test receive
on shutdown did simply hang.

Reported-by: Denis Goleshchikhin
Fixes #19753
Closes #19851

9 days agoRELEASE-NOTES: synced rc-8_18_0-1
Daniel Stenberg [Fri, 5 Dec 2025 22:51:47 +0000 (23:51 +0100)] 
RELEASE-NOTES: synced

9 days agomdlinkcheck: detect and check "raw" links
Daniel Stenberg [Fri, 5 Dec 2025 10:45:35 +0000 (11:45 +0100)] 
mdlinkcheck: detect and check "raw" links

- URLs specified outside of the markdown []() are now extracted and
  checked

- also check TODO, FAQ and KNOWN_BUGS

- more aggressive avoiding to check github.com/curl/curl, all uses of
  example domains and some more established URLs on the curl.se site

- list all errors in the end to make them easier to spot in CI logs

Closes #19848

9 days agoDISTROS: remove broken URLs for buildroot
Daniel Stenberg [Fri, 5 Dec 2025 13:11:39 +0000 (14:11 +0100)] 
DISTROS: remove broken URLs for buildroot

9 days agoFAQ: fix hackerone URL
Daniel Stenberg [Fri, 5 Dec 2025 13:04:25 +0000 (14:04 +0100)] 
FAQ: fix hackerone URL

9 days agodocs: use .example URLs for proxies
Daniel Stenberg [Fri, 5 Dec 2025 12:33:02 +0000 (13:33 +0100)] 
docs: use .example URLs for proxies

9 days agodocs: remove dead URLs
Daniel Stenberg [Fri, 5 Dec 2025 12:17:11 +0000 (13:17 +0100)] 
docs: remove dead URLs

- KNOWN_BUGS: remove dead URL
- ECH: remove two dead URLs
- MAIL-ETIQUETTE: remove dead URL

9 days agotest1498: disable 'HTTP PUT from stdin' test on Windows
Viktor Szakats [Fri, 5 Dec 2025 15:14:19 +0000 (16:14 +0100)] 
test1498: disable 'HTTP PUT from stdin' test on Windows

Test became flaky with memanalyze errors after merging #19845,
in a TrackMemory Windows Unicode c-ares openssl-quic build:
GHA/windows: mingw, AM x86_64 c-ares U.

Disable it until further investigation.

This test uses the Windows-specific multi-threaded stdin code
that caused issues in the past. It's also using `TerminateThread()`,
that apps aren't supposed to.

Examples:
https://github.com/curl/curl/pull/19845#issuecomment-3614921298
https://github.com/curl/curl/actions/runs/19948992659/job/57205061260?pr=19845#step:13:3028
https://github.com/curl/curl/actions/runs/19966429786/job/57259325027?pr=19852#step:13:3030

Also seen to fail earlier while testing torture tests on Windows:
https://github.com/curl/curl/pull/19675#issuecomment-3573154110

Ref: 4e051ff5506319ee87e3656be8f76b01de217103 #19845

Closes #19855

9 days agotidy-up: avoid `(())`, clang-format fixes and more
Viktor Szakats [Thu, 4 Dec 2025 21:48:20 +0000 (22:48 +0100)] 
tidy-up: avoid `(())`, clang-format fixes and more

- drop redundant parentheses from macro definitions.
- apply clang-format in some places missed earlier.
- wolfssl: fix a macro guard comment.
- curl_setup.h: drop empty lines
- FAQ: fix C formatting.

Closes #19854

9 days agocurlx: limit use of system allocators to the minimum possible
Viktor Szakats [Thu, 4 Dec 2025 22:54:25 +0000 (23:54 +0100)] 
curlx: limit use of system allocators to the minimum possible

Clone a multibye conversion function into curlx/fopen, and use that
local copy from curlx/fopen functions. Adjust allocators in curlx/fopen
to use curl's in normal builds, and system allocators in TrackMemory
builds to avoid recursion.

This allows to switch curlx/multibyte functions to curl allocators in
all configurations, as they are no longer called by curlx/fopen, and
a recursive call can no longer happen.

After this patch the system allocator is only used in TrackMemory
Windows builds, within curlx `fopen`, `freopen`, `stat` and `open`
functions.

Also:
- test 1, 440, 767: raise allocation limitsto fit the extra allocations
  in Windows Unicode builds.
- replace all uses of `curlx_unicodefree()` macro with `curlx_free()`
  across the codebase.
- curlx/multibyte: delete `curlx_unicodefree()`.
- ldap: join Windows and non-Windows codepaths that became
  identical after moving from `curlx_unicodefree()` to `curlx_free()`.
- vauth: drop a strdup from standard to curl allocator since
  the original allocation is now already done by curl's.
- tool_doswin: drop now superfluous strdup from `FindWin32CACert()`.
- memanalyzer.pm: sync weirdo `calloc` log message with `malloc`'s.

Fixes #19748
Closes #19845

10 days agoldap: improve detection of Apple LDAP
Viktor Szakats [Fri, 5 Dec 2025 11:43:37 +0000 (12:43 +0100)] 
ldap: improve detection of Apple LDAP

When detecting the Apple fork of "legacy" LDAP, replace the `__APPLE__`
macro (which can be present also when using an old mainline OpenLDAP
while building for an Apple platform) with `LDAP_OPT_X_TLS_PASSPHRASE`
which is an Apple-specific macro, merged by Apple in 2007, later adding
the comment 'Apple Specific code'. This macro hasn't been retrofitted
to OpenLDAP since then, and unlikely to happen in the future.

Refs:
https://github.com/apple-oss-distributions/OpenLDAP/commit/c4d990a6cfa0cb71d6dffe6f6aeeb722fd7c627b#diff-0f7a5f85bae4de860b70aabf34aa12b0ecc37e748cd96e203e2d8ddb30a207c3R145
https://github.com/apple-oss-distributions/OpenLDAP/commit/49ac28a486d72f36cd9713b41180b41d34f18ef6#diff-0f7a5f85bae4de860b70aabf34aa12b0ecc37e748cd96e203e2d8ddb30a207c3R166

Follow-up to 859ce48de12986f5bf846c2800dacab893ff12c1 #19832
Closes #19849

10 days agotests/servers: put unix-domain-path inside LOGDIR
Stefan Eissing [Tue, 2 Dec 2025 14:53:29 +0000 (15:53 +0100)] 
tests/servers: put unix-domain-path inside LOGDIR

Change Unix domain socket paths from `/tmp/curl-socksd-<random>` to
`/drive/path/to/LOGDIR/PIDDIR/*-uds` to avoid having to create and
delete them before use. Also to use a path which remains an absolute one
while passed from MSYS2 Perl to native Windows curl tool and test server
via the command-line, and keep pointing to the same location, fixing:
```
=== Start of file commands.log
../src/curl.exe -q --output log/3/curl1468.out --include --trace-ascii log/3/trace1468
  --trace-time http://this.is.a.host.name:64405/1468
  --proxy socks5h://localhost/tmp/curl-socksd-YnbvRo98 [...]
=== End of file commands.log
=== Start of file socks2_server.log
[...]
14:11:54.597968 Listening on Unix socket D:/a/_temp/msys64/tmp/curl-socksd-YnbvRo98
```
Ref: https://github.com/curl/curl/actions/runs/19896583933/job/57028545111?pr=19812

The curl tool is pending #19825 to fix accepting an absolute unix domain
socket path on Windows.

Assisted-by: Viktor Szakats
Closes #19810

10 days agoTODO: remove a mandriva.com reference
Daniel Stenberg [Fri, 5 Dec 2025 07:51:11 +0000 (08:51 +0100)] 
TODO: remove a mandriva.com reference

It's a casino now

10 days agoldap: detect version of "legacy" LDAP
Viktor Szakats [Thu, 4 Dec 2025 14:32:44 +0000 (15:32 +0100)] 
ldap: detect version of "legacy" LDAP

Legacy LDAP means an OpenLDAP-compatible implementation
without the private API `ldap_init_fd()` introduced in OpenLDAP
2.4.6+ (2007-10-31), and not WinLDAP.

One known example is Apple's LDAP build, which is based on
OpenLDAP 2.4.28 (2011-11-25), without providing this private API.

The version query API was introduced around 1998-1999, before
the minimum (2.0 2000-08-01) required by curl.

Follow-up to 3e2a946926853608d67805bd9f4a58345fff364a #19808
Closes #19832

10 days agourl: if curl_url_get() fails due to OOM, error out properly
Daniel Stenberg [Thu, 4 Dec 2025 18:01:02 +0000 (19:01 +0100)] 
url: if curl_url_get() fails due to OOM, error out properly

Even if the scheme is "file"!

Closes #19838

10 days agoCURLMOPT_SOCKETFUNCTION.md: fix the callback argument use
Daniel Stenberg [Thu, 4 Dec 2025 18:57:44 +0000 (19:57 +0100)] 
CURLMOPT_SOCKETFUNCTION.md: fix the callback argument use

The example code does not use curl_multi_assign(), but its callback
function used socketp (called sockp in the function) to get the struct
priv pointer instead of the correct clientp (cbp).

Reported-by: Greg Hudson
Fixes #19840
Closes #19841

10 days agodocs/libcurl: fix C formatting nits
Viktor Szakats [Thu, 4 Dec 2025 19:11:45 +0000 (20:11 +0100)] 
docs/libcurl: fix C formatting nits

Closes #19844

10 days agoopenssl: simplify `HAVE_KEYLOG_CALLBACK` guard
Viktor Szakats [Thu, 4 Dec 2025 19:28:34 +0000 (20:28 +0100)] 
openssl: simplify `HAVE_KEYLOG_CALLBACK` guard

non-LibreSSL always includes BoringSSL and AWS-LC, no need to check for
them explicitly.

Follow-up to 69c89bf3d3137fcbb2b8bc57233182adcf1e2817 #18330
Closes #19843

10 days agombedtls: sync format across log messages
Viktor Szakats [Sat, 29 Nov 2025 09:54:28 +0000 (10:54 +0100)] 
mbedtls: sync format across log messages

Closes #19842

10 days agosws: fix binding to unix socket on Windows
Viktor Szakats [Tue, 2 Dec 2025 16:45:18 +0000 (17:45 +0100)] 
sws: fix binding to unix socket on Windows

Windows 10.17063+ (having unix socket support) fails to set for unix
sockets the `SO_REUSEADDR` option, with error 10045 (`WSAEOPNOTSUPP`),
and also fails to set `SO_KEEPALIVE` with error 10042 (`WSAENOPROTOOPT`).

Fix by not enabling these socket options on Windows for unix sockets.

Also:
- fixing test 1435, 1436 to run in CI.
- fixing the `socksd` test server for test 1467, 1468, 1470. But, also
  disable these for now due to another Windows issue: #19825

Ref: https://stackoverflow.com/questions/68791319/unix-domain-socket-bind-failed-in-windows/68794755#68794755
Ref: #19810
Closes #19812

10 days agotidy-up: miscellaneous
Viktor Szakats [Fri, 21 Nov 2025 11:34:02 +0000 (12:34 +0100)] 
tidy-up: miscellaneous

- gnutls, mbedtls: fix casing in log messages.
- src/tool_cfgable.h: drop unused header.
- appveyor.sh: variable style.
- cmakelint.sh: sync with libssh2, catch `.cmake.in` explicitly.
- examples: drop obsolete comments, exclamation marks.
- fix comment typos, casing.

Closes #19839

10 days agotidy-up: one more round of formatting nits
Viktor Szakats [Sat, 29 Nov 2025 22:11:52 +0000 (23:11 +0100)] 
tidy-up: one more round of formatting nits

Closes #19835

10 days agobadwords: check FAQ with allowlisted 'will', fix a typo
Viktor Szakats [Thu, 4 Dec 2025 16:44:46 +0000 (17:44 +0100)] 
badwords: check FAQ with allowlisted 'will', fix a typo

Also:
- badwords.pl: add support for filename:word exceptions.
- badwords.pl: handle `-w` file open errors.

Ref: https://github.com/curl/curl/pull/19817#issuecomment-3612386568
Closes #19837

10 days agobufref: add Curl_bufref_dup that returns a strdup()ed version
Daniel Stenberg [Thu, 4 Dec 2025 15:39:22 +0000 (16:39 +0100)] 
bufref: add Curl_bufref_dup that returns a strdup()ed version

Cleans up a common pattern somewhat. Implemented as a macro.

Closes #19834

10 days agoconnection: attached transfer count
Stefan Eissing [Thu, 4 Dec 2025 16:15:33 +0000 (17:15 +0100)] 
connection: attached transfer count

Since we no longer traverse the transfers attached to a connection,
change the sparse bitset to just a `uint32_t` counter.

This makes multi_ev the single user of sparse bitsets for transfers
using a socket and allocation failures are handled there correctly.

Refs #19818
Closes #19836

10 days agobufref: rename *memdup() to *memdup0()
Daniel Stenberg [Thu, 4 Dec 2025 15:20:25 +0000 (16:20 +0100)] 
bufref: rename *memdup() to *memdup0()

To make it clearer to readers of the code that the resulting dup also
has a null terminator. Something a "normal" memdup() does not provide.

Closes #19833

10 days agoformdata: use struct bufref for maybe-dynamic fields.
Patrick Monnerat [Wed, 3 Dec 2025 20:52:33 +0000 (21:52 +0100)] 
formdata: use struct bufref for maybe-dynamic fields.

Lengths are not stored in the structures, as they may be given before
the data locations.

Closes #19827

10 days agolib: turn state.referer into a struct bufref
Patrick Monnerat [Wed, 3 Dec 2025 20:13:52 +0000 (21:13 +0100)] 
lib: turn state.referer into a struct bufref

Closes #19827

10 days agolib: turn state.url into a struct bufref
Patrick Monnerat [Wed, 3 Dec 2025 22:15:18 +0000 (23:15 +0100)] 
lib: turn state.url into a struct bufref

Closes #19827

10 days agolib: add a Curl_bufref_uptr() function and use it
Patrick Monnerat [Wed, 3 Dec 2025 17:36:03 +0000 (18:36 +0100)] 
lib: add a Curl_bufref_uptr() function and use it

Function Curl_bufref_ptr() now returns a const char *.
New function Curl_bufref_uptr() returns a const unsigned char *.

Usage and doc updated.

Closes #19827

10 days agoldap: call ldap_init() before setting the options
Daniel Stenberg [Wed, 3 Dec 2025 23:14:20 +0000 (00:14 +0100)] 
ldap: call ldap_init() before setting the options

Closes #19830

10 days agovtls: do not reach into ASN1_STRING
Theo Buehler [Thu, 4 Dec 2025 13:43:18 +0000 (14:43 +0100)] 
vtls: do not reach into ASN1_STRING

OpenSSL 4 has plans to make ASN1_STRING opaque, which will break the
build, so convert the code to use accessors. ASN1_STRING_length() and
ASN1_STRING_type() go way back to SSLeay and ASN1_STRING_get0_data() is
OpenSSL 1.1 API present in BoringSSL since foreer and also available
since LibreSSL 2.7, so this should not cause compat issues with any
libcrypto in a supported version of the fork family.

https://github.com/openssl/openssl/issues/29117

Closes #19831

11 days agoruntests: make memanalyzer a Perl module (for 1.1-2x speed-up per test run)
Viktor Szakats [Wed, 3 Dec 2025 03:42:02 +0000 (04:42 +0100)] 
runtests: make memanalyzer a Perl module (for 1.1-2x speed-up per test run)

Patch #19786 removed an exception, which caused many more CI jobs to run
`memanalyze.pl`. It resulted in a 10-30% (Linux), 15% (macOS), 100% (2x,
on Windows) slowdown of runtest steps. It also made some jobs exceed
their time limits and fail (seen with the Windows ARM64 job.)

Turns out the overhead was caused by calling `memanalyze.pl` as
an external process (twice per test), which in turn had to load a full
Perl stack from scratch each time.

Fix by converting memanalyze to a Perl modul, loaded as part of
`runtests.pl`, which eliminated the overhead completely.

It also sped up existing jobs where memanalyze was run for a long time,
e.g. two c-ares Windows jobs, saving 4.5m per CI run.

Supersedes #19819
Bug: https://github.com/curl/curl/pull/19786#issuecomment-3598679397
Follow-up to fb7033d7600dfb59de06e7af8a0d6ab2a4163578 #19786
Closes #19821

11 days agonoproxy: fix ipv6 handling
Georg Schulz-Allgaier [Wed, 3 Dec 2025 21:49:05 +0000 (22:49 +0100)] 
noproxy: fix ipv6 handling

Closes #19828

11 days agodocs: clarify how to do unix domain sockets with SOCKS proxy
Daniel Stenberg [Thu, 4 Dec 2025 07:45:55 +0000 (08:45 +0100)] 
docs: clarify how to do unix domain sockets with SOCKS proxy

Ref: #19825
Closes #19829

11 days agotest787: fix possible typo `&` -> `%` in curl option
Viktor Szakats [Wed, 3 Dec 2025 16:22:37 +0000 (17:22 +0100)] 
test787: fix possible typo `&` -> `%` in curl option

They are close on the keyboard and don't affect test results.

To make this test XML-compliant.

Ref: #14479
Follow-up to 40c264db617d025ca5053bc0964a185d11101301 #15739
Closes #19826

11 days agotests: add `%AMP` macro, use it in two tests
Viktor Szakats [Tue, 2 Dec 2025 04:05:36 +0000 (05:05 +0100)] 
tests: add `%AMP` macro, use it in two tests

To allow replacing `&` characters in `tests/data/test*` files for
XML-compliance.

Also:
- document `%GT`, `%LT`
  Follow-up to de49cc89abc917cb4f273ebea8c6fb584d097de2 #19470

Closes #19824

11 days agosrc: fix formatting nits
Viktor Szakats [Wed, 3 Dec 2025 14:53:46 +0000 (15:53 +0100)] 
src: fix formatting nits

Closes #19823

11 days agoGHA/checksrc: give more time for slow Azure servers [ci skip]
Viktor Szakats [Wed, 3 Dec 2025 15:32:07 +0000 (16:32 +0100)] 
GHA/checksrc: give more time for slow Azure servers [ci skip]

Sometimes 1 minutes is too short to install 39.4 kB of archives.

Ref: https://github.com/curl/curl/actions/runs/19898949860/job/57036965452

11 days agoidn: avoid allocations and wcslen on Windows
Viktor Szakats [Mon, 1 Dec 2025 21:18:41 +0000 (22:18 +0100)] 
idn: avoid allocations and wcslen on Windows

Eliminate a heap buffer in both `win32_idn_to_ascii()` and
`win32_ascii_to_idn()`, by replacing it with stack buffer. The maximum
size is fixed in these cases, and small enough to fit there.

Also reuse length returned by the UTF-8 to wchar conversion, allowing
to drop `wcslen()` call in both functions, and allowing to call
the wchar to UTF-8 conversion API `WideCharToMultiByte()` with the known
length, saving length calculations within that API too.

Ref: https://github.com/curl/curl/pull/19748#issuecomment-3592015200

Closes #19798

11 days agolib: fix formatting nits (part 3)
Viktor Szakats [Tue, 2 Dec 2025 06:25:18 +0000 (07:25 +0100)] 
lib: fix formatting nits (part 3)

From `lib/h` to `lib/w`.

part 1: 47a1ab2ebecb21485c0e955316d90511e80a3c43 #19764
part 2: 86b346443b68cde7ef33e1ab770e6c8ab641d2b1 #19800

Closes #19811

12 days agotest3207: enable memdebug for this test again
Daniel Stenberg [Tue, 2 Dec 2025 16:46:52 +0000 (17:46 +0100)] 
test3207: enable memdebug for this test again

Closes #19813

12 days agoGHA/windows: install MSYS2 c-ares only when used
Viktor Szakats [Wed, 3 Dec 2025 02:06:39 +0000 (03:06 +0100)] 
GHA/windows: install MSYS2 c-ares only when used

Closes #19820

12 days agopytest: fix and improve reliability
Stefan Eissing [Mon, 1 Dec 2025 11:48:55 +0000 (12:48 +0100)] 
pytest: fix and improve reliability

Address issues listed in #19770:
- allow for ngttpx to successfully shut down on last attempt that might
  extend beyond the finish timestamp
- timeline checks: allos `time_starttransfer` to appear anywhere in
  the timeline as a slow client might seen response data before setting
  the other counters
- dump logs on test_05_02 as it was not reproduced locally

Fixes #19970
Closes #19783

12 days agopytest: improve stragglers
Stefan Eissing [Tue, 2 Dec 2025 13:26:31 +0000 (14:26 +0100)] 
pytest: improve stragglers

A fix for the tests that took the longest:
- test_05: make the server close the HTTP/1.1 connection when
  simulating an error during a download. This eliminates waiting
  for a keepalive timeout
- test_02: pause tests with slightly smaller documents, eliminate
  special setup for HTTP/2. We test stream window handling now
  elsewhere already
- cli_hx_download: run look in 500ms steps instead of 1sec, resuming
  paused tranfers earlier.

Closes #19809

12 days agolib: fix formatting nits (part 2)
Viktor Szakats [Thu, 27 Nov 2025 03:27:26 +0000 (04:27 +0100)] 
lib: fix formatting nits (part 2)

From `lib/curl*` to `lib/g*`. With fixes to part 1.

part 1: 47a1ab2ebecb21485c0e955316d90511e80a3c43 #19764

Closes #19800

12 days agoldap: provide version for "legacy" ldap as well
Daniel Stenberg [Tue, 2 Dec 2025 13:13:55 +0000 (14:13 +0100)] 
ldap: provide version for "legacy" ldap as well

It displays in version output as WinLDAP and LDAP/1, compared to
OpenLDAP/[version] for the OpenLDAP backend code.

Closes #19808

12 days agoquiche: use client writer
Stefan Eissing [Tue, 2 Dec 2025 12:42:29 +0000 (13:42 +0100)] 
quiche: use client writer

Instead of buffering response body data until it is received by the
transfer loop, write the response data directly to the client.

Use a connection wide scratch buffer to get the response body from
quiche. Eliminates need for maintaining individual buffers for each
stream.

Fixes #19803
Reported-by: Stanislav Fort
Closes #19806

13 days agoDEPRECATE.md: remove OpenSSL-QUIC in January 2026 instead
Daniel Stenberg [Tue, 2 Dec 2025 10:13:49 +0000 (11:13 +0100)] 
DEPRECATE.md: remove OpenSSL-QUIC in January 2026 instead

Move it up two months. It was only ever experimental so this cannot
interfere with any production code so shorten the "quarantine".

Closes #19805

13 days agocurl_gssapi: make sure Curl_gss_log_error() has an initialized buffer
Daniel Stenberg [Tue, 2 Dec 2025 08:53:00 +0000 (09:53 +0100)] 
curl_gssapi: make sure Curl_gss_log_error() has an initialized buffer

Reported-by: Stanislav Fort (Aisle Research)
Closes #19802

13 days agoRELEASE-NOTES: fix typo
Daniel Stenberg [Tue, 2 Dec 2025 09:13:32 +0000 (10:13 +0100)] 
RELEASE-NOTES: fix typo

13 days agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 2 Dec 2025 08:16:20 +0000 (09:16 +0100)] 
RELEASE-NOTES: synced

13 days agomemdebug: log socket close before closing
Stefan Eissing [Mon, 1 Dec 2025 17:08:25 +0000 (18:08 +0100)] 
memdebug: log socket close before closing

To not get a mixup in the memdebug log order.

Closes #19793

13 days agolibssh2: consider strdup() failures OOM and return correctly
Daniel Stenberg [Mon, 1 Dec 2025 15:32:39 +0000 (16:32 +0100)] 
libssh2: consider strdup() failures OOM and return correctly

In the ssh_state_pkey_init function.

Closes #19791