]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 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
2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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
2 months agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 24 May 2025 21:00:26 +0000 (23:00 +0200)] 
RELEASE-NOTES: synced

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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
2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 months agopytest: add pinnedpubkey test cases
Stefan Eissing [Wed, 21 May 2025 15:40:11 +0000 (17:40 +0200)] 
pytest: add pinnedpubkey test cases

Add positive/negative test cases in pytest for pinned public keys.

Closes #17412

2 months agobuild: fix OS400 build after curlx move
Andrew [Wed, 21 May 2025 12:45:39 +0000 (13:45 +0100)] 
build: fix OS400 build after curlx move

Fixes #17410
Closes #17411

2 months agoopenssl: reduce Curl_ossl_ctx_init complexity
Stefan Eissing [Wed, 21 May 2025 08:57:27 +0000 (10:57 +0200)] 
openssl: reduce Curl_ossl_ctx_init complexity

Reduce Curl_ossl_ctx_init() complexity by splitting it up into
sub functions.

While splitting if ECH, add pytest fixed for AWS-LC and enable
it in CI.

Closes #17404

2 months agoconfigure: suppress command not found for brew
Matt Jolly [Wed, 21 May 2025 10:30:11 +0000 (20:30 +1000)] 
configure: suppress command not found for brew

42331cb48a1f66efaa0920ee8ccba5a74d67de27 made configure checks more
CMake-like, but now calls `brew` resulting in "command not found" in
the configure output if the package is not installed.

Redirect stderr to suppress this; it's not an issue for us if `brew`
isn't found.

Follow-up to 42331cb48a1f66efaa0920ee8ccba5a74d67de27 #17362

Closes #17407

2 months agounit1979, unit1980: fix indent, formatting, scope
Viktor Szakats [Wed, 21 May 2025 07:44:19 +0000 (09:44 +0200)] 
unit1979, unit1980: fix indent, formatting, scope

Closes #17403

2 months agoftplistparser: protect two more len -1 uses
Daniel Stenberg [Wed, 21 May 2025 06:17:25 +0000 (08:17 +0200)] 
ftplistparser: protect two more len -1 uses

Pointed out by Coverity

Closes #17400

2 months agohttp_aws_sigv4: avoid risk of overflowed constant
Daniel Stenberg [Wed, 21 May 2025 06:24:39 +0000 (08:24 +0200)] 
http_aws_sigv4: avoid risk of overflowed constant

- Simplify canon_query() a bit. Avoid unconditionally using length -1
  where length risks being zero at times. Pointed out by Coverity.
- Fix indent errors
- narrow some variable scopes
- fix keywords in tests

Closes #17402

2 months agourl: fix @param in create_conn header to new one
Christian Schmitz [Wed, 21 May 2025 06:18:28 +0000 (08:18 +0200)] 
url: fix @param in create_conn header to new one

was async, but is now reusedp.

Closes #17401

2 months agohttp_aws_sigv4: improve sigv4 url encoding and canonicalization
Nigel Brittain [Sun, 27 Apr 2025 00:22:23 +0000 (00:22 +0000)] 
http_aws_sigv4: improve sigv4 url encoding and canonicalization

Closes #17129

2 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 21 May 2025 05:56:42 +0000 (07:56 +0200)] 
RELEASE-NOTES: synced

2 months agoDEPRECATE: restore the Windows CE text
Daniel Stenberg [Tue, 20 May 2025 21:11:23 +0000 (23:11 +0200)] 
DEPRECATE: restore the Windows CE text

Accidentally wiped out with 63e513b106113db0b1b68bab347b80c

2 months agoftplistparser: add two overflow preventions
Daniel Stenberg [Tue, 20 May 2025 13:46:41 +0000 (15:46 +0200)] 
ftplistparser: add two overflow preventions

These two conditions probably cannot actually happen, but these two
checks make that certain and should please the static code analyzers.

Pointed out by Coverity

Closes #17397

2 months agodns_entry: move from conn to data->state
Stefan Eissing [Mon, 19 May 2025 10:25:58 +0000 (12:25 +0200)] 
dns_entry: move from conn to data->state

The `struct Curl_dns_entry *` used to established a connection
do not have the connection's lifetime, but the transfer's lifetime
(of the transfer that initiates the connect).

