]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
8 months agoGHA/macos: stop ignoring test 2100 with gcc
Viktor Szakats [Thu, 6 Mar 2025 00:57:55 +0000 (01:57 +0100)] 
GHA/macos: stop ignoring test 2100 with gcc

It runs fine now. Tested in all gcc-12 jobs after temporarly enabling
debug in them all (test 2100 requires debug-enabled).

Ref: c349bd668c91f2484ae21c0f361ddf497143093c #14097 (issue 15.)

Closes #16582

8 months agolib1156: pass longs to `curl_easy_setopt()`
Viktor Szakats [Wed, 5 Mar 2025 21:32:47 +0000 (22:32 +0100)] 
lib1156: pass longs to `curl_easy_setopt()`

To fix this test on macOS with the gcc compiler.

Also unignore test 1156 in GHA/macos.

Ref: c349bd668c91f2484ae21c0f361ddf497143093c #14097 (issue 15.)
Ref: 7b0240c07799c28dc84272f9e38e1092ce4cc498 #16539
Ref: 2ec00372a1fc7f27cd3a6c43e29007400acfe2b6 #16482

Closes #16579

8 months agocurl.h: switch `CURL_HTTP_VERSION*` enums to long constants
Viktor Szakats [Wed, 5 Mar 2025 21:32:28 +0000 (22:32 +0100)] 
curl.h: switch `CURL_HTTP_VERSION*` enums to long constants

It fixes tests 1539, and 2402, 2404 (for non-Secure Transport), on macOS
with the gcc compiler.

Also unignore these tests in GHA/macos for non-secure transport.

Ref: c349bd668c91f2484ae21c0f361ddf497143093c #14097 (issue 15.)
Ref: 7b0240c07799c28dc84272f9e38e1092ce4cc498 #16539
Ref: 2ec00372a1fc7f27cd3a6c43e29007400acfe2b6 #16482

Closes #16580

8 months agotests/certs: drop the empty .dhp files
Daniel Stenberg [Wed, 5 Mar 2025 14:28:06 +0000 (15:28 +0100)] 
tests/certs: drop the empty .dhp files

They are not used for anything.

Closes #16576

8 months agoGHA/macos: restore nghttp2 package for runtests HTTP/2 tests
Viktor Szakats [Wed, 5 Mar 2025 21:48:46 +0000 (22:48 +0100)] 
GHA/macos: restore nghttp2 package for runtests HTTP/2 tests

Regression from e7751571ebca9f18588a1905d7741a99be5ae96b #16517

8 months agoruntests: check and report if `diff` tool is missing
Viktor Szakats [Wed, 5 Mar 2025 17:38:57 +0000 (18:38 +0100)] 
runtests: check and report if `diff` tool is missing

To make it apparent which CI jobs are missing this tool, so we can
install it to improve the runtests log.

Correction to the followed-up commit: `diff` is not installed via the
`gcc` package but via `automake`. Meaning it needs be installed manually
for MSYS cmake jobs.

Follow-up to e6c78e18dac1da2027eac6dd3829a0fdbfa55501 #16571
Closes #16578

8 months agoGHA/windows: bump msys2 action, downgrade runtime for mingw tests
Viktor Szakats [Wed, 5 Mar 2025 13:55:30 +0000 (14:55 +0100)] 
GHA/windows: bump msys2 action, downgrade runtime for mingw tests

Bump msys2/setup-msys2 from 2.26.0 to 2.27.0. It brings the perf
regression experienced earlier with GfW and the pre-installed
MSYS2 on the GHA runner. Apply the runtime downgrade trick as
a workaround.

Fixes #16440
Fixes #16547
Closes #16574

8 months agoGHA/windows: stop ignoring most ignored test results
Viktor Szakats [Wed, 5 Mar 2025 10:50:02 +0000 (11:50 +0100)] 
GHA/windows: stop ignoring most ignored test results

These tests seem to be running no less stable now than others.
Stop ignoring their results to catch real issues.

These are consistently failing and remain on the ignore list:

in MSVC / vcpkg jobs:
```
FAIL-IGNORED 2302: 'WebSockets via callback (frame mode) + curl_ws_send()' WebSockets
FAIL-IGNORED 2303: 'WebSockets but gets a 200 back' WebSockets
FAIL-IGNORED 2307: 'WebSockets, overlong PING payload' WebSockets
```
https://github.com/curl/curl/actions/runs/13674664461/job/38233949942?pr=16570#step:14:4089
- Likely curl issues either in tests, server, or in WebSockets support.

in tests running under MSYS, affecting native mingw Windows builds only:
```
FAIL-IGNORED 612: 'SFTP post-quote remove file' SFTP, post-quote
[...]
 curl: (21) rm command failed: Operation failed
```
https://github.com/curl/curl/actions/runs/13674664461/job/38233952699?pr=16570#step:14:1378

in tests running under MSYS, affecting both MSYS and native mingw Windows builds:
```diff
FAIL-IGNORED 613: 'SFTP directory retrieval' SFTP, directory
[...]
 --- log/7/check-expected 2025-03-05 11:19:54.119658000 +0000
 +++ log/7/check-generated 2025-03-05 11:19:54.119658000 +0000
@@ -1,3 +1,3 @@
 d?????????    N U         U               N ???  N NN:NN asubdir[LF]
--rw?rw?rw?    1 U         U              37 Jan  1  2000 plainfile.txt[LF]
+-rw?r-?r-?    1 U         U              37 Jan  1  2000 plainfile.txt[LF]
 -r-?r-?r-?    1 U         U              47 Dec 31  2000 rofile.txt[LF]
```
https://github.com/curl/curl/actions/runs/13674664461/job/38233950866?pr=16570#step:14:1316
- Possibly a curl test portabibility, Perl or MSYS issue.

in Cygwin tests:
```
FAIL-IGNORED 615: 'SFTP put remote failure' SFTP, SFTP put, FAILURE
```
https://github.com/curl/curl/actions/runs/13674664461/job/38233949428?pr=16570#step:12:3817

Follow-up to adcfd4fb3e9be1de0e506728066bea2aaa53c394 #16553
Ref: #14854
Closes #16570

8 months agotool_getparam: parse_header() without strtok
Daniel Stenberg [Wed, 5 Mar 2025 12:43:48 +0000 (13:43 +0100)] 
tool_getparam: parse_header() without strtok

Read a provided header file line-by-line instead. Avoids strtok(),
avoids a possibly quite large malloc for the entire file.

Closes #16572

8 months agorequest: clear sendbuf_hds_len when resetting request bufq
Ondřej Hlavatý [Wed, 5 Mar 2025 13:09:26 +0000 (14:09 +0100)] 
request: clear sendbuf_hds_len when resetting request bufq

Without this, any usage of sendbuf_hds_len on a retried request is
wrong. We noticed by getting debug callbacks with incorrect header len.
We did not figure out how to trigger the retries in a test environment
though.

