Commit graph

38470 commits

Author SHA1 Message Date
Stefan Eissing
5448495cfd
vtls_scache: check reentrancy
Track lock status of session cache, add DEBUGASSERT()s for proper
calling sequences. Add check of lock status.

Use lock status check to prevent reentry of import/export calls.
Deny such calls with CURLE_RECURSIVE_API_CALL.

Closes #21383
2026-04-20 11:22:00 +02:00
Viktor Szakats
85e825770a
GHA: bump test minimums (more)
Follow-up to 701a8319ec96c0b73c39e16c5db68dd758419c2 #21353

Closes #21382
2026-04-20 10:47:19 +02:00
Viktor Szakats
1fbffe7f08
GHA: use more OpenSSL 4, enable ECH in more jobs
for Linux and macOS.

Closes #21379
2026-04-20 02:53:24 +02:00
Viktor Szakats
4c548b978f
openssl: fix unused variable warnings in !verbose builds
Also fix clang-tidy `readability-redundant-control-flow`.

```
lib/vtls/openssl.c:4055:46: error: unused parameter 'reason' [-Wunused-parameter]
 4055 |                                          int reason)
      |                                              ^
lib/vtls/openssl.c:4279:19: error: variable 'status' set but not used [-Wunused-but-set-variable]
 4279 |       const char *status = NULL;
      |                   ^
```
Ref: https://github.com/curl/curl/actions/runs/24641388439/job/72045859306?pr=21379

```
lib/vtls/openssl.c:4092:7: error: Value stored to 'rv' is never read [clang-analyzer-deadcode.DeadStores]
 4092 |       rv = SSL_ech_get1_status(ssl, &inner, &outer);
      |       ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/vtls/openssl.c:4092:7: note: Value stored to 'rv' is never read
 4092 |       rv = SSL_ech_get1_status(ssl, &inner, &outer);
      |       ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/vtls/openssl.c:4112:3: error: redundant return statement at the end of a function with a void return type [readability-redundant-control-flow]
 4111 | #endif
      | ~~~~~~
 4112 |   return;
      |   ^~~~~~~
 4113 | }
```
Ref: https://github.com/curl/curl/actions/runs/24642154148/job/72047919525?pr=21379#step:42:186

Cherry-picked from #21379

Closes #21380
2026-04-20 02:37:35 +02:00
Dag-Erling Smørgrav
759f2e5d97
tests: avoid infinite recursion for make check
The combination of a misspelled directory name and failing to check the
result of cd leads to infinite recursion as `make check` simply invokes
itself over and over.

Follow-up to 00887aee8c #18079
Closes #21378
2026-04-20 00:44:21 +02:00
Dag-Erling Smørgrav
6506693f0b
lib1960: fix test failure
On platforms where struct sockaddr has a length field, the current code
leaves it uninitialized, resulting in a test failure when valgrind is
used.

Closes #21377
2026-04-20 00:44:21 +02:00
Stefan Eissing
ebed4aaf01
ws: fix a blocking curl_ws_send() to report written length correctly
Fixes #21372
Reported-by: Yiwei Hou
Clkoses #21373
2026-04-20 00:06:55 +02:00
Viktor Szakats
9e38e06769
GHA: keep testing 3 as openssl-prev, bump mainline to 4
Ref: #21317
Ref: #21316

Closes #21376
2026-04-19 14:05:46 +02:00
renovate[bot]
23a06e1fb9
GHA: update dependency libressl/portable to v4.3.1
Closes #21365
2026-04-19 11:54:47 +02:00
Viktor Szakats
07e9f73f32
runtests: skip setting ed25519 SSH key format
`ssh-keygen -t ed25519` does not support PEM key format, and it
defaults to `RFC4716` which is what we want.

It affected GHA/windows tests that explicitly used ed25519 keys.

Also:
- GHA/windows: bump minimums to hopefully catch this early next time.
  1701a8319e #21353
- merge two Perl lines.

Reported-by: herbenderbler on github
Fixes #21360
Follow-up to acda4eae5e #21223

Closes #21374
2026-04-19 11:53:18 +02:00
renovate[bot]
fc7bd0704e
GHA: update dependency nghttp2/nghttp2 to v1.69.0
Closes #21375
2026-04-19 11:52:11 +02:00
Daniel Stenberg
54ded66618
docs/libcurl: improve easy setopt examples
- always assign the curl_easy_perform() return code (and declare
  the necessary 'result' variable for it)

- always call curl_easy_cleanup() on the created easy handles

Closes #21364
2026-04-18 23:34:39 +02:00
Daniel Stenberg
1cc683c859
CURLOPT_RTSP_SESSION_ID.md: expand the comment
Enhance the example code

Closes #21363
2026-04-18 23:32:09 +02:00
Daniel Stenberg
d129ff355d
CURLOPT_RTSP_SESSION_ID.md: minor language fix 2026-04-17 22:40:49 +02:00
Stefan Eissing
e0b2ec2400
pytest: check 429 handling
Add a "limit" handler to httpd that responds 429 after 5 requests and
then 429s all requests for 2 seconds. After which another 4 requests are
served before 429 strikes again.

