Commit Graph

35764 Commits

Author SHA1 Message Date
Sergey
29e0a8a09b
cmake: fix option() and mark_as_advanced() mixed order
Closes #17163
2025-04-24 10:04:17 +02:00
Viktor Szakats
c1c99054ab
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.
9c13e62b00/Formula/f/fish.rb
ce631fd2fb/cmake/Install.cmake (L15-L21)

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

Closes #17145
2025-04-24 10:04:17 +02:00
Jochen Sprickerhof
82606325e3
openssl-quic: Add missing include
uint_hash, Curl_uint_hash_init and others are used in the file.

Regression from 657aae79c0

Closes #17156
2025-04-24 08:45:35 +02:00
Stefan Eissing
5e95556fc2
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
2025-04-24 08:43:03 +02:00
Daniel Stenberg
39f5e7cb69
asyn-base: remove the HTTPSRR_WORKS define
It is done in asyn-ares.c since 179aeeaf22

Closes #17161
2025-04-24 08:40:52 +02:00
Daniel Stenberg
f9f1a15699
lib/src/docs/test: improve curl_easy_setopt() calls
Fix invokes where the argument was not the correct type.

Closes #17160
2025-04-23 23:44:55 +02:00
Niall
179aeeaf22
ares: add definition for HTTPSRR_WORKS
Closes #17157
2025-04-23 23:39:41 +02:00
Daniel Stenberg
9c59a6ac55
libcurl-tutorial.md: fix read callback explanation
Fixes #17138
Reported-by: Thomas Klausner
Closes #17154
2025-04-23 23:23:59 +02:00
Helmut Grohne
51170b52d1
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
2025-04-23 23:21:05 +02:00
Viktor Szakats
596da988c4
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 20d9d3bcce #17151
Follow-up to b06c12b724 #16574

Closes #17158
2025-04-23 19:42:45 +02:00
Viktor Szakats
5852a0bedf
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 a366552243 #17115
Ref: https://github.com/actions/runner-images/issues/11391

Closes #17153
2025-04-23 15:12:22 +02:00
Viktor Szakats
20d9d3bcce
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 b06c12b724 #16574
Closes #17151
2025-04-23 13:46:52 +02:00
Viktor Szakats
73b6f8d2fe
cmake: fix fish install directory detection via pkg-config
Follow-up to c8b0f0c9ad #16833

Closes #17147
2025-04-23 11:34:27 +02:00
Daniel Stenberg
b993f2871b
doh: make sure CURLOPT_PROTOCOLS is set a with a "long" arg
Closes #17142
2025-04-23 08:52:49 +02:00
Viktor Szakats
3394644325
runtests: fix indentation [ci skip]
Cherry-picked from #16840
2025-04-22 21:11:37 +02:00
Viktor Szakats
e5a965b676
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
2025-04-22 19:07:03 +02:00
Viktor Szakats
d60c9aec42
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
2025-04-22 16:50:12 +02:00
Viktor Szakats
a366552243
GHA: always use Ninja on macos runners
It's installed by default on the macos runners now.

Closes #17115
2025-04-22 16:50:12 +02:00
dependabot[bot]
4c20eb7108
GHA/windows: bump cygwin/cygwin-install-action
to f200932376

Closes #17118
2025-04-22 16:50:12 +02:00
Stefan Eissing
657aae79c0
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
2025-04-22 15:57:18 +02:00
Stefan Eissing
1d66a769d7
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
2025-04-22 15:55:36 +02:00
Stefan Eissing
ebe6612505
vquic: unblame netbsd
it was innocent.

Follow-up to 4872dafd80

