]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
3 months agometahash: add asserts to help analyzers bagder/meta-assert 17268/head
Daniel Stenberg [Wed, 7 May 2025 08:49:13 +0000 (10:49 +0200)] 
metahash: add asserts to help analyzers

Where NULL pointers are not acceptable input.

3 months agoimap: use easy handle/connection meta for proto structs
Stefan Eissing [Tue, 6 May 2025 14:27:43 +0000 (16:27 +0200)] 
imap: use easy handle/connection meta for proto structs

Remove the imap protocol structs from connectdata->proto union
and data->req.p and use the easy handle/connection meta hash
for keeping them.

Closes #17261

3 months agocmake: set `BUILDING_LIBCURL` directly for unit test targets
Viktor Szakats [Tue, 6 May 2025 23:29:32 +0000 (01:29 +0200)] 
cmake: set `BUILDING_LIBCURL` directly for unit test targets

To avoid adding this macro to the global `CURL_DEBUG_MACROS` variable,
which may be used for targets defined after unit tests, and where this
macro may not be necessary.

As of this commit unit tests are defined last, so extending the global
variable did not cause any issue.

Follow-up to 220eda34cdfdcc4316845d2e2bbe5bd8b10305e0 #17259

Closes #17264

3 months agogenerate.bat: exclude curlinfo.c from legacy VS projects
Jay Satiro [Tue, 6 May 2025 21:47:37 +0000 (17:47 -0400)] 
generate.bat: exclude curlinfo.c from legacy VS projects

- Do not include curlinfo.c as a ClCompile unit when compiling the curl
  tool.

Prior to this change generate.bat would add curlinfo.c to the source
files for the curl tool because it is located in the src directory. That
caused ambiguous behavior in legacy versions of Visual Studio which had
to guess between two main entry points (one in curlinfo and one in
tool_main, the latter being correct).

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

3 months agotests: separate tunit tests from unit tests more
Daniel Stenberg [Tue, 6 May 2025 13:03:46 +0000 (15:03 +0200)] 
tests: separate tunit tests from unit tests more

- unit tests need no tool code as they are libcurl unit tests
- unit test 1621 is now tunit test 1621 instead, as it tests tool code
- build unit tests with BUILDING_LIBCURL as they pretent to be libcurl

Closes #17259

3 months agortsp: move easy handle/connection protoocol structs into meta data
Stefan Eissing [Tue, 6 May 2025 08:44:27 +0000 (10:44 +0200)] 
rtsp: move easy handle/connection protoocol structs into meta data

Remove the connectdata proto and data->req.p member for rtsp and manage
the structs as meta data at easy handle/connection.

Closes #17254

3 months agopop3: add null pointer check
Daniel Stenberg [Tue, 6 May 2025 09:05:30 +0000 (11:05 +0200)] 
pop3: add null pointer check

Pointed out by Coverity. A precaution to catch internal errors.

Follow-up to 76d13c721bcd992e3e19f52

Closes #17255

3 months agoftp: fix bug in failed init
Stefan Eissing [Tue, 6 May 2025 10:59:28 +0000 (12:59 +0200)] 
ftp: fix bug in failed init

torture tests revealed that memory was not released correctly when FTP's
connection setup failed an allocation.

Follow-up from a2d90d4ba5076643b5af9978c4

Closes #17258

3 months agosmb: use easy handle/connection meta hash to keep structs
Stefan Eissing [Wed, 30 Apr 2025 12:00:35 +0000 (14:00 +0200)] 
smb: use easy handle/connection meta hash to keep structs

Keep easy/connection related protoocl structs in the meta hash instead
of the unions at request and connectdata.

Closes #17238

3 months agortmp: use connection meta for RTMP* instance
Stefan Eissing [Wed, 30 Apr 2025 10:59:01 +0000 (12:59 +0200)] 
rtmp: use connection meta for RTMP* instance

Keep RTMP* instance at connection meta hash.

Closes #17237

3 months agopop3: use meta hashes at easy handle and connection
Stefan Eissing [Wed, 30 Apr 2025 10:06:53 +0000 (12:06 +0200)] 
pop3: use meta hashes at easy handle and connection

Keep the pop3 related protocol information in the meta hashes at easy
handle and connection.

Move the struct definitions inside pop3.c

Closes #17236

3 months agoftp: use easy handle and connectin meta data for protocol structs
Stefan Eissing [Mon, 5 May 2025 11:31:14 +0000 (13:31 +0200)] 
ftp: use easy handle and connectin meta data for protocol structs

- remove data->req.p.ftp and store `struct FTP` as easy meta data
- place `struct ftp_conn` instance in connection meta data

Closes #17249

3 months agotftp: use connections meta hash
Stefan Eissing [Wed, 30 Apr 2025 09:08:02 +0000 (11:08 +0200)] 
tftp: use connections meta hash

Use connection meta hash for state struct instead of union pointer at
connectdata.

Closes #17235

