]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
12 months agopingpong: on disconnect, check for unflushed pingpong state
Stefan Eissing [Sun, 8 Jun 2025 10:00:00 +0000 (12:00 +0200)] 
pingpong: on disconnect, check for unflushed pingpong state

When a pingpong based protocol tries to perform a connection disconnect,
it sends a sort of "logout" command to the server, unless the connection
is deemed dead.

But the disconnect might happen before pingpong data has been completely
sent, in which case sending the "logout" will not work. Check the
pingpong state and do not "logout" when data is pending.

This was detected as a condition in fuzzing that triggered a debug
assert in the pingpong sending.

Closes #17555

12 months agotool_operate: fix return code when --retry is used but not triggered
Daniel Stenberg [Mon, 9 Jun 2025 06:37:49 +0000 (08:37 +0200)] 
tool_operate: fix return code when --retry is used but not triggered

Verify with test 752

Reported-by: fjaell on github
Fixes #17554
Closes #17559

12 months agoGHA: enclose `if` expressions in `${{ }}` where missing
Viktor Szakats [Fri, 6 Jun 2025 21:29:22 +0000 (23:29 +0200)] 
GHA: enclose `if` expressions in `${{ }}` where missing

Enclosing expressions in `${{ }}` is optional, but sometimes required.
It seems more straighforward to use it always rather than decide on
a case-by-case basis. Before this patch 71 `if`s were enclosed and 49
were not. Enclosing these makes it easy to grep and recognize these
whereever used.

https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/using-conditions-to-control-job-execution

Closes #17550

12 months agotool_getparam: fix --ftp-pasv
Dan Fandrich [Fri, 6 Jun 2025 17:21:09 +0000 (10:21 -0700)] 
tool_getparam: fix --ftp-pasv

This boolean option was moved to the wrong handling function. Make it
an ARG_NONE and move it to the correct handler and add a test to
verify that the option works.

Follow-up to 698491f44

Reported-by: fjaell on github
Fixes #17545
Closes #17547

12 months agoGHA: tidy up single-line `run` blocks
Viktor Szakats [Fri, 6 Jun 2025 20:15:02 +0000 (22:15 +0200)] 
GHA: tidy up single-line `run` blocks

Also double quote a shell variable.

Closes #17552

12 months agotests/servers.pm: add more ways to figure out current user
Daniel Stenberg [Thu, 5 Jun 2025 21:37:59 +0000 (23:37 +0200)] 
tests/servers.pm: add more ways to figure out current user

Some CI tests fail due to "Can't start ssh server due to lack of USER name" -
add more ways to try to figure it out if no environment variable works: the
whoami and id commands.

Closes #17544

12 months agoGHA/hacktoberfest-accepted: tidy up item order
Viktor Szakats [Fri, 6 Jun 2025 20:30:12 +0000 (22:30 +0200)] 
GHA/hacktoberfest-accepted: tidy up item order

`if`, then `env`, then `run`.

Also tidy up quotes in env entries.

Closes #17551

12 months agoCI: fix zizmor 1.9.0 warnings, shellcheck verify CI shell code, fix fallouts
Viktor Szakats [Thu, 5 Jun 2025 07:58:34 +0000 (09:58 +0200)] 
CI: fix zizmor 1.9.0 warnings, shellcheck verify CI shell code, fix fallouts

zizmor 1.9.0 effectively bans using GHA macros within shell script
snippets. Rework them to pass GHA macro values via envs and use those
envs in shell snippets. `${{ env.* }}` macros could be converted
to native env references after making their names shell-compatible.

Envs and shell commands can no longer be used in GHA macro values. Most
cases could be fixed by using literals. Passing quoted values with
spaces combined with other args also doesn't work anymore. This was
replaced by passing them separately.

Despite the initial complications, avoiding GHA macros in scripts does
seems to make the CI code reasonable cleaner. It also makes it possible
to analyze the scripts with shellcheck, finding subtle issues that went
unnoticed till now.

Also:
- un-ignore and fix three existing zizmor `template-injection` issues.
- add script to extract and shellcheck all shell code stored within GHA
  and Circle CI YAML files.
- add CI job to run this script.
- fix shellcheck issues discovered.
- fix minor differences between cmake and autotools FreeBSD jobs.
- merge cmake/autotools FreeBSD jobs to avoid developing unwanted
  differences again.