`Curl_dns_entry *` is reference counted with the "dns cache". That
cache might be owned by the multi or the transfer's share. In the
share, the reference count needs updating under lock.

Therefore, the dns entry can only be kept *and* released using the
same transfer it was initially looked up from. But a connection is
often discarded using another transfer.

So far, the problem of this has been avoided in clearing the connection's
dns entries in the "multi_don()" handling. So, connections had NULL
dns entries after the initial transfers and its connect had been handled.

Keeping the dns entries in data->state seems therefore a better choice.

Also: remove the `struct Curl_dns_entry *` from the connect filters
contexts. Use `data->state.dns` every time instead and fail correctly
when not present and needed.

Closes #17383

2 months agoformdata: fix memory leak in OOM situation
Daniel Stenberg [Tue, 20 May 2025 07:05:16 +0000 (09:05 +0200)] 
formdata: fix memory leak in OOM situation

Fixes #17390
Follow-up to c26da713e7dfa8c26a71bf3c0c75
Reported-by: Viktor Szakats
Closes #17393

2 months agoDEPRECATE.md: fix typo
Viktor Szakats [Mon, 19 May 2025 22:27:44 +0000 (00:27 +0200)] 
DEPRECATE.md: fix typo

Bug: https://github.com/curl/curl/actions/runs/15112183952/job/42473983311

Closes #17391

2 months agoGHA/non-native: update cross-platform-actions/action digest to 97419d1
renovate[bot] [Mon, 19 May 2025 14:50:41 +0000 (14:50 +0000)] 
GHA/non-native: update cross-platform-actions/action digest to 97419d1

Closes #17389

2 months agochecksrc: avoid extra runs in CI, enable more check locally, fix fallouts
Viktor Szakats [Sat, 17 May 2025 00:02:23 +0000 (02:02 +0200)] 
checksrc: avoid extra runs in CI, enable more check locally, fix fallouts

To avoid redundant work in CI and to avoid a single checksrc issue make
all autotools jobs fail. After this patch checksrc issues make fail
the checksrc job, the `dist / verify-out-of-tree-autotools-debug`,
`dist / maketgz-and-verify-in-tree`  jobs and the fuzzer job (if run).
Of these, the `dist` jobs replicate local builds, also testing the build
logic.

Also add a script to check the complete local repository, optionally
with the build tree to verify generated C files.

Also:
- automatically run checksrc in subdirectories having a `checksrc`
  target. (examples, OS400, tests http/client, unit and tunit)
- tests/libtest: make sure to run `checksrc` on generated `lib1521.c`.
  (requires in-tree autotools build.)
- tests: run `checksrc` on targets also for non-`DEBUGBUILD`
  builds. It ensures to check `lib1521.c` in CI via job
  `dist / maketgz-and-verify-in-tree`.
- src: drop redundant `$(builddir)` in autotools builds.
- scripts: add `checksrc-all.sh` script to check all C sources and
  the build directory as an option.
- use the above from CI, also make it verify all generated sources.
- silence `checksrc` issues in generated C sources.
- checksrc: add `-v` option to enable verbose mode.
- checksrc: make verbose mode show checked filename and fix to only
  return error on failure.
- make sure that generated C files pass `checksrc`.

Assisted-by: Daniel Stenberg
Closes #17376

2 months agoGHA/non-native: bump to FreeBSD 14.2, OpenBSD 7.7
Viktor Szakats [Mon, 19 May 2025 14:27:20 +0000 (16:27 +0200)] 
GHA/non-native: bump to FreeBSD 14.2, OpenBSD 7.7

Follow-up to f56309fdfb34e3a01b070423a3e5313e73d67acc #17387

Closes #17388

2 months agoGHA/non-native: update cross-platform-actions/action action to v0.28.0
renovate[bot] [Mon, 19 May 2025 13:15:33 +0000 (13:15 +0000)] 
GHA/non-native: update cross-platform-actions/action action to v0.28.0

Closes #17387

2 months agopytest: enable in 5 GHA jobs, fix fallouts
Viktor Szakats [Thu, 15 May 2025 20:11:06 +0000 (22:11 +0200)] 
pytest: enable in 5 GHA jobs, fix fallouts

They take about 4.5 minutes of CI time in GHA/macos.

Also:
- autotools: improve `caddy`, `vsftpd` detection.
  Bringing it closer to cmake.
- autotools: fix `--with-test-caddy=no`, `--with-test-vsftps=no`,
  `--with-test-nghttpx=no` options.