3 months agoopenldap: use connection meta for context struct
Stefan Eissing [Tue, 29 Apr 2025 11:09:00 +0000 (13:09 +0200)] 
openldap: use connection meta for context struct

Remove member of conn->proto union.

Closes #17224

3 months agoECH: reference the OpenSSL ECH feature branch
sftcd [Mon, 5 May 2025 21:37:49 +0000 (22:37 +0100)] 
ECH: reference the OpenSSL ECH feature branch

rather than the defo-project fork.

Closes #17251

3 months agospacecheck.pl: check for non-ASCII chars, fix fallouts
Viktor Szakats [Sat, 3 May 2025 16:11:29 +0000 (18:11 +0200)] 
spacecheck.pl: check for non-ASCII chars, fix fallouts

Reported-by: James Fuller
Assisted-by: Dan Fandrich
Closes #17247

3 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 1 May 2025 20:27:18 +0000 (22:27 +0200)] 
RELEASE-NOTES: synced

3 months agoGHA: Update libressl-portable/portable to v4.1.0
renovate[bot] [Wed, 30 Apr 2025 19:42:34 +0000 (19:42 +0000)] 
GHA: Update libressl-portable/portable to v4.1.0

Closes #17234

3 months agomkhelp: fix to not generate a line-ending space in some cases
Viktor Szakats [Wed, 30 Apr 2025 16:32:02 +0000 (18:32 +0200)] 
mkhelp: fix to not generate a line-ending space in some cases

Fixing gcc-15:
```
bld/src/tool_hugehelp.c:11739:1: error: trailing whitespace [-Werror=trailing-whitespace=]
```
Ref: https://github.com/curl/curl/actions/runs/14758743743/job/41433794102?pr=17239#step:10:32

Closes #17240

3 months agoTLS: add CURLOPT_SSL_SIGNATURE_ALGORITHMS and --sigalgs
Andrei Florea [Wed, 2 Apr 2025 07:41:54 +0000 (09:41 +0200)] 
TLS: add CURLOPT_SSL_SIGNATURE_ALGORITHMS and --sigalgs

Fixes #12982
Closes #16964

3 months agoTODO: remove "nicer lacking perl message"
NeimadTL [Tue, 29 Apr 2025 22:32:23 +0000 (18:32 -0400)] 
TODO: remove "nicer lacking perl message"

The document has been updated by removing point 20.2 as it was done
some time ago.

Closes #17233

3 months agodocs/libcurl: fix type and prototype problems in examples
Daniel Stenberg [Tue, 29 Apr 2025 20:27:52 +0000 (22:27 +0200)] 
docs/libcurl: fix type and prototype problems in examples

Found by enabling the typechecks when compiling them with
verify-examples.pl

Closes #17231

3 months agoCURLOPT_XFERINFOFUNCTION.md: fix the callback return type in example
Daniel Stenberg [Tue, 29 Apr 2025 15:47:50 +0000 (17:47 +0200)] 
CURLOPT_XFERINFOFUNCTION.md: fix the callback return type in example

Fixes #17228
Reported-by: gkarracer on github
Closes #17229

3 months agoscripts: fix perl indentation, whitespace, semicolons
Viktor Szakats [Mon, 28 Apr 2025 12:57:16 +0000 (14:57 +0200)] 
scripts: fix perl indentation, whitespace, semicolons

Ref: #17116

Closes #17209

3 months agoGHA: drop vcpkg cache and most vcpkg logic with it
Viktor Szakats [Sat, 26 Apr 2025 16:37:39 +0000 (18:37 +0200)] 
GHA: drop vcpkg cache and most vcpkg logic with it

The unplanned dropping of the granular vcpkg binary cache indeed fell
into the cracks between Microsoft's various departments. The old method
is now official dropped, without replacement either on the vcpkg side or
the GitHub cache provider side.

Without a granular cache, vcpkg is impractical for builds larger than
a small dependency tree in CI, for performance reasons.

A granular cache is critical for CI use. Building dependencies is not
a goal of this CI, so a more desirable option would be pre-built binary
downloads. This would also allow keeping job timeouts low, which is
important for quick iteration in GHA when a flaky job requiring a manual
retry needs all other jobs to finish first. (GHA often disregards
step timeouts, which is another contributing factor here.)

Windows remains tested extensively with MSYS2, curl-for-win, and via
AppVeyor CI with MSVC + OpenSSL, and also in GHA via scaled back vcpkg
jobs that perform well without caching. What's lost is the recently
added Android OpenSSL build tests.

We may consider building/cachine important dependencies manually as in
GHA/linux-http3, and/or try integrating MSVC jobs with MSYS2 UCRT DLLs.

Ref: https://github.com/microsoft/vcpkg-tool/pull/1662
Ref: https://github.com/microsoft/vcpkg/issues/45073

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

Closes #17200

3 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

3 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

3 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

3 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

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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

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

Closes #17204

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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]

3 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

3 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

3 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

3 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

3 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

3 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

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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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