Closes #21357
2026-04-17 22:17:50 +02:00
Daniel Stenberg
6daf4bc7e2
http: clear digest nonce on cross-orgin redirect
Verify in test 1966

Reported-by: Yalguun Tumenkhuu
Closes #21359
2026-04-17 22:16:08 +02:00
Daniel Stenberg
97cf21acd2
CURLOPT_RTSP_SESSION_ID.md: clarify reuse "dangers"
When re-using easy handles the session id stays, unless you do something
about it.

Closes #21358
2026-04-17 17:48:22 +02:00
Viktor Szakats
a06fd64974
unit1658: rename CURLcode to result
Closes #21356
2026-04-17 13:34:44 +02:00
Viktor Szakats
1701a8319e
GHA: bump required test minimums
Ref: https://testclutch.curl.se/static/reports/feature-matrix.html

Closes #21353
2026-04-17 13:10:43 +02:00
Viktor Szakats
5e45e82bc9
lib506: rename CURLcode variable to result
Closes #21352
2026-04-17 12:09:14 +02:00
Viktor Szakats
b515a71356
unit1675: fix -Wformat-signedness
Closes #21351
2026-04-17 12:09:14 +02:00
Stefan Eissing
70281e39be
haproxy: use correct ip version on client supplied address
When a user supplies an IP address to use for the HAPROXY protocol,
the IP version reported must be deduced from the address and has
no relation to the IP version used for the upstream connection.

Add test3220 to verify.

Fixes #21340
Reported-by: Fiona Klute
Closes #21341
2026-04-17 10:01:49 +02:00
Viktor Szakats
021a87cf81
vtls_scache: rename CURLcode variable to result
Closes #21346
2026-04-16 22:57:17 +02:00
Daniel Stenberg
bb771cec34
RELEASE-NOTES: synced 2026-04-16 22:56:46 +02:00
Stefan Eissing
a973377cd7
dnsd: implement HTTPS-RR with alpn pref and no-default-alpn
Support HTTPS records in dnsd that have ALPN preferences.

Add pytest test_22_* to verify that HTTPS record ALPN
preferencces take effect if the HTTPS resolve arrives in time.

Fix HTTPS eyeballing use of timeouts for second attempt. Also,
make an initial HTTP/1.1 attempt switch off HTTP/2.

Closes #21329
2026-04-16 22:53:20 +02:00
Stefan Eissing
1bf1f8ed6a
pytest_05_09: increase reliability
Test has been flaky due to not waiting for the test server to be
listening. On slow CI systems, the started thread is late and the curl
command gets a refused connection.

Closes #21337
2026-04-16 22:52:13 +02:00
Daniel Stenberg
885b553545
lib: rename more CURLcode variables to 'result'
Closes #21348
2026-04-16 22:50:52 +02:00
Daniel Stenberg
b4024bf808
http: clear credentials better on redirect
Verify with test 2506: netrc with redirect using proxy

Updated test 998 which was wrong.

Reported-by: Muhamad Arga Reksapati

Closes #21345
2026-04-16 21:51:41 +02:00
Viktor Szakats
3e0e2cc1ab
GHA: drop 3rd-party apt source docker.list
Seen on `ubuntu-slim` runners.

Also:
- extend to two jobs to `ls -l` package sources on both ubuntu-latest,
  ubuntu-24.04-arm, and ubuntu-slim.
- drop former stray apt source `ondrej-ubuntu-php-noble.sources`.
  It's no longer present on the image.

Closes #21344
2026-04-16 15:37:13 +02:00
renovate[bot]
0a6f815ff7
GHA/http3-linux: update dependency ngtcp2/ngtcp2 to v1.22.1
Closes #21343
2026-04-16 15:08:16 +02:00
Stefan Eissing
32a513e180
urlapi: same origin tests
Add new internal `curl_url_same_origin()` to check if a href has the
same origin as a base URL. Add test cases in test1675 and use this in
http2 push handling.

Closes #21328
2026-04-16 15:00:43 +02:00
Viktor Szakats
ce7174555d
build: adjust/add casts to fix -Wformat-signedness
Also adjust a mask in `mqttd.c`.

Follow-up to 548c16a824 #21335
Cherry-picked from #20848

Closes #21339
2026-04-16 11:38:14 +02:00
Daniel Stenberg
7e450cb80a
libssh2: allocate libssh2-friendly memory in kbd_callback
The function libssh2_userauth_keyboard_interactive_ex() calls the
callback and is documented to call free() on the memory returned to
libssh2 from the callback. libcurl can therefore not use the regular
curlx_strdup() for this, as that is not compatible in debug builds or
when curl_global_init_mem() is used.

Fixes #21336
Closes #21338
2026-04-16 10:35:32 +02:00
Viktor Szakats
548c16a824
build: fix -Wformat-signedness by adjusting printf masks
- sync printf masks with the passed value.
- fix a couple of casts.

Cherry-picked from #20848

