]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
7 months agobuild: enable gcc-15 picky warnings
Viktor Szakats [Fri, 25 Apr 2025 14:39:45 +0000 (16:39 +0200)] 
build: enable gcc-15 picky warnings

Closes #17199

7 months agoopenssl: set the cipher string before doing private cert
Corinna Brandt [Tue, 29 Apr 2025 13:31:17 +0000 (15:31 +0200)] 
openssl: set the cipher string before doing private cert

... as this allows a set string to affect how OpenSSL deals with the
private keys/certs.

Closes #17227

7 months agomqtt: use conn/easy meta hash
Stefan Eissing [Tue, 29 Apr 2025 08:49:46 +0000 (10:49 +0200)] 
mqtt: use conn/easy meta hash

Remove mqtt structs from the unions at connectdata and
easy handle requests. Use meta hash at easy/connnection.

Make mqtt structs private to mqtt.c

Closes #17221

7 months agomulti_ev: remove redundant check for data
Daniel Stenberg [Tue, 29 Apr 2025 12:03:10 +0000 (14:03 +0200)] 
multi_ev: remove redundant check for data

Pointed out by CodeSonar

Closes #17226

7 months agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 29 Apr 2025 12:07:59 +0000 (14:07 +0200)] 
RELEASE-NOTES: synced

7 months agometa data handling for easy/conn fixes
Stefan Eissing [Tue, 29 Apr 2025 08:53:34 +0000 (10:53 +0200)] 
meta data handling for easy/conn fixes

- return error when adding to hash fails
- do not free passed in data, as ownership is taken by call

Closes #17219

7 months agoVULN-DISCLOSURE-POLICY: use of weak algos
Daniel Stenberg [Tue, 29 Apr 2025 09:10:19 +0000 (11:10 +0200)] 
VULN-DISCLOSURE-POLICY: use of weak algos

Not necessarily security problems.

Closes #17220

7 months agoopenssl: first unload the provider, then free the context
Daniel Stenberg [Tue, 29 Apr 2025 09:52:47 +0000 (11:52 +0200)] 
openssl: first unload the provider, then free the context

Doing it in the reversed order causes bad problems inside OpenSSL.

Closes #17223

7 months agoetag-save.md: mention how using both options is a good idea
Daniel Stenberg [Tue, 29 Apr 2025 07:27:08 +0000 (09:27 +0200)] 
etag-save.md: mention how using both options is a good idea

Ref: https://curl.se/mail/archive-2025-04/0011.html

Closes #17217

7 months agongtcp2+openssl: enable test 17_10
Stefan Eissing [Tue, 29 Apr 2025 08:20:34 +0000 (10:20 +0200)] 
ngtcp2+openssl: enable test 17_10

TLS session reuse in QUIC is also implemented for ngtcp2+openssl. Enable
the test.

Closes #17218

7 months agoopenssl: enable builds for *both* engines and providers
Daniel Stenberg [Tue, 8 Apr 2025 09:45:17 +0000 (11:45 +0200)] 
openssl: enable builds for *both* engines and providers

OpenSSL3 can in fact have both enabled at once. Load the provider and
key/cert appropriately. When loading a provider, the user can now also
set an associated "property string".

Work on this was sponsored by Valantic.

Closes #17165

7 months agolib: provide a getaddrinfo wrapper 17134/head
Daniel Stenberg [Tue, 22 Apr 2025 12:51:49 +0000 (14:51 +0200)] 
lib: provide a getaddrinfo wrapper

This uses c-ares under the hood and supports the CURL_DNS_SERVER
environment variable - for debug builds only. The getaddrinfo()
replacement function is only used if CURL_DNS_SERVER is set to make a
debug build work more like a release version without the variable set.

'override-dns' is a new feature for the test suite when curl can be told
to use a dedicated DNS server, and test 2102 is the first to require
this.

Requires c-ares 1.26.0 or later.

Closes #17134

7 months agocfilters: remove assert
Daniel Stenberg [Mon, 28 Apr 2025 15:05:14 +0000 (17:05 +0200)] 
cfilters: remove assert

The OSS-fuzz probe reaches this, so it can apparently in run-time. There
is already a run-time handling of the situation.

Closes #17211

7 months agobuildinfo: move from tests/server/ to src/, rename to curlinfo
Daniel Stenberg [Sun, 27 Apr 2025 15:35:20 +0000 (17:35 +0200)] 
buildinfo: move from tests/server/ to src/, rename to curlinfo

Since a16485a42ea5dabe6c, the test servers build with a different set of
options than the tool/lib - for example a different CURLDEBUG. To make
buildinfo better reflect the curl build, move it to src/ and build it
here using the local CURLDEBUG. Renamed to curlinfo to not get confused
with buildinfo.txt

I chose src/ and not lib/ because the file also uses tool-specific headers.

Assisted-by: Viktor Szakats
Closes #17187

7 months agoprogress: fix integer overflow check
Jay Satiro [Mon, 28 Apr 2025 17:35:44 +0000 (13:35 -0400)] 
progress: fix integer overflow check

- Fix logic typo.

Prior to this change the overflow check was reversed, meaning it did
not stop an overflow condition and also if there wasn't an overflow it
erroneously set the total expected transfer size to the maximum value.

Follow-up to 69ce9a7f from earlier today.

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

7 months agopull_request_template.md: remove again
Daniel Stenberg [Mon, 28 Apr 2025 15:07:13 +0000 (17:07 +0200)] 
pull_request_template.md: remove again

