]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
11 hours agotest436: fix running on Windows with `_curlrc` present master
Viktor Szakats [Sat, 9 Aug 2025 18:28:15 +0000 (20:28 +0200)] 
test436: fix running on Windows with `_curlrc` present

in the user home directory.

Before this patch, the curl tool found the system curlrc first, ignoring
the custom one set by the test via `CURL_HOME`.

Closes #18242

11 hours agocmake: set `CURL_DIRSUFFIX` automatically in multi-config builds
Viktor Szakats [Sat, 9 Aug 2025 15:36:40 +0000 (17:36 +0200)] 
cmake: set `CURL_DIRSUFFIX` automatically in multi-config builds

To make it easier to run tests when using the Visual Studio generator,
also perhaps Xcode.

Also drop manual settings from CI.

Closes #18241

22 hours agocmake: drop redundant unity mode for `curlinfo`
Viktor Szakats [Sat, 9 Aug 2025 11:20:23 +0000 (13:20 +0200)] 
cmake: drop redundant unity mode for `curlinfo`

Unity mode adds nothing besides some overhead and log noise for
targets built from a single source file.

I wish cmake disabled unity automatically in this case.

Closes #18238

34 hours agocmake: optimize building examples in CI
Viktor Szakats [Wed, 6 Aug 2025 20:17:50 +0000 (22:17 +0200)] 
cmake: optimize building examples in CI

In CI we want to ensure that examples build cleanly, but we don't want
to actually run them there. Meaning it's enough to just compile, but not
link them in CI. Saving time up to 2-4x (MSVC), and disk space up
to 1.2GB (or 8-70x).

Add a new cmake target that compiles all examples without linking them
into runnable binaries. Keep a full build for a single example to test
if it links correctly.

Also:
- CI: switch over all `curl-examples` targets to `curl-examples-build`
- GHA/linux-old: build examples in one of the cmake builds.

Result highlights:

Job                 | Bef. |  Bef. | Aft. | Aft. |
:------------------ | ---: | ----: | ---: |----: |
cygwin              |  15s |   9MB |  10s |  1MB |
msys                |  13s |   8MB |   7s |  1MB |
dl-mingw 15         |  39s |  113M |  34s |  2MB |
dl-mingw 9.5.0      |  49s | 115MB |  42s |  2MB |
dl-mingw 7.3.0      |  19s | 113MB |  14s |  2MB |
dl-mingw 6.4.0      |   9s |  12MB |   7s |  4MB |
Linux cross         |  19s |  28MB |  19s |  2MB |
MSVC UWP            |  65s | 374MB |   9s | 17MB |
MSVC x64            |  22s | 846MB |   9s | 17MB |
VS2010              |  48s | 105MB |  15s |  9MB |
VS2022 clang-cl     | 195s | 1.2GB |  51s | 20MB |
iOS Xcode           |   8s |       |   5s |      |
macOS LibreSSL      |  16s |       |  11s |      |
Linux aws-lc        |   3s |       |   1s |      |

Follow-up to dda251ef1020da07dc4640a225e01051cb977535 #18232

Closes #18209

34 hours agoappveyor: show disk space used in each job
Viktor Szakats [Fri, 8 Aug 2025 23:27:51 +0000 (01:27 +0200)] 
appveyor: show disk space used in each job

Also bump minimum dir size in GHA, to reduce details.

Follow-up to be71475b1313ff017acc1efab16e0fea84cd32f5 #18150
Closes #18235

36 hours agocmake: define `WIN32_LEAN_AND_MEAN` for examples
Viktor Szakats [Fri, 8 Aug 2025 20:25:01 +0000 (22:25 +0200)] 
cmake: define `WIN32_LEAN_AND_MEAN` for examples

To build faster. Also syncing with autotools.

Job                 | Before | After |
:------------------ | -----: | ----: |
dl-mingw 15         |    45s |   39s |
dl-mingw 9.5.0      |    72s |   49s |
dl-mingw 7.3.0      |    29s |   19s |
dl-mingw 6.4.0      |    20s |    9s |
Linux cross         |    30s |   19s |
MSVC UWP            |    77s |   65s |
MSVC x64            |    27s |   22s |
VS2010              |    61s |   48s |
VS2022 clang-cl     |   226s |  195s |