- fix/sync quote use across shell code.
- replace `$HOME` with `~` or literal where it made sense.
- replace most `brew --prefix` with literals.
- move all curl install tests to the `curl-install*` prefix.
- add missing curl install tests to cygwin/msys/mingw/*bsd.
- pipe to `tar` instead of storing downloads on disk.
- drop unnecessary `PKG_CONFIG_PATH` when building nghttp3.

Ref: https://github.com/curl/curl/actions/runs/15461461371/job/43523546041
Ref: https://github.com/zizmorcore/zizmor/releases/tag/v1.9.0

Follow-up to e522f47986bb72f194636e155191d7dccdc2d4fc #17278

Closes #17537

12 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 5 Jun 2025 11:54:53 +0000 (13:54 +0200)] 
RELEASE-NOTES: synced

Bump to 8.14.2 - a tentative version we probably will not release.

12 months agopytest: adapt for runs with openssl-1.1.1
Stefan Eissing [Thu, 5 Jun 2025 08:37:24 +0000 (10:37 +0200)] 
pytest: adapt for runs with openssl-1.1.1

Fix use of nghttpx fixture to be present even when h3 is not
available in curl. Fix TLS protocol versions expectations for
older openssl versions.

Closes #17538

12 months agopytest: disable test_07_37 and test_07_36 with openssl's quic
Stefan Eissing [Thu, 5 Jun 2025 08:44:32 +0000 (10:44 +0200)] 
pytest: disable test_07_37 and test_07_36 with openssl's quic

These tests fail often in CI and I have no motivation to find out why.
Disable the tests for openssl's own QUIC.

Closes #17539

12 months agofuzzer: get the deadlock unstuck
Stefan Eissing [Thu, 5 Jun 2025 11:17:02 +0000 (13:17 +0200)] 
fuzzer: get the deadlock unstuck

Change the workflow name to change the concurrency lock name so
that the invoked Fuzzer workflow does no longer lock the same name.

Closes #17541

12 months agocurl.h: make CURLSSLOPT_* symbols defined as longs
Daniel Stenberg [Thu, 5 Jun 2025 06:07:04 +0000 (08:07 +0200)] 
curl.h: make CURLSSLOPT_* symbols defined as longs

Help users get them used right.

Closes #17535

12 months agoINSTALL.md: cygwin details and add source code link
John Haugabook [Thu, 29 May 2025 23:51:10 +0000 (19:51 -0400)] 
INSTALL.md: cygwin details and add source code link

Added more details to help with cygwin install, adding links to curl
source code where relevant to help save people a little time.

Closes #17485

12 months agodocs/examples: add ftp-delete.c
Daniel Stenberg [Thu, 5 Jun 2025 09:05:38 +0000 (11:05 +0200)] 
docs/examples: add ftp-delete.c

To show how to delete a single file after a transfer

Closes #17540

12 months agosystem.h: remove some macros
Daniel Stenberg [Sat, 31 May 2025 16:47:23 +0000 (18:47 +0200)] 
system.h: remove some macros

Since curl_off_t is always 64 bit these days, we can simplify and avoid
using some macros.

Closes #17498

12 months agoCI: fix OpenBSD tests stall
Stefan Eissing [Wed, 4 Jun 2025 12:32:12 +0000 (14:32 +0200)] 
CI: fix OpenBSD tests stall

impacket could not be used as it neeeds package six

- openbsd does not find python3, add package six
- http2-server.pl: only warn about unknown parameter if not empty string

Closes #17532

12 months agoSCP/SFTP: avoid busy loop after EAGAIN
Stefan Eissing [Wed, 4 Jun 2025 13:26:55 +0000 (15:26 +0200)] 
SCP/SFTP: avoid busy loop after EAGAIN

The ssh libraries do not reveal if they still have data buffered from
the peer. Only when their buffers are read empty can curl be sure that
it is safe to rely on socket polling.

This change adds detection of EGAIN on receive in the transfer loop and
allows SFTP/SCP transfers to avoid a busy loop in such a case (which
should happen often when CPU exceeds network bandwidth).

Closes #17533

12 months agotest1117: reduce write delays
Stefan Eissing [Wed, 4 Jun 2025 07:40:32 +0000 (09:40 +0200)] 
test1117: reduce write delays

Test1117 seems to verify that a response, incoming slowly, is read
completely before sending another request on the same connection.

The previsou write delay of 1000ms made the test last 23+ seconds.
A delay of 100ms seems to achieve the same test on modern machines, but
the overall run time is less than 3 seconds.

Closes #17530

12 months agoRELEASE-NOTES: synced curl-8_14_1
Daniel Stenberg [Wed, 4 Jun 2025 05:40:18 +0000 (07:40 +0200)] 
RELEASE-NOTES: synced

8.14.1 release

12 months agoTHANKS: add names from 8.14.1 release
Daniel Stenberg [Wed, 4 Jun 2025 05:40:18 +0000 (07:40 +0200)] 
THANKS: add names from 8.14.1 release

12 months agocmake: enable `-std=gnu99` for Windows CE CeGCC
Viktor Szakats [Mon, 2 Jun 2025 19:15:45 +0000 (21:15 +0200)] 
cmake: enable `-std=gnu99` for Windows CE CeGCC

To sync with autotools, which auto-detects this option and enables it by
default.

It also makes it possible to compile unsuffixed long long integer
literals correctly, allowing to drop some legacy macros without bumping
into build errors like:
```
lib/vtls/schannel.c: In function 'schannel_send':
lib/vtls/schannel.c:1815: error: integer constant is too large for 'long' type
```
Ref: https://github.com/curl/curl/actions/runs/15374705821/job/43286736583?pr=17498#step:9:20

Bug: https://github.com/curl/curl/pull/17498#issuecomment-2925507481
Reported-by: Daniel Stenberg
Closes #17523

12 months agodllmain: exclude from Cygwin builds
Jeremy Drake [Tue, 3 Jun 2025 17:35:46 +0000 (10:35 -0700)] 
dllmain: exclude from Cygwin builds

On Cygwin, it is unsafe to call POSIX functions from DllMain, which
OPENSSL_thread_stop does.  Additionally, it should be unnecessary as
OpenSSL uses pthread_key_create to register a thread destructor to do
thread cleanup in a POSIX way.

Reported-by: Yuyi Wang
Ref: https://cygwin.com/pipermail/cygwin/2025-June/258235.html

Fixes #17262
Closes https://github.com/curl/curl/pull/17528

12 months agotls BIOs: handle BIO_CTRL_EOF correctly
Stefan Eissing [Tue, 3 Jun 2025 09:54:40 +0000 (11:54 +0200)] 
tls BIOs: handle BIO_CTRL_EOF correctly

Needs to return 1 if EOF from underlying filter has been seen.

Fixes #17471
Reported-by: Michael Kaufmann
Closes #17526

12 months agocurl: make -N handled correctly
Daniel Stenberg [Tue, 3 Jun 2025 11:34:08 +0000 (13:34 +0200)] 
curl: make -N handled correctly

Options marked ARG_NO should have their 'toggle' value reverted when the
short option is used as it implies using the --no- prefix.

-N happens be the only short option flag for a --no- long option.

Reported-by: Stefan Eissing
Closes #17527

12 months agoautotools: recognize more Linux targets when setting `-D_GNU_SOURCE`
Viktor Szakats [Mon, 2 Jun 2025 22:38:20 +0000 (00:38 +0200)] 
autotools: recognize more Linux targets when setting `-D_GNU_SOURCE`

To set `-D_GNU_SOURCE`.

Required to declare `accept4` on uclibc targets. `host_os` can have
the value `uclinux-uclibcgnueabi` in this case.

Fixing:
```
cf-socket.c: In function 'cf_tcp_accept_connect':
cf-socket.c:2141:18: error: implicit declaration of function 'accept4'; did you mean 'accept'? [-Werror=implicit-function-declaration]
 2141 |     s_accepted = accept4(ctx->sock, (struct sockaddr *) &add, &size,
```

Follow-up to 3d02872be7cfe6dcdef4b02321b47af19e1ce268 #16979

Reported-by: Kadambini Nema
Fixes #17512
Closes #17524

12 months agocmdline-docs: mention HTTP resumed uploads to be shaky
Daniel Stenberg [Mon, 2 Jun 2025 12:16:25 +0000 (14:16 +0200)] 
cmdline-docs: mention HTTP resumed uploads to be shaky

In the documentation for the --continue-at and --range options.

A future version could implement support for the new standard HTTP resumed
uploads mechanism.

Ref: #17510
Closes #17521

12 months agopytest: do not use reserved chars in url queries
Stefan Eissing [Mon, 26 May 2025 15:07:37 +0000 (17:07 +0200)] 
pytest: do not use reserved chars in url queries

Closes #17458

12 months agoscorecard: rework format and add json print
Stefan Eissing [Fri, 30 May 2025 10:58:34 +0000 (12:58 +0200)] 
scorecard: rework format and add json print

Improve the JSON result format to be more descriptive and
easier to parse.

Add --print option to scorecard.py that prints a saved JSON file
Add date field to score card.

Closes #17465

12 months agotest1498: verify "-T ."
Daniel Stenberg [Mon, 2 Jun 2025 10:35:49 +0000 (12:35 +0200)] 
test1498: verify "-T ."

Closes #17519

12 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 2 Jun 2025 11:02:12 +0000 (13:02 +0200)] 
RELEASE-NOTES: synced

12 months agocurl: upload from '.' fix
Stefan Eissing [Mon, 2 Jun 2025 10:12:13 +0000 (12:12 +0200)] 
curl: upload from '.' fix

CURLOPT_NOPROGRESS is being set twice, if a file is uploaded from '.'.

Fix order of options so that '.' can override the global setting. Without
this, the `tool_readbusy_cb()` is never inoked and cannot unpause a
transfer waiting for more input.

Fixes #17513
Reported-by: denandz on github
Closes #17517

12 months agotool_getparam: make --no-anyauth not be accepted
Daniel Stenberg [Sun, 1 Jun 2025 16:21:52 +0000 (18:21 +0200)] 
tool_getparam: make --no-anyauth not be accepted

It was previously just ignored, now it triggers an error. It was never
documented (nor intended) to work.

Fixes #17508
Reported-by: Dan Fandrich
Closes #17511

12 months agows: tests and fixes
Ruocco, Calvin [Mon, 14 Apr 2025 15:59:45 +0000 (17:59 +0200)] 
ws: tests and fixes

This started out as regression tests for the `curl_ws_recv()` and
`curl_ws_send()` implementation and ended up with a bugfix, additional
protocol validation and minor logging improvements.

- Fix reset of fragmented message decoder state when a PING/PONG is
  received in between message fragments.

- Fix undefined behavior (applying zero offset to null pointer) in
  curl_ws_send() when the given buffer is NULL.

- Detect invalid overlong PING/PONG/CLOSE frames.
- Detect invalid fragmented PING/PONG/CLOSE frames.
- Detect invalid sequences of fragmented frames.

  - a) A continuation frame (0x80...) is received without any ongoing
    fragmented message.
  - b) A new fragmented message is started (0x81/0x01/0x82/0x02...)
    before the ongoing fragmented message has terminated.

- Made logs for invalid opcodes easier to understand.
- Moved noisy logs to the `CURL_TRC_WS` log level.
- Unified the prefixes for WebSocket log messages: `[WS] ...`

- Add env var `CURL_WS_FORCE_ZERO_MASK` in debug builds.

  - If set, it forces the bit mask applied to outgoing payloads to
    0x00000000, which effectively means the payload is not masked at
    all. This drastically simplifies defining the expected `<protocol>`
    data in test cases.

- 2700: Frame types
- 2701: Invalid opcode 0x3
- 2702: Invalid opcode 0xB
- 2703: Invalid reserved bit RSV1 _(replaces 2310)_
- 2704: Invalid reserved bit RSV2
- 2705: Invalid reserved bit RSV3
- 2706: Invalid masked server message
- 2707: Peculiar frame sizes _(part. replaces 2311)_
- 2708: Automatic PONG
- 2709: No automatic PONG _(replaces 2312)_
- 2710: Unsolicited PONG
- 2711: Empty PING/PONG/CLOSE
- 2712: Max sized PING/PONG/CLOSE
- 2713: Invalid oversized PING _(replaces 2307)_
- 2714: Invalid oversized PONG
- 2715: Invalid oversized CLOSE
- 2716: Invalid fragmented PING
- 2717: Invalid fragmented PONG
- 2718: Invalid fragmented CLOSE
- 2719: Fragmented messages _(part. replaces 2311)_
- 2720: Fragmented messages with empty fragments
- 2721: Fragmented messages with interleaved pong
- 2722: Invalid fragmented message without initial frame
- 2723: Invalid fragmented message without final frame

- 2305: curl_ws_recv() loop reading three larger frames
  - This test involuntarily sent an invalid sequence of opcodes (0x01...,0x01...,0x81...) , but neither libcurl nor the test caught this! The correct sequence was tested in 2311 (0x01...,0x00...,0x80...). See below for 2311.
  - Validation of the opcode sequence was added to libcurl and is now tested in 2723.
  - Superseded by 2719 (fragmented message) and 2707 (large frames).
- 2307: overlong PING payload
  - The tested PING payload length check was actually missing, but the test didn't catch this since it involuntarily sent an invalid opcode (0x19... instead of 0x89...) so that the expected error occurred, but for the wrong reason.
  - Superseded by 2713.
- 2310: unknown reserved bit set in frame header
  - Superseded by 2703 and extended by 2704 and 2705.
- 2311: curl_ws_recv() read fragmented message
  - Superseded by 2719 (fragmented message) and 2707 (large frames).
- 2312: WebSockets no auto ping
  - Superseded by 2709.

- No tests for `CURLOPT_WRITEFUNCTION`.
- No tests for sending of invalid frames/fragments.

Closes #17136

12 months agotests: improve server start reliability
Stefan Eissing [Mon, 2 Jun 2025 08:41:20 +0000 (10:41 +0200)] 
tests: improve server start reliability

Fix all lookups of the port a server is using by
- unlinking the portfile before the start
- waiting `timeout` seconds for the port file to exist
  and contain a positive number
- check results and fail server start when port could
  not be determined

Closes #17516

12 months agotest1510: fix expectation
Stefan Eissing [Mon, 2 Jun 2025 07:55:33 +0000 (09:55 +0200)] 
test1510: fix expectation

The test had `Closing connection 0` in its expectations, but a stripfile
expression that removes such lines. No recent changes, but started failing
this morning.

Too little coffee for me? Or what triggered this?

Closes #17515

12 months agoasyn-thrdd: fix cleanup when RR fails due to OOM
Daniel Stenberg [Mon, 2 Jun 2025 06:47:03 +0000 (08:47 +0200)] 
asyn-thrdd: fix cleanup when RR fails due to OOM

Fixes #17507
Closes #17514

12 months agoGHA/non-native: un-ignore tests on OpenBSD, bump to `-j8` for NetBSD/FreeBSD
Viktor Szakats [Sun, 1 Jun 2025 06:01:23 +0000 (08:01 +0200)] 
GHA/non-native: un-ignore tests on OpenBSD, bump to `-j8` for NetBSD/FreeBSD

- un-ignore tests (3017, FTP, TFTP) on OpenBSD
Patch-by: Jacob Mealey
  Ref: https://github.com/curl/curl/issues/13623#issuecomment-2925129037
Fixes: #13623
- KNOWN_BUGS: drop TFTP failures issue on OpenBSD.
Fixes: #13623
- bump test parallelism to `-j8` (from `-j4`) for NetBSD, FreeBSD,
  to match OpenBSD.
  Before: https://github.com/curl/curl/actions/runs/15371760479
  After: https://github.com/curl/curl/actions/runs/15371937205

- FreeBSD: sync cmake `TFLAGS` with autotools. (This branch is not
  currently hit in CI.)
  Follow-up to 7f3d598276e988a46558fe6a2951b1ae354afcdf #15040

Closes #17505

12 months agotests: re-enable 1510, unignore 2027 2051 in GHA/macos, document heimdal memleak
Viktor Szakats [Tue, 27 May 2025 05:40:19 +0000 (07:40 +0200)] 
tests: re-enable 1510, unignore 2027 2051 in GHA/macos, document heimdal memleak

- test1510: it was marked flaky, then disabled. Keep the flaky flag
  and allow it to run again.
  Ref: ef02da315604acd72c39264e732661a2aea2c583
  Ref: 0110cced2a44a0c89fd5f98c30e80afeb208c0e0

- GHA/linux: extend information about the heimdal valgrind failures.

- GHA/macos: unignore 2037 2041 in torture tests. They no longer
  appear flaky.
  Follow-up to 4b791dca37c3130bbe0d4cae12326866c2d553ae #14667

Closes #17462

12 months agodocs/tests: remove mention of hyper
Yedaya Katsman [Sat, 31 May 2025 18:47:26 +0000 (21:47 +0300)] 
docs/tests: remove mention of hyper

Closes #17500

12 months agolicense: update some copyright links to curl.se
Yedaya Katsman [Sat, 31 May 2025 20:24:33 +0000 (23:24 +0300)] 
license: update some copyright links to curl.se

Instead of curl.haxx.se

Also widen the .gitignore for libtest, since it missed libtest751,
so ignore three digit tests that start with 5-9 instead of just 5-6.

Closes #17502

12 months agomemanalyze.pl: fix getaddrinfo/freeaddrinfo checks
Daniel Stenberg [Sat, 31 May 2025 21:25:39 +0000 (23:25 +0200)] 
memanalyze.pl: fix getaddrinfo/freeaddrinfo checks

It did not parse them correctly. Problem never shows before we don't run
torture tests with these functions - yet.

Seen when enabling torture tests with the threaded resolver.

Closes #17503

12 months agoVULN-DISCLOSURE-POLICY.md: the distros list wants <= 7 days embargo
Daniel Stenberg [Sat, 31 May 2025 15:46:19 +0000 (17:46 +0200)] 
VULN-DISCLOSURE-POLICY.md: the distros list wants <= 7 days embargo

Closes #17497

12 months agows: handle blocked sends better
z2_ [Sat, 31 May 2025 12:22:00 +0000 (14:22 +0200)] 
ws: handle blocked sends better

Closes #17496

12 months agotests: test mtls also w/ clientAuth EKU only
Yedaya Katsman [Fri, 30 May 2025 15:59:14 +0000 (18:59 +0300)] 
tests: test mtls also w/ clientAuth EKU only

The google chrome root program will stop allowing roots that have both
clientAuth and ServerAuth [1].

In one of the mtls tests, use a certificate with only the clientAuth
EKU.

[1] https://googlechrome.github.io/chromerootprogram/#322-pki-hierarchies-included-in-the-chrome-root-store

Closes #17493

12 months agotests: test mtls with --insecure
Yedaya Katsman [Fri, 30 May 2025 15:43:05 +0000 (18:43 +0300)] 
tests: test mtls with --insecure

Closes #17493

12 months agotests: fix checks for https-mtls proto
Yedaya Katsman [Fri, 30 May 2025 15:37:47 +0000 (18:37 +0300)] 
tests: fix checks for https-mtls proto

If there were two tests using the "https-mtls" server there was a perl
unbound variable error, since certfile wan't set. Additionally, once the
responsiveserver function was actually called, it failed finding a
responsiveness function. For now I made it use the `verifypid` function,
since the curl execution in `verifyhttp` doesn't know about client
certificates.

Closes #17493

12 months agoftp: fix teardown of DATA connection in done
Stefan Eissing [Fri, 30 May 2025 10:05:14 +0000 (12:05 +0200)] 
ftp: fix teardown of DATA connection in done

When ftp_done() is called to terminate the transfer, it needs to tear
down any open SECONDARY filter chain. The condition on when to do that
was relying on there to be a valid socket. This is not sufficient as the
socket is only set *after* happy eyeballing has decided on one.

Instead of checking for a valid conn->sock, check if any connection
filter is installed.

Fixes #17482
Reported-by: Rasmus Melchior Jacobsen
Closes #17491

12 months agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 31 May 2025 13:12:43 +0000 (15:12 +0200)] 
RELEASE-NOTES: synced

12 months agotests: await portfile to be complete
Stefan Eissing [Sat, 31 May 2025 11:31:03 +0000 (13:31 +0200)] 
tests: await portfile to be complete

When running under load, a started server may not produce a valid portfile
before the runner starts reading it. If the read is not successful, wait
for 100ms and try again, timing out after 15 seconds.

Fixes #17492
Closes #17495

12 months agospelling: call it null-terminate consistently
Daniel Stenberg [Fri, 30 May 2025 09:20:05 +0000 (11:20 +0200)] 
spelling: call it null-terminate consistently

With a dash, using two Ls. Also for different forms of the word.

Use NULL in all uppercase if it means a zero pointer.

Follow-up to 307b7543ea1e73ab04e062bdbe4b

Closes #17489

12 months agowolfssl: fix sending of early data
Stefan Eissing [Fri, 30 May 2025 09:08:42 +0000 (11:08 +0200)] 
wolfssl: fix sending of early data

Early data was reported as being sent, but was not. While everything was
aligned with the Gods and early data was reported as accepted, the
actual sending required another call to wolfSSL.

Fixes #17481
Reported-by: Ethan Everett
Closes #17488

12 months agospelling: 'a' vs 'an'
Daniel Stenberg [Fri, 30 May 2025 08:27:35 +0000 (10:27 +0200)] 
spelling: 'a' vs 'an'

Closes #17487

12 months agoGHA/non-native: drop AmigaOS jobs, toolchain no longer available
Viktor Szakats [Fri, 30 May 2025 08:21:47 +0000 (10:21 +0200)] 
GHA/non-native: drop AmigaOS jobs, toolchain no longer available

Fixing:
```
[...] https://github.com/bebbo/amiga-gcc/releases/download/Mechen/amiga-gcc.tgz
curl: (22) The requested URL returned error: 404
```
Ref: https://github.com/curl/curl/actions/runs/15342088546/job/43170188027#step:2:17

Reason:
"As a sign of protest against the refusal to restore 2FA accounts,
this account is now empty."
Ref: https://github.com/bebbo/

If someone happens to have a local copy of the toolchain, we may use it
to restore the AmigaOS jobs.

Closes #17486

12 months agolibssh: adjust indentation
Viktor Szakats [Fri, 30 May 2025 07:57:32 +0000 (09:57 +0200)] 
libssh: adjust indentation

Follow-up to 54d04e2536d82d4f859f0e3dd63163f584e3061b #17478

12 months agomisc: we write *an* IPv6 address
Daniel Stenberg [Thu, 29 May 2025 22:52:25 +0000 (00:52 +0200)] 
misc: we write *an* IPv6 address

Add it as a "bad word"

Closes #17484

12 months agotool_getparam: remove two nextarg NULL checks
Daniel Stenberg [Thu, 29 May 2025 08:45:52 +0000 (10:45 +0200)] 
tool_getparam: remove two nextarg NULL checks

Because by checking for NULL when the argument can never be NULL, they
mislead the static analyzers into thinking it *can* be NULL and then the
analyzers tend to warn about other places in the code *without* the
check!

Closes #17483

12 months agodocs: fix typos
Samuel Henrique [Wed, 28 May 2025 22:12:47 +0000 (23:12 +0100)] 
docs: fix typos

After Gmail called out the typo I fixed on
532d89a866b5641d380a88144270b1c3ca6ba84e, I've decided to paste the
whole man page into Google docs and check what other issues it would
spot.

I know, it sounds silly, but I've just spent the last hour and a half
going over each one of them and fixing everything which was a true
finding and non-controversial.

Closes #17480

12 months agomisc: fix spelling
John Bampton [Wed, 28 May 2025 21:31:57 +0000 (07:31 +1000)] 
misc: fix spelling

Closes #17479

12 months agocmake: fix missed version number for multi-pkg-config detections
Viktor Szakats [Wed, 28 May 2025 16:21:17 +0000 (18:21 +0200)] 
cmake: fix missed version number for multi-pkg-config detections

It broke cmake builds with OpenSSL 3.5.0 and ngtcp2 1.12.0 or newer,
when detected via `pkg-config`.

For brotli, mbedtls, LDAP, ngtcp2 builds, it caused their version
numbers missing from the configure log when detected via `pkg-config`.

Regression from 01e45f81bddb2fef27fe35b7dd32032062a183f6 #16980
Regression from 3b501976a9adcf20218ffb96d9041806432227e4 #16479

Bug: https://github.com/curl/curl/pull/16980#issuecomment-2916811388
Reported-by: x-xiang on github
Closes #17476

12 months agomisc: fix spelling
John Bampton [Wed, 28 May 2025 19:53:23 +0000 (05:53 +1000)] 
misc: fix spelling

Closes #17478

12 months agotests: move test docs into /docs
Daniel Stenberg [Tue, 27 May 2025 06:06:37 +0000 (08:06 +0200)] 
tests: move test docs into /docs

In an attempt to make them easier to find.

The man pages runtests.md and testcurl.md are in /docs

The rest of the test documentation is in /docs/tests

Closes #17463

12 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 28 May 2025 12:55:59 +0000 (14:55 +0200)] 
RELEASE-NOTES: synced

Bumped to 8.14.1

12 months agohttp: fail early when rewind of input failed when following redirects
Stefan Eissing [Wed, 28 May 2025 11:27:19 +0000 (13:27 +0200)] 
http: fail early when rewind of input failed when following redirects

When inspecting a possible follow HTTP request, the result of a rewind
of the upload data was ignored as it was not clear at that point in time
if the request would become a GET.

This initiated the followup, rewound again, which failed again and
terminated the follow up.

This was confusing to users as it was not clear of the follow up was
done or not.

Fix: fail the early rewind when the request is not converted to GET.

Fixes #17472
Closes #17474
Reported-by: Jeroen Ooms
12 months agomulti: fix add_handle resizing
Stefan Eissing [Wed, 28 May 2025 12:04:31 +0000 (14:04 +0200)] 
multi: fix add_handle resizing

Due to someone being stupid, the resizing of the multi's transfer
table was actually shrinking it. Oh my.

Add test751 to reproduce, add code assertion.

Fixes #17473
Reported-by: Jeroen Ooms
Closes #17475

12 months agotool_getparam: refactored, simplified
Daniel Stenberg [Sun, 25 May 2025 10:24:49 +0000 (12:24 +0200)] 
tool_getparam: refactored, simplified

- add dedicated option functions for bools/none/strings
- simplify clearing (some) arguments, use '*' instead of ' '
- scripts/top-complexity: remove getparameter from whitelist
- handle --help separately
- getstr and getstrn do not allow a NULL input
- improve the ;auto check, it needs to be trailing
- add toggle bit helper function
- unify an error message for bad --no- use
- introduce generic handling of deprecated options: ARG_DEPR
- handle --no- prefix on more booleans:

    --cert-status
    --doh-cert-status
    --false-start
    --mptcp
    --ssl-no-revoke
    --ssl-revoke-best-effort
    --tcp-fastopen

Closes #17448

12 months agoBUG-BOUNTY.md. mention the medium bounty amount in 2025
Daniel Stenberg [Wed, 28 May 2025 06:29:40 +0000 (08:29 +0200)] 
BUG-BOUNTY.md. mention the medium bounty amount in 2025

Closes #17470

12 months agoRELEASE-NOTES: synced curl-8_14_0
Daniel Stenberg [Wed, 28 May 2025 05:40:54 +0000 (07:40 +0200)] 
RELEASE-NOTES: synced

8.14.0 release

12 months agodocs/THANKS: updated from the 8.14.0 release
Daniel Stenberg [Wed, 28 May 2025 05:40:54 +0000 (07:40 +0200)] 
docs/THANKS: updated from the 8.14.0 release

12 months agoGHA: Update ngtcp2/nghttp3 to v1.10.1
renovate[bot] [Tue, 27 May 2025 14:18:09 +0000 (14:18 +0000)] 
GHA: Update ngtcp2/nghttp3 to v1.10.1

Closes #17466

12 months agowcurl: update to v2025.05.26
Samuel Henrique [Mon, 26 May 2025 21:46:24 +0000 (22:46 +0100)] 
wcurl: update to v2025.05.26

This release fixes a small issue with the retry strategy:

 * Increase number of retries to 5 (32 sec total time), fixing the
   problem with misleading output. Previously, it was showing a higher
   number of retries than what would be done and it always did only 3.

Closes #17461

12 months agocurl_url_get.md: don't call it normalized
Daniel Stenberg [Tue, 27 May 2025 07:15:11 +0000 (09:15 +0200)] 
curl_url_get.md: don't call it normalized

Because that's not what it does.

Reported-by: Alberto Leiva Popper
Fixes #16829
Closes #17464

12 months agoGHA: Update ngtcp2/ngtcp2 to v1.13.0
renovate[bot] [Mon, 26 May 2025 18:54:21 +0000 (18:54 +0000)] 
GHA: Update ngtcp2/ngtcp2 to v1.13.0

Closes #17459

12 months agodocs: fix typo in retry.md
Samuel Henrique [Sat, 24 May 2025 20:58:01 +0000 (21:58 +0100)] 
docs: fix typo in retry.md

Closes #17443

12 months agoCURLOPT_FOLLOWLOCATION.md: switch to GET => no body
Daniel Stenberg [Mon, 26 May 2025 08:01:08 +0000 (10:01 +0200)] 
CURLOPT_FOLLOWLOCATION.md: switch to GET => no body

Clarify

URL: https://curl.se/mail/lib-2025-05/0026.html
Closes #17454

12 months agoCURLOPT_READFUNCTION.md: mention the seek callback
Daniel Stenberg [Mon, 26 May 2025 10:17:11 +0000 (12:17 +0200)] 
CURLOPT_READFUNCTION.md: mention the seek callback

Brought-up-by: Jeroen Ooms
URL: https://curl.se/mail/lib-2025-05/0030.html
Closes #17455

12 months agoasyn-ares: remove obsolete reference to local_ip6
Kai Pastor [Sun, 25 May 2025 19:07:46 +0000 (21:07 +0200)] 
asyn-ares: remove obsolete reference to local_ip6

7bf576064c moved local_ip6 from the parameter list to the actual
implementation of Curl_async_ares_set_dns_local_ip6. The no-op code for
!( defined(HAVE_CARES_SET_LOCAL) && defined(USE_IPV6) ) still had an
reference which is removed by this change.

Closes #17450

12 months agoftp: fix race in upload handling
Stefan Eissing [Fri, 23 May 2025 14:06:57 +0000 (16:06 +0200)] 
ftp: fix race in upload handling

When TYPE was skipped for an immediate STORE command and the server
replied fast and the EPRT data connection was not ready, the transfer
was not initated, leading to no upload.

Fixes #17394
Closes #17428
Reported-by: JoelAtWisetech on github
12 months agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 24 May 2025 21:00:26 +0000 (23:00 +0200)] 
RELEASE-NOTES: synced

12 months agogetparameter: move --npn, --sslv2 and --sslv3 to generic handler
Daniel Stenberg [Sat, 24 May 2025 13:40:32 +0000 (15:40 +0200)] 
getparameter: move --npn, --sslv2 and --sslv3 to generic handler

For deprecated options.

Closes #17442

12 months agocurl: only warn once for --manual in manual-disabled build
Daniel Stenberg [Sat, 24 May 2025 13:32:33 +0000 (15:32 +0200)] 
curl: only warn once for --manual in manual-disabled build

It would previously say it twice.

Closes #17441

12 months agotool_operate: split up single_transfer
Daniel Stenberg [Fri, 23 May 2025 22:30:22 +0000 (00:30 +0200)] 
tool_operate: split up single_transfer

Complexity reduced from 124 to 83

Remove whitelisting of this function from the complexity script.

Closes #17437

12 months agocurl: change the struct getout flags field into bitfields
Daniel Stenberg [Fri, 23 May 2025 22:08:56 +0000 (00:08 +0200)] 
curl: change the struct getout flags field into bitfields

As the flags were use mostly as individual booleans anyway, the code
gets simpler when we use bitfields instead of manual bitwise operations.

Closes #17436

12 months agourlapi: move complex switch case to separate func
Jacob Mealey [Fri, 23 May 2025 01:40:41 +0000 (21:40 -0400)] 
urlapi: move complex switch case to separate func

Move complex switch statement cases in curl_url_set
to their own functions and call them from switch.

Closes #17435

12 months agoGHA: Update awslabs/aws-lc to v1.52.0
renovate[bot] [Fri, 23 May 2025 20:57:11 +0000 (20:57 +0000)] 
GHA: Update awslabs/aws-lc to v1.52.0

Closes #17434

12 months agoDockerfile: update debian:bookworm-slim Docker digest to 90522ee
renovate[bot] [Thu, 22 May 2025 11:06:02 +0000 (11:06 +0000)] 
Dockerfile: update debian:bookworm-slim Docker digest to 90522ee

Closes #17416

12 months agolib: change progress bitwise ops to bitfields
Daniel Stenberg [Fri, 23 May 2025 14:47:52 +0000 (16:47 +0200)] 
lib: change progress bitwise ops to bitfields

Since they are mostly independent, using them as bitfelds makes the code
easier.

- remove the unused struct field 'width'.

- convert 'speeder_c' to an unsigned char from int

Closes #17431

12 months agosasl: give help when unable to select AUTH
Stefan Eissing [Fri, 23 May 2025 10:21:18 +0000 (12:21 +0200)] 
sasl: give help when unable to select AUTH

When SASL is unable to select an AUTH mechanism, give user help
in info message why no AUTH could be selected.

Fixes #17420
Closes #17427
Reported-by: Aditya Garg
12 months agourldata: remove the unused struct field 'hide_progress'
Daniel Stenberg [Fri, 23 May 2025 14:30:57 +0000 (16:30 +0200)] 
urldata: remove the unused struct field 'hide_progress'

It was only set, never read.

Closes #17430

12 months agosetopt: create set_ssl_options()
Daniel Stenberg [Fri, 23 May 2025 13:57:08 +0000 (15:57 +0200)] 
setopt: create set_ssl_options()

Used for both CURLOPT_SSL_OPTIONS and CURLOPT_PROXY_SSL_OPTIONS

Also: make the DoH code use the full original argument value instead of
each individual flag. Makes it easier to keep all of these in synk.

Closes #17429

12 months agolib3026: drop DLL pre-load perf mitigation for old mingw
Viktor Szakats [Thu, 22 May 2025 07:35:25 +0000 (09:35 +0200)] 
lib3026: drop DLL pre-load perf mitigation for old mingw

curl no longer supports old/legacy/classic mingw.

This mitigation was addressing slow perf seen in CI with old mingw.
The slow perf is not seen in current CI with supported compilers.

Remove the duplicate DLL load function from libtest. It's no longer
used after this patch.

Current CI run times for test3026 on GHA/windows:
```
test 3026...[curl_global_init thread-safety]
 # mingw, CM clang-x86_64 gnutls libssh
 -------e--- OK (1715 out of 1738, remaining: 00:02, took 0.196s, duration: 02:55)
 # dl-mingw, CM 9.5.0-x86_64 schannel
 -------e--- OK (1554 out of 1577, remaining: 00:02, took 0.217s, duration: 02:29)
 # msvc, CM x64-windows schannel +examples
 -------e--- OK (1578 out of 1601, remaining: 00:02, took 0.205s, duration: 02:50)
```

Follow-up to 38029101e2d78ba125732b3bab6ec267b80a0e72 #11625
Follow-up to 856b133f5d62475d4cc12624c4cccb4170134712 #9412
Ref: #17413

Closes #17414

12 months agoGHA: update rojopolis/spellcheck-github-actions digest to 584b2ae
renovate[bot] [Fri, 23 May 2025 07:09:45 +0000 (07:09 +0000)] 
GHA: update rojopolis/spellcheck-github-actions digest to 584b2ae

Closes #17423

12 months agoDEPRECATE.md: add version numbers to old deprecated items
Daniel Stenberg [Fri, 23 May 2025 08:31:00 +0000 (10:31 +0200)] 
DEPRECATE.md: add version numbers to old deprecated items

For better tracking

Closes #17424

12 months agohttp_aws_sigv4: simplify, avoid many gotos
Daniel Stenberg [Fri, 23 May 2025 06:48:22 +0000 (08:48 +0200)] 
http_aws_sigv4: simplify, avoid many gotos

Closes #17422

12 months agohttp_aws_sigv4: return error on too many query components
Daniel Stenberg [Fri, 23 May 2025 06:40:46 +0000 (08:40 +0200)] 
http_aws_sigv4: return error on too many query components

Instead of just silently continuing.

Closes #17421

12 months agowindows: fix builds targeting WinXP, test it in CI
Viktor Szakats [Thu, 22 May 2025 10:16:11 +0000 (12:16 +0200)] 
windows: fix builds targeting WinXP, test it in CI

- appveyor: make a job target Windows XP.

- examples/block_ip: force this specific example to target Vista to make
  it compile when building curl for Windows XP. Fixing:
  ```
  docs\examples\block_ip.c(157): warning C4013: 'inet_pton' undefined; assuming extern returning int
  docs\examples\block_ip.c(272): warning C4013: 'inet_ntop' undefined; assuming extern returning int
  ```
  Ref: https://ci.appveyor.com/project/curlorg/curl/builds/52102142/job/2ajdluhc20r4gmmw#L530

Cherry-picked from #17413
Closes #17415

12 months agoGHA: add a job to check function complexity
Daniel Stenberg [Tue, 20 May 2025 14:49:57 +0000 (16:49 +0200)] 
GHA: add a job to check function complexity

- Done with the new top-complexity script which uses the pmccabe tool.

- Any function scoring over 100 makes the test fail

- The script outputs all functions scoring over 70

- Two >100 functions are whitelisted by name, but they are not allowed
  to increase their scores.

Closes #17398

12 months agomprintf: move outputs into separate functions
Daniel Stenberg [Wed, 21 May 2025 08:33:45 +0000 (10:33 +0200)] 
mprintf: move outputs into separate functions

To make everything easier to read and follow.

Closes #17409

12 months agoftplistparser: protect more cases decrementing 'len'
Daniel Stenberg [Wed, 21 May 2025 10:12:15 +0000 (12:12 +0200)] 
ftplistparser: protect more cases decrementing 'len'

So that they never wrap. More Coverity remarks.

Closes #17406

12 months agourl: reduce complexity of url_match_conn
Stefan Eissing [Wed, 21 May 2025 11:11:06 +0000 (13:11 +0200)] 
url: reduce complexity of url_match_conn

Split off the function code into several static helpers according to
aspects checked.

closes #17408