- cmake: sync `nghttpx` default with autotools.
- pytest: disable failing mbedTLS tests on macOS CI.
- pytest: disable failing earlydata tests on macOS CI.
- GHA/macos: keep vsftpd pytests disabled due to lengthy run times.
- pytest: fix test_05_04 for LibreSSL. Ref: #17367
Authored-by: Stefan Eissing
Remaining issues:
- some unidentified tests taking a long time with mbedTLS:
  `================= 462 passed, 278 skipped in 347.93s (0:05:47) =================`
  Ref: https://github.com/curl/curl/actions/runs/15073354301/job/42374999041#step:17:1536
  Workaround: not enabling pytest for mbedTLS jobs
- 17 FTP tests taking a long time (affecting all TLS backends):
  without vsftpd:
  `====================== 496 passed, 244 skipped in 56.15s =======================`
  Ref: https://github.com/curl/curl/actions/runs/15073354301/job/42374998230#step:17:1536
  with vsftpd:
  `================= 513 passed, 227 skipped in 409.37s (0:06:49) =================`
  Ref: https://github.com/curl/curl/actions/runs/15073678568/job/42376039672?pr=17362#step:17:1537
  Workaround: force-disable vsftpd.
- 100 tests failing with SecureTransport. Let's ignore that due to imminent deprecation.
  Ref: https://github.com/curl/curl/actions/runs/15055652333/job/42320873732#step:17:15362

Follow-up to 30ef79ed937ca0fc7592ff73d162398773c6a5aa #17295
Follow-up to 914790336664da0451e2f57906373a7707bd7cc3 #16518

Closes #17362

2 months agoGHA/linux: restore native arm job
Viktor Szakats [Fri, 16 May 2025 22:21:20 +0000 (00:21 +0200)] 
GHA/linux: restore native arm job

Previously deleted due to flakiness in stunnel package install step.

Follow-up to 0005f91259a7c5088ce98e15dbba8e0e70a97e0c #16303
Closes #17375

2 months agourldata: move a struct field in ssl_primary_config
Daniel Stenberg [Mon, 19 May 2025 12:36:57 +0000 (14:36 +0200)] 
urldata: move a struct field in ssl_primary_config

... which makes the struct eight bytes smaller with no gaps.

Closes #17386

2 months agoDEPRECATE.md: drop support for VS2008
Daniel Stenberg [Sun, 18 May 2025 21:01:32 +0000 (23:01 +0200)] 
DEPRECATE.md: drop support for VS2008

Closes #17380

2 months agoftplistparser: split up into more functions
Daniel Stenberg [Mon, 19 May 2025 08:31:24 +0000 (10:31 +0200)] 
ftplistparser: split up into more functions

And some general cleanups

Closes #17384

2 months agoDEPRECATE.md: drop Windows CE support
Daniel Stenberg [Sun, 18 May 2025 14:45:19 +0000 (16:45 +0200)] 
DEPRECATE.md: drop Windows CE support

Closes #17379

2 months agopytest tls: extend coverage
Stefan Eissing [Sat, 17 May 2025 10:19:01 +0000 (12:19 +0200)] 
pytest tls: extend coverage

Add possibility to reload QUIC test server with another certificate. Add
tests for more coverage of handshakes.

Closes #17382

2 months agotool_operate: make retrycheck() a separate function
Daniel Stenberg [Mon, 19 May 2025 07:58:42 +0000 (09:58 +0200)] 
tool_operate: make retrycheck() a separate function

Simplifies post_per_transfer()

Closes #17381

2 months agoformdata: cleanups
Daniel Stenberg [Fri, 16 May 2025 21:18:34 +0000 (23:18 +0200)] 
formdata: cleanups

- use memchr() instead of for() loop
- add and use free_formlist() instead of duplicate code
- shorten some variable names
- reduce flag struct field from 'long' to 'unsigned char'
- pass in struct pointer, not individual fields, to addhttppost()

Closes #17370

2 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 19 May 2025 08:10:40 +0000 (10:10 +0200)] 
RELEASE-NOTES: synced

2 months agotool_operate: when retrying, only truncate regular files
Daniel Stenberg [Fri, 16 May 2025 22:17:11 +0000 (00:17 +0200)] 
tool_operate: when retrying, only truncate regular files