Closes #16573

8 months agognutls: set priority via --ciphers
Stefan Eissing [Tue, 4 Mar 2025 14:50:12 +0000 (15:50 +0100)] 
gnutls: set priority via --ciphers

No longer ignore the `--ciphers` argument in gnutls curl builds, but use
it to set the gnutls priority string.

When the set ciphers start with '+', '-' or '!', it is *appended* to the
curl generated priority string. Otherwise it replaces the curl one
completely.

Add test_17_18 to check various combinations.

Closes #16557

8 months agoGHA/windows: always install diffutils for MSYS/mingw, required by `runtests`
Viktor Szakats [Wed, 5 Mar 2025 11:56:40 +0000 (12:56 +0100)] 
GHA/windows: always install diffutils for MSYS/mingw, required by `runtests`

To include the expected/generated diffs in the error log.

Also make it explicit for pure MSYS, though it was installed by `gcc`
before this patch.

Closes #16571

8 months agotool_dirhie: create dir hierarchy without strtok
Daniel Stenberg [Wed, 5 Mar 2025 08:10:21 +0000 (09:10 +0100)] 
tool_dirhie: create dir hierarchy without strtok

And use dynbuf

Closes #16566

8 months agotool_paramhlp: do --proto parsing without strtok
Daniel Stenberg [Wed, 5 Mar 2025 09:02:36 +0000 (10:02 +0100)] 
tool_paramhlp: do --proto parsing without strtok

Saves a strdup. Avoids a banned function.

Closes #16567

8 months agohttp_aws_sigv4: cannot be used for proxy
Daniel Stenberg [Wed, 5 Mar 2025 09:55:56 +0000 (10:55 +0100)] 
http_aws_sigv4: cannot be used for proxy

Make sure it is never attempted.

Reported-by: Philippe Antoine
Closes #16569

8 months agotests: make sure 'commands.log' is generated in the correct logdir
Daniel Stenberg [Wed, 5 Mar 2025 09:40:44 +0000 (10:40 +0100)] 
tests: make sure 'commands.log' is generated in the correct logdir

Closes #16568

8 months agohttp2: detect session being closed on ingress handling
Stefan Eissing [Tue, 4 Mar 2025 11:31:32 +0000 (12:31 +0100)] 
http2: detect session being closed on ingress handling

nghttp2 will on its own send GOAWAY frames, closing the connection, when
internal processing of frames runs into errors. This may not become
visible in a direct error code from a call to nghttp2.

Check for session being closed on ingress processing (on sending, we
already did that) and report an error if so. In addition, monitor
outgoing GOAWAY not initiated by us so that the user will get a fail
message when that happens.

Add some more long response header tests.

Closes #16544

8 months agohttp2: add on_invalid_frame callback for error detection
Stefan Eissing [Tue, 4 Mar 2025 10:48:04 +0000 (11:48 +0100)] 
http2: add on_invalid_frame callback for error detection

When the server sends HEADER/CONTINUATION frames that exceed nghttp2's
size, this error is being reported via the on_invalid_frame_recv
callback. Without registering there, it will go unnoticed.

RST the stream when such a frame is encountered.

Closes #16544

8 months agohttp2: reset stream on response header error
Stefan Eissing [Mon, 3 Mar 2025 13:05:34 +0000 (14:05 +0100)] 
http2: reset stream on response header error

We send a GOAWAY, but some servers ignore that and happily continue
sending the stream response. RST the stream when response header errors
are encountered.

Fixes #16535
Reported-by: Peng-Yu Chen
Closes #16544

8 months agosrc: avoid strdup on platforms not doing UTF8 conversions
Daniel Stenberg [Tue, 4 Mar 2025 16:50:37 +0000 (17:50 +0100)] 
src: avoid strdup on platforms not doing UTF8 conversions

... and use more const strings.

Closes #16560

8 months agodocs: adapt to removed --with-random
Orgad Shaneh [Wed, 5 Mar 2025 07:09:24 +0000 (09:09 +0200)] 
docs: adapt to removed --with-random

Amends 269fdd4c6ed5d837d57448ac977f6f300968df15.

Closes #16565

8 months agotool_getparam: parse --trace-config without strdup()/free()
Daniel Stenberg [Tue, 4 Mar 2025 16:12:46 +0000 (17:12 +0100)] 
tool_getparam: parse --trace-config without strdup()/free()

Closes #16559

8 months agoGHA/windows: drop running tests with dl-mingw 7.3.0 due to flakiness
Viktor Szakats [Wed, 5 Mar 2025 01:33:19 +0000 (02:33 +0100)] 
GHA/windows: drop running tests with dl-mingw 7.3.0 due to flakiness

This job was never stable. Bumping to -j8 (from -j4) possibly made it
flakier: 032447e6249bf87958b16eb0c97874490b711ec7 #16271

Keep this job for build tests and drop running tests to improve the CI
experience and save CI time.

It's also a simple build with no dependencies. CI continues to build
a similar job with 9.5.0, which is more stable.

It remains a puzzle why builds with this toolchain (7.3.0 win32 threads
mingw-builds) is flakier and requires more test exceptions than the
indentical build with a slightly different build/version of
the toolchain (9.5.0 posix threads winlibs_mingw).

Ref: #14854
Closes #16564

8 months agobuild: tidy-ups around `inet_pton`
Viktor Szakats [Wed, 5 Mar 2025 00:31:58 +0000 (01:31 +0100)] 
build: tidy-ups around `inet_pton`

- cmake: make the `inet_pton`/`inet_ntop` detection codepath explicit
  for WinCE. To not rely on an empty `HAVE_WIN32_WINNT`.

- tests/server/mqttd: drop `inet_pton` header and lib source.

- tests/server: move `inet_pton` lib source to a variable.

Closes #16563

8 months agotool_getparam: do parse_upload_flags without the alloc/free
Daniel Stenberg [Tue, 4 Mar 2025 14:32:19 +0000 (15:32 +0100)] 
tool_getparam: do parse_upload_flags without the alloc/free

Follow-up to 6758aa722ddf5a6

Closes #16552

9 months agoGHA: brew `--no-lock` an invalid option now, drop
Viktor Szakats [Tue, 4 Mar 2025 18:17:13 +0000 (19:17 +0100)] 
GHA: brew `--no-lock` an invalid option now, drop

```
Error: invalid option: --no-lock
```
Ref: https://github.com/curl/curl/actions/runs/13659344413/job/38186577572#step:2:655

Closes #16561

9 months agotests/server: replace `strerror` with `sstrerror` in socksd
Viktor Szakats [Tue, 4 Mar 2025 17:32:51 +0000 (18:32 +0100)] 
tests/server: replace `strerror` with `sstrerror` in socksd

To follow the `errno` -> `SOCKERRNO` update.

Missed from the previous commit.

