]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
8 weeks agotidy-up: miscellaneous
Viktor Szakats [Sun, 1 Feb 2026 00:56:43 +0000 (01:56 +0100)] 
tidy-up: miscellaneous

- curl_ntlm_core, smtp, schannel: fix comments.
- curl_setup.h: fix to undef before define.
- tool_doswin, server/sockfilt: reduce variables scopes.
- tool_doswin: drop an interim variable.
- windows: replace `SOCKET_ERROR` with `0` to align with rest of code.
- libssh2: rename variable to align with rest of code.
- gtls, unit1398: use `#if 0`.
- curl_trc.h, curlx/inet_ntop.h: add missing parentheses in macro
  expressions.
- ldap.c: set empty macro to `do {} while(0)`.
- examples/crawler: rename a non-CURLcode `result` variable.
- CURLINFO_TLS_SESSION: drop stray colon.
- add `const` to casts where missing.
- drop unnecessary parentheses.
- fix indent.
- quote style.
- comment style.
- whitespace, newlines, fold/unfold.

Closes #20554

8 weeks agowindows: tidy up `wincrypt.h` / BoringSSL/AWS-LC coexist workaround
Viktor Szakats [Wed, 11 Feb 2026 23:33:20 +0000 (00:33 +0100)] 
windows: tidy up `wincrypt.h` / BoringSSL/AWS-LC coexist workaround

- openssl: move and expand explanatory comment.

- openssl: drop duplicate workaround.

- schannel: drop workaround. Unnecessary, because OpenSSL headers are
  not included in or after schannel code.

- schannel: drop explicit `wincrypt.h` include. It's indirectly
  included by system `<schannel.h>`.

- ldap: drop explicit `wincrypt.h` include.
  It isn't used there, and also not required for the workaround.
  `winldap.h` keeps including it indirectly.

Tested with BoringSSL and AWS-LC (MultiSSL with Schannel), also LDAP
enabled, and H3, unity and non-unity, and all tested cases build fine.

In lib in general, the point is to have the `#undef`s between the first
`wincrypt.h` include [1] and the first OpenSSL include [2], within a
single compilation unit. For non-unity builds the only such source is
`openssl.c`. For unity ones, depending on batch size, in theory we
should `#undef` after each `wincrypt.h` include. In practice this is
overkill and most cases are covered by `#undef`-fing _first_ in
`vtls/openssl.c`, and `#undef` in `ldap.c`. It's not impossible that we
need to add more undefs after further `wincrypt.h` includes to cover so
far undiscovered build cases [3]. Though I could not find more with the
current sources and source order.

It's also an option to include OpenSSL first, then `wincrypt.h`, as
done in libtests, but for lib and `vtls/openssl.c` it's more practical
to do the opposite.

[1] can be indirect, e.g. via `iphlpapi.h`, `schannel.h`, `winldap.h`.