It was just super annoying and bad

Closes #17212

7 months agoprogress: avoid integer overflow when gathering total transfer size
Daniel Stenberg [Mon, 28 Apr 2025 11:41:20 +0000 (13:41 +0200)] 
progress: avoid integer overflow when gathering total transfer size

Reported by OSS-fuzz

Closes #17207

7 months agosmb: avoid integer overflow on weird input date
Daniel Stenberg [Mon, 28 Apr 2025 11:35:02 +0000 (13:35 +0200)] 
smb: avoid integer overflow on weird input date

Found by OSS-fuzz

Closes #17206

7 months agopull_request_template.md: REUSE compliance
Daniel Stenberg [Mon, 28 Apr 2025 11:44:15 +0000 (13:44 +0200)] 
pull_request_template.md: REUSE compliance

Plus move it to .github

Closes #17208

7 months agopull_request_template.md: provide basic instructions
Daniel Stenberg [Mon, 28 Apr 2025 08:28:55 +0000 (10:28 +0200)] 
pull_request_template.md: provide basic instructions

This should appear on GitHub for pull-requests and asks users to submit
their PRs as draft to begin with, to help us know when PRs are ready.

Closes #17205

7 months agows: store protocol context as connection meta data
Stefan Eissing [Wed, 23 Apr 2025 08:34:12 +0000 (10:34 +0200)] 
ws: store protocol context as connection meta data

Eliminates union member on struct connectdata. Sample of how
other procotols can handle their connection related data.

This avoids potention mix-ups of the `proto` union of a
connection with other protocol instances.

Removed ws "disconnect" callback as meta data is automatically
destroyed when a connection is destroyed.

Closes #17146

7 months agoHTTPSRR.md: clarify somewhat
Daniel Stenberg [Mon, 28 Apr 2025 06:30:16 +0000 (08:30 +0200)] 
HTTPSRR.md: clarify somewhat

Closes #17204

7 months agotests: add basic ECH tests
sftcd [Fri, 25 Apr 2025 17:26:04 +0000 (18:26 +0100)] 
tests: add basic ECH tests

Test 4000 and 4001

Closes #17192

7 months agocmake: extend integration tests
Viktor Szakats [Sun, 27 Apr 2025 10:26:41 +0000 (12:26 +0200)] 
cmake: extend integration tests

- GHA: add cmake integration tests for Windows.
- make them run faster with prefill, unity, Ninja, omitting curl tool.
- also test static libcurl.
- add old-cmake support with auto-detection.
- auto-detect Ninja.
- run consumer test apps to see if they work.
- add support for Windows.
- make it more verbose.
- re-add `ExternalProject` cmake consumer test. It's broken.
- tidy up terminology.

Cherry-picked from #16973
Closes #17203

7 months agocurl_osslq: remove a leftover debug fprintf() call
Daniel Stenberg [Sat, 26 Apr 2025 21:18:43 +0000 (23:18 +0200)] 
curl_osslq: remove a leftover debug fprintf() call

Reported-by: xiadnoring on github
Fixes #17198
Closes #17202

7 months agoGHA: update actions/download-artifact digest to d3f86a1
renovate[bot] [Thu, 24 Apr 2025 17:47:17 +0000 (17:47 +0000)] 
GHA: update actions/download-artifact digest to d3f86a1

Closes #17174

7 months agoGHA: Update awslabs/aws-lc to v1.50.0
renovate[bot] [Fri, 25 Apr 2025 15:41:09 +0000 (15:41 +0000)] 
GHA: Update awslabs/aws-lc to v1.50.0

Closes #17191

7 months agoRELEASE-PROCEDURE.md: release candidate git tagging explained
Daniel Stenberg [Thu, 24 Apr 2025 20:57:51 +0000 (22:57 +0200)] 
RELEASE-PROCEDURE.md: release candidate git tagging explained

To help anyone wanting to build/reproduce release candidates, this is
the set git tag naming scheme to use. Similar to, but different, than
the "normal" release tags to not be possible to mixup.

Closes #17177

7 months agows: fix the header replace check
Daniel Stenberg [Fri, 25 Apr 2025 21:36:05 +0000 (23:36 +0200)] 
ws: fix the header replace check

It passed in the wrong header length to the check function, which made
it do duplicated headers in cases where the user provides its own set.

Reported-by: sbernatsky on github
Fixes #17170
Closes #17194
Closes #16178

7 months agoGHA/windows: add gcc-15 job
Viktor Szakats [Fri, 25 Apr 2025 14:32:27 +0000 (16:32 +0200)] 
GHA/windows: add gcc-15 job

It's taking 2.5 minutes and planned for removal when MSYS2 gcc-15 gets
deployed in CI.

15.0.1 builds significantly faster than 9.5.0. (But still slower than
7.3.0 and 6.4.0)

Ref: https://github.com/msys2/MINGW-packages/commit/f59921184b35858d4ceb91679578de0d62475cbf
Ref: https://github.com/msys2/MINGW-packages/pull/24037

Closes #17190

7 months agocmake: honor individual picky option overrides found in `CMAKE_C_FLAGS`
Viktor Szakats [Sat, 26 Apr 2025 07:34:55 +0000 (09:34 +0200)] 
cmake: honor individual picky option overrides found in `CMAKE_C_FLAGS`

Also to sync up with similar `./configure` feature via
`CURL_ADD_COMPILER_WARNINGS()`.

Example: `-DCMAKE_C_FLAGS=-Wno-xor-used-as-pow`