It also happens to fix what looks like a Windows SDK header bug seen
with VS2019 on AppVeyor CI:
```
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\winscard.h(1422,1): error C2220: the following warning is treated as an error (compiling source file C:\projects\curl\docs\examples\block_ip.c)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\winscard.h(1422,1): warning C5031: #pragma warning(pop): likely mismatch, popping warning state pushed in different file (compiling source file C:\projects\curl\docs\examples\block_ip.c)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\winioctl.h : message : #pragma warning(push) (compiling source file C:\projects\curl\docs\examples\block_ip.c)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\windows.h(254,17): warning C5031: #pragma warning(pop): likely mismatch, popping warning state pushed in different file (compiling source file C:\projects\curl\docs\examples\block_ip.c)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\winscard.h : message : #pragma warning(push) (compiling source file C:\projects\curl\docs\examples\block_ip.c)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\winsock2.h(4221,1): warning C5031: #pragma warning(pop): likely mismatch, popping warning state pushed in different file (compiling source file C:\projects\curl\docs\examples\block_ip.c)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\windows.h : message : #pragma warning(push) (compiling source file C:\projects\curl\docs\examples\block_ip.c)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\winsock2.h : warning C5032: detected #pragma warning(push) with no corresponding #pragma warning(pop) (compiling source file C:\projects\curl\docs\examples\block_ip.c)
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/52531106/job/66b6r098pll2le70#L312

Closes #18232

40 hours agoopenssl: clear errors after a failed `d2i_X509()`
Viktor Szakats [Fri, 8 Aug 2025 11:07:34 +0000 (13:07 +0200)] 
openssl: clear errors after a failed `d2i_X509()`

Without it, subsequent OpenSSL API calls may fail with an error caught
within the OpenSSL `d2i_X509()` (decode) call.

It was seen to happen when importing from the Windows certificate store
(e.g. with `--ca-native`), and any one of the certificates failed while
decoding, then skipped.

Behind the scene (and undocumented), the failed decode call is adding
an error to an internal OpenSSL error queue. This error is picked up
later, at the connect phase, by another OpenSSL API call, which happens
to check the error queue, without clearing it first. It made the connect
fail with the error collected earlier, while decoding the malformed and
discarded certificate.

Fix by explicitly clearing the error queue if the decode call fails.

Ref: https://docs.openssl.org/3.5/man3/d2i_X509/

`-vvvv` output before this patch:
```
[0-0] == Info: successfully imported Windows ROOT store
[0-0] == Info: successfully imported Windows CA store
[0-0] == Info: [SSL] SSL_connect() -> err=-1, detail=1
[0-0] == Info: TLS connect error: error:068000DD:asn1 encoding routines::illegal padding
[0-0] == Info: [SSL] cf_connect() -> 35, done=0
```

Mainline OpenSSL (as of 3.5.2) and quictls (as of 3.3.0) are affected.

LibreSSL is not affected. (I did not test BoringSSL and AWS-LC)

Assisted-by: Stefan Eissing
Reported-by: MichaƂ Petryka
Fixes #18190

Closes #18228

42 hours agotool_parsecfg: use dynbuf for quoted arguments
Daniel Stenberg [Fri, 8 Aug 2025 15:41:30 +0000 (17:41 +0200)] 
tool_parsecfg: use dynbuf for quoted arguments

Instead of doing malloc/free every time and "manual" buffer population.
This reuses the dynbuf for this purpose for the duration of parsing the
file.

Closes #18230

2 days agotool_operate: cleanups
Daniel Stenberg [Thu, 7 Aug 2025 21:11:10 +0000 (23:11 +0200)] 
tool_operate: cleanups

- move the state struct from config to global. It is used as a single
  instance anyway so might as well be a single one to save memory.
- simplify and combine several conditions
- set default retry delay inititally
- use better struct field names to make it easier to understand their
  purposes
- remove the state->outfiles field as it was not necessary
- remove superfluous glob cleanup call
- move conditions around to remove an indent level
- move the ->url NULL check

Takes single_transfer()'s complexity score down from 78 to 68.

Closes #18226

2 days agotool_writeout: check gmtime return code too
Daniel Stenberg [Fri, 8 Aug 2025 07:24:46 +0000 (09:24 +0200)] 
tool_writeout: check gmtime return code too

If the unlikely event happen that it fails, it returns NULL.
CodeSonar is not happy unless we check for it.

Closes #18225

2 days agoschannel: add an error message for client cert not found
Jay Satiro [Thu, 31 Jul 2025 19:13:23 +0000 (15:13 -0400)] 
schannel: add an error message for client cert not found

Prior to this change curl would show the generic error message
"curl: (58) Problem with the local SSL certificate".

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

2 days agoGHA: update cloudflare/quiche to v0.24.5
renovate[bot] [Thu, 7 Aug 2025 21:02:40 +0000 (21:02 +0000)] 
GHA: update cloudflare/quiche to v0.24.5

Closes #18224

2 days agoGHA: update actions/cache digest to 0400d5f
renovate[bot] [Thu, 7 Aug 2025 14:22:00 +0000 (14:22 +0000)] 
GHA: update actions/cache digest to 0400d5f

Closes #18222

2 days agocurl: remove first argument from helpf()
Daniel Stenberg [Thu, 7 Aug 2025 14:12:44 +0000 (16:12 +0200)] 
curl: remove first argument from helpf()

It was always the same and it is a global already!

Closes #18221

2 days agotool_writeout: check strftime() return code
Daniel Stenberg [Thu, 7 Aug 2025 13:43:25 +0000 (15:43 +0200)] 
tool_writeout: check strftime() return code

Because if it fails, the contents of the output buffer is undefined.

Pointed out by CodeSonar

Also polished the documentation

Follow-up to fadc487567

Closes #18220

2 days agocfilters: make Curl_conn_get_socket simpler
Stefan Eissing [Thu, 7 Aug 2025 12:18:59 +0000 (14:18 +0200)] 
cfilters: make Curl_conn_get_socket simpler

Since it is only used for the first socket anyway, simplify the
function.

Closes #18219

2 days agorequest: eliminate request `getheader` bool, reverse `header` default
Stefan Eissing [Thu, 7 Aug 2025 09:29:10 +0000 (11:29 +0200)] 
request: eliminate request `getheader` bool, reverse `header` default

Deduce that the transfer response expects headers by the protocol
handler implementing `write_resp_hd` callback. This eleminates the
`getheader` parameter in the `Curl_xfer_setup_*()` methods.

Add an implementation to RTSP for `write_resp_hd`, joining the HTTP
protocol in the only handlers having it.

Reverse the default of request's `header` bit that signals that headers
are expected. Default is now FALSE, set to TRUE when setting up the
transfer by presence of `write_resp_hd` in the protocol handler.

Closes #18218

3 days agoares: destroy channel on shutdown
Stefan Eissing [Thu, 7 Aug 2025 08:32:14 +0000 (10:32 +0200)] 
ares: destroy channel on shutdown

When we cancel async resolv operations, we have kept an existing ares
channel open. This seems unreliable as reported in #18216.

To get reliable behaviour, always destroy the ares channel on async
shutdown and create a new one on demand.

Fixes #18216
Reported-by: devgs on github
Closes #18217

3 days agocurl: make global truly global
Daniel Stenberg [Wed, 6 Aug 2025 21:18:46 +0000 (23:18 +0200)] 
curl: make global truly global

The GlobalConfig only exists in a single instance and it has worked like
this since the dawn of time. It is about time we stop passing around
pointers to what was already essentially a global object and instead
just use a... global.

It simplifies things.

Closes #18213

3 days agohttp: resurrect addition from 41fe621
Stefan Eissing [Thu, 7 Aug 2025 07:50:34 +0000 (09:50 +0200)] 
http: resurrect addition from 41fe621

For some reason, these lines were unintentionally deleted in 6d5570c.
Thanks to IoannisGS for noticing.

Bug: https://github.com/curl/curl/pull/18179#issuecomment-3162876532
Reported-by: IoannisGS on github
Closes #18215

3 days agocmake: ExternalProject test tidy-ups
Viktor Szakats [Thu, 7 Aug 2025 07:18:30 +0000 (09:18 +0200)] 
cmake: ExternalProject test tidy-ups

Follow-up to b8296d367aa4277ee297d474fe438da687ffc5ec #18208

Closes #18214

3 days agocurl_quiche.c: add include
Karthik Das [Thu, 7 Aug 2025 03:47:04 +0000 (09:17 +0530)] 
curl_quiche.c: add include

Fixes #18211
Closes #18212

3 days agocmake: make the ExternalProject test work
Viktor Szakats [Wed, 6 Aug 2025 17:21:16 +0000 (19:21 +0200)] 
cmake: make the ExternalProject test work

By micromanaging the project dependency and its inclusion into the test
project. It feels like an awkward construct, but perhaps better than
nothing.

It's also fragile because it's a static build with no assistance from
the external project (curl in this case). Mitigated in test by disabling
all dependencies and some features.

Since there is no special core cmake logic to be tested here, in CI
the test is tested really. To keep CI jobs at minimum, only add 3 of
them, taking 42s in total. (All 6 would take 270s.)

Follow-up to e2a23d5d0d566105237acec37a2c22a6f79cee3e #17203

Closes #18208

3 days agolibcurl: reset rewind flag in curl_easy_reset()
Oxan van Leeuwen [Wed, 6 Aug 2025 12:09:32 +0000 (14:09 +0200)] 
libcurl: reset rewind flag in curl_easy_reset()

curl_easy_reset() did not reset the `rewind_read` flag. This caused any
handles that previously had a CURLE_SEND_FAIL_REWIND error to get stuck
with that error, failing any subsequent requests, even if they didn't
have any body at all.

Verified in test 3034

Fixes #18206
Closes #18207

3 days agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 6 Aug 2025 15:19:09 +0000 (17:19 +0200)] 
RELEASE-NOTES: synced

3 days agotool_operate: use the correct config pointer
Daniel Stenberg [Mon, 4 Aug 2025 21:21:14 +0000 (23:21 +0200)] 
tool_operate: use the correct config pointer

Triggered when doing 100+ parallel globbed upload transfers.

Reported-by: letshack9707 on hackerone
Closes #18200

3 days agotests/ech_tests.sh: indent, if/for style, inline ifs
Viktor Szakats [Tue, 5 Aug 2025 13:29:11 +0000 (15:29 +0200)] 
tests/ech_tests.sh: indent, if/for style, inline ifs

Sync with rest of shell scripts.

Follow-up to 2485a2d10054cfc8fce769bd45fa1a26fe070d8e #17001
Closes #18187

3 days agomulti: fix bad splay management
Daniel Stenberg [Wed, 6 Aug 2025 07:03:31 +0000 (09:03 +0200)] 
multi: fix bad splay management

The splay tree is a tree where each easy handle can be added *once*. The
expire time for that node is the closest expire time for that easy
handle.

Easy handles can however have more expire times queued up, so when the
node is removed from the splay tree because it is the next in line to
take care of, we must check if there is another expire time in the queue
and then add the node back into the splay.

Failing to do the later part, the calling of add_next_timeout after
Curl_splaygetbest, would leave the state.expiretime on the previous time
stamp, which when could make the next call to Curl_splaygetbest use the
wrong time stamp and get a wrong node out, causing trouble.

Reported-by: letshack9707 on hackerone
Closes #18201

3 days agolib: xfer_setup simplify
Stefan Eissing [Wed, 6 Aug 2025 09:56:08 +0000 (11:56 +0200)] 
lib: xfer_setup simplify

Make variants for transfers that send/receive or do both with just the
parameters they need. Split out the shutdown setting into a separate
function. Only FTP bothers with that.

Closes #18203

4 days agotool_urlglob: polish, cleanups, improvements
Daniel Stenberg [Tue, 5 Aug 2025 14:00:20 +0000 (16:00 +0200)] 
tool_urlglob: polish, cleanups, improvements

- assert instead of printing "internal error" for unlikely events
- avoid allocating the main struct
- convert globerror() from macro to function
- renames to shorter and clearer names
- malloc + copy => memdup0
- change buffer handling to dynbuf
- realloc to handle more globs, but use less memory for few

Closes #18198

4 days agolib: replace conn [write]sockfd members by index
Stefan Eissing [Tue, 5 Aug 2025 11:11:53 +0000 (13:11 +0200)] 
lib: replace conn [write]sockfd members by index

The `connectdata` members `sockfd` and `writesockfd` needed to by either
CURL_SOCKET_BAD or a copy of one of `conn->sock[2]`. When equal to one,
that index was used to send/recv/poll the proper socket or connection
filter chain.

Replace those with `send_idx` and `recv_idx` which are either -1, 0 or 1
to indicate which socket/filter to send/receive on.

Closes #18179

4 days agosplay: add another assert for detected usage problem
Daniel Stenberg [Wed, 6 Aug 2025 06:12:08 +0000 (08:12 +0200)] 
splay: add another assert for detected usage problem

Closes #18199

4 days agoGHA: update actions/download-artifact action to v5
renovate[bot] [Tue, 5 Aug 2025 22:40:09 +0000 (22:40 +0000)] 
GHA: update actions/download-artifact action to v5

Closes #18193

4 days agoBINDINGS.md: add LibQurl
Qriist [Wed, 6 Aug 2025 00:10:09 +0000 (20:10 -0400)] 
BINDINGS.md: add LibQurl

Add LibQurl to the list of known binding libraries.

Closes #18195

4 days agoconfig2setopts: avoid curlx_dyn_addf(..., "%s"
Daniel Stenberg [Wed, 6 Aug 2025 06:02:39 +0000 (08:02 +0200)] 
config2setopts: avoid curlx_dyn_addf(..., "%s"

Closes #18194

4 days agodynbuf: assert on curlx_dyn_addf use with just "%s"
Daniel Stenberg [Tue, 5 Aug 2025 22:52:04 +0000 (00:52 +0200)] 
dynbuf: assert on curlx_dyn_addf use with just "%s"

Because it is wasteful and should be done better.

Closes #18194

4 days agoGHA/curl-for-win: include CPU archs in job names
Viktor Szakats [Tue, 5 Aug 2025 22:22:53 +0000 (00:22 +0200)] 
GHA/curl-for-win: include CPU archs in job names

Closes #18191

4 days agovtls: set seen http version on successful ALPN
Stefan Eissing [Tue, 5 Aug 2025 11:37:12 +0000 (13:37 +0200)] 
vtls: set seen http version on successful ALPN

When a HTTP version has been negotiated via ALPN, set the member
`conn->httpversion_seen` accordingly. This allows pending transfers to
reuse multiplexed http connections before the response to the first
transfer has arrived.

Fixes #18177
Reported-by: IoannisGS on github
Closes #18181

4 days agotool_cb_hrd: remove global pointer from 'struct HdrCbData'
Daniel Stenberg [Tue, 5 Aug 2025 12:14:10 +0000 (14:14 +0200)] 
tool_cb_hrd: remove global pointer from 'struct HdrCbData'

It is not necessary

Closes #18184

4 days agotool: replace three malloc + copy with memdup0
Daniel Stenberg [Tue, 5 Aug 2025 12:24:15 +0000 (14:24 +0200)] 
tool: replace three malloc + copy with memdup0

The function already existed for private use in var.c

Closes #18185

4 days agoci: update openssl/openssl to v3.5.2
renovate[bot] [Tue, 5 Aug 2025 12:27:08 +0000 (12:27 +0000)] 
ci: update openssl/openssl to v3.5.2

Closes #18186

4 days agotool_cb_wrt: use dynbuf instead of "manual" malloc
Daniel Stenberg [Tue, 5 Aug 2025 11:43:49 +0000 (13:43 +0200)] 
tool_cb_wrt: use dynbuf instead of "manual" malloc

When creating new file names for no-clobber

Closes #18182

4 days agotool_cb_wrt: split out win_console() from tool_write_cb()
Daniel Stenberg [Tue, 5 Aug 2025 11:26:44 +0000 (13:26 +0200)] 
tool_cb_wrt: split out win_console() from tool_write_cb()

Closes #18180

4 days agosetopt: add helper functions to setopt_long()
Daniel Stenberg [Tue, 5 Aug 2025 06:47:31 +0000 (08:47 +0200)] 
setopt: add helper functions to setopt_long()

- Consistently keep options within ranges
- Reduce the maximum maxredirs value to fit a signed short
- Removed comments as the place to document the options is not here

Closes #18174

4 days agoGHA: pin jobs to windows-2022
Viktor Szakats [Tue, 5 Aug 2025 10:55:59 +0000 (12:55 +0200)] 
GHA: pin jobs to windows-2022

To avoid being bumped to windows-2025 in September, and to stay with
the superior performance offered by windows-2022 runners.

Ref: #18140
Closes #18178

4 days agovquic: use curl_getenv
David Zhuang [Mon, 4 Aug 2025 23:56:15 +0000 (16:56 -0700)] 
vquic: use curl_getenv

getenv isn't defined on all platforms, which prevents vquic from
building. I specifically ran into this issue building on PlayStation.

Closes #18170

4 days agoopenssl: output unescaped utf8 x509 issuer/subject DNs
Roberto Hidalgo [Tue, 5 Aug 2025 02:29:00 +0000 (20:29 -0600)] 
openssl: output unescaped utf8 x509 issuer/subject DNs

Closes #18171

4 days agomulti: change prefix for the network change bits to CURLMNWC_
Daniel Stenberg [Tue, 5 Aug 2025 09:39:32 +0000 (11:39 +0200)] 
multi: change prefix for the network change bits to CURLMNWC_

Because "CURLM_" is used for curl multi error codes and it is convenient
to use the prefix to identify the number family.

Closes #18176

5 days agocurl_multi_get_offt: language fix
Daniel Stenberg [Tue, 5 Aug 2025 09:32:21 +0000 (11:32 +0200)] 
curl_multi_get_offt: language fix

Closes #18175

5 days agocurl_multi_get_offt: add separate man pages for the options
Daniel Stenberg [Mon, 4 Aug 2025 22:09:18 +0000 (00:09 +0200)] 
curl_multi_get_offt: add separate man pages for the options

Follow-up to 1ad2009ad63478ace18977ec5314f597f45ad084

Closes #18168

5 days agowolfssl: rename ML-KEM hybrids to match IETF draft
Anthony Hu [Fri, 25 Jul 2025 17:27:33 +0000 (13:27 -0400)] 
wolfssl: rename ML-KEM hybrids to match IETF draft

Closes #18123

5 days agourldata: reduce two long struct fields to unsigned short
Daniel Stenberg [Mon, 4 Aug 2025 20:25:29 +0000 (22:25 +0200)] 
urldata: reduce two long struct fields to unsigned short

Closes #18173

5 days agohostip: cache negative name resolves
Daniel Stenberg [Sun, 3 Aug 2025 22:06:03 +0000 (00:06 +0200)] 
hostip: cache negative name resolves

Hold them for half the normal lifetime. Helps when told to transfer N
URLs in quick succession that all use the same non-resolving hostname.

Done by storing a DNS entry with a NULL pointer for 'addr'.

Previously an attempt was made in #12406 by Björn Stenberg that was
ultimately never merged.

Closes #18157

5 days agobuild: disable `TCP_NODELAY` for emscripten
Viktor Szakats [Sun, 3 Aug 2025 21:48:53 +0000 (23:48 +0200)] 
build: disable `TCP_NODELAY` for emscripten

In WebAssembly, using `TCP_NODELAY` fails with:
```
* Could not set TCP_NODELAY: Protocol not available
```

Add a new feature macro in `curl_setup.h` telling whether `TCP_NODELAY`
is known to be supported at runtime, when defined at compile-time.

Keep `TCP_NODELAY` guards at their current positions to ensure the
necessary headers (e.g. `netinet/tcp.h` and `netinet/in.h`) define it.

Reported-by: Jeroen Ooms
Fixes #17974
Closes #18155

5 days agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 4 Aug 2025 21:53:16 +0000 (23:53 +0200)] 
RELEASE-NOTES: synced

5 days agomulti: add new information extraction method
Stefan Eissing [Wed, 23 Jul 2025 07:18:59 +0000 (09:18 +0200)] 
multi: add new information extraction method

Adds `curl_off_t curl_multi_get_offt(CURLM *multi_handle, CURLMinfo_offt
info)` to the multi interface with enums:

* CURLMINFO_XFERS_CURRENT: current number of transfers
* CURLMINFO_XFERS_RUNNING: number of running transfers
* CURLMINFO_XFERS_PENDING: number of pending transfers
* CURLMINFO_XFERS_DONE: number of finished transfers to read
* CURLMINFO_XFERS_ADDED: total number of transfers added, ever

Add documentation for functions and info enums.

Add use in the curl command line tool to replace two static
variables counting the same "from the outside".

refs #17870
Closes #17992

5 days agowriteout: add %time{}
Daniel Stenberg [Thu, 31 Jul 2025 14:41:36 +0000 (16:41 +0200)] 
writeout: add %time{}

Output the current UTC time using strftime format. %f is an extra curl
specific flag to output the microsecond fraction of the current second.

Verified by test 1981

Closes #18119

5 days agolib: replace `getsock()` logic with pollsets
Stefan Eissing [Mon, 4 Aug 2025 14:17:37 +0000 (16:17 +0200)] 
lib: replace `getsock()` logic with pollsets

`getsock()` calls operated on a global limit that could
not be configure beyond 16 sockets. This is no longer adequate
with the new happy eyeballing strategy.

Instead, do the following:
- make `struct easy_pollset` dynamic. Starting with
  a minimal room for two sockets, the very common case,
  allow it to grow on demand.
- replace all protocol handler getsock() calls with pollsets
  and a CURLcode to return failures
- add CURLcode return for all connection filter `adjust_pollset()`
  callbacks, since they too can now fail.
- use appropriately in multi.c and multi_ev.c
- fix unit2600 to trigger pollset growth

Closes #18164

5 days agotool_paramhlp: fix secs2ms()
Petar Popovic [Mon, 4 Aug 2025 17:48:26 +0000 (19:48 +0200)] 
tool_paramhlp: fix secs2ms()

- remove one zero from digs[5]
- remove size of size

Closes #18167

5 days agocmake: enable `-Wall` for MSVC 1944
Viktor Szakats [Mon, 4 Aug 2025 14:33:18 +0000 (16:33 +0200)] 
cmake: enable `-Wall` for MSVC 1944

MSVC=1944 is now tested in CI. It did not trigger new `-Wall` compiler
warnings, thus safe to enable `-Wall` for.

Closes #18165

5 days agocurl: add --follow
Daniel Stenberg [Fri, 25 Apr 2025 11:09:00 +0000 (13:09 +0200)] 
curl: add --follow

Makes curl follow redirects an act on the response code and change a
custom method accordingly, contrary to --location.

Potential future command line to send QUERY and following a redirect
according to the status code:

    curl -d "request-body" -X QUERY --follow https://example.com

add test 794,796,797

Assisted-by: Daniel Böhmer <post@daniel-boehmer.de>
Closes #16543

5 days agosetopt: split out cookielist() and cookiefile()
Daniel Stenberg [Mon, 4 Aug 2025 12:47:33 +0000 (14:47 +0200)] 
setopt: split out cookielist() and cookiefile()

into their own sub functions

Closes #18162

5 days agoGHA/windows: give more time for Ubuntu installs
Viktor Szakats [Mon, 4 Aug 2025 13:41:41 +0000 (15:41 +0200)] 
GHA/windows: give more time for Ubuntu installs

Recently sometimes the Ubuntu package repository is very slow to access.
Remove the time limit for the install step, and bump the total limit,
aligning with Linux jobs.

In most cases the `install packages` steps takes 15-25 seconds.
Sometimes this goes up to 30-45 minutes.

Reported-by: nevakrien on github
Bug: https://github.com/curl/curl/discussions/14854#discussioncomment-13988574
Closes #18163

5 days agohostip: do DNS cache pruning in milliseconds
Daniel Stenberg [Mon, 4 Aug 2025 12:15:03 +0000 (14:15 +0200)] 
hostip: do DNS cache pruning in milliseconds

Instead of using integer seconds. Also: if the cache contains over
30,000 entries after first pruning, it makes anoter round and removes
all entries that are older than half the age of the oldest entry until
it goes below 30,000.

Closes #18160

5 days agoGHA/windows: show disk space used in each job
Viktor Szakats [Sun, 3 Aug 2025 15:21:41 +0000 (17:21 +0200)] 
GHA/windows: show disk space used in each job

Also:
- make the dl-minge 6.4.0 job shared. To save 761MB of disk space, and
  speed up examples build step by 50% (10 seconds).

Closes #18150

5 days agoruntests: add `--ci` option, show `Env:` only when non-empty
Viktor Szakats [Sat, 2 Aug 2025 11:15:28 +0000 (13:15 +0200)] 
runtests: add `--ci` option, show `Env:` only when non-empty

To reduce log noise in local test runs:
- move the `buildinfo.txt` dump and header info lines
  `OS:`, `Perl:`, `diff:` behind a `--ci` `runtests.pl` option.
- enable this option for the CI test targets.
- hide `Env:` header info line if empty.
- merge `Env:` output into a single `logmsg()` call.

Closes #18147

5 days agounit2604: avoid `UNCONST()`
Viktor Szakats [Sat, 2 Aug 2025 10:15:31 +0000 (12:15 +0200)] 
unit2604: avoid `UNCONST()`

Closes #18143

5 days agolibtests: use `FMT_SOCKET_T`, drop more casts
Viktor Szakats [Sat, 2 Aug 2025 00:01:20 +0000 (02:01 +0200)] 
libtests: use `FMT_SOCKET_T`, drop more casts

Follow-up to 37913c01a51653d257dc7d57f676504cedbf16f6 #18106

Closes #18142

5 days agoconfigure: if no perl, disable unity and shell completion, related tidy ups
Viktor Szakats [Fri, 1 Aug 2025 22:18:12 +0000 (00:18 +0200)] 
configure: if no perl, disable unity and shell completion, related tidy ups

Also:
- GHA/linux, macos: test `install` with autotools too.
- GHA/linux, macos: enable fish and zsh completion in an autotools job.
- scripts: drop dynamic perl checks redundant after this patch.
- scripts: drop two interim variables.
- autotools: make `build-certs` target check perl first.
- autotools: replace `$(PERL)` with `@PERL@` to match the pattern used
  in most automake scripts. For consistency. This makes `PERL` be
  defined at configure-time, as opposed to make-time, for these cases
  now.

Closes #18141

6 days agocurl-config: remove X prefix use
Daniel Stenberg [Mon, 4 Aug 2025 07:04:23 +0000 (09:04 +0200)] 
curl-config: remove X prefix use

That shellcheck now annoyingly and uselessly complains about.

Closes #18158

6 days agocmake: fix to restrict `SystemConfiguration` to macOS
Viktor Szakats [Sun, 3 Aug 2025 20:14:02 +0000 (22:14 +0200)] 
cmake: fix to restrict `SystemConfiguration` to macOS

Also fix indentation and tidy up to use `STREQUAL` when checking for
Darwin.

Reported-by: Waldemar Kornewald
Fixes #18149
Regression from 739ef9804d8e1e9b4a8d2a610896babc62c5524b #13713
Closes #18153

6 days agosplay: rename KEY_NOTUSED TO SPLAY_SUBNODE
Daniel Stenberg [Sun, 3 Aug 2025 19:15:18 +0000 (21:15 +0200)] 
splay: rename KEY_NOTUSED TO SPLAY_SUBNODE

- explains its purpose better
- make it global static const
- added an assert for a condition that should never happen (that we
  also catch run-time)

Closes #18152

6 days agounit2600: add another case
Stefan Eissing [Sat, 2 Aug 2025 10:55:11 +0000 (12:55 +0200)] 
unit2600: add another case

Add a case with 1 ipv4 and 3 ipv6 and check that all are attempted with
the correct minimum duration before failures. To check that more ipv6
than ipv4 lead to the correct behaviour.

Closes #18144

7 days agocmake: re-add simple test target, and name it `tests`
Viktor Szakats [Sat, 2 Aug 2025 11:10:05 +0000 (13:10 +0200)] 
cmake: re-add simple test target, and name it `tests`

Before this patch there was no (easy) way to run tests without various
verbose options, hindering readability of the output due its length.

Unfortunately CMake reserves `test` as a target name, which was
the reason for its removal earlier. Re-add it with the name `tests`,
to have the functionality without the name collision.

Also add a `tests` target as an alias to `test` for autotools.

Ref: https://cmake.org/cmake/help/v4.1/policy/CMP0037.html
Follow-up to cfea4f2f4dc316c38694440ef2eed899a3e7d207 #6258
Closes #18145

8 days agodocs: add CURLOPT type change history, drop casts where present
Viktor Szakats [Fri, 1 Aug 2025 10:49:40 +0000 (12:49 +0200)] 
docs: add CURLOPT type change history, drop casts where present

Some CURLOPT constants defined in the curl public headers were initially
enums (= ints), or macros with bare numeric values. Recent curl releases
upgraded them to `long` constants, to make them pass correctly to
`curl_easy_setop()` by default, i.e. without requiring a `(long)` cast.

This patch drops such casts from the examples embedded in the docs. At
the same time it documents which curl release made them `long` types,
to keep them useful when working with previous libcurl versions.

Also:
- drop a `(long)` cast that was never necessary.
- CURLOPT_ALTSVC_CTRL.md: bump local copy of macros to long.
- test1119: make it ignore symbols ending with an underscore, to skip
  wildcard, e.g. `**CURLAUTH_***`.

Closes #18130

8 days agoCURLOPT: replace `(long)` cast with `L` suffix for `CURLHSTS_*` macros
Viktor Szakats [Fri, 1 Aug 2025 10:54:18 +0000 (12:54 +0200)] 
CURLOPT: replace `(long)` cast with `L` suffix for `CURLHSTS_*` macros

In curl/curl.h and the man page. To match the rest of CURLOPT macros.

Cherry-picked from #18130

8 days agobuild: if no perl, fix to use the pre-built hugehelp, if present
Viktor Szakats [Thu, 31 Jul 2025 14:38:34 +0000 (16:38 +0200)] 
build: if no perl, fix to use the pre-built hugehelp, if present

- cmake: Before this patch a missing perl disabled the curl manual.
  After this patch, it automatically picks up a pre-built hugehelp,
  if present (= when building from a release tarball).
  Follow-up to 0035ff45c59437db1a8ffe960b40905c8582b149 #16081

- autotools: Rework behavior when perl is missing. Before this patch
  it caused a hard error when docs/manual/ca-embed were enabled.
  Of these, docs were enabled by default. After this patch, doc
  generation is automatically skipped, with a warning. Manual generation
  falls back to using a pre-built hugehelp, or a stub if that's missing.
  CA-embed is automatically skipped, with a warning.
  Slight difference from cmake: When built with no perl and no pre-built
  hugehelp, the manual is enabled, but the content is empty; with cmake
  it's disabled proper.
  Follow-up to 137aecfbf1e933e7228a4f62cc977eabffb2afbf #13514
  Follow-up to 541321507e386744c3ea1200cc83cc98338e27d7 #12857

Also:
- GHA/distcheck: verify if the pre-built hugehelp makes it into curl.
- GHA/distcheck: streamline disabling perl with autotools.
- GHA/distcheck: `--disable-docs` no longer required to build without perl.
  Passing it also implicitly disables the curl manual, which is
  undesired in these tests.
- cmake: drop redundant `HAVE_MANUAL_TOOLS` interim variable.
- cmake: move two `set()` lines close to their counterparts.

Follow-up to 25119fbaaa76a182d4b08d64853d0a8db9181219 #18104

Closes #18118

8 days agomanagen: reset text mode at end of table marker
Daniel Stenberg [Fri, 1 Aug 2025 16:03:36 +0000 (18:03 +0200)] 
managen: reset text mode at end of table marker

It previously mostly ignored it which lead to bad format after a table
has ended with "##".

Closes #18139

8 days agourlapi: allow more path characters "raw" when asked to URL encode
Daniel Stenberg [Thu, 24 Jul 2025 16:36:28 +0000 (18:36 +0200)] 
urlapi: allow more path characters "raw" when asked to URL encode

Setting the path component to contain the letters:

    ! $ & ' ( ) { } [ ] * + , ; = : @

now leaves them un-encoded when CURLU_URLENCODE is used.

Amended test 1560 to verify.

Reported-by: Jeroen Ooms
Fixes #17977
Closes #18024

8 days agoexamples: drop long cast for `CURLALTSVC_*`
Viktor Szakats [Fri, 1 Aug 2025 16:54:14 +0000 (18:54 +0200)] 
examples: drop long cast for `CURLALTSVC_*`

Follow-up to d45b85d79198a0259123923a6aa186ded2aaca6c #18063

8 days agoCURLOPT: bump remaining macros to `long`
Viktor Szakats [Fri, 1 Aug 2025 14:27:15 +0000 (16:27 +0200)] 
CURLOPT: bump remaining macros to `long`

This patch bumps the size of these macros from `int` to `long`, while
keeping their actual values the same. It may cause incompatibilities in
user code, requiring the bump of holder variables and/or adding casts:

- CURLGSSAPI_DELEGATION_FLAG
- CURLGSSAPI_DELEGATION_NONE
- CURLGSSAPI_DELEGATION_POLICY_FLAG

- CURLMIMEOPT_FORMESCAPE

- CURLSSH_AUTH_AGENT
- CURLSSH_AUTH_ANY
- CURLSSH_AUTH_DEFAULT
- CURLSSH_AUTH_GSSAPI
- CURLSSH_AUTH_HOST
- CURLSSH_AUTH_KEYBOARD
- CURLSSH_AUTH_NONE
- CURLSSH_AUTH_PASSWORD
- CURLSSH_AUTH_PUBLICKEY

Also:
- keep existing cast within the documentation to make sure it applies
  to older curl versions as well.

Closes #18134

8 days agoCURLOPT: bump `CURLPROTO_*` macros to `long`
Viktor Szakats [Fri, 1 Aug 2025 14:47:41 +0000 (16:47 +0200)] 
CURLOPT: bump `CURLPROTO_*` macros to `long`

This patch bumps the size of these macros from `int` to `long`, while
keeping their actual values the same. It may cause incompatibilities in
user code, requiring the bump of holder variables and/or adding casts:

- CURLPROTO_HTTP
- CURLPROTO_HTTPS
- CURLPROTO_FTP
- CURLPROTO_FTPS
- CURLPROTO_SCP
- CURLPROTO_SFTP
- CURLPROTO_TELNET
- CURLPROTO_LDAP
- CURLPROTO_LDAPS
- CURLPROTO_DICT
- CURLPROTO_FILE
- CURLPROTO_TFTP
- CURLPROTO_IMAP
- CURLPROTO_IMAPS
- CURLPROTO_POP3
- CURLPROTO_POP3S
- CURLPROTO_SMTP
- CURLPROTO_SMTPS
- CURLPROTO_RTSP
- CURLPROTO_RTMP
- CURLPROTO_RTMPT
- CURLPROTO_RTMPE
- CURLPROTO_RTMPTE
- CURLPROTO_RTMPS
- CURLPROTO_RTMPTS
- CURLPROTO_GOPHER
- CURLPROTO_SMB
- CURLPROTO_SMBS
- CURLPROTO_MQTT
- CURLPROTO_GOPHERS
- CURLPROTO_ALL

Also:
- keep existing cast within the documentation to make sure it applies
  to older curl versions as well.

Closes #18136

8 days agoCURLOPT: bump `CURL_SSLVERSION_*` macros to `long`
Viktor Szakats [Fri, 1 Aug 2025 14:43:33 +0000 (16:43 +0200)] 
CURLOPT: bump `CURL_SSLVERSION_*` macros to `long`

This patch bumps the size of these macros from `int` to `long`, while
keeping their actual values the same. It may cause incompatibilities in
user code, requiring the bump of holder variables and/or adding casts:

- CURL_SSLVERSION_DEFAULT
- CURL_SSLVERSION_SSLv2
- CURL_SSLVERSION_SSLv3
- CURL_SSLVERSION_TLSv1
- CURL_SSLVERSION_TLSv1_0
- CURL_SSLVERSION_TLSv1_1
- CURL_SSLVERSION_TLSv1_2
- CURL_SSLVERSION_TLSv1_3

- CURL_SSLVERSION_MAX_DEFAULT
- CURL_SSLVERSION_MAX_NONE
- CURL_SSLVERSION_MAX_TLSv1_0
- CURL_SSLVERSION_MAX_TLSv1_1
- CURL_SSLVERSION_MAX_TLSv1_2
- CURL_SSLVERSION_MAX_TLSv1_3

Also:
- keep existing cast within the documentation to make sure it applies
  to older curl versions as well.

Closes #18135

8 days agoCURLOPT: bump `CURLWS_NOAUTOPONG`, `CURLWS_RAW_MODE` macros to `long`
Viktor Szakats [Fri, 1 Aug 2025 15:35:42 +0000 (17:35 +0200)] 
CURLOPT: bump `CURLWS_NOAUTOPONG`, `CURLWS_RAW_MODE` macros to `long`

This patch bumps the size of these macros from `int` to `long`, while
keeping their actual values the same. It may cause incompatibilities in
user code, requiring the bump of holder variables and/or adding casts:

- CURLWS_NOAUTOPONG
- CURLWS_RAW_MODE

Also:
- keep existing cast within the documentation to make sure it applies
  to older curl versions as well.

Closes #18137

8 days agolib2700: use `testnum`
Viktor Szakats [Fri, 1 Aug 2025 15:39:35 +0000 (17:39 +0200)] 
lib2700: use `testnum`

Follow-up to 02dd471bbf8e04fc595ad0f28c965c278ffcefd0 #17591
Follow-up to d3594be6531df3d5eafcdd09f84ad9dee1777028 #17136

Closes #18138

8 days agoopenssl: check SSL_write() length on retries
Stefan Eissing [Fri, 1 Aug 2025 12:55:52 +0000 (14:55 +0200)] 
openssl: check SSL_write() length on retries

When an SSL_write() blocks we need to retry it with the
same length as before or stupid OpenSSL freaks out. Remember
it, limit any longer sends and fail shorter ones.

Fixes #18121
Reported-by: adamse on github
Closes #18132

8 days agorelease-notes: fix warning
Daniel Stenberg [Fri, 1 Aug 2025 13:41:31 +0000 (15:41 +0200)] 
release-notes: fix warning

Follow-up to 2ec54556d4e3f3ab551b5

Closes #18133

8 days agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 1 Aug 2025 13:40:53 +0000 (15:40 +0200)] 
RELEASE-NOTES: synced

8 days agopytest: test very long urls
Stefan Eissing [Fri, 1 Aug 2025 09:01:55 +0000 (11:01 +0200)] 
pytest: test very long urls

test_02_36 tests h1/h2/h3 with urls longer than 1/16/32/64K.

Protocols behave the same until the size exceed 64k when h2 frame limits
bite and h3 exhibits a different http status.

Failed attempt to reproduce #18121
Closes #18129

9 days agocli_hx_download: fix compiler warnings about format strings
Stefan Eissing [Fri, 1 Aug 2025 08:33:12 +0000 (10:33 +0200)] 
cli_hx_download: fix compiler warnings about format strings

Follow-up to ba9ddb935794a9fdd6906f

Closes #18127

9 days agocurl_easy_ssls_export: make the example more clear
Stefan Eissing [Thu, 31 Jul 2025 13:13:49 +0000 (15:13 +0200)] 
curl_easy_ssls_export: make the example more clear

As mentioned in #18031
Closes #18117

9 days agotls: CURLINFO_TLS_SSL_PTR testing
Stefan Eissing [Wed, 23 Jul 2025 09:21:36 +0000 (11:21 +0200)] 
tls: CURLINFO_TLS_SSL_PTR testing

Add tests of CURLINFO_TLS_SSL_PTR and its returned value in test client
'hx-download'. Use obtained pointer to look up the negotiated TLS
version.

Update manpage of CURLINFO_TLS_SSL_PTR to also describe the behaviour of
wolfSSL similar to OpenSSL. Fix the wolfSSl implementation for TCP to
behave like that. Update the QUIC queries.

Fix rustls `get_internals()` to return the rustls_connection* and not
the address of the pointer.

Assisted-by: Viktor Szakats
Closes #18066

9 days agoip happy eyeballing: keep attempts running
Stefan Eissing [Thu, 31 Jul 2025 08:23:35 +0000 (10:23 +0200)] 
ip happy eyeballing: keep attempts running

When `CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS` expires, start the next ip
connect attempt, but keep all ongoing attempts alive.

Separate happy-eyeballs connection filter into own source files.

Closes #18105

9 days agocurl: add --parallel-max-host to limit concurrent connections per host
Daniel Stenberg [Mon, 28 Jul 2025 08:41:20 +0000 (10:41 +0200)] 
curl: add --parallel-max-host to limit concurrent connections per host

Where 'host' is protocol + hostname + portnumber.

Closes #18052

9 days agospacecheck.pl: when detecting unicode, mention line number
Daniel Stenberg [Thu, 31 Jul 2025 15:10:12 +0000 (17:10 +0200)] 
spacecheck.pl: when detecting unicode, mention line number

Closes #18120

9 days agowindows: document toolchain support for `CERT_NAME_SEARCH_ALL_NAMES_FLAG`
Viktor Szakats [Thu, 31 Jul 2025 18:32:55 +0000 (20:32 +0200)] 
windows: document toolchain support for `CERT_NAME_SEARCH_ALL_NAMES_FLAG`

Follow-up to 5f99b45693e9d649397b7b7781f498d9c175bfa2 #18113
Follow-up to 3bfcfe82b9e7fe18cdbd3a06b219a8ce40188a23 #18085

9 days agoschannel: not supported with UWP, drop redundant code
Viktor Szakats [Thu, 31 Jul 2025 05:44:35 +0000 (07:44 +0200)] 
schannel: not supported with UWP, drop redundant code

Schannel is not supported by UWP. SSPI is also required by Schannel in
curl, and SSPI also isn't supported by UWP.

mingw-w64 is able to create such build regardless (my guess: due to API
parts not accurately marked as UWP-only), but the binary is unlikely
to work. With MSVC the failure happens at build-time.

Ref: https://learn.microsoft.com/windows/win32/api/sspi/nf-sspi-initsecurityinterfacea#requirements
Ref: https://learn.microsoft.com/windows/win32/secauthn/initializesecuritycontext--schannel#requirements

Drop all UWP-related logic, including two related feature checks, that
can now be permanently enabled.

Also:
- build: show fatal error for Schannel in UWP mode.
- build: do not allow enabling SSPI in UWP mode.
- drop undocumented option `DISABLE_SCHANNEL_CLIENT_CERT`. Added without
  mention in an unrelated commit. The PR text says to save size. On x64
  this is 0.3%, or 4KB out of 1.3MB. The tiny gain doesn't justify
  an extra build variant. Ref: 8beff4355956e3d18ceb3afc21c1f3edec82543c
- move `MPROTO_SCHANNEL_CERT_SHARE_KEY` closer to its use.
- replace commented block with `#if 0`.

Reviewed-by: Jay Satiro
Follow-up to cd0ec4784c1c0f873939f33ec1a73c8739f276b9 #17089
Closes #18116

10 days agowindows: drop two interim, single-use macros
Viktor Szakats [Wed, 30 Jul 2025 22:59:39 +0000 (00:59 +0200)] 
windows: drop two interim, single-use macros

Follow-up to e77d8670685d38d80c940877a4fdfa3382c4d6cc

Closes #18114

10 days agocurl_mime_data_cb.md: mention what datasize is for
Daniel Stenberg [Thu, 31 Jul 2025 08:13:34 +0000 (10:13 +0200)] 
curl_mime_data_cb.md: mention what datasize is for

Closes #18115

10 days agobufq: add integer overflow checks before chunk allocations
Cole Leavitt [Thu, 31 Jul 2025 05:19:01 +0000 (22:19 -0700)] 
bufq: add integer overflow checks before chunk allocations

Closes #18112