If /dev/null or another character device etc is used for output, trying
to truncate that only causes errors.

Add test 1497 to verify

Fixes #17371
Reported-by: Brendan Dolan-Gavitt
Closes #17374

2 months agosetopt: split setopt_long
Christian Schmitz [Fri, 16 May 2025 15:53:06 +0000 (17:53 +0200)] 
setopt: split setopt_long

Split off the biggest options RTSP_REQUEST, SSLVERSION and HTTP_VERSION
into sub functions to reduce complexity.

Closes #17372

2 months agolibtests: define CURL_DISABLE_DEPRECATION first
Daniel Stenberg [Fri, 16 May 2025 15:09:49 +0000 (17:09 +0200)] 
libtests: define CURL_DISABLE_DEPRECATION first

Instead of using the kludgey ignore macros inline. They make setting
break-points in a debugger and single-stepping code impossible.

Closes #17373

2 months agoformdata: split up FormAdd
Christian Schmitz [Fri, 16 May 2025 09:11:24 +0000 (11:11 +0200)] 
formdata: split up FormAdd

To reduce complexity of FormAdd, split the checking part into a separate
function.

Closes #17366

2 months agolibssh2: remove the 'actualcode' struct field
Daniel Stenberg [Fri, 16 May 2025 12:11:54 +0000 (14:11 +0200)] 
libssh2: remove the 'actualcode' struct field

Return and use CURLcode to a larger extent to avoid the complicated
double return code setup previously used.

Closes #17369

2 months agourlapi: remove unneeded guards around PUNY2IDN
Jacob Mealey [Thu, 15 May 2025 23:57:49 +0000 (19:57 -0400)] 
urlapi: remove unneeded guards around PUNY2IDN

Add more IDN/punycode tests to 1560

Closes #17364

2 months agoasnyc-thrdd: explain how this is okay with a comment
Stefan Eissing [Fri, 16 May 2025 08:38:13 +0000 (10:38 +0200)] 
asnyc-thrdd: explain how this is okay with a comment

Coverity assess correctly that a variable write under mutex lock could
overwrite values from another thread - if the function were ever called
from multiple thread for the same transfer - which it is not.

Closes #17365

2 months agolibssh: add NULL check for Curl_meta_get()
Daniel Stenberg [Thu, 15 May 2025 19:58:36 +0000 (21:58 +0200)] 
libssh: add NULL check for Curl_meta_get()

It really cannot return NULL in a working condition, but ...

Pointed out by Coverity.

Closes #17359

2 months agolibssh: remove a condition that always equals false
Daniel Stenberg [Thu, 15 May 2025 19:55:41 +0000 (21:55 +0200)] 
libssh: remove a condition that always equals false

Found by Coverity

Closes #17358

2 months agotest1173.pl: whitelist some option-looking names that aren't options
Daniel Stenberg [Thu, 15 May 2025 20:08:09 +0000 (22:08 +0200)] 
test1173.pl: whitelist some option-looking names that aren't options

Referring to the names in the CURLOPT_DEBUGFUNCTION by name is still
fine. They start with CURLINFO but aren't really options for *getinfo().

Closes #17361

2 months agopytest-xdist: pytest in parallel
Stefan Eissing [Mon, 12 May 2025 13:49:49 +0000 (15:49 +0200)] 
pytest-xdist: pytest in parallel

Require now pytest-xdist from tests/http/requirements.txt and
run pytest in 'auto' parallel mode (counts cpu cores).

For CI runs, set the worker count to 4, overriding the
core count of 2 exposed in the images.

- use Filelock to generate allocated ports at start for all
  workers and have subsequent workers just read the file and
  take the ports for their slot
- make httpd config clearing a function fixture so every test
  starts with a clean httpd config
- have fixture `configures_httpd` as parameter of test cases
  that configure httpd anyway, saving one reload
- add pytest-xdist and filelock to required pyhton modules
- add installs to ruff CI
- give live checks waiting for a server to start up longer time
- add fixtures to tests that rely on a server
- do not stop servers unnecessarily. failures may not start them
  properly again, leading to unexpected fails in whatever follows
- add a https: port to httpd that is *not* back by QUIC to allow
  failover tests without stopping the QUIC server

Closes #17295

2 months agolibssh2: split up ssh_statemachine
Daniel Stenberg [Thu, 15 May 2025 13:40:13 +0000 (15:40 +0200)] 
libssh2: split up ssh_statemachine