It may be useful as a workaround if a specific build combination hits
a picky warning within curl's source code. If such happens, we do
appreciate a report to fix it in curl itself.

Closes #17197

7 months agobuild: enable gcc-12/13+, clang-10+ picky warnings
Viktor Szakats [Sat, 26 Apr 2025 07:28:28 +0000 (09:28 +0200)] 
build: enable gcc-12/13+, clang-10+ picky warnings

Cherry-picked from #17190
Closes #17196

7 months agocmake: use `LIB_NAME` in `curl-config.cmake.in`
Viktor Szakats [Sat, 26 Apr 2025 07:17:32 +0000 (09:17 +0200)] 
cmake: use `LIB_NAME` in `curl-config.cmake.in`

Cherry-picked from #16973
Closes #17195

7 months agoGHA/linux: formatting nit [ci skip]
Viktor Szakats [Wed, 23 Apr 2025 18:12:42 +0000 (20:12 +0200)] 
GHA/linux: formatting nit [ci skip]

Cherry-picked from #16973

7 months agourlapi: redirecting to "" is considered fine
Daniel Stenberg [Fri, 25 Apr 2025 14:22:24 +0000 (16:22 +0200)] 
urlapi: redirecting to "" is considered fine

If the CURLU handle already holds a proper URL, otherwise it is an
error.

Verified by test 1560

Fixes #17188
Reported-by: zopsicle on github
Closes #17189

7 months agoGHA: update wolfSSL/wolfssl to v5.8.0
renovate[bot] [Fri, 25 Apr 2025 07:33:49 +0000 (07:33 +0000)] 
GHA: update wolfSSL/wolfssl to v5.8.0

Closes #17182

7 months agoGHA/macos: fix typo in comment [ci skip]
Viktor Szakats [Fri, 25 Apr 2025 19:08:59 +0000 (21:08 +0200)] 
GHA/macos: fix typo in comment [ci skip]

7 months agosectransp: fix building for macOS Sierra and older
Viktor Szakats [Fri, 25 Apr 2025 16:26:10 +0000 (18:26 +0200)] 
sectransp: fix building for macOS Sierra and older

Reported-by: Eric Knibbe
Bug: https://github.com/curl/curl/pull/16581#issuecomment-2830837500
Regression from 2d94439eaa8da4fe11f99872a8b44087f74f88b0 #16581

Closes #17193

7 months agotool_paramhlp: avoid integer overflow in secs2ms()
Daniel Stenberg [Fri, 25 Apr 2025 10:05:52 +0000 (12:05 +0200)] 
tool_paramhlp: avoid integer overflow in secs2ms()

The previous approach was wrong and could lead to wrong timeout values
getting used.

Reported-by: bsr13 on hackerone
Closes #17184

7 months agocf-socket: fix FTP accept connect
Andreas Westin [Thu, 17 Apr 2025 08:46:35 +0000 (10:46 +0200)] 
cf-socket: fix FTP accept connect

When cf_tcp_accept_connect() is called and it sets up a connection it
never indicates to the caller that the it's done.

Closes #17186

7 months agocmake: use `CMAKE_COMPILE_WARNING_AS_ERROR` if available
Viktor Szakats [Fri, 25 Apr 2025 08:52:39 +0000 (10:52 +0200)] 
cmake: use `CMAKE_COMPILE_WARNING_AS_ERROR` if available

It's available in CMake >= 3.24.

Ref: https://cmake.org/cmake/help/latest/variable/CMAKE_COMPILE_WARNING_AS_ERROR.html

Closes #17183

7 months agocmake: stop deleting `-W<n>` from `CMAKE_C_FLAGS` (MSVC)
Viktor Szakats [Thu, 24 Apr 2025 23:45:23 +0000 (01:45 +0200)] 
cmake: stop deleting `-W<n>` from `CMAKE_C_FLAGS` (MSVC)

1. `CMAKE_C_FLAGS` may apply to other projects, and deleting/altering it
   may be unexpected.

2. We pass `-W4`/`-Wall` internally now, which do override custom
   `-W<n>` options in all supported MSVC versions.
   (as tested with Visual Studio generators)
   Ref: https://ci.appveyor.com/project/curlorg/curl/builds/51945416

Follow-up to e86542038dda88dadf8959584e803895f979310c #17047
Ref: 866e02935deb28373130116dac578d84e057a03e #1711

Closes #17179

7 months agoGHA: skip updating man-db for faster installs (Ubuntu)
Viktor Szakats [Fri, 25 Apr 2025 07:19:31 +0000 (09:19 +0200)] 
GHA: skip updating man-db for faster installs (Ubuntu)

This step could take from 5 seconds to 5 minutes, sometimes making it
run out of its time slot. It affected 60 CI jobs.

Saving an estimated minimum of 5 minutes per CI run.

Also fixing:
```
Fri, 25 Apr 2025 06:19:14 GMT
Processing triggers for man-db (2.12.0-4build2) ...
Fri, 25 Apr 2025 06:23:40 GMT
Running kernel seems to be up-to-date.
[...]
Error: The action 'install packages' has timed out after 5 minutes.
```
Ref: https://github.com/curl/curl/actions/runs/14658212268/job/41136971525?pr=17180#step:2:169

Closes #17181

7 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 25 Apr 2025 07:49:59 +0000 (09:49 +0200)] 
RELEASE-NOTES: synced