Follow-up to adcfd4fb3e9be1de0e506728066bea2aaa53c394 #16553

9 months agotests/server: replace `errno` with `SOCKERRNO` in sockfilt, socksd, sws
Viktor Szakats [Tue, 4 Mar 2025 14:32:18 +0000 (15:32 +0100)] 
tests/server: replace `errno` with `SOCKERRNO` in sockfilt, socksd, sws

To correctly read the winsock2 result code on Windows.

Follow-up to de2126b1821fecbc1f66715714cb34c5c2d14ec4 #5241
Ref: https://github.com/curl/curl/commit/5e855bbd18f84a02c951be7cac6188276818cdac#r38507132
Ref: #14854
Closes #16553

9 months agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 4 Mar 2025 16:27:28 +0000 (17:27 +0100)] 
RELEASE-NOTES: synced

9 months agocf-socket: remove empty switch
Michał Antoniak [Tue, 4 Mar 2025 14:43:32 +0000 (15:43 +0100)] 
cf-socket: remove empty switch

Closes #16555

9 months agotests/data/Makefile.am: fix trailing slash issue
Daniel Stenberg [Tue, 4 Mar 2025 14:57:51 +0000 (15:57 +0100)] 
tests/data/Makefile.am: fix trailing slash issue

Follow-up from 6758aa722ddf5a6db819b753d962

Fixes #16556
Closes #16558

9 months agoIMAP: add CURLOPT_UPLOAD_FLAGS and --upload-flags
tiymat [Sat, 11 Jan 2025 20:50:12 +0000 (17:20 -0330)] 
IMAP: add CURLOPT_UPLOAD_FLAGS and --upload-flags

Set properties on the uploaded resource.

Test 3209 and 3210 verify.

Closes #15970

9 months agolibssh2: print user with verbose flag
Samuel Dionne-Riel [Fri, 21 Feb 2025 19:24:48 +0000 (14:24 -0500)] 
libssh2: print user with verbose flag

This change:

 - Breaks out the existing print out of the LIBSSH2_DEBUG compile-time
   flag
 - Adds (single) quotation marks around the string to better expose the
   actual value
 - Adds a NULL print if not set, mirroring other verbose prints in
   libssh2

Why was this done?

I was trying out the `sftp` option in `curl`, and found myself hitting
an issue where I was not able to get curl to tell me which username it
was using to connect to a host.

With this change, the `User: ` line is printed with `-v`, just like
other SSH verbose prints.

Instead of using the pattern used with *SSH MD5 public key*, where a
ternary is used to print `NULL` on NULL values, it is using a different
branch to add quotes around the string value.

The quotes around the string value are used to better expose to the user
an empty string value, compared to "no-value".

Closes #16430

9 months agolib: fix two curlx_strtoofft invokes
Daniel Stenberg [Mon, 3 Mar 2025 21:40:43 +0000 (22:40 +0100)] 
lib: fix two curlx_strtoofft invokes

- cf-h1-proxy: check return code and return error if the parser fails

- http: make the Retry-After parser check for a date string first then
  number to avoid mis-parsing the begining of a date as a number

Closes #16548

9 months agotests/server: round of tidy-ups
Viktor Szakats [Sun, 8 Sep 2024 14:18:57 +0000 (16:18 +0200)] 
tests/server: round of tidy-ups

Dedupe, merge macros, globals, make symbols local where possible.
Drop unused macros and headers. Drop `DEFAULT_LOGFILE` macro in favour
of `--logfile` command-line option.

Ref: #15000
Closes #16525

9 months agotidy-up: alphasort lists, indentation/whitespace, pp
Viktor Szakats [Tue, 18 Feb 2025 13:24:59 +0000 (14:24 +0100)] 
tidy-up: alphasort lists, indentation/whitespace, pp

- cmake/win32-cache: alphasort items.
- configure.ac: alphasort `CURL_CHECK_FUNC_*` checks.
- configure.ac: alphasort `AC_CHECK_FUNCS` checks.
- prefer `#ifdef`/`#ifndef`.
- lib/asyn-thread: drop unused value of `USE_HTTPSRR_ARES`.
- lib/formdata: drop unused header `libgen.h`.
- indentation, whitespace.

Closes #16490

9 months agocmake: exclude `-MP` for `clang-cl` again
Viktor Szakats [Mon, 3 Mar 2025 23:26:45 +0000 (00:26 +0100)] 
cmake: exclude `-MP` for `clang-cl` again

To avoid this warning/error (seen with Ninja generator):
```
clang-cl: warning: argument unused during compilation: '-MP' [-Wunused-command-line-argument]
```

Curious why CI missed it. Maybe due to using a Visual Studio generator.

Regression from e0fd5790d94feb239f7d2457578f2a34c85cdd65 #16004
Closes #16550

9 months agocmake: allow `CURL_STATIC_CRT` with UCRT VS2015+ builds
Viktor Szakats [Fri, 28 Feb 2025 12:17:39 +0000 (13:17 +0100)] 
cmake: allow `CURL_STATIC_CRT` with UCRT VS2015+ builds

After this patch, we're back to 8.12.1, but disallowing
`CURL_STATIC_CRT=ON` with shared curl exe built with VS2013 or older.
Because those may crash. A stable reprducer is with `ENABLE_DEBUG=ON`
and calling `curl.exe -V`.

You can pass the necessary CMake and MSVC linker options manually,
to get around this condition.

Shared build with static UCRT may be crashing too, depending on
conditions. Consult the documentation about limitations of static CRT:
https://learn.microsoft.com/cpp/c-runtime-library/crt-library-features

Follow-up to 049352dd80e1ab73945c49a3bac2e4a08db32f98 #16516
Follow-up to edfa537100d6b5d2ac1b829c66757880afe59407 #16456
Ref: #16394
Closes #16522

9 months agoftp: fix comment
Jay Satiro [Sun, 2 Mar 2025 20:12:27 +0000 (15:12 -0500)] 
ftp: fix comment

- Explain ftp_conn's newhost and newport in the struct definition.

Follow-up to 1485e892 which changed the order of some struct members to
reduce struct size.

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

9 months agohttp_chunks: replace a strofft call with curl_str_hex
Daniel Stenberg [Thu, 27 Feb 2025 22:12:01 +0000 (23:12 +0100)] 
http_chunks: replace a strofft call with curl_str_hex

Make it not skip leading blanks. There should not be any.

Closes #16546

9 months agodocs/cmdline-opts: unify HTTP version style in --help output
Daniel Stenberg [Mon, 3 Mar 2025 11:13:38 +0000 (12:13 +0100)] 
docs/cmdline-opts: unify HTTP version style in --help output

$ curl -h all | grep -- --http