Into many sub functions.

Complexity taken down from 150 to 37.

Closes #17356

2 months agodocs/libcurl: mention sensitive data/headers
Daniel Stenberg [Thu, 15 May 2025 09:02:55 +0000 (11:02 +0200)] 
docs/libcurl: mention sensitive data/headers

In the CURLOPT_DEBUGFUNCTION and CURLOPT_VERBOSE documentation.

Mentioned-by: Gordon Parke
Fixes #17353
Closes #17355

2 months agoGHA/curl-for-win: build one job with classic zlib
Viktor Szakats [Thu, 15 May 2025 16:02:25 +0000 (18:02 +0200)] 
GHA/curl-for-win: build one job with classic zlib

curl-for-win switched to zlib-ng by default. Switch curl's explicit
zlib-ng job to classic zlib to keep testing that build path.

Ref: https://github.com/curl/curl-for-win/pull/79
Ref: https://github.com/curl/curl-for-win/commit/5aed6363cd1051b560b3f7c57c97e04bf8cd74cb

Closes #17357

2 months agotool_operate: move config2setopts to separate file, split into subs
Daniel Stenberg [Thu, 15 May 2025 07:49:47 +0000 (09:49 +0200)] 
tool_operate: move config2setopts to separate file, split into subs

To decrease size and complexity. Complexity taken down from 190 to 80.

Bonus:

- remove leftover HTTP/0.9 warning never triggered since hyper was dropped
- remove the ftp-skip-ip option unless FTP is used
- only set HTTP options if HTTP(S) is used
- remove use of the pointless SETOPT_CHECK macro

Side-effect:

- The order of the options in --libcurl is modified

Closes #17352

2 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 15 May 2025 12:16:15 +0000 (14:16 +0200)] 
RELEASE-NOTES: synced

2 months agoCONTRIBUTE: add project guidelines for AI use
Daniel Stenberg [Mon, 12 May 2025 10:55:20 +0000 (12:55 +0200)] 
CONTRIBUTE: add project guidelines for AI use

Feedback-by: Daniel Fosco
Feedback-by: Jimmy Sjölund
Feedback-by: Christoph Jabs
Feedback-by: Manuel Strehl
Feedback-by: Dan Fandrich
Feedback-by: Sarah Gooding
Closes #17325

2 months agongtcp2: clarify ignoring of result
Stefan Eissing [Thu, 15 May 2025 08:48:12 +0000 (10:48 +0200)] 
ngtcp2: clarify ignoring of result

In shutdown, the result of a bufq_write() is intentionally ignored, but
it was not obvious why. Add a (void) cast to declare intent and a
comment explaining why.

Closes #17354

2 months agopytest: give parameterised tests better ids for read- and parsability
Stefan Eissing [Tue, 13 May 2025 10:55:16 +0000 (12:55 +0200)] 
pytest: give parameterised tests better ids for read- and parsability

Closes #17340

2 months agonetrc: deal with null token better
Daniel Stenberg [Wed, 14 May 2025 22:05:11 +0000 (00:05 +0200)] 
netrc: deal with null token better

If there is no length of the token, assign a blank string to avoid
risking it being NULL.

Pointed out by Coverity

Closes #17351

2 months agotests/FILEFORMAT.md: document the aws feature
Daniel Stenberg [Wed, 14 May 2025 21:39:44 +0000 (23:39 +0200)] 
tests/FILEFORMAT.md: document the aws feature

Closes #17350

2 months agotests: add aws feature to the related tests
Maksim Ściepanienka [Wed, 14 May 2025 19:55:47 +0000 (21:55 +0200)] 
tests: add aws feature to the related tests

Closes #17347

2 months agoGHA: add libssh to the openssl O3 job
Daniel Stenberg [Wed, 14 May 2025 09:50:01 +0000 (11:50 +0200)] 
GHA: add libssh to the openssl O3 job

To make sure we run libssh tests with valgrind enabled

Closes #17345

2 months ago_SEEALSO.md: remove spaces around command and man page section
Daniel Stenberg [Wed, 14 May 2025 21:07:30 +0000 (23:07 +0200)] 
_SEEALSO.md: remove spaces around command and man page section

Follows traditions better

Closes #17348