7 months agotests/buildinfo: former "disabled" now provides more info
Daniel Stenberg [Fri, 25 Apr 2025 06:16:13 +0000 (08:16 +0200)] 
tests/buildinfo: former "disabled" now provides more info

This tool now contains ON/OFF information about features in the build.
This way, runtests gets both positive and negative feature presence with
this. Allows for more flexibility and avoids having to duplicate the
names.

Closes #17180

7 months agoaws-sigv4: allow a blank string
Daniel Stenberg [Thu, 24 Apr 2025 21:39:08 +0000 (23:39 +0200)] 
aws-sigv4: allow a blank string

make sure a zero length sigv4 gets the default value

Reported-by: Arian van Putten
Fixes #17176
Closes #17178

7 months agobuild: tidy up internal feature detection variables for wolfSSL
Viktor Szakats [Thu, 17 Apr 2025 21:47:37 +0000 (23:47 +0200)] 
build: tidy up internal feature detection variables for wolfSSL

Sync them with the function name they detect, and sync them between
cmake and autotools.

- rename `HAVE_WOLFSSL_BIO` to `HAVE_WOLFSSL_BIO_NEW`.
- rename `HAVE_WOLFSSL_FULL_BIO` to `HAVE_WOLFSSL_BIO_SET_SHUTDOWN`.
- autotools: rename `WOLFSSL_NTLM` to `HAVE_WOLFSSL_DES_ECB_ENCRYPT`
  (to sync with cmake).
- autotools: rename `WOLFSSL_BIO` to `HAVE_WOLFSSL_BIO_NEW`
  (to sync with cmake).
- autotools: simplify `HAVE_WOLFSSL_DES_ECB_ENCRYPT` detection.

Cherry-picked from #17082

Closes #17175

7 months agoGHA/windows: limit jobs to 15 minutes
Viktor Szakats [Thu, 24 Apr 2025 17:12:42 +0000 (19:12 +0200)] 
GHA/windows: limit jobs to 15 minutes

They typically finish (well) within 10 minutes.

A notable exception was vcpkg jobs when a rebuild was triggered.
With caching lost and reducing them to short builds, this is not
an issue at the moment.

The advantage of shorter timeouts is hung/crashed jobs giving back
control earlier for a manual retry.

Closes #17173

7 months agoautotools: detect `wolfSSL_set_quic_use_legacy_code` like cmake does
Viktor Szakats [Thu, 17 Apr 2025 14:27:53 +0000 (16:27 +0200)] 
autotools: detect `wolfSSL_set_quic_use_legacy_code` like cmake does

Cherry-picked from #17082

Closes #17172

7 months agocmake: tidy up and document feature detections in dependencies
Viktor Szakats [Thu, 17 Apr 2025 08:07:30 +0000 (10:07 +0200)] 
cmake: tidy up and document feature detections in dependencies

- update text on dependency feature detection variables, and move it
  to its own section in `docs/INSTALL-CMAKE.md`.
  Ref: #17032 (Discussion)

- tidy up descriptions/comments, alpha-sort.

- move comment to its own section in `docs/INSTALL-CMAKE.md`.

- split `HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT` to distinct names for
  each TLS backend API. To make the names more stable and to sync them
  with autotools.
  Follow-up to 07cc50f8ebc6ad4c2ad23642ca727d79dab8855e #17018
  Follow-up to 342a654ef32f6c4ff284d8680f85db6136534699 #15873

- drop redundant condition while detecting QUICTLS API.
  Follow-up to 07cc50f8ebc6ad4c2ad23642ca727d79dab8855e #17018

- add config-comparison exception for `HAVE_SSL_SET_QUIC_TLS_CBS`.
  Follow-up to 5eefdd71a394d135c0ffb56fb8ec117c87dbe4f0 #17027

- detect `wolfSSL_get_peer_certificate` like autotools does.

- detect `wolfSSL_UseALPN` like autotools does.

Closes #17082

7 months agoc-ares: really lazy init channel
Stefan Eissing [Thu, 24 Apr 2025 10:18:33 +0000 (12:18 +0200)] 
c-ares: really lazy init channel

Only initialize the c-ares channel when we start resolving and not
alreads when the application sets `CURLOPT_DNS_SERVERS` and friends.

Creating an ares channel takes considerable time and when we have the
DNS information for a transfer already cached, we do not need it.

Closes #17167

7 months agombedtls: TLS 1.3 is max when mbedtls has 1.3 support
Daniel Stenberg [Tue, 22 Apr 2025 14:05:42 +0000 (16:05 +0200)] 
mbedtls: TLS 1.3 is max when mbedtls has 1.3 support

Co-authored-by: Viktor Szakats
Reported-by: kkalganov on github
Fixes #17048
Closes #17137

7 months agotypecheck-gcc.h: fix the typechecks
Daniel Stenberg [Tue, 22 Apr 2025 20:20:27 +0000 (22:20 +0200)] 
typecheck-gcc.h: fix the typechecks

Refreshed, cleaned up, improved and now checks *all* options.

This must have stopped working at some point. gcc-14 least shows these
warnings with this change, not without.

Add test 745 to verify that all options listed in curl.h is also checked
by the typechecker.

This improved checker found almost 30 mistakes in the curl git
repository.

Closes #17143

7 months agocmake: fix option() and mark_as_advanced() mixed order
Sergey [Thu, 24 Apr 2025 01:45:17 +0000 (18:45 -0700)] 
cmake: fix option() and mark_as_advanced() mixed order

Closes #17163