Now:

     --http0.9                      Allow HTTP/0.9 responses
 -0, --http1.0                      Use HTTP/1.0
     --http1.1                      Use HTTP/1.1
     --http2                        Use HTTP/2
     --http2-prior-knowledge        Use HTTP/2 without HTTP/1.1 Upgrade
     --http3                        Use HTTP/3
     --http3-only                   Use HTTP/3 only

Before:

     --http0.9                      Allow HTTP 0.9 responses
 -0, --http1.0                      Use HTTP 1.0
     --http1.1                      Use HTTP 1.1
     --http2                        Use HTTP/2
     --http2-prior-knowledge        Use HTTP 2 without HTTP/1.1 Upgrade
     --http3                        Use HTTP v3
     --http3-only                   Use HTTP v3 only

Closes #16542

9 months agotool_operate: remove unnecessary (long) typecasts
Daniel Stenberg [Mon, 3 Mar 2025 11:08:22 +0000 (12:08 +0100)] 
tool_operate: remove unnecessary (long) typecasts

Closes #16540

9 months agopytest: check overlarge response headers
Stefan Eissing [Mon, 3 Mar 2025 11:14:20 +0000 (12:14 +0100)] 
pytest: check overlarge response headers

Add test_01 11, 12 and 13 to check various very long response
headers (accumulated and single) with http/1.1 and h2.

Closes #16541

9 months agomulti_ev: use `mid` instead of `id` for transfer hashes
Stefan Eissing [Mon, 3 Mar 2025 13:39:47 +0000 (14:39 +0100)] 
multi_ev: use `mid` instead of `id` for transfer hashes

`data->id` is unique in the same connection pool, but a multi may
involved more than one pool. `data->mid` is unique inside the multi and
since multi_ev lives inside one multi, the `mid` is the right thing to
use.

Closes #16545

9 months agocurl.h: convert CURLUSESSL* names to defines
Daniel Stenberg [Mon, 3 Mar 2025 10:42:15 +0000 (11:42 +0100)] 
curl.h: convert CURLUSESSL* names to defines

So that we can use L suffix.

Follow-up to 2ec00372a1fc7f27cd3a6c43e29007400acfe2b6

Closes #16539

9 months agolib: add CURLFOLLOW_OBEYCODE and CURLFOLLOW_FIRSTONLY
Daniel Stenberg [Mon, 3 Mar 2025 10:35:48 +0000 (11:35 +0100)] 
lib: add CURLFOLLOW_OBEYCODE and CURLFOLLOW_FIRSTONLY

With this change, the argument passed to the CURLOPT_FOLLOWLOCATION
option is now instead a "mode" instead of just a boolean. Documentation
is extended to describe the two new modes.

Test 1571 to 1581 verify.

Closes #16473

9 months agolib: replace while(ISBLANK()) loops with Curl_str_passblanks()
Daniel Stenberg [Thu, 27 Feb 2025 22:26:54 +0000 (23:26 +0100)] 
lib: replace while(ISBLANK()) loops with Curl_str_passblanks()

- replace several ISSPACE() with ISBLANK(), since the former also skips
  CR and LF which in most cases should not occur where this macro is
  used

- after this commit, there is no ISSPACE() user left in libcurl code, but
  unfortunately tool and test code use the macro so it cannot be removed.

Closes #16520

9 months agohttp2: enhance error messages on Curl_dyn* upon receiving headers
Peng-Yu Chen [Sun, 2 Mar 2025 17:15:21 +0000 (17:15 +0000)] 
http2: enhance error messages on Curl_dyn* upon receiving headers

This is a partial fix of #16535. The error message format is borrowed
from the existing code[1].

Sample message before:
    curl: (56) process_pending_input: nghttp2_session_mem_recv() returned -902:The user callback function failed

Sample message after:
    curl: (56) Error receiving HTTP2 header: 100(A value or data field grew larger than allowed)

[1]: https://github.com/curl/curl/blob/df672695e5992ad9b99819e9950de682e243cb48/lib/http2.c#L1999-L2000

Closes #16536

9 months agoOpenSSL/quictls: add support for TLSv1.3 early data
Stefan Eissing [Tue, 25 Feb 2025 14:07:19 +0000 (15:07 +0100)] 
OpenSSL/quictls: add support for TLSv1.3 early data

based on #16450

Adds support for TLSv1.3 early data for TCP and QUIC via ngtcp2.

Closes #16477

9 months agoGHA: update dependency nghttp2/nghttp2 to v1.65.0
renovate[bot] [Sun, 2 Mar 2025 08:05:16 +0000 (08:05 +0000)] 
GHA: update dependency nghttp2/nghttp2 to v1.65.0

Tweaked-by: Viktor Szakats
Closes #16534

9 months agoGHA: update actions/cache digest to d4323d4
renovate[bot] [Thu, 27 Feb 2025 16:21:03 +0000 (16:21 +0000)] 
GHA: update actions/cache digest to d4323d4

Closes #16510

9 months agoGHA: update actions/download-artifact digest to cc20338
renovate[bot] [Wed, 26 Feb 2025 15:22:11 +0000 (15:22 +0000)] 
GHA: update actions/download-artifact digest to cc20338

Closes #16500

9 months agodocker: update debian:bookworm-slim Docker digest to ceac69a
renovate[bot] [Tue, 25 Feb 2025 07:01:14 +0000 (07:01 +0000)] 
docker: update debian:bookworm-slim Docker digest to ceac69a

Closes #16471

9 months agoGHA: update actions/upload-artifact digest to 4cec3d8
renovate[bot] [Fri, 21 Feb 2025 19:55:07 +0000 (19:55 +0000)] 
GHA: update actions/upload-artifact digest to 4cec3d8

Closes #16431

9 months agoshutdowns: split shutdown handling from connection pool
Stefan Eissing [Thu, 27 Feb 2025 14:47:30 +0000 (15:47 +0100)] 
shutdowns: split shutdown handling from connection pool

Further testing with timeouts in event based processing revealed that
our current shutdown handling in the connection pool was not clear
enough. Graceful shutdowns can only happen inside a multi handle and it
was confusing to track in the code which situation actually applies. It
seems better to split the shutdown handling off and have that code
always be part of a multi handle.

Add `cshutdn.[ch]` with its own struct to maintain connections being
shut down. A `cshutdn` always belongs to a multi handle and uses that
for socket/timeout monitoring.

The `cpool`, which can be part of a multi or share, either passes
connections to a `cshutdn` or terminates them with a one-time, best
effort.

Add an `admin` easy handle to each multi and share. This is used to
perform all maintenance operations where no "real" easy handle is
available. This solves the problem that the multi admin handle requires
some additional initialisation (e.g. timeout list).

The share needs its admin handle as it is often cleaned up when no other
transfer or multi handle exists any more. But we need a `data` in almost
every call.

Fix file:// handling of errors when adding a new connection to the pool.

Changes in `curl` itself:

- for parallel transfers, do not set a connection pool in the share,
  rely on the multi's connection pool instead. While not a requirement
  for the new `cshutdn` to work, this is

  a) helpful in testing to trigger graceful shutdowns
  b) a broader code coverage of libcurl via the curl tool

- on test_event with uv, cleanup the multi handle before returning from
  parallel_event(). The uv struct is on the stack, cleanup of the multi
  later will crash when it tries to register sockets. This is a "eat
  your own dogfood" related fix.

Closes #16508

9 months agoGHA: update dependency awslabs/aws-lc to v1.47.0
renovate[bot] [Sat, 1 Mar 2025 01:05:37 +0000 (01:05 +0000)] 
GHA: update dependency awslabs/aws-lc to v1.47.0

Closes #16530

9 months agoasyn: bring back port to the Curl_async struct
Daniel Stenberg [Sat, 1 Mar 2025 17:22:59 +0000 (18:22 +0100)] 
asyn: bring back port to the Curl_async struct

To make sure we store and use the correct port used for this particular
lookup.

Partial revert of 8ded8e5f3f

Fixes #16531
Reported-by: Jay Satiro
Closes #16532

9 months agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 1 Mar 2025 17:44:56 +0000 (18:44 +0100)] 
RELEASE-NOTES: synced

9 months agohash_offt: standalone hash for curl_off_t
Stefan Eissing [Sun, 23 Feb 2025 11:20:17 +0000 (12:20 +0100)] 
hash_offt: standalone hash for curl_off_t

Add a standalong hash table for curl_offt_t as key. This allows a
smaller memory footprint and faster lookups as we do not need to deal
with variable key lengths.

Use in all places we had the standard hash for this purpose.

Closes #16442

9 months agopytest: test negotiate with http proxy
Stefan Eissing [Fri, 31 Jan 2025 10:25:15 +0000 (11:25 +0100)] 
pytest: test negotiate with http proxy

Fixes #14973
Reported-by: stevenpackardblp on github
When curl negotiated with a http: proxy for a https: request, it
wrongly believed there must be an SSL filter present, which during
CONNECT, there is not.

25b445e fixed this. This PR adds a pytest case for the setup.

Closes #16136

9 months agoexamples: prefer `return` over `exit()` (cont.)
Viktor Szakats [Fri, 28 Feb 2025 16:44:55 +0000 (17:44 +0100)] 
examples: prefer `return` over `exit()` (cont.)

Some of these calls were not in callbacks. These examples may leak
handles.

Also fix some whitespace.

Follow-up to 08c7c937dc0dbd1f92f73360e5d8b2bb2ee6afa8 #16507
Closes #16524

9 months agowinbuild: reduce command-line length by dropping whitespace
Viktor Szakats [Fri, 28 Feb 2025 22:56:01 +0000 (23:56 +0100)] 
winbuild: reduce command-line length by dropping whitespace