[2] in
- BoringSSL/AWS-LC: any include (due to `openssl/base.h`).
  Original fix removed by BoringSSL in year
  [2014](https://github.com/google/boringssl/commit/ded93581f1674f81faa0dba4b15a842756066ab2#diff-878093ea6426091505b4c49c59b78924f42859af0eb4ce39b8089bda9577e013).
- OpenSSL: `openssl/ssl.h`, `openssl/x509v3.h`, and some more affected,
  and including `openssl/ossl_typ.h` does the `#undef` automatically.
  Since [3.1.0+](https://github.com/openssl/openssl/commit/fbb9a1f99713b5277d5658963c1706069061e015)
  each inclusion does the `#undef`, in 3.0.x (and earlier) only
  the first inclusion did. Initially fixed in
  [0.9.6d](https://github.com/openssl/openssl/commit/1955b8742354a989650853412c27863f1644e81d)
- LibreSSL [2.3.0+](https://github.com/libressl/portable/commit/0fa826d34f42ecd0932aaf48012ca9165ac1612b):
  not affected, though to suppress another warning 3.8.2+ and
  a [define](https://github.com/libressl/portable/commit/e7fe6caab2869a043514c297ce04e6995a65d79f)
  is necessary.

[3] `lib/Makefile.inc` defines the order of unity sources.

For libtests, the case is simpler: There is always one compilation unit,
with a fixed order, and at the moment `cli_hx_download.c` is including
OpenSSL first, then wincrypt, and in this order they don't bother each
other. Also, at the moment `lib758.c` is the only other OpenSSL header
user, but it's compiled after `cli_hx_download.c` so the include is
skipped there. We may need to revisit this if either header gets
included before it.

All this said it'd be nice if BoringSSL/AWS-LC restored the built-in
workaround to behave like LibreSSL and OpenSSL and not require local
workarounds like these.

Ref: https://github.com/curl/curl/pull/20556#issuecomment-3888425644

Follow-up to 4c46c829f5ed7c37b3313c67a6662b7332c1ff7f #9110
Follow-up to fbe07c6829ba8c5793c84c2856526e19e9029ab9 #5669 #5857

Closes #20567

8 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 12 Feb 2026 08:25:40 +0000 (09:25 +0100)] 
RELEASE-NOTES: synced

8 weeks agocli_hx_download: add Schannel support
Viktor Szakats [Wed, 11 Feb 2026 01:35:02 +0000 (02:35 +0100)] 
cli_hx_download: add Schannel support

Fixes:
```
$ wine libtests.exe cli_hx_download https://curl.se/
[...]
Assertion failed: t->checked_ssl, file .../curl/tests/libtest/cli_hx_download.c, line 563
```

into:
```
[t-0] info Schannel TLS version 0x00000800
```

Refs:
https://learn.microsoft.com/windows/win32/secauthn/querycontextattributes--general
https://learn.microsoft.com/windows/win32/api/schannel/ns-schannel-secpkgcontext_connectioninfo

Ref: c220674ac451231e05df1686bd3da473e5c37252 #20564
Follow-up to ba9ddb935794a9fdd6906f043102a0d3e5795113 #18066

Closes #20556

8 weeks agocmake: fix `CURL_DROP_UNUSED` accidental left always-enabled
Viktor Szakats [Wed, 11 Feb 2026 15:47:38 +0000 (16:47 +0100)] 
cmake: fix `CURL_DROP_UNUSED` accidental left always-enabled

Follow-up to 66ad54e46b934e17e786e10e0292fa6f1f3fa816 #20357

Closes #20565

8 weeks agowindows: tidy up includes, macros, document dependencies
Viktor Szakats [Wed, 11 Feb 2026 12:54:27 +0000 (13:54 +0100)] 
windows: tidy up includes, macros, document dependencies

- define `SECURITY_WIN32` globally in `curl_setup.h`.
  To make sure it applies to all includes.

- document which Windows headers require `SECURITY_WIN32`.

- stop suppressing MSVC warning:
  `C4201 is: nonstandard extension used : nameless struct/union`
  The warning is no longer seen in supported build envs with the current
  codebase.
  Follow-up to 8beff4355956e3d18ceb3afc21c1f3edec82543c #8419

- document why `SCHANNEL_USE_BLACKLISTS` is needed.

- just define `SCHANNEL_USE_BLACKLISTS`, drop the unnecessary value `1`.

- stop defining unused `SCH_CRED_MAX_SUPPORTED*` fallback macros.
  Follow-up to 8beff4355956e3d18ceb3afc21c1f3edec82543c #8419

- document why `subauth.h` is included (where missing).

- move and de-dupe `subauth.h` include into `curl_setup.h`, limit to
  Schannel builds.

- stop include `schnlsp.h`. It is a 1-to-1 compatibility wrapper for
  `schannel.h`.

- curl_sspi.h: clarify comment about `SP_NAME_` macros.
  They are local macros, their SDK names are different and curl does not
  use them.

- curl_sspi.h: drop superfluous includes `security.h` and `rpc.h`.

Cherry-picked from #20556

Closes #20564

8 weeks agobuild: check `MSG_NOSIGNAL` directly, drop detection and interim macro
Viktor Szakats [Wed, 11 Feb 2026 03:10:00 +0000 (04:10 +0100)] 
build: check `MSG_NOSIGNAL` directly, drop detection and interim macro

Drop detecting it at configure time, along with the interim macro
`HAVE_MSG_NOSIGNAL`. There is no longer a reason for this workaround,
and allows to save the work at configure time and simplify.

Also say in a comment that `sys/socket.h` is defining this macro.

Follow-up to 77b3bc239daf75d9fb7702ee34c8e5871c47d387

Closes #20559

8 weeks agocurl_setup.h: merge back single-use internal header `curl_setup_once.h`
Viktor Szakats [Wed, 11 Feb 2026 00:51:21 +0000 (01:51 +0100)] 
curl_setup.h: merge back single-use internal header `curl_setup_once.h`

Originally split in 2006, but the issues cited are no longer present in
current code. As of now both `curl_setup.h` and `curl_setup_once.h` are
included once per compiler invocation, without recursion. The latter is
a sub-header of the former with no clear distinction in their contents.

Merge them to avoid having to decide where to put new global PP logic.
Also to make it easier to overview what gets defined/included globally
and in what order. (Perhaps even allowing some tidying up here.)

Follow-up to 77b3bc239daf75d9fb7702ee34c8e5871c47d387

Closes #20555

8 weeks agodocs/libcurl: unify WARNING use
Daniel Stenberg [Wed, 11 Feb 2026 08:33:35 +0000 (09:33 +0100)] 
docs/libcurl: unify WARNING use

Consistently use bold and colon.

Closes #20561

8 weeks agotool_operate: split post_per_transfer into sub functions
Daniel Stenberg [Wed, 11 Feb 2026 07:35:08 +0000 (08:35 +0100)] 
tool_operate: split post_per_transfer into sub functions

To make it easier to read and manage. Reduce complexity.

Closes #20560

8 weeks agoGHA/linux: update pizlonator/fil-c to v0.678
renovate[bot] [Wed, 11 Feb 2026 04:07:09 +0000 (04:07 +0000)] 
GHA/linux: update pizlonator/fil-c to v0.678

Closes #20558

8 weeks agopytest: bump pip cryptography to 46.0.5
Viktor Szakats [Wed, 11 Feb 2026 05:05:33 +0000 (06:05 +0100)] 
pytest: bump pip cryptography to 46.0.5

For CVE-2026-26007 (curl not affected)

8 weeks agoGHA: update awslabs/aws-lc to v1.67.0
renovate[bot] [Tue, 10 Feb 2026 01:12:19 +0000 (01:12 +0000)] 
GHA: update awslabs/aws-lc to v1.67.0

Closes #20553

8 weeks agohttp_aws_sigv4: fix query normalization of %2b
Daniel Stenberg [Mon, 9 Feb 2026 13:59:39 +0000 (14:59 +0100)] 
http_aws_sigv4: fix query normalization of %2b

Reported-by: Nuno Goncalves
Fixes #20543
Closes #20550

8 weeks agogss: exclude verbose error logic from non-verbose builds
Viktor Szakats [Tue, 10 Feb 2026 00:41:41 +0000 (01:41 +0100)] 
gss: exclude verbose error logic from non-verbose builds

Closes #20551

8 weeks agovtls: use ALPN http/1.0 & http/1.1 for HTTP/1.0 requests
Jay Satiro [Thu, 5 Feb 2026 22:43:55 +0000 (17:43 -0500)] 
vtls: use ALPN http/1.0 & http/1.1 for HTTP/1.0 requests

- For compatibility reasons send both ALPN ids http/1.0 and http/1.1 for
  HTTP/1.0 requests.

Prior to this change for compatibility reasons curl would send ALPN
http/1.1 for HTTP/1.0 requests, since some servers do not recognize
ALPN http/1.0. However some servers may recognize only ALPN http/1.0 for
HTTP/1.0 requests. Therefore curl now sends both.

Reported-by: programmerlexi@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/20487
Closes https://github.com/curl/curl/pull/20533

8 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 9 Feb 2026 15:28:57 +0000 (16:28 +0100)] 
RELEASE-NOTES: synced

8 weeks agotest1980: verify sigv4 normalization query with + and spaces
Daniel Stenberg [Mon, 9 Feb 2026 12:21:26 +0000 (13:21 +0100)] 
test1980: verify sigv4 normalization query with + and spaces

Ref: #20543
Closes #20548

8 weeks agoVULN-DISCLOSURE-POLICY.md: mention GitHub quirks
Daniel Stenberg [Sat, 7 Feb 2026 22:45:27 +0000 (23:45 +0100)] 
VULN-DISCLOSURE-POLICY.md: mention GitHub quirks

Closes #20541

8 weeks agodigest: escape double quotes and backslashes in realm and nonce 20545/head
Daniel Stenberg [Sun, 8 Feb 2026 11:30:09 +0000 (12:30 +0100)] 
digest: escape double quotes and backslashes in realm and nonce

change test 907 to use quote in realm to verify

Fixes #20482
Reported-by: cooldadpresident on github
Closes #20545

8 weeks agotests: convert base64 data to %b64[]
Daniel Stenberg [Sun, 8 Feb 2026 13:09:13 +0000 (14:09 +0100)] 
tests: convert base64 data to %b64[]

To make it easier to read, understand and edit tests - and grep them.

Closes #20547

2 months agobuild: tidy up and simplify `setmode()` detection and use
Viktor Szakats [Sat, 7 Feb 2026 16:57:39 +0000 (17:57 +0100)] 
build: tidy up and simplify `setmode()` detection and use

- move macro to `curl_setup.h` (from curlx), and rename.
  It's required by src, test servers, libtests. Also used by unit/tunit,
  (which is fixable but this patch doesn't touch it.)
- special-case it for Windows/Cygwin/MS-DOS.
- build: drop `setmode()`/`_setmode()` detection.
  This also avoids detecting the different `setmode()` on BSDs,
  and a lot of complexity and overhead.
- use `CURL_O_BINARY`.

Follow-up to 250d613763dfc29f73010696ee7948f19d07dba9 #15787
Follow-up to 5e70566094463b8463d4dc1bec9b66763a761c76 #15169

Closes #20539

2 months agocurl_setup.h: drop extra header guard for internal include
Viktor Szakats [Sun, 8 Feb 2026 02:36:45 +0000 (03:36 +0100)] 
curl_setup.h: drop extra header guard for internal include

The included local header starts with this same guard. The original
commit added it for fixing VMS builds along with many other changes, but
without mention of this specific one in the commit message.

`curl_setup.h` is included once, which includes `curl_setup_once.h`
once, even if the latter wouldn't have it's own guard.

Ref: 25f351424b353884bfe36f5e1c7a787b04b46932

Closes #20544

2 months agocurl_get_line: drop single-use macro
Viktor Szakats [Sun, 8 Feb 2026 00:04:20 +0000 (01:04 +0100)] 
curl_get_line: drop single-use macro

Follow-up to 769ccb4d4261a75c8a4236fbe7dc3e27956db1c9 #19140

Closes #20542

2 months agourl.c: restore mistaken comment change
Daniel Stenberg [Sat, 7 Feb 2026 22:04:00 +0000 (23:04 +0100)] 
url.c: restore mistaken comment change

Follow-up to d7a9f1ab15

Closes #20540

2 months agosws: prevent "connection monitor" to say disconnect twice
Daniel Stenberg [Fri, 6 Feb 2026 23:16:58 +0000 (00:16 +0100)] 
sws: prevent "connection monitor" to say disconnect twice

2 months agourl: fix reuse of connections using HTTP Negotiate
Daniel Stenberg [Thu, 5 Feb 2026 07:34:21 +0000 (08:34 +0100)] 
url: fix reuse of connections using HTTP Negotiate

Assume Negotiate means connection-based

Reported-by: Zhicheng Chen
Closes #20534

2 months agosrc/Makefile.inc: update `CURLX_HFILES`
Viktor Szakats [Sat, 7 Feb 2026 17:04:31 +0000 (18:04 +0100)] 
src/Makefile.inc: update `CURLX_HFILES`

Closes #20537

2 months agodocs: compare `result` against literal `CURLE_OK` (where missing)
Viktor Szakats [Sat, 7 Feb 2026 15:50:54 +0000 (16:50 +0100)] 
docs: compare `result` against literal `CURLE_OK` (where missing)

Also scope to result variables.

Closes #20536

2 months agotidy-up: move literals to right-side of `if` expressions (where missing)
Viktor Szakats [Sat, 7 Feb 2026 14:59:59 +0000 (15:59 +0100)] 
tidy-up: move literals to right-side of `if` expressions (where missing)

Closes #20535

2 months agotool_cb_prg: drop duplicate preprocessor logic
Viktor Szakats [Thu, 5 Feb 2026 21:23:32 +0000 (22:23 +0100)] 
tool_cb_prg: drop duplicate preprocessor logic

In favor of the copy in `curl_setup.h`.

Closes #20531

2 months agolib518, 537: drop `#error` on unlikely/impossible build condition
Viktor Szakats [Thu, 5 Feb 2026 21:10:03 +0000 (22:10 +0100)] 
lib518, 537: drop `#error` on unlikely/impossible build condition

`FD_SETSIZE` is used in core code and expected to be present.

Closes #20530

2 months agoREADME: add MQTTS
Daniel Stenberg [Thu, 5 Feb 2026 21:44:32 +0000 (22:44 +0100)] 
README: add MQTTS

Follow-up to 6c31df453b02597e

Closes #20532

2 months agocurl_setup_once: allow CURL_DEBUGASSERT for customization
Juan Belon [Mon, 22 Dec 2025 10:51:10 +0000 (10:51 +0000)] 
curl_setup_once: allow CURL_DEBUGASSERT for customization

Closes #19744

2 months agoDockerfile: update debian:bookworm-slim Docker digest to 98f4b71
renovate[bot] [Tue, 3 Feb 2026 05:37:23 +0000 (05:37 +0000)] 
Dockerfile: update debian:bookworm-slim Docker digest to 98f4b71

Closes #20501

2 months agodocs: fix grammar nitpicks
Spenser Black [Wed, 4 Feb 2026 15:17:07 +0000 (15:17 +0000)] 
docs: fix grammar nitpicks

Closes #20518

2 months agourl.c: code/comment cleanup around conn creation
Stefan Eissing [Wed, 28 Jan 2026 16:20:57 +0000 (17:20 +0100)] 
url.c: code/comment cleanup around conn creation

Several comments were outdated and parameters to create_conn() and
ConnectionExists() were not needed. Give functions better names and
consistently use terms `needle` and `conn`.

No functional change.

Closes #20464

2 months agocurl: add -I and -i to -h important
jhauga [Fri, 30 Jan 2026 21:15:06 +0000 (16:15 -0500)] 
curl: add -I and -i to -h important

Closes #20483

2 months agoGHA: update google/boringssl to v0.20260204.0
renovate[bot] [Wed, 4 Feb 2026 18:10:39 +0000 (18:10 +0000)] 
GHA: update google/boringssl to v0.20260204.0

Closes #20519

2 months agomk-ca-bundle.pl: drop support for obsolete/insecure fingerprint algos
Viktor Szakats [Thu, 5 Feb 2026 13:32:35 +0000 (14:32 +0100)] 
mk-ca-bundle.pl: drop support for obsolete/insecure fingerprint algos

MD5 and SHA1 fingerprints can no longer be included in the output when
using the `-t` option.

Closes #20527

2 months agolib: disable websockets early if no http
Viktor Szakats [Thu, 5 Feb 2026 11:42:59 +0000 (12:42 +0100)] 
lib: disable websockets early if no http

To prevent inconsistent `CURL_DISABLE_WEBSOCKETS` states between source
files.

Follow-up to 8edc0338f30f458f812f9ea355de1240771fa343 #20351

Closes #20526

2 months agobuild: make `HTTP_ONLY` build options also disable websockets
Viktor Szakats [Thu, 5 Feb 2026 11:31:42 +0000 (12:31 +0100)] 
build: make `HTTP_ONLY` build options also disable websockets

Closes #20525

2 months agocmake: use `list(APPEND ...)` where missing
Viktor Szakats [Thu, 5 Feb 2026 11:15:07 +0000 (12:15 +0100)] 
cmake: use `list(APPEND ...)` where missing

Cherry-picked from #20407

Closes #20522

2 months agoGHA/linux-old: use tilde where possible and consistent
Viktor Szakats [Thu, 5 Feb 2026 11:18:42 +0000 (12:18 +0100)] 
GHA/linux-old: use tilde where possible and consistent

Cherry-picked from #20407

Closes #20524

2 months agoGHA/non-native: pin DJGPP toolchain to hash
Viktor Szakats [Thu, 5 Feb 2026 02:42:05 +0000 (03:42 +0100)] 
GHA/non-native: pin DJGPP toolchain to hash

This package is automatically bumped, but needs manual intervention
anyway, to update gcc version number in the filename.

Follow-up to 4ad0a022e1d47119c9f0b11068f3d0b0a932e989 #20517

Closes #20523

2 months agoCI: log downloaded file hashes, pin manually bumped ones
Viktor Szakats [Wed, 4 Feb 2026 13:54:26 +0000 (14:54 +0100)] 
CI: log downloaded file hashes, pin manually bumped ones

To ensure downloaded binaries are the expected ones. Also to document
SHA-256 hashes of all binary packages and source tarballs.

Closes #20517

2 months agobuild: use native file open flags in Windows-specific code
Viktor Szakats [Wed, 4 Feb 2026 13:32:11 +0000 (14:32 +0100)] 
build: use native file open flags in Windows-specific code

To comply with official documentation. Also to make code compile with
`NO_OLDNAMES` (mingw-w64) or `_CRT_DECLARE_NONSTDC_NAMES=0` (MSVC) set.

Ref: #15652

Closes #20516

2 months agomqtt: verify Remaining Length for CONNACK and PUBACK
Daniel Stenberg [Wed, 4 Feb 2026 10:00:56 +0000 (11:00 +0100)] 
mqtt: verify Remaining Length for CONNACK and PUBACK

Verified in test 1132

Closes #20513

2 months agoVULN-DISCLOSURE-POLICY.md: push reports to the web form
Daniel Stenberg [Wed, 4 Feb 2026 10:50:06 +0000 (11:50 +0100)] 
VULN-DISCLOSURE-POLICY.md: push reports to the web form

Closes #20515

2 months agoGHA/windows: set `lookup-only` in build-cache jobs
Viktor Szakats [Wed, 4 Feb 2026 01:40:27 +0000 (02:40 +0100)] 
GHA/windows: set `lookup-only` in build-cache jobs

To save a few seconds by not actually restoring the cache, just checking
if there is cache hit.

Follow-up to fb44e44d929f4e8eb140e5e1c7bd3a7f4d0e7d58 #20456

Closes #20512

2 months agobuild: move curl stat struct type to the curlx namespace
Viktor Szakats [Tue, 3 Feb 2026 14:06:07 +0000 (15:06 +0100)] 
build: move curl stat struct type to the curlx namespace

To match surrounding curlx symbols and functions.

Follow-up to a84b041281463315d3f8723febc97be1147964f4 #20496

Closes #20508

2 months agoimap: add a check for Curl_meta_get()
Daniel Stenberg [Tue, 3 Feb 2026 16:11:04 +0000 (17:11 +0100)] 
imap: add a check for Curl_meta_get()

It should not return NULL, but if it does we need to bail out. Like we
do elsewhere.a

Found by CodeSonar.
Closes #20510

2 months agomulti: update timer unconditionally in multi_remove_handle
Stefan Eissing [Tue, 3 Feb 2026 09:18:13 +0000 (10:18 +0100)] 
multi: update timer unconditionally in multi_remove_handle

When removing an easy handle from a multi, there was an optimization
to update the timer only when the removed handle had any timers.

With the introduction of the "dirty" bitset, easy handles can now cause
a timeout of 0 to be set without having anything in their timer list.
Removing such a handle needs to update the timer now always, so that
it may get cleared when there is nothing more to wait for.

The previous "not clearing a 0 timer" should not have any effect on
application's logic. Without clearing, the timer will fire and then
adjust itself to the proper value. But it would cause one more timer
fire than necessary.

Reported-by: Jan Macku
Fixes https://github.com/curl/curl/issues/20498
Closes https://github.com/curl/curl/pull/20502

2 months agobuild: require POSIX `strdup()`
Viktor Szakats [Mon, 2 Feb 2026 18:02:34 +0000 (19:02 +0100)] 
build: require POSIX `strdup()`

Stop detecting this function and drop the local fallback.

Let us know if this update is causing an issue.

Notes:
- on Windows `_strdup()` is required instead.
- `strdup()/_strdup()` were required before this patch to build one of
  the examples: `block_ip`.
- `strdup()/_strdup()` were required in 8.18.0 and earlier to build
  tests.

Closes #20505

2 months agofopen.h: simplify curl memory macro mappings
Viktor Szakats [Tue, 3 Feb 2026 10:34:07 +0000 (11:34 +0100)] 
fopen.h: simplify curl memory macro mappings

Closes #20506

2 months agocurlx: drop unused `curlx_saferealloc()`
Viktor Szakats [Tue, 3 Feb 2026 13:10:02 +0000 (14:10 +0100)] 
curlx: drop unused `curlx_saferealloc()`

Unused since 67ae101666f1023263c475b88b266bc9b5e658c0 #19949

Closes #20504

2 months agobuild: tidy up and dedupe `strdup` functions
Viktor Szakats [Mon, 2 Feb 2026 13:08:14 +0000 (14:08 +0100)] 
build: tidy up and dedupe `strdup` functions

- de-dupe lib/src strdup/memdup functions into curlx.
- introduce `CURLX_STRDUP_LOW()` for mapping `strdup()`, and to do it at
  one place within the code, in `curl_setup.h`.
- tests/server: use `curlx_strdup()`. (Also to fix building without
  a system `strdup()`.)
- curlx/curlx.h: shorten and tidy up.
- adjust Windows build path to not need `HAVE_STRDUP`.
- build: stop detecting `HAVE_STRDUP` on Windows.

Closes #20497

2 months agocurl_setup.h: simplify curl memory macro mappings
Viktor Szakats [Sun, 1 Feb 2026 01:02:59 +0000 (02:02 +0100)] 
curl_setup.h: simplify curl memory macro mappings

Full argument listing is redundant for `curl`-prefixed internal macros.

Closes #20499

2 months agotypos: silence false positives found in C code
Viktor Szakats [Mon, 2 Feb 2026 23:50:42 +0000 (00:50 +0100)] 
typos: silence false positives found in C code

Closes #20500

2 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 2 Feb 2026 22:44:30 +0000 (23:44 +0100)] 
RELEASE-NOTES: synced

2 months agohostip.c: fix leak of addrinfo
Stefan Eissing [Thu, 29 Jan 2026 10:59:05 +0000 (11:59 +0100)] 
hostip.c: fix leak of addrinfo

When creating a dns entry, the addrinfo is passed into the entry on
success and needed deallocation by the caller on failure.

Change the signature to have Curl_dnscache_mk_entry() *always* take
ownership of the addrinfo, even on failure. Change parameter to address
of pointer so that call always clears it.

This makes the handling of failures to Curl_dnscache_mk_entry() simpler.

Fixes #20465
Closes #20468

2 months agobuild: tidy up curl-specific fstat calls and stat struct type
Viktor Szakats [Mon, 2 Feb 2026 12:14:30 +0000 (13:14 +0100)] 
build: tidy up curl-specific fstat calls and stat struct type

To avoid redefining the `fstat` system symbol, and to clarify
`struct_stat` is a curl symbol.

- introduce `curlx_fstat()` macro and use it.
- rename `struct_stat` to `curl_struct_stat`.

Also:
- tests: replace direct `curlx_win32_stat()` call with `curlx_stat()`.
- checksrc: disallow direct `_fstati64` and `fstat()` calls, except in
  examples.

Closes #20496

2 months agobuild: use more `const`
Viktor Szakats [Sun, 1 Feb 2026 02:57:45 +0000 (03:57 +0100)] 
build: use more `const`

Mostly with `char *` types.

Also:
- mime, x509asn1, tool_operate, lib3207: drop redundant casts.
- examples/smooth-gtk-thread: add missing variable declaration.
- reduce variable scopes.
- tests/server: move `data_to_hex()` to its only user: `sws`.

Closes #20489

2 months agoftp: drop single-caller local verbose function
Viktor Szakats [Mon, 2 Feb 2026 03:12:43 +0000 (04:12 +0100)] 
ftp: drop single-caller local verbose function

Closes #20495

2 months agoftp: replace a `curlx_free()` with `curlx_dyn_free()`
Viktor Szakats [Mon, 2 Feb 2026 01:24:05 +0000 (02:24 +0100)] 
ftp: replace a `curlx_free()` with `curlx_dyn_free()`

On an error path.

Follow-up to f4beef524a53e1951c102fdb2ab96dd7a5e01077 #12638

Closes #20494

2 months agotest1604: avoid dynamic allocations
Viktor Szakats [Sun, 1 Feb 2026 21:17:44 +0000 (22:17 +0100)] 
test1604: avoid dynamic allocations

Closes #20493

2 months agotest1304: drop `CURL_UNCONST()`
Viktor Szakats [Sun, 1 Feb 2026 20:26:09 +0000 (21:26 +0100)] 
test1304: drop `CURL_UNCONST()`

Closes #20492

2 months agocmake: skip binutils ld hack if zlib/openssl target is not `IMPORTED`
Viktor Szakats [Sat, 31 Jan 2026 20:15:51 +0000 (21:15 +0100)] 
cmake: skip binutils ld hack if zlib/openssl target is not `IMPORTED`

The binutils ld hack requires reading the targets' `LOCATION` property.
This property exists in `IMPORTED` targets. `ZLIB::ZLIB` and
`OpenSSL::Crypto` are normally `IMPORTED` targets defined by CMake's
built-in Find modules. However, in some cases (e.g. in "superbuilds"),
they may be regular targets, defined manually, without a `LOCATION`
property. To avoid a CMake warning in such case, verify if the target is
`IMPORTED` before reading this property.

This also mean that in such case the binutils/ld/gcc hack is not
enabled, and libcurl may fail linking in static mode.

https://cmake.org/cmake/help/v4.2/prop_tgt/IMPORTED.html
https://cmake.org/cmake/help/v4.2/prop_tgt/LOCATION.html

Reported-by: Tomáš Malý
Fixes #20419
Follow-up to 3e841630ece59c04e26058a761302f38370fd0cc #20427
Follow-up to 16f073ef49f94412000218c9f6ad04e3fd7e4d01 #16973

Closes #20486

2 months agobuild: tidy up local `lseek()` mappings
Viktor Szakats [Sun, 1 Feb 2026 00:04:58 +0000 (01:04 +0100)] 
build: tidy up local `lseek()` mappings

- stop redefining system symbol `lseek`, by introducing `curl_lseek()`.
- handle AmigaOS quirk within the macro mapping.
- add missing parenthesis to `LSEEK_ERROR` values.
- tool_util: use curl `lseek` macros in `tool_ftruncate64()`.
- move `LSEEK_ERROR` to right-hand side of if expressions.
- checksrc: disallow direct uses of `_lseeki64`, `llseek`, `lseek`.

Closes #20488

2 months agoGHA: bump GHA and pip dependencies
dependabot[bot] [Sun, 1 Feb 2026 14:55:09 +0000 (14:55 +0000)] 
GHA: bump GHA and pip dependencies

- update `actions/checkout` from 6.0.1 to 6.0.2
- update `ruff` from 0.14.11 to 0.14.14
- update `cryptography` from 46.0.3 to 46.0.4
- update `psutil` from 7.2.1 to 7.2.2
- update `websockets` from 15.0.1 to 16.0

Closes #20490
Closes #20491

2 months agotidy-up: miscellaneous
Viktor Szakats [Fri, 23 Jan 2026 11:59:42 +0000 (12:59 +0100)] 
tidy-up: miscellaneous

- INSTALL-CMAKE.md: add missing periods, text fixes.
- md4, md5: sync variables names.
- curl_trc: sync an argument type.
- docs/examples: sync debug/trace function copies, constify, tidy-ups.
- replace commented code with `#if 0`.
- drop redundant parenthesis (macro values, `return`, around single
  variables, function calls).
- fix indentation, apply clang-format in places.

Closes #20481

2 months agoCURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md: fix available protocols
Jay Satiro [Sat, 31 Jan 2026 19:36:25 +0000 (14:36 -0500)] 
CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md: fix available protocols

Bug: https://curl.se/mail/lib-2026-01/0033.html
Reported-by: Tenant HellTower (Negar)
2 months agovtls: dedupe common on-session-reuse logic
Viktor Szakats [Thu, 29 Jan 2026 16:01:21 +0000 (17:01 +0100)] 
vtls: dedupe common on-session-reuse logic

Closes #20475

2 months agossh: dedupe state change function
Viktor Szakats [Thu, 29 Jan 2026 15:07:26 +0000 (16:07 +0100)] 
ssh: dedupe state change function

Closes #20473

2 months agocmake: improve setting up runtests in Windows cross-builds
Viktor Szakats [Thu, 29 Jan 2026 19:55:27 +0000 (20:55 +0100)] 
cmake: improve setting up runtests in Windows cross-builds

Closes #20479

2 months agoGHA/windows: fix typo in test number [ci skip]
Viktor Szakats [Thu, 29 Jan 2026 23:23:57 +0000 (00:23 +0100)] 
GHA/windows: fix typo in test number [ci skip]

Follow-up to 3ae234b2a3aca14908c292ac09755f6c08daac1a #20462

2 months agotests/server/sockfilt: avoid possible endless loop on Windows
Viktor Szakats [Thu, 29 Jan 2026 21:57:19 +0000 (22:57 +0100)] 
tests/server/sockfilt: avoid possible endless loop on Windows

Seen to happen when run under WINE v10.0 on macOS.
```
$ CURL_TEST_EXE_EXT_SRV=.exe CURL_TEST_EXE_EXT_TOOL=.exe \
CURL_TEST_EXE_RUNNER=wine TFLAGS='951 -t' ninja tests
[...]
16:02:18.607002 [select_ws_wait_thread] PeekNamedPipe error: (0x00000032) - Request not supported.
[...endless repeat...]
```

Closes #20478

2 months agotests/server: tidy-up error messages (Windows)
Viktor Szakats [Thu, 29 Jan 2026 19:54:17 +0000 (20:54 +0100)] 
tests/server: tidy-up error messages (Windows)

- show error description on `PeekNamedPipe()` error.
- show `GetLastError()` instead of socket error on non-socket failures
  in the window handler.
- include full hex `GetLastError()` numbers in error messages, syncing
  with Schannel code.
- drop internal `win32_perror()` function, in favor of direct
  `curlx_*strerror()` calls.

Closes #20477

2 months agotool_help.h: drop redundant `U` suffix from literals
Viktor Szakats [Thu, 29 Jan 2026 18:37:24 +0000 (19:37 +0100)] 
tool_help.h: drop redundant `U` suffix from literals

Also:
- update the generator script accordingly.
- convert lowercase `u` suffix to uppercase to match rest of code.

Closes #20476

2 months agohttp2: dedupe nghttp2 verbose frame print function
Viktor Szakats [Thu, 29 Jan 2026 14:59:15 +0000 (15:59 +0100)] 
http2: dedupe nghttp2 verbose frame print function

Closes #20472

2 months agomd4, md5: replace custom types with `uint32_t`
Viktor Szakats [Thu, 29 Jan 2026 12:46:24 +0000 (13:46 +0100)] 
md4, md5: replace custom types with `uint32_t`

Closes #20469

2 months agosetup-os400.h: drop no longer used custom type `u_int32_t`
Viktor Szakats [Thu, 29 Jan 2026 12:49:08 +0000 (13:49 +0100)] 
setup-os400.h: drop no longer used custom type `u_int32_t`

Unused since bb5529331334e1e1c79ff3320220bba12fc8457d.

Closes #20470

2 months agosend: drop `CURL_UNCONST()` from buffer argument on most platforms
Viktor Szakats [Wed, 28 Jan 2026 14:24:09 +0000 (15:24 +0100)] 
send: drop `CURL_UNCONST()` from buffer argument on most platforms

Keep it on platforms requiring a non-const buffer. These are AmigaOS and
OS400.

Also:
- replace `SEND_QUAL_ARG2` with boolean macro `SEND_NONCONST_ARG2`.

Closes #20463

2 months agoGHA/macos: merge an autotools job into a cmake one, drop an iOS job
Viktor Szakats [Thu, 29 Jan 2026 01:28:21 +0000 (02:28 +0100)] 
GHA/macos: merge an autotools job into a cmake one, drop an iOS job

Merging the two macOS jobs saves 4-5 minutes. The dropped iOS Ninja job
saves 0.5-1 minute. (Keep the two slow iOS jobs to maintain variation.)

Number of Apple jobs is 32 after this patch.

Also:
- skip building tests and example in iOS autotools to save 30-40s.

Closes #20467

2 months agodocs: document the need for a 64-bit type and stdint.h
Dan Fandrich [Thu, 9 Jan 2025 18:57:39 +0000 (10:57 -0800)] 
docs: document the need for a 64-bit type and stdint.h

These are requirements above and above C89.

Ref: #20406

Closes #20384

2 months agoGHA/windows: mark test 3001 flaky in native Windows jobs
Viktor Szakats [Wed, 28 Jan 2026 14:12:46 +0000 (15:12 +0100)] 
GHA/windows: mark test 3001 flaky in native Windows jobs

It has been happening for a long time.

Example:
```
test 3001...[HTTPS localhost, last subject alt name matches, CN does not match]

 3001: protocol FAILED!
 There was no content at all in the file log/7/server.input.
 Server glitch? Total curl failure? Returned: 56
== Contents of files in the log/7/ directory after test 3001
=== Start of file commands.log
 ../src/curl.exe -q --output log/7/curl3001.out  --include --trace-ascii log/7/trace3001 --trace-time -4 --cacert ./certs/test-ca.crt https://localhost:64259/3001 > log/7/stdout3001 2> log/7/stderr3001
=== End of file commands.log
=== Start of file http_server.log
 13:57:47.951283 Running HTTP IPv4 version on port 64256
=== End of file http_server.log
=== Start of file https_stunnel.log
 2026.01.28 13:57:48 LOG5[ui]: stunnel 5.76 on x64-pc-mingw32-gnu platform
 2026.01.28 13:57:48 LOG5[ui]: Compiled/running with OpenSSL 3.5.4 30 Sep 2025
 [...]
 2026.01.28 13:57:49 LOG5[0]: Service [curltest] accepted connection from 127.0.0.1:64281
 2026.01.28 13:57:51 LOG3[0]: s_connect: connect 127.0.0.1:64256: Connection refused (WSAECONNREFUSED) (10061)
 2026.01.28 13:57:51 LOG3[0]: No more addresses to connect
 2026.01.28 13:57:51 LOG5[0]: Connection reset: 0 byte(s) sent to TLS, 0 byte(s) sent to socket
=== End of file https_stunnel.log
=== Start of file server.cmd
 Testnum 3001
=== End of file server.cmd
=== Start of file stderr3001
 curl: (56) Recv failure: Connection was reset
=== End of file stderr3001
[...]
RUN: Unknown server on our https port: 64259 (56)
```

Ref: https://github.com/curl/curl/actions/runs/21440845836/job/61743268798?pr=20461

Closes #20462

2 months agotests/server: drop stray casts from `swrite`/`sread` arguments
Viktor Szakats [Wed, 28 Jan 2026 13:50:19 +0000 (14:50 +0100)] 
tests/server: drop stray casts from `swrite`/`sread` arguments

Closes #20461

2 months agotests/server: replace 4 remaining `send()` calls with `swrite()`
Viktor Szakats [Wed, 28 Jan 2026 13:35:18 +0000 (14:35 +0100)] 
tests/server: replace 4 remaining `send()` calls with `swrite()`

They were masked by `()`, which was also not necessary anymore.

Follow-up to 483f4291fb8134a31c437e82212d541782121ad7 #20459
Follow-up to a585cc35e57fc06806443207e31a244c9df029bb #20097
Follow-up to bf7375ecc50e857760b0d0a668c436e208a400bd #18503

Closes #20460

2 months agobuild: replace `send`/`recv` with `swrite`/`sread` where missing
Viktor Szakats [Wed, 28 Jan 2026 11:57:23 +0000 (12:57 +0100)] 
build: replace `send`/`recv` with `swrite`/`sread` where missing

Also:
- checksrc: ban `send` and `recv`, as documented in `CODE_STYLE.md`.

Follow-up to 9a2663322c330ff11275abafd612e9c99407a94a #17572
Ref: a585cc35e57fc06806443207e31a244c9df029bb #20097
Ref: #20441

Closes #20459

2 months agobuild: assume `stdint.h`
Viktor Szakats [Wed, 21 Jan 2026 15:20:51 +0000 (16:20 +0100)] 
build: assume `stdint.h`

curl requires `stdint.h` from C99, and no longer builds without it since
v8.18.0 (after dropping VS2008 support). Assume it's available, drop
feature checks.

Also:
- drop duplicate `stdint.h` includes.
- introduce internal `HAVE_UINTPTR_T`, enabled by default.
- OS400: disable `HAVE_UINTPTR_T`.
- build: keep cmake pre-fill and `cmp-config.pl` exception because cmake
  and autotools both detect `stdint.h` implicitly.

Co-authored-by: Dan Fandrich
Ref: #20405
Ref: #20384
Follow-up to 2e1a045d8985e5daa4d9a4f908ed870a16d8e41e #17931

Closes #20406

2 months agopytest: remove 03_02
Stefan Eissing [Wed, 28 Jan 2026 08:46:18 +0000 (09:46 +0100)] 
pytest: remove 03_02

The test for restarting the server during ongoing transfers does not
work reliably for HTTP/3. This seems due to the nature of UDP/QUIC where
the client may learn about a closed connection at any time, not only
when starting a new request.

Remove the test.

Closes #20458

2 months agoimap: fix custom listing
Christian Schmitz [Mon, 19 Jan 2026 16:01:16 +0000 (17:01 +0100)] 
imap: fix custom listing

Add test 1847 and 1848.

Fixes #20356
Closes #20360

2 months agovquic: handle SOCKEMSGSIZE correctly
Stefan Eissing [Tue, 27 Jan 2026 13:27:24 +0000 (14:27 +0100)] 
vquic: handle SOCKEMSGSIZE correctly

Report UDP packets with SOCKEMSGSIZE as being "sent" to progress
the send buffer properly on PMTUD probes.

Reported-by: Daniil Gentili
Fixes #20440
Closes #20448

2 months agocf-socket: use SOCK_CLOEXEC in socket_open when available
Itay Bookstein [Mon, 26 Jan 2026 18:23:18 +0000 (20:23 +0200)] 
cf-socket: use SOCK_CLOEXEC in socket_open when available

To close the possible race between socket() and fcntl(), we use
SOCK_CLOEXEC instead of fcntl() when it is available.

Closes #20442

2 months agoh2+h3: align stream close handling
Stefan Eissing [Wed, 7 Jan 2026 14:07:13 +0000 (15:07 +0100)] 
h2+h3: align stream close handling

For HTTP/2, add error code description to close failures.

For HTTP/3, add special handling like in HTTP/2 when streams
have been rejected or an error comes during the response body
and we are not interested in the body.

Closes #20207

2 months agoGHA: update openssl/openssl to v3.6.1
renovate[bot] [Tue, 27 Jan 2026 13:57:19 +0000 (13:57 +0000)] 
GHA: update openssl/openssl to v3.6.1

Closes #20449

2 months agowindows: `USE_WINSOCK` to guard winsock2 code (where missing)
Viktor Szakats [Tue, 27 Jan 2026 22:53:05 +0000 (23:53 +0100)] 
windows: `USE_WINSOCK` to guard winsock2 code (where missing)

Replacing `_WIN32`.

Also:
- tool_doswin: guard possibly non-portable socket code with
  `USE_WINSOCK`. The socket is cast to `HANDLE` and passed to
  win32 API `SetStdHandle(STD_INPUT_HANDLE, ...)`.
- lib/setup-win32.h: move `#undef`s before their `#define` pair.

Closes #20455

2 months agotool_doswin: avoid Windowsisms in socket code (cont.)
Viktor Szakats [Tue, 27 Jan 2026 23:46:37 +0000 (00:46 +0100)] 
tool_doswin: avoid Windowsisms in socket code (cont.)

For general readability. Also to match the rest of the source code.

- bump `send()` result type from `int` to `ssize_t`.
- fix an `int` to be `curl_socklen_t`.
- `.S_un.S_addr` -> `.s_addr`.
- `SD_RECEIVE` -> `SHUT_RD`.
- `SD_SEND` -> `SHUT_WR`.

Follow-up to a81ab3e6db370f31fca2fc67ca8bfda263f15caa #20452
Follow-up to 9a2663322c330ff11275abafd612e9c99407a94a #17572

Closes #20457

2 months agoGHA/windows: fix shell, fix GHA fail to share cache between arm and intel Windows
Viktor Szakats [Tue, 27 Jan 2026 23:15:45 +0000 (00:15 +0100)] 
GHA/windows: fix shell, fix GHA fail to share cache between arm and intel Windows

A cache entry created by windows-2022 is not picked up by
windows-11-arm. Also a cache created by windows-11-arm is not picked up
by windows-2022. Possibly related to this filed in 2025 June:
https://github.com/actions/cache/issues/1622. Also tried
`enableCrossOsArchive` to no avail. Unclear if these two runners count
as distinct operating systems, I'd guess not. Cache entries are
identical on the web UI. Via GH API they show up with the same cache key
bot different "version" (hash) and different sizes, possibly due to the
zstd vs. gzip bug above.

Fixing (identical error text on either runner):
```
Error: Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: Windows-stunnel-5.76-amd64
```

Also fix a silly typo in the shell value.

Follow-up to 0f54ca6150f5bff5e8eb8b165de86262e98f5e69 #20454
Closes #20456

2 months agotls: remove checks for DEFAULT
Daniel Stenberg [Tue, 27 Jan 2026 15:59:32 +0000 (16:59 +0100)] 
tls: remove checks for DEFAULT

Since 9d8998c99408e1adf, the setopt code changes input DEFAULT to an
actual more specific TLS version (1.2) for the backends to use and check
for.

This means that the default value (0L) cannot and should not actually be
used when the TLS backends run. This change adds asserts to verify that
and removes code that accepts the DEFAULT value as a valid version with
the TLS version functions' logic.

Applications can still set a specific lower version if they want (1, 1.0
or 1.1).

Closes #20453