7 months agocmake: install shell completions for cross-builds
Viktor Szakats [Wed, 23 Apr 2025 08:26:38 +0000 (10:26 +0200)] 
cmake: install shell completions for cross-builds

Also:
- omit auto-detecting `CURL_COMPLETION_FISH_DIR` via `pkg-config`
  for cross-builds and when `CMAKE_INSTALL_PREFIX` is set.
- flatten nested `if`s.

Note:
On macOS with Homebrew, `pkg-config --variable completionsdir fish`
returns the version-specific Cellar path instead of the permanent path
`/opt/homebrew/share/fish/vendor_completions.d/`. This mimics what
autotools does, but may need further fixing, possibly upstream.
https://github.com/Homebrew/homebrew-core/blob/9c13e62b009b8e814fda180e0fcc5096318daf31/Formula/f/fish.rb
https://github.com/fish-shell/fish-shell/blob/ce631fd2fb1f5b63f5f0f1b4041a30dfad823d22/cmake/Install.cmake#L15-L21

Ref: #17147
Ref: 51170b52d15256d4aaf74ed6eea9a9297f5d595c #17159
Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1103938

Closes #17145

7 months agoopenssl-quic: Add missing include
Jochen Sprickerhof [Wed, 23 Apr 2025 13:54:21 +0000 (15:54 +0200)] 
openssl-quic: Add missing include

uint_hash, Curl_uint_hash_init and others are used in the file.

Regression from 657aae79c0

Closes #17156

7 months agomulti: init_do(): check result
Stefan Eissing [Wed, 23 Apr 2025 09:24:45 +0000 (11:24 +0200)] 
multi: init_do(): check result

Calls to `Curl_init_do()` did not check on result and missed failures to
properly and completely initialize a transfer request.

The main cause of such an init failure is the need to rewind the
READFUNCTION without a SEEKFUNCTION registered. Check the failure to
"rewind" the upload data immediately make test cases 1576 and friends
fail.

Reported-by: Travis Lane
Fixes #17139
Closes #17150

7 months agoasyn-base: remove the HTTPSRR_WORKS define
Daniel Stenberg [Wed, 23 Apr 2025 21:43:38 +0000 (23:43 +0200)] 
asyn-base: remove the HTTPSRR_WORKS define

It is done in asyn-ares.c since 179aeeaf228e

Closes #17161

7 months agolib/src/docs/test: improve curl_easy_setopt() calls
Daniel Stenberg [Wed, 23 Apr 2025 21:13:29 +0000 (23:13 +0200)] 
lib/src/docs/test: improve curl_easy_setopt() calls

Fix invokes where the argument was not the correct type.

Closes #17160

7 months agoares: add definition for HTTPSRR_WORKS
Niall [Wed, 23 Apr 2025 13:57:37 +0000 (14:57 +0100)] 
ares: add definition for HTTPSRR_WORKS

Closes #17157

7 months agolibcurl-tutorial.md: fix read callback explanation
Daniel Stenberg [Wed, 23 Apr 2025 12:36:02 +0000 (14:36 +0200)] 
libcurl-tutorial.md: fix read callback explanation

Fixes #17138
Reported-by: Thomas Klausner
Closes #17154

7 months agoautotools: install shell completion files on cross build
Helmut Grohne [Wed, 23 Apr 2025 08:54:28 +0000 (09:54 +0100)] 
autotools: install shell completion files on cross build

 Before 8.13.0, it was not possible to generate them as it required
 calling the compiled binary, but this has been fixed.

Co-authored-by: Samuel Henrique <samueloph@debian.org>
Closes #17159

7 months agoGHA/windows: fixup MSYS2 downgrade step
Viktor Szakats [Wed, 23 Apr 2025 17:30:39 +0000 (19:30 +0200)] 
GHA/windows: fixup MSYS2 downgrade step

Fix step failing when 3.6 is detected.
Ref: https://github.com/curl/curl/actions/runs/14620854081/job/41020237740?pr=17157#step:14:8

Follow-up to 20d9d3bcce5efe47ab14e5c9233c2889515fada1 #17151
Follow-up to b06c12b7248592cf001e621d7cd8dc78a827212b #16574

Closes #17158

7 months agoGHA: use more Ninja
Viktor Szakats [Wed, 23 Apr 2025 12:13:55 +0000 (14:13 +0200)] 
GHA: use more Ninja

Use it for AmigaOS, Android, dl-mingw 7.3.0 and 6.4.0 Windows builds.

Also drop explicit ninja installs.

dl-mingw:
Before:
7.3.0: https://github.com/curl/curl/actions/runs/14617346216/job/41008536465
6.4.0: https://github.com/curl/curl/actions/runs/14617346216/job/41008540878
After:
7.3.0: https://github.com/curl/curl/actions/runs/14617983032/job/41010584040?pr=17153
6.4.0: https://github.com/curl/curl/actions/runs/14617983032/job/41010586490?pr=17153

Follow-up to a36655224356c10d70bcc566ce60f82af795ca90 #17115
Ref: https://github.com/actions/runner-images/issues/11391

Closes #17153

7 months agoGHA/windows: apply MSYS2 runtime downgrades to v3.5.x, leave v3.6.x as-is
Viktor Szakats [Wed, 23 Apr 2025 10:12:02 +0000 (12:12 +0200)] 
GHA/windows: apply MSYS2 runtime downgrades to v3.5.x, leave v3.6.x as-is

windows-runners 20250420.1.0 come with msys2-runtime 3.6.x. It has
the perf regression issue fixed, so stop downgrading it.