Closes #17133
2025-04-22 15:54:07 +02:00
Stefan Eissing
2a25abeaf1
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
2025-04-22 15:52:17 +02:00
Stefan Eissing
24dd825ed5
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
2025-04-22 14:33:41 +02:00
Stefan Eissing
4872dafd80
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
2025-04-22 13:46:36 +02:00
Daniel Stenberg
2de9a97141
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
2025-04-22 10:26:04 +02:00
Daniel Stenberg
c4da2bc906
curl/curlver.h: next version is 8.14.0 2025-04-22 09:44:34 +02:00
Daniel Stenberg
17bf1b9d9d
RELEASE-NOTES: synced 2025-04-22 09:43:55 +02:00
Daniel Stenberg
f142056e01
hostip: fix build when no async resolvers are present
Fixes #17124
Closes #17125
2025-04-22 09:18:40 +02:00
Daniel Stenberg
1db267eada
asyn-base: fix build with disabled threaded resolver
... but *with* DoH.

Fixes #17121
Closes #17123
2025-04-22 08:42:56 +02:00
Max Eliaser
7b375b8b91
CURLOPT_ERRORBUFFER.md: the buffer is read only after curl takes ownership
Clarifies #17100
Closes #17105
2025-04-22 08:40:42 +02:00
Daniel Stenberg
ba07dcd27b
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
2025-04-22 08:01:08 +02:00
Daniel Stenberg
23bed347b3
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
2025-04-21 11:06:44 +02:00
Daniel Stenberg
da9494eef0
tool_getparam: clear argument only when needed
Test 699 verifies

Reported-by: bsr13 on hackerone
Closes #17112
2025-04-20 23:08:11 +02:00
Viktor Szakats
929c9a7ef7
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
2025-04-20 13:50:57 +02:00
Viktor Szakats
b12b812196
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
2025-04-20 13:50:57 +02:00
Viktor Szakats
c4e776cafa
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
2025-04-20 13:50:56 +02:00
Viktor Szakats
e325001e52
cmake: link crypt32 for OpenSSL feature detection
Also fix to link the winsock library for WinCE there.

Reported-by: Jixinqi
Fixes #17101
Closes #17102
2025-04-20 09:36:32 +02:00
Viktor Szakats
3f297f1ecc
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
2025-04-19 10:41:58 +02:00
Daniel Stenberg
3192eeabae
RELEASE-NOTES: synced 2025-04-19 00:05:37 +02:00
Brian Chrzanowski
c0df01fd94
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
2025-04-19 00:01:28 +02:00
Stefan Eissing
21fd64645b
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
2025-04-18 23:52:51 +02:00
Daniel Stenberg
1102ea9f4b
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
2025-04-18 23:24:18 +02:00
Daniel Stenberg
834836dc14
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
2025-04-18 23:10:29 +02:00
sftcd
d6c8907864
doh: httpsrr fix
Closes #17099
2025-04-18 23:03:31 +02:00
Viktor Szakats
f616704980
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 c8b0f0c9ad #16833

Closes #17094
2025-04-18 10:34:11 +02:00
Viktor Szakats
cd0ec4784c
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 e3912f0f9f #17086
Follow-up to 15fb1dc7f8 #17069

Closes #17089
2025-04-17 22:15:54 +02:00
Viktor Szakats
cac50319f9
runtests: recognize lowercase windows in curl -V
As in vcpkg triplets. Test it in CI.

Closes #17088
2025-04-17 19:16:00 +02:00
Viktor Szakats
e3912f0f9f
GHA/windows: restore a simple vcpkg job (zlib + libssh2)
To keep the basics tested. Building zlib and libssh2 takes <1.5 minutes.

So far it seems the "lost" vcpkg binary cache is not a vcpkg-tool
regression, but a GitHub server-side deprecation combined with lack of
replacement service or lack of vcpkg support for such service.

Ref: https://github.blog/changelog/2025-03-20-notification-of-upcoming-breaking-changes-in-github-actions/
Ref: https://github.com/microsoft/vcpkg/issues/45073

Follow-up to 15fb1dc7f8 #17069

Closes #17086
2025-04-17 18:31:54 +02:00
Stefan Eissing
2b6f503570
pytest: make test_07_22 more lenient to exit codes
Depending on timing when the server aborting the connection is detected,
the reported curl exit code may vary. Check for the possible set of
expected codes instead of a single one.

Closes #17083
2025-04-17 17:30:03 +02:00