Commit Graph

35235 Commits

Author SHA1 Message Date
Viktor Szakats
f9eb9e5e23
cmake: use LIB_NAME in curl-config.cmake.in
Cherry-picked from #16973
Closes #17195
2025-04-26 12:59:53 +02:00
Viktor Szakats
54ef546ec4
GHA/linux: formatting nit [ci skip]
Cherry-picked from #16973
2025-04-26 09:20:01 +02:00
Daniel Stenberg
15839450be
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
2025-04-25 22:38:04 +02:00
renovate[bot]
01b177721b
GHA: update wolfSSL/wolfssl to v5.8.0
Closes #17182
2025-04-25 22:34:32 +02:00
Viktor Szakats
d58ff6e4b5
GHA/macos: fix typo in comment [ci skip] 2025-04-25 21:10:04 +02:00
Viktor Szakats
d7914f75aa
sectransp: fix building for macOS Sierra and older
Reported-by: Eric Knibbe
Bug: https://github.com/curl/curl/pull/16581#issuecomment-2830837500
Regression from 2d94439eaa #16581

Closes #17193
2025-04-25 21:06:22 +02:00
Daniel Stenberg
4db64a6437
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
2025-04-25 17:54:19 +02:00
Andreas Westin
cc884c08a8
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
2025-04-25 17:39:27 +02:00
Viktor Szakats
c3aa22272d
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
2025-04-25 11:42:24 +02:00
Viktor Szakats
1e9b48c010
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 e86542038d #17047
Ref: 866e02935d #1711

Closes #17179
2025-04-25 11:42:24 +02:00
Viktor Szakats
5acba8bc36
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
2025-04-25 10:17:36 +02:00
Daniel Stenberg
f034716ded
RELEASE-NOTES: synced 2025-04-25 09:49:59 +02:00
Daniel Stenberg
1968b32afd
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
2025-04-25 09:43:47 +02:00
Daniel Stenberg
2ab6b9d405
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
2025-04-25 09:32:57 +02:00
Viktor Szakats
ae0ff69f7a
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
2025-04-24 23:44:33 +02:00
Viktor Szakats
1f6fef7ec0
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
2025-04-24 19:46:28 +02:00
Viktor Szakats
4a15cfc99f
autotools: detect wolfSSL_set_quic_use_legacy_code like cmake does
Cherry-picked from #17082

Closes #17172
2025-04-24 19:46:28 +02:00
Viktor Szakats
4bfc379b90
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 07cc50f8eb #17018
  Follow-up to 342a654ef3 #15873

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

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

- detect `wolfSSL_get_peer_certificate` like autotools does.

- detect `wolfSSL_UseALPN` like autotools does.

Closes #17082
2025-04-24 19:46:27 +02:00
Stefan Eissing
7bf576064c
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
2025-04-24 14:07:01 +02:00
Daniel Stenberg
437c72fbba
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
2025-04-24 14:02:56 +02:00
Daniel Stenberg
79b4e56b3f
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
2025-04-24 13:23:49 +02:00
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