This makes CI jobs settle on this version when supplied by
the runner image or the msys2/setup-msys2 action:
MINGW64_NT-10.0-20348 fv-az980-636 3.6.1-0cfedd4f.x86_64 2025-04-12 01:44 UTC x86_64 Msys

With 3.6.1, we've seen issues launching `perl.exe` before this patch:
https://github.com/curl/curl/discussions/14854#discussioncomment-12908214
https://github.com/curl/curl/discussions/14854#discussioncomment-12921007

Follow-up to b06c12b7248592cf001e621d7cd8dc78a827212b #16574
Closes #17151

7 months agocmake: fix `fish` install directory detection via `pkg-config`
Viktor Szakats [Wed, 23 Apr 2025 08:52:06 +0000 (10:52 +0200)] 
cmake: fix `fish` install directory detection via `pkg-config`

Follow-up to c8b0f0c9ad78eafc6c8f0005113de346ee797c21 #16833

Closes #17147

7 months agodoh: make sure CURLOPT_PROTOCOLS is set a with a "long" arg
Daniel Stenberg [Wed, 23 Apr 2025 06:19:56 +0000 (08:19 +0200)] 
doh: make sure CURLOPT_PROTOCOLS is set a with a "long" arg

Closes #17142

7 months agoruntests: fix indentation [ci skip]
Viktor Szakats [Tue, 22 Apr 2025 19:10:39 +0000 (21:10 +0200)] 
runtests: fix indentation [ci skip]

Cherry-picked from #16840

7 months agocmake: avoid 'target is imported but not globally visible' when consuming libcurl...
Viktor Szakats [Tue, 22 Apr 2025 08:36:16 +0000 (10:36 +0200)] 
cmake: avoid 'target is imported but not globally visible' when consuming libcurl with old cmake

Fixes:
```
CMake Error at bld-curl/_pkg/lib/cmake/CURL/CURLConfig.cmake:62 (add_library):
  add_library cannot create ALIAS target "CURL::libcurl" because target
  "CURL::libcurl_shared" is imported but not globally visible.
Call Stack (most recent call first):
  CMakeLists.txt:39 (find_package)
```