Closes #21335
2026-04-16 10:32:50 +02:00
Daniel McCarney
54cc65595d
ci: update RUSTLS_VERSION 0.15.1 -> 0.15.2
Closes #21333
2026-04-15 23:34:33 +02:00
Daniel Stenberg
7fd35f4c34
unittests: cleanups
- make sure all UNITTEST prototypes mark in which unit test they are used,
  with "@unittest" markup

- make sure all UNITTEST functions do not use Curl_ prefix, as that is a
  prefix we use for global private functions and these functions are static
  and therefore not global and the prefix is wrong

- drop UNITTEST for functions not used in unit tests

- make the extract-unit-protos script highlight the above issues if found

- extract-unit-protos now also outputs the unit test number for all the
  generated protos in lib/unitprotos.h to aid readers. It also adds the source
  file and line number where the proto originates from.

- extract-unit-protos now exits with a non-zero value if any of the above
  warnings are triggered

- cf-dns: Curl_cf_dns_result => static cf_dns_result
- hostip: Curl_ipv6works => static ipv6works
- url: remove Curl_setup_conn() - not used anymore
- connect: Curl_timeleft_now_ms => UNITTEST timeleft_now_ms

Closes #21330
2026-04-15 23:32:38 +02:00
Viktor Szakats
94f14c54b0
renovate: use standard bump formula for OpenSSL
Cherry-picked from #21317

Closes #21323
2026-04-15 10:17:33 +02:00
Viktor Szakats
ce2f65c415
pytest: fix dnsd pid filename
Spotted by GitHub Code Quality

Follow-up to a5542c23e7 #21289

Closes #21321
2026-04-15 10:17:33 +02:00
Daniel Stenberg
fa057ea3de
transfer: clear the old autoreferer
Verify in test 2505

Closes #21322
2026-04-15 10:15:25 +02:00
Daniel Stenberg
c60d90cd65
urlapi: make parse_file() return zero data on error
This fixes the torture failures in 1675

Also, make it allocate the scheme *after* the path has been verified, so
that it is avoided in the common error cases.

Fixes #21326
Closes #21324
2026-04-15 10:14:09 +02:00
Viktor Szakats
36295347bc
GHA/linux: tidy up and extend address-sanitizer job options
Also tried `integer` which has hits, but too slow to be practical to run on
every commit.

Closes #20785
2026-04-14 23:39:42 +02:00
Viktor Szakats
880cd0c34b
GHA/non-native: bump cross-platform-actions to 1.0.0
Closes #21320
2026-04-14 23:30:55 +02:00
Viktor Szakats
2e5acc1b15
GHA/linux: rename mbedtls-prev env to align with Renovate
- rename version env to stay compatible with Renovate `matchStrings`.
- also switch to manual bumps.
  Bump rule was wrong, and deemed not worthy the complexity to fix.

Closes #21319
2026-04-14 18:54:23 +02:00
Viktor Szakats
7767b56862
GHA/http3-linux: bump OpenSSL 4 beta to final
Closes #21318
2026-04-14 18:54:23 +02:00
Daniel Stenberg
3a19987a87
urldata: move cookiehost to struct SingleRequest
To make it scoped for the single request appropriately.

Reported-by: Muhamad Arga Reksapati

Verify with libtest 2504: a custom Host *disabled* on reused handle

Closes #21312
2026-04-14 16:59:11 +02:00
Stefan Eissing
86f1e5b3f6
test dnsd: implement delayed responses
Add "Delay-A: ms", "Delay-AAAA: ms" and "Delay-HTTPS: ms" to the test
dnsd config and implement delayed response handling.

Add test_21_09 and test_21_10 to check that delayed responses connect
using the undelayed address family.

Closes #21299
2026-04-14 16:49:07 +02:00
Stefan Eissing
bcd94e2750
socks: use dns filter for resolving
Use a dns connection filter to resolve hostnames where their addresses
are locally resolved and forwarded to the SOCKS proxy.

This makes all improvements, like in #21295 for example, also apply
to socks connections. Curl_resolv() is now only called from a DNS
filter.

(ftp still calls Curl_resolv_blocking() in two places, one of which
 may be replaceable with a DNS filter as well to remove the block, tbd)

Closes #21297
2026-04-14 16:48:20 +02:00
Daniel Stenberg
0567e72168
tests: use %b64[] instead of "raw" base64
Closes #21313
2026-04-14 16:18:14 +02:00
Daniel Stenberg
188c2f166a
http: clear the proxy credentials as well on port or scheme change
Add tests 2009-2011 to verify switching between proxies with credentials
when the switch is driven by a redirect

Reported-by: Dwij Mehta

Closes #21304
2026-04-14 16:14:51 +02:00
Daniel Stenberg
9ceb3ff46a
urlapi: stop extracting hostname from file:// URLs on Windows
There is no reason we should treat this part different on Windows. Noe
anything except blank, localhost or 127.0.0.1 cause error there as well.

Also: fix query handling in urlencode_str

Closes #21296
2026-04-14 12:09:48 +02:00