2 months agolibssh: split up the state machine function
Daniel Stenberg [Wed, 14 May 2025 09:46:11 +0000 (11:46 +0200)] 
libssh: split up the state machine function

This reduces the "complexity score" for myssh_statemach_act from 160 to
100, taking it down from the most complex function in libcurl to the
5th.

Also fixes a memory leak of the sftp session.

Closes #17346

2 months agoscripts: move the ruff linter command into a script 17343/head
Dan Fandrich [Tue, 13 May 2025 23:14:57 +0000 (16:14 -0700)] 
scripts: move the ruff linter command into a script

This makes it easier for users to run it with the correct options
locally. Also, update the ruff, pytype and cmakelint versions to the
latest current ones.

Closes #17343

2 months agospacecheck.pl: drop more exceptions
Viktor Szakats [Tue, 13 May 2025 09:11:55 +0000 (11:11 +0200)] 
spacecheck.pl: drop more exceptions

- replace ß (scharfes S) with links.
- replace § (section sign) with links.
- replace 🙏 emoji with `:pray:`.
 Supported by GitHub, Forgejo/Gitea and most likely GitLab.
- docs/libcurl/curl_mprintf.md: replace Unicode ± with `{+|-}`.
- docs/CIPHERS.md: URL encode Unicode in URLs.
- lib1560: use hex encoding in `räksmörgås.se`.
- unit1307: use hex encoding in `Lindmätarv`.
- drop LATIN SMALL LETTER A WITH ACUTE exception.
  No longer appears in tests.

This leaves the single character exception: `ö`
And file exceptions holding contributor names.

Follow-up to 9243ed59b387a90940fa4a16ebfd99ad7d6c2f63 #17329
Follow-up to 838dc53bb7bf52039b23af0e9ccffa51cf9ad7d0 #17247

Closes #17335

2 months agotests/server/Makefile.inc: cleanup
Daniel Stenberg [Tue, 13 May 2025 10:05:39 +0000 (12:05 +0200)] 
tests/server/Makefile.inc: cleanup

- drop curl_ctype.h as it is not used by test servers
- list all curlx files in the CURLX_* lists
- sort the lists alphabetically

Closes #17339

2 months agosetopt: provide info for CURLE_BAD_FUNCTION_ARGUMENT
Daniel Stenberg [Tue, 13 May 2025 09:25:43 +0000 (11:25 +0200)] 
setopt: provide info for CURLE_BAD_FUNCTION_ARGUMENT

If CURLE_BAD_FUNCTION_ARGUMENT is returned and failf() has not provided
any details, this adds a generic error string that includes the option
number.

This helps debugging for example the curl tool which does a lot of
setopt calls and in reading post fact logs it is not always easy to tell
exactly which call that failed.

Closes #17337

2 months agoheaders: set an error message on illegal response headers
Daniel Stenberg [Tue, 13 May 2025 09:19:40 +0000 (11:19 +0200)] 
headers: set an error message on illegal response headers

Makes it report "Invalid response header" instead of the slightly odd "A
libcurl function was given a bad argument".

Add test 749 and 750 for more CONNECT response testing.

Reported-by: Int64x86 on github
Fixes #17330
Closes #17336

2 months agolib1560: use hex notation, drop non-ASCII exception
Viktor Szakats [Tue, 13 May 2025 08:35:26 +0000 (10:35 +0200)] 
lib1560: use hex notation, drop non-ASCII exception

Closes #17334

2 months agotests: provide all non-ascii data hex encoded
Daniel Stenberg [Tue, 13 May 2025 06:12:26 +0000 (08:12 +0200)] 
tests: provide all non-ascii data hex encoded

- make the scanner not whitelist anything for test cases making
  everything non-ascii forced to be hex encoded

- update all tests using non-ascii bytes to use %hex[] sequences

Closes #17331

2 months agocurlx: move the docs to docs/internals/
Daniel Stenberg [Tue, 13 May 2025 06:18:30 +0000 (08:18 +0200)] 
curlx: move the docs to docs/internals/

Closes #17333

2 months agotests/server: stop using libcurl string comparisons
Daniel Stenberg [Mon, 12 May 2025 20:48:47 +0000 (22:48 +0200)] 
tests/server: stop using libcurl string comparisons

Further untangle the test server code from curl code. While the string
comparison functions are available in the libcurl API, the tests servers
don't link with libcurl. Use native functions instead.

Closes #17328