tests/cmake reproducer (requires #16973):
```shell
export CMAKE_CONSUMER=/path/to/CMake-3.12.0/bin/cmake
./test.sh find_package
```

I don't understand what this error says, why it happens in certain CMake
versions, and why a workaround is necessary for what seems like
a standard export/consume configuration. This patch is based on internet
suggestions and other projects ending up with this workaround.

Cherry-picked from #16973
Closes #17140

7 months agoopenssl-quic: avoid potential `-Wnull-dereference`, add assert
Viktor Szakats [Sun, 20 Apr 2025 08:13:52 +0000 (10:13 +0200)] 
openssl-quic: avoid potential `-Wnull-dereference`, add assert

Seen with curl-for-win, OpenSSL QUIC, gcc 14.2.0, cmake unity mode.

Silences:
```
In file included from _x86-win-ucrt-bld/lib/CMakeFiles/libcurl_object.dir/Unity/unity_5_c.c:55:
In function 'cf_osslq_check_and_unblock',
    inlined from 'cf_progress_egress' at lib/vquic/curl_osslq.c:1730:12:
lib/vquic/curl_osslq.c:1581:11: error: potential null pointer dereference [-Werror=null-dereference]
 1581 |           nghttp3_conn_unblock_stream(ctx->h3.conn, stream->s.id);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/vquic/curl_osslq.c:1582:34: error: potential null pointer dereference [-Werror=null-dereference]
 1582 |           stream->s.send_blocked = FALSE;
      |                                  ^
```

Co-authored-by: Daniel Stenberg
Co-authored-by: Stefan Eissing
Closes #17107

7 months agoGHA: always use Ninja on macos runners
Viktor Szakats [Mon, 21 Apr 2025 02:00:36 +0000 (04:00 +0200)] 
GHA: always use Ninja on macos runners

It's installed by default on the macos runners now.

Closes #17115

7 months agoGHA/windows: bump cygwin/cygwin-install-action
dependabot[bot] [Mon, 21 Apr 2025 15:50:58 +0000 (15:50 +0000)] 
GHA/windows: bump cygwin/cygwin-install-action

to https://github.com/cygwin/cygwin-install-action/commit/f2009323764960f80959895c7bc3bb30210afe4d

Closes #17118

7 months agolib: add meta_hash to connection, eliminate hash_offt
Stefan Eissing [Fri, 18 Apr 2025 09:03:29 +0000 (11:03 +0200)] 
lib: add meta_hash to connection, eliminate hash_offt

With a meta_hash at each connection (similar to easy handle, let
multi_ev.c store its pollsets as meta data, no longer needing its own
hashes.

This eliminates the last use of Curl_hash_offt. Remove it.

Closes #17095

7 months agohttp: fix HTTP/2 handling of TE request header using "trailers"
Stefan Eissing [Tue, 22 Apr 2025 10:53:22 +0000 (12:53 +0200)] 
http: fix HTTP/2 handling of TE request header using "trailers"

A "TE" request header is allowed in HTTP/2 when it only carries the
"trailers" value. RFC 9113 ch. 8.2.2. Check client supplied TE values
for the "trailers" token and only pass that one in a HTTP/2 request.

Add test_01_17 to verify.

Fixes #17122
Reported-by: epicmkirzinger on github
Closes #17128

7 months agovquic: unblame netbsd
Stefan Eissing [Tue, 22 Apr 2025 12:23:31 +0000 (14:23 +0200)] 
vquic: unblame netbsd

it was innocent.

Follow-up to 4872dafd8075fab781b7a3ac

Closes #17133

7 months agoconnect: shutdown timer fix
Stefan Eissing [Tue, 22 Apr 2025 13:23:36 +0000 (15:23 +0200)] 
connect: shutdown timer fix

Fix a bug in timeout handling for connection shutdowns that led to
default timeout of 2 seconds not being in effect.

Only set the shutdown timeout expiry when operating on a non-admin
transfers. Admin handles are only temproarily tied to a connection.

Fixes #17130
Reported-by: Rasmus Melchior Jacobsen
Closes #17135

7 months agocares: fix missing lazy init for CURLOPT_DNS_SERVERS
Stefan Eissing [Tue, 22 Apr 2025 09:02:41 +0000 (11:02 +0200)] 
cares: fix missing lazy init for CURLOPT_DNS_SERVERS

When setting option CURLOPT_DNS_SERVERS, the ares channel was not
properly initialized and the setting failed.

Fixes #17119
Reported-by: calvin2021y on github
Closes #17127

7 months agovquic: init for every call to recvmsg
Stefan Eissing [Tue, 22 Apr 2025 11:12:24 +0000 (13:12 +0200)] 
vquic: init for every call to recvmsg

When calling recvmsg(), always set up the msg structures for
each call as there are OS implemenations that change members
of msg.

Fixes #17120
Reported-by: Harry Sintonen
Closes #17131

7 months agovquic: consistent name for the stream struct across backends
Daniel Stenberg [Sun, 20 Apr 2025 21:24:52 +0000 (23:24 +0200)] 
vquic: consistent name for the stream struct across backends

Now known as "struct h3_stream_ctx" in all four backends.

Also as a bonus: a single definition of the H3_STREAM_CTX macro

Closes #17113

7 months agocurl/curlver.h: next version is 8.14.0
Daniel Stenberg [Tue, 22 Apr 2025 07:44:34 +0000 (09:44 +0200)] 
curl/curlver.h: next version is 8.14.0

7 months agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 22 Apr 2025 07:43:55 +0000 (09:43 +0200)] 
RELEASE-NOTES: synced

7 months agohostip: fix build when no async resolvers are present
Daniel Stenberg [Tue, 22 Apr 2025 06:55:21 +0000 (08:55 +0200)] 
hostip: fix build when no async resolvers are present

Fixes #17124
Closes #17125

7 months agoasyn-base: fix build with disabled threaded resolver
Daniel Stenberg [Tue, 22 Apr 2025 05:54:32 +0000 (07:54 +0200)] 
asyn-base: fix build with disabled threaded resolver

... but *with* DoH.

Fixes #17121
Closes #17123

7 months agoCURLOPT_ERRORBUFFER.md: the buffer is read only after curl takes ownership
Max Eliaser [Sat, 19 Apr 2025 21:08:06 +0000 (14:08 -0700)] 
CURLOPT_ERRORBUFFER.md: the buffer is read only after curl takes ownership

Clarifies #17100
Closes #17105

7 months agolib: use BIT() instead of bool in structs more
Daniel Stenberg [Sun, 20 Apr 2025 22:08:22 +0000 (00:08 +0200)] 
lib: use BIT() instead of bool in structs more

Since it makes use of bitfields on supported platforms, it saves a few
bytes memory. Might as well use it consistently.

Closes #17114

7 months agowcurl: import v2025.04.20 script + docs
Daniel Stenberg [Fri, 11 Apr 2025 21:17:03 +0000 (23:17 +0200)] 
wcurl: import v2025.04.20 script + docs

Build/install the man page. Install the script.

This an "import" rather than just adding the script into the release tarball
with maketgz to make sure the tarball build is completely reproducible.

wcurl development, issues etc is still to be done at
https://github.com/curl/wcurl

Assisted-by: Viktor Szakats
Assisted-by: Samuel Henrique
Closes #17035

7 months agotool_getparam: clear argument only when needed
Daniel Stenberg [Tue, 15 Apr 2025 15:27:47 +0000 (17:27 +0200)] 
tool_getparam: clear argument only when needed

Test 699 verifies

Reported-by: bsr13 on hackerone
Closes #17112

7 months agoopenssl-quic: fix printf mask
Viktor Szakats [Sun, 20 Apr 2025 08:08:00 +0000 (10:08 +0200)] 
openssl-quic: fix printf mask

Fixes:
```
lib/vquic/curl_osslq.c:835:25: error: format '%zd' expects argument of type 'signed size_t', but argument 6 has type 'curl_off_t' {aka 'long long int'} [-Werror=format=]
  835 |   CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] DATA len=%zu, total=%zd",
      |                         ^~~~
  836 |               stream->s.id, buflen, stream->download_recvd);
      |                                     ~~~~~~~~~~~~~~~~~~~~~~
      |                                           |
      |                                           curl_off_t {aka long long int}
```

Closes #17106

7 months agoGHA/linux: tidy up around wolfSSH
Viktor Szakats [Sun, 20 Apr 2025 09:59:06 +0000 (11:59 +0200)] 
GHA/linux: tidy up around wolfSSH

- fix filter expression for cache step.
  It did not cause an issue because `wolfssh` is always paired with
  a `wolfssl*`.

- build `wolfssh` against `wolfssl-opensslextra` (was: `wolfssl-all`).
  It makes `wolfssh` builds `OPENSSL_COEXIST`-compatible, and clarifies
  its use in the clang-tidy job. The earlier mixup didn't cause issues
  because the clang-tidy job is compile-only (using their headers only.)
  Useful side-effect is making the wolfssh build valgrind-tested.

Reported-by: bo0tzz on github
Ref: https://github.com/curl/curl/discussions/16970#discussioncomment-12752019

Closes #17109

7 months agoGHA/windows: enable MSYS2 `diffutils` on ARM64
Viktor Szakats [Sat, 19 Apr 2025 08:31:51 +0000 (10:31 +0200)] 
GHA/windows: enable MSYS2 `diffutils` on ARM64

https://packages.msys2.org/packages/mingw-w64-clang-aarch64-diffutils

Thanks-to: Christoph Reiter
Ref: https://github.com/curl/curl/pull/17067#issuecomment-2816599349

Closes #17103

7 months agocmake: link `crypt32` for OpenSSL feature detection
Viktor Szakats [Sat, 19 Apr 2025 07:34:35 +0000 (09:34 +0200)] 
cmake: link `crypt32` for OpenSSL feature detection

Also fix to link the winsock library for WinCE there.

Reported-by: Jixinqi
Fixes #17101
Closes #17102

7 months agoruntests: add retry option to reduce flakiness
Viktor Szakats [Thu, 17 Apr 2025 14:25:37 +0000 (16:25 +0200)] 
runtests: add retry option to reduce flakiness

Add `--retry=<num>` option to tell runtests to retry the first `<num>`
tests that failed. Retries aren't run right away, but added to the end
of the test queue. Once all retry slots are used, test fail as normal.

In CI, typically a single test fails for flakiness, and rarely over 5.

Make the `ci-test` targets default to `--retry=5`.

Closes #17091

7 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 18 Apr 2025 22:05:37 +0000 (00:05 +0200)] 
RELEASE-NOTES: synced