Keep the `@for %%i in [...]` lines within limits by stripping whitespace
from the input `.c` source lists read from `Makefile.inc`. To avoid this
error after adding a new `.c` source:
```
configuration name: libcurl-vc14-x64-release-dll-ssl-dll-ipv6-sspi
NMAKE : fatal error U1095: expanded command line 'for %i in (altsvc.obj            amigaos.obj
           asyn-ares.obj         asyn-thread.obj       base64.obj            bufq.obj
              bufref.obj            cf-h1-proxy.obj       cf-h2-proxy.obj       cf-haproxy.obj [...]
  vssh/wolfssh.obj) do @echo ..\builds\libcurl-vc14-x64-release-dll-ssl-dll-ipv6-sspi-obj-lib/%i \
                   ' too long
Stop.
Command exited with code 2
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/51605338/job/dqg6qtebtscb279g#L44

Reported-by: Stefan Eissing
Bug: https://github.com/curl/curl/pull/16508#issuecomment-2690443409
Fixes #16521
Closes #16528

9 months agodocs: vulnerabilities in debug code are not eligible for a bounty
Dan Fandrich [Fri, 28 Feb 2025 20:36:14 +0000 (12:36 -0800)] 
docs: vulnerabilities in debug code are not eligible for a bounty

This is code that is off by default and is therefore treated as a
regular bug.

Ref: #16526
Closes #16527

9 months agoGHA/macos: use quictls in some jobs, other small improvements
Viktor Szakats [Fri, 28 Feb 2025 02:50:29 +0000 (03:50 +0100)] 
GHA/macos: use quictls in some jobs, other small improvements

- enable quictls in autotools and cmake jobs. autotools requires
  a workaround due to wrong libpath in the quictls pkg-config.
  nghttp3 is offered by Homebrew, but not ngtcp2, to enable H3.

- install `libnghttp2` rather than `nghttp2`.
  `libnghttp2` is preinstalled and smaller. It also avoids detecting
  `nghttpx`, which confuses `pytest`.

- limit `brew unlink openssl` to libressl/quictls jobs.

Closes #16517

9 months agotests: fix comment in lib533
Zhaoming Luo [Fri, 28 Feb 2025 13:06:34 +0000 (21:06 +0800)] 
tests: fix comment in lib533

Closes #16523

9 months agognutls: fix use of pkcs11 urls for keys/certs
Stefan Eissing [Tue, 25 Feb 2025 09:31:43 +0000 (10:31 +0100)] 
gnutls: fix use of pkcs11 urls for keys/certs

Fixes #16249
Forwarded-to-us-by: Carlos Henrique Lima Melara
Always use `gnutls_certificate_set_x509_key_file2()` for loading keys
and certificates, even without a password, since this function support
pkcs11 urls.

Thanks to @tatsuhiro-t for finding this out.
Help-by: Tatsuhiro Tsujikawa
Closes #16472

9 months agocmake: allow `CURL_STATIC_CRT` with shared libcurl and no curl exe
Viktor Szakats [Fri, 28 Feb 2025 03:56:12 +0000 (04:56 +0100)] 
cmake: allow `CURL_STATIC_CRT` with shared libcurl and no curl exe

Follow-up to edfa537100d6b5d2ac1b829c66757880afe59407 #16456

Closes #16516

9 months agotidy-up: prefer `return` over `exit()`, fix fallouts
Viktor Szakats [Thu, 27 Feb 2025 10:32:43 +0000 (11:32 +0100)] 
tidy-up: prefer `return` over `exit()`, fix fallouts

To avoid breaking the control flow and align to majority of code
already using `return`.

`exit()` has the side-effect of suppressing leak detection in cases.
Fix fallouts detected after switching to `return`.

- configure:
  - fix `getaddrinfo` run test to call `freeaddrinfo()` to pacify ASAN,
    and call `WSACleanup()` to deinit winsock2.
  - fix `getifaddrs` run test to call `freeifaddrs()` to pacify ASAN.
- tests/server:
  - setup `atexit(win32_cleanup)` via `win32_init()`.
  - return 2 instead of 1 on winsock2 init failures.
  - sws: goto cleanup instead of `exit()` in `http_connect()`.
    Follow-up to 02dfe7193704817184b522888ffa926e6b73f648 #7235
- tests/client/http:
  - cleanup memory to pacify ASAN in `h2-upgrade-extreme`,
    `tls-session-reuse`.
- examples:
  - block_ip: fix memory leak reported by CI.
  - http2-upload: avoid handle leaks.

Untouched `exit()` calls, made from callbacks:
- docs/examples: ephiperfifo.c, ghiper.c, hiperfifo.c
- tests/libtest: lib582.c, lib655.c, lib670.c
- tests/server: tftpd.c

Closes #16507

9 months agotest488: set --output-dir
Stefan Eissing [Fri, 28 Feb 2025 08:54:21 +0000 (09:54 +0100)] 
test488: set --output-dir

Otherwise the downloaded files land in the `tests` directory and
show up in git status.

Closes #16519

9 months agocmake: drop `HAVE_C_FLAG_Wno_long_double` logic for ancient Apple gcc
Viktor Szakats [Thu, 27 Feb 2025 22:54:47 +0000 (23:54 +0100)] 
cmake: drop `HAVE_C_FLAG_Wno_long_double` logic for ancient Apple gcc

The initial curl CMake commit introduced it in 2009-04-02 via
4c5307b45655ba75ab066564afdc0c111a8b9291. Suppressing a stray
`-Wlong-double` warning in `mprintf.c`. This was before Apple switched
to clang, and likely affected the Apple distributed GCC, version 4.2.1
at the time. It applied the workaround to CMake builds only, though
the issue seems build-tool agnostic. Yet, it was not suppressed or
reported for autotools builds.

For these reasons this logic seems obsolete and this patch drops it with
no replacement. It saves a feature detection for GCC builds for macOS.

In PR sub-commits I added (and reverted) in-source suppression. In case
it becomes necessary, that should fix it for all build tools.

Closes #16513

9 months agocmake: improve httpd detection for pytest
Viktor Szakats [Thu, 27 Feb 2025 19:22:35 +0000 (20:22 +0100)] 
cmake: improve httpd detection for pytest

Look for `httpd` in addition to `apache2`, like `./configure` does.
It fixes detection with macOS Homebrew for example.

Closes #16515

9 months agoGHA/linux: improve 'test configs' step, don't set `TFLAGS` for pytest
Viktor Szakats [Thu, 27 Feb 2025 17:58:18 +0000 (18:58 +0100)] 
GHA/linux: improve 'test configs' step, don't set `TFLAGS` for pytest

- omit comments from th config dump, show filenames for each line.
- `TFLAGS` is not used by pytest, don't set it.

Closes #16514

9 months agoasyn-ares: use the correct port number
Daniel Stenberg [Thu, 27 Feb 2025 20:54:14 +0000 (21:54 +0100)] 
asyn-ares: use the correct port number

Only triggers with old c-ares versions.

Follow-up to 8ded8e5f3f4b6586

Closes #16511

9 months agoGHA/linux: merge two package install steps
Viktor Szakats [Thu, 27 Feb 2025 16:01:17 +0000 (17:01 +0100)] 
GHA/linux: merge two package install steps

Merge pytest prereq package install step into the main package install
step, to save install time.

Closes #16509

9 months agourldata: remove 'hostname' from struct Curl_async
Daniel Stenberg [Mon, 24 Feb 2025 12:58:38 +0000 (13:58 +0100)] 
urldata: remove 'hostname' from struct Curl_async

It is unnecessary duplicated information, as the host name being
resolved is already present in conn->host.

Closes #16451

9 months agoGHA: spellcheck curl symbols better
Daniel Stenberg [Thu, 27 Feb 2025 10:17:42 +0000 (11:17 +0100)] 
GHA: spellcheck curl symbols better

This now makes sure to trim off exact matches for curl symbols and long
curl commanad line options instead of using pattern matching as before.
This should catch typoed names (that still follow the pattern) better.

The cleanspell.pl script is no longer used. cleancmd.pl is used for all
markdown files.

Closes #16504

9 months agodocs: minor edits to please the new spellchecker regime
Daniel Stenberg [Thu, 27 Feb 2025 10:20:03 +0000 (11:20 +0100)] 
docs: minor edits to please the new spellchecker regime

9 months agoruntests: accept `CURL_DIRSUFFIX` without ending slash
Viktor Szakats [Thu, 27 Feb 2025 01:38:07 +0000 (02:38 +0100)] 
runtests: accept `CURL_DIRSUFFIX` without ending slash

Follow-up to 3585796049aa5c8cc2ef4e4fa3ac289b0d5ed85c #16452
Closes #16506

9 months agoappveyor: run VS2008 job with old CMake 3.12.2
Viktor Szakats [Wed, 26 Feb 2025 21:35:09 +0000 (22:35 +0100)] 
appveyor: run VS2008 job with old CMake 3.12.2

Switch VS2008 job the oldest runner machine. It adds the oldest CMake to
the Windows mix, from 2018-11-30. Not a beauty, missing support for `-B`
and Unity, but it's a version curl supports. It's newer than Old Linux.
The previous oldest was 3.16.2. It remains used with VS2010-VS2017.

Also:
- fix VS2008 job to actually build examples.
- switch VS2019 job to OpenSSL 1.1.0 that wasn't tested before.
  Migrate OpenSSL 1.0.2 to the VS2008 job.
- measure run time of individual build steps.

Follow-up to 01c25e3b008085a7944f3eea4971f5eb469a6c49 #16458
Closes #16505

9 months agoGHA: tidy up parallel options, improve performance for some jobs
Viktor Szakats [Wed, 26 Feb 2025 20:40:59 +0000 (21:40 +0100)] 
GHA: tidy up parallel options, improve performance for some jobs

- replace `--parallel <n>` and `-j<n>` for individual commands with
  `MAKEFLAGS`, for jobs not yet doing it.
  This enables parallel builds in distcheck / maketgz-and-verify-in-tree,
  where `-j` option was missing.
- add `--parallel` for iOS Xcode job for improved performance.
- drop redundant `-j5` for Android jobs.
- drop stray `cmake --config` options from single-target jobs (cygwin,
  msys/mingw, dl-mingw, non-native). Drop redundant
  `CMAKE_RUNTIME_OUTPUT_DIRECTORY_*` settings too.
- GHA/windows: add timeout for package install steps where missing.
- GHA/non-native: specify target type explicitly for iOS cmake jobs.
  Xcode default was already Debug, single-target default was generic,
  now it's Release, with unity batch to keep it fast.

`MAKEFLAGS` is necessary for autotools jobs and CMake jobs using
the default (GNU Make) generator. It's ignored by Ninja and other tools.
`cmake --parallel` is still necessary for jobs with Visual Studio or
Xcode generators. Parallelism is 5 for GHA Linux and Windows runners,
4 for macOS, 3 for VMs, 2 for AppVeyor.

Closes #16502

9 months agourlapi: fix redirect from file:// with query, and simplify
Daniel Stenberg [Wed, 26 Feb 2025 10:13:36 +0000 (11:13 +0100)] 
urlapi: fix redirect from file:// with query, and simplify

- fix redirect from file:// URL with query part
- find_host_sep() simplify
- urlencode_str() simplify
- redirect_url() simplify
- made more const char *
- add more redirect URL test cases to test 1560

Closes #16498

9 months agobuild: set `-O3` and tune WinCE in CI, fix `getpart`, `vtls_scache` fallouts
Viktor Szakats [Tue, 25 Feb 2025 13:38:41 +0000 (14:38 +0100)] 
build: set `-O3` and tune WinCE in CI, fix `getpart`, `vtls_scache` fallouts

- GHA/windows/WinCE:
  - set `-O3 -DNDEBUG` C flags manually for the CMake mingw32ce build.
    CMake doesn't recognize the platform and fails to add them. To match
    autotools (using `-O2`), and hit similar compiler warnings.
  - enable parallel builds for cmake.
  - tune parallelism for cmake using unity batches.
  - tune parallelism for autotools.

  Follow-up to 2a292c39846107228201674d686be5b3ed96674d #15975

- tests: fix potentially uninitialized value in `readline()` in
  `getpart.c`. Detected by gcc 4.4.0 `-O2` (Windows CE) jobs:
  ```
  tests/server/getpart.c: In function 'getpart':
  tests/server/getpart.c:298: error: 'datalen' may be used uninitialized in this function
  ```
  Ref: https://github.com/curl/curl/actions/runs/13522595237/job/37785147505?pr=16476#step:11:25
  Follow-up to 592880a3caf0b6f48b1dda6fbcf6a734237fcd43

- vtls_scache: rework returning pointer to avoid compiler warning seen
  with `-O3` gcc 4.4.0 builds (Windows CE/schannel):
  ```
  lib/vtls/schannel.c: In function 'schannel_connect_step1':
  lib/vtls/vtls_scache.c:975: error: dereferencing pointer 'old_cred.4474' does break strict-aliasing rules
  lib/vtls/vtls_scache.c:985: error: dereferencing pointer 'old_cred.4474' does break strict-aliasing rules
  lib/vtls/schannel.c:959: note: initialized from here
  ```
  Ref: https://github.com/curl/curl/actions/runs/13523868335/job/37789610845#step:9:25
  Follow-up to fa0ccd9f1fbbbd77bf50b26e3ba231ea6c729474 #15774

Closes #16476

9 months agoGHA/windows: move UWP vcpkg job up top
Viktor Szakats [Wed, 26 Feb 2025 14:48:35 +0000 (15:48 +0100)] 
GHA/windows: move UWP vcpkg job up top

To bring it closer to WinCE and make the vcpkg jobs with tests form
a continuous group.

Closes #16499

9 months agovtls: move common early data code into vtls.c
Stefan Eissing [Mon, 24 Feb 2025 12:35:20 +0000 (13:35 +0100)] 
vtls: move common early data code into vtls.c

With now 2 backends implementing early data, it makes sense to have the
common handling in a single place.

Closes #16450

9 months agotest1167: catch #defines with extra whitespace
Viktor Szakats [Wed, 26 Feb 2025 11:13:43 +0000 (12:13 +0100)] 
test1167: catch #defines with extra whitespace

Before this patch, it missed this in `curl/curl.h`:
```c
#  define __has_declspec_attribute(x) 0
```
After this patch:
```
test 1167...[Verify curl prefix of public symbols in header files]
/usr/bin/perl -I. -I.  returned 1, when expecting 0
 1167: exit FAILED
== Contents of files in the log/14/ dir after test 1167
=== Start of file server.cmd
 Testnum 1167
=== End of file server.cmd
=== Start of file stdout1167
 Bad symbols in public header files:
   __has_declspec_attribute(x)
=== End of file stdout1167
FAIL 1167: 'Verify curl prefix of public symbols in header files' source analysis
TESTFAIL: These test cases failed: 1167
```

Ref: #16491
Closes #16496

9 months agotests: make sure gdb gets the right path for -x
Daniel Stenberg [Wed, 26 Feb 2025 09:48:40 +0000 (10:48 +0100)] 
tests: make sure gdb gets the right path for -x

Regression from #16452

Closes #16495

9 months agocurl.h: stop defining non-curl `__has_declspec_attribute`
Viktor Szakats [Wed, 26 Feb 2025 00:00:43 +0000 (01:00 +0100)] 
curl.h: stop defining non-curl `__has_declspec_attribute`

Public curl headers are best not to define 3rd-party or system macros.
Introduce `CURL_HAS_DECLSPEC_ATTRIBUTE` to cover this system macro and
use it.

Detected by test1167 after dropping the indentation:
```
test 1167...[Verify curl prefix of public symbols in header files]

/usr/bin/perl -I. -I.  returned 1, when expecting 0
 1167: exit FAILED
== Contents of files in the log/10/ dir after test 1167
=== Start of file server.cmd
 Testnum 1167
=== End of file server.cmd
=== Start of file stdout1167
 Bad symbols in public header files:
   __has_declspec_attribute(x)
=== End of file stdout1167
```
Ref: https://github.com/curl/curl/actions/runs/13533200900/job/37819784405?pr=16490#step:42:2087

Ref: https://clang.llvm.org/docs/LanguageExtensions.html#has-declspec-attribute
Follow-up to 50482b8c0a2cf5315e66d182998c8fc4901ffb2d #3616
Ref: #16496 (fixing test1167)
Closes #16491

9 months agobuild: silence mingw32ce C99 format warnings, simplify CI
Viktor Szakats [Wed, 26 Feb 2025 00:33:49 +0000 (01:33 +0100)] 
build: silence mingw32ce C99 format warnings, simplify CI

`./configure` mingw32ce builds enable C99 mode automatically, that
triggers compiler warnings in gcc 4.4.0. We initially worked it around
in CI by suppressing the detection of C99 with `ac_cv_prog_cc_c99=no`.

Replace it with automatically silencing the bogus warnings in C99 mode,
for all build systems:
```
lib/ftp.c: In function 'Curl_GetFTPResponse':
lib/ftp.c:726: error: format '%zd' expects type 'signed size_t', but argument 4 has type 'ssize_t'
lib/ws.c: In function 'ws_dec_pass_payload':
lib/ws.c:304: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/ws.c: In function 'ws_enc_write_head':
lib/ws.c:581: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'long int'
lib/vtls/schannel.c: In function 'schannel_connect_step1':
lib/vtls/schannel.c:1122: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/vtls/schannel.c: In function 'schannel_connect_step2':
lib/vtls/schannel.c:1311: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/vtls/schannel.c: In function 'schannel_send':
lib/vtls/schannel.c:1793: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/vtls/schannel.c:1810: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/vtls/schannel.c: In function 'schannel_shutdown':
lib/vtls/schannel.c:2286: error: format '%zd' expects type 'signed size_t', but argument 4 has type 'ssize_t'
lib/vtls/vtls.c: In function 'ssl_cf_recv':
lib/vtls/vtls.c:1422: error: format '%zd' expects type 'signed size_t', but argument 5 has type 'ssize_t'
```
Ref: https://github.com/curl/curl/actions/runs/13533841306/job/37821720902?pr=16492#step:9:20

Also: simplify Windows CE job configuration in GHA/windows.

Follow-up to 2a292c39846107228201674d686be5b3ed96674d #15975
Closes #16492

9 months agocmake: warn for OpenSSL versions missing TLS 1.3 support (revert)
Viktor Szakats [Tue, 25 Feb 2025 23:49:25 +0000 (00:49 +0100)] 
cmake: warn for OpenSSL versions missing TLS 1.3 support (revert)

We decided not to show warnings for this issue.

Also this:
```
CMake Warning at CMakeLists.txt:783 (message):
  OpenSSL does not support TLS 1.3.
```
as seen in #16483 with CMake 3.12.4, `OPENSSL_VERSION` is empty.
Perhaps detection isn't reliable? I haven't seen this so far with
mainline OpenSSL. An `if(OPENSSL_VERSION AND ...)` can fix it, if we
opt for this warning in the future.

Follow-up to #16122
This reverts commit 34c1c653fc475efb828658f900979596905c688e #16120
Closes #16485

9 months agoGHA/http3-linux: build out-of-tree, make test2502 support it
Viktor Szakats [Tue, 25 Feb 2025 16:35:18 +0000 (17:35 +0100)] 
GHA/http3-linux: build out-of-tree, make test2502 support it

To sync with the rest of core workflows.

Also fixup test2502 failing for out-of-tree builds due to:
```
== Info: error reading ca cert file ./certs/EdelCurlRoot-ca.cacert (Error while reading file.)
```
Ref: https://github.com/curl/curl/actions/runs/13525575035/job/37795171282?pr=16480#step:23:3608

Cherry-picked from #16480
Closes #16481

9 months agoGHA/linux: build out-of-tree, make autotools `tidy` target support it
Viktor Szakats [Tue, 25 Feb 2025 15:49:04 +0000 (16:49 +0100)] 
GHA/linux: build out-of-tree, make autotools `tidy` target support it

To sync with the rest of core workflows.

Also fix the `tidy` (clang-tidy) target in autotools to support
out-of-tree builds:
```
clang-tidy slist_wc.c terminal.c tool_bname.c [...] var.c tool_hugehelp.c tool_ca_embed.c
  -quiet --warnings-as-errors=* -checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-optin.performance.Padding,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-clang-analyzer-valist.Uninitialized --
  -I../../include -I../lib -I../src -I../../lib -I../../src
  -DBUILDING_CURL -DUSE_MANUAL -D_GNU_SOURCE -DHAVE_CONFIG_H
[1/45] Processing file /home/runner/work/curl/curl/bld/src/slist_wc.c.
Error while processing /home/runner/work/curl/curl/bld/src/slist_wc.c.
[2/45] Processing file /home/runner/work/curl/curl/bld/src/terminal.c.
Error while processing /home/runner/work/curl/curl/bld/src/terminal.c.
[3/45] Processing file /home/runner/work/curl/curl/bld/src/tool_bname.c.
Error while processing /home/runner/work/curl/curl/bld/src/tool_bname.c.
[...]
```
Ref: https://github.com/curl/curl/actions/runs/13525337357/job/37794388404?pr=16480#step:36:561

Closes #16480

9 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 26 Feb 2025 09:31:16 +0000 (10:31 +0100)] 
RELEASE-NOTES: synced

9 months agowolfssl: warn if CA native import option is ignored
Jay Satiro [Fri, 21 Feb 2025 08:50:15 +0000 (03:50 -0500)] 
wolfssl: warn if CA native import option is ignored

- Show verbose message if the CA native import option is set but
  the wolfSSL build does not support it.

wolfSSL has to be built with WOLFSSL_SYS_CA_CERTS to import native
CA certificates and that may not be common.

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

9 months agoaltsvc: rewrite parser using strparse
Daniel Stenberg [Mon, 24 Feb 2025 14:29:13 +0000 (15:29 +0100)] 
altsvc: rewrite parser using strparse

Extend test 1654.

Closes #16454

9 months agocookie: do prefix matching case-sensitively
Daniel Stenberg [Wed, 26 Feb 2025 06:54:15 +0000 (07:54 +0100)] 
cookie: do prefix matching case-sensitively

According to section 4.1.3.1 and 4.1.3.2 of
draft-ietf-httpbis-rfc6265bis-19

Ref: https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis-19#section-4.1.3.1

Closes #16494

9 months agourldata: move the ech struct field to the "right place"
Daniel Stenberg [Tue, 25 Feb 2025 22:53:41 +0000 (23:53 +0100)] 
urldata: move the ech struct field to the "right place"

We keep the struct field ordered in a rough size order, big to small.

Closes #16489

9 months agoGHA: enable the RTSP tests on macOS gcc-12
Daniel Stenberg [Tue, 25 Feb 2025 22:22:29 +0000 (23:22 +0100)] 
GHA: enable the RTSP tests on macOS gcc-12

9 months agocurl.h: change some enums to defines with L suffix
Daniel Stenberg [Tue, 25 Feb 2025 16:33:17 +0000 (17:33 +0100)] 
curl.h: change some enums to defines with L suffix

To help applications do the right thing easier, change some enum values
into defines with L suffixes so that they get the corect type (long)
easier when used with curl_easy_setopt(). This also fixes a few of our
own libtests.

To reduce the risk that this change breaks the compile for any existing
users, the previously provided enums are still provided, but the values
to use are not defined by the enums.

This change "magically" fixes a few RTSP test failures we have had on
64-bit platforms because those options were not see using longs
properly.

Closes #16482

9 months agolibtest/libprereq.c: set CURLOPT_FOLLOWLOCATION with a long
Daniel Stenberg [Tue, 25 Feb 2025 22:13:49 +0000 (23:13 +0100)] 
libtest/libprereq.c: set CURLOPT_FOLLOWLOCATION with a long

Previously this used '1', which as an int. The option needs a long.

Closes #16487

9 months agoCURLOPT_HTTPHEADER.md: add comments to the example
Daniel Stenberg [Tue, 25 Feb 2025 22:16:50 +0000 (23:16 +0100)] 
CURLOPT_HTTPHEADER.md: add comments to the example

Ref: https://mastodon.social/@jpmens/114065709635360064
Closes #16488