7 months agowebsocket: add option to disable auto-pong reply
Brian Chrzanowski [Wed, 24 Jul 2024 02:15:23 +0000 (22:15 -0400)] 
websocket: add option to disable auto-pong reply

This adds another bitflag on CURLOPT_WS_OPTIONS (CURLWS_NOAUTOPONG) that
disables the default and automatic PONG reply in the WebSocket layer.

Assisted-by: Calvin Ruocco
Closes #16744

7 months agoquic: no local idle connection timeout, ngtcp2 keep-alive
Stefan Eissing [Tue, 15 Apr 2025 08:55:59 +0000 (10:55 +0200)] 
quic: no local idle connection timeout, ngtcp2 keep-alive

Do not set a transport parameter idle timeout, meaning we have no such
thing from our side. The remote setting then applies.

In ngtcp2, set its "keep-alive" timer to prevent a possible remote idle
timeout to tear down the connection while we have active transfers on
that connection.

Closes #17057

7 months agocf-https-connect: use the passed in dns struct pointer
Daniel Stenberg [Thu, 17 Apr 2025 20:49:29 +0000 (22:49 +0200)] 
cf-https-connect: use the passed in dns struct pointer

... instead of digging it out from the connection struct.

Plus: simplify struct referencing in the condition.

Closes #17092

7 months agodoh: reduce the DNS request buffer size
Daniel Stenberg [Thu, 17 Apr 2025 15:54:59 +0000 (17:54 +0200)] 
doh: reduce the DNS request buffer size

No point in having it larger than the largest allowed request size.

Also removed a no longer used struct.

Closes #17087

7 months agodoh: httpsrr fix
sftcd [Fri, 18 Apr 2025 16:12:23 +0000 (17:12 +0100)] 
doh: httpsrr fix

Closes #17099

7 months agocmake: fix shell completion install when just one flavor is enabled
Viktor Szakats [Fri, 18 Apr 2025 07:46:59 +0000 (09:46 +0200)] 
cmake: fix shell completion install when just one flavor is enabled

Also:
- tidy up the `if` tree.
- drop `include(GNUInstallDirs)` in favor of the upper-level one.

Reported-by: Daniel Engberg
Bug: https://github.com/curl/curl/issues/16946#issuecomment-2814663246
Follow-up to c8b0f0c9ad78eafc6c8f0005113de346ee797c21 #16833

Closes #17094

7 months agoGHA/windows: add 2 basic MSVC jobs to restore some CI coverage
Viktor Szakats [Thu, 17 Apr 2025 17:21:38 +0000 (19:21 +0200)] 
GHA/windows: add 2 basic MSVC jobs to restore some CI coverage

To keep testing these with MSVC:
- UWP !ssl
- arm64 build on the `windows-11-arm` runner
- examples
- OpenSSH-Windows (fix install on `windows-11-arm`)
- `windows-2025` runner
- cmake pre-fill checker

Surprise: UWP doesn't support SSPI, which is required by curl's Schannel
backend. Thus, no TLS support for this UWP build. It also suggests
the Schannel UWP mingw-w64 binaries may be broken and just a happy build
accident thanks to mingw-w64 headers being inaccurate.

Building zlib + libssh2 might actually take up to 2+ minutes with vcpkg,
instead of the previously estimated <1.5 minutes.

Follow-up to e3912f0f9fac06d37cd1ab93cef4f01f33809f0b #17086
Follow-up to 15fb1dc7f86ad1832e0386ec7d92542f44ee9c44 #17069

Closes #17089