Commit Graph

35528 Commits

Author SHA1 Message Date
Daniel Stenberg
aa00cb08c9
getparameter: move --npn, --sslv2 and --sslv3 to generic handler
For deprecated options.

Closes #17442
2025-05-24 22:49:34 +02:00
Daniel Stenberg
9b89fd6db7
curl: only warn once for --manual in manual-disabled build
It would previously say it twice.

Closes #17441
2025-05-24 22:48:24 +02:00
Daniel Stenberg
ed07f59841
tool_operate: split up single_transfer
Complexity reduced from 124 to 83

Remove whitelisting of this function from the complexity script.

Closes #17437
2025-05-24 15:43:08 +02:00
Daniel Stenberg
65e4444d67
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
2025-05-24 13:41:32 +02:00
Jacob Mealey
8ab73bb1ff
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
2025-05-24 13:39:34 +02:00
renovate[bot]
2a651525c8
GHA: Update awslabs/aws-lc to v1.52.0
Closes #17434
2025-05-23 23:15:48 +02:00
renovate[bot]
83116e1fca
Dockerfile: update debian:bookworm-slim Docker digest to 90522ee
Closes #17416
2025-05-23 23:14:33 +02:00
Daniel Stenberg
129719c29c
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
2025-05-23 23:13:03 +02:00
Stefan Eissing
37b25f7bb0
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
2025-05-23 22:56:05 +02:00
Daniel Stenberg
b445031e94
urldata: remove the unused struct field 'hide_progress'
It was only set, never read.

Closes #17430
2025-05-23 17:15:32 +02:00
Daniel Stenberg
1fef013b81
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
2025-05-23 17:15:00 +02:00
Viktor Szakats
a0a1df5af9
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 38029101e2 #11625
Follow-up to 856b133f5d #9412
Ref: #17413

Closes #17414
2025-05-23 11:59:03 +02:00
renovate[bot]
76ab38d3b8
GHA: update rojopolis/spellcheck-github-actions digest to 584b2ae
Closes #17423
2025-05-23 11:42:35 +02:00
Daniel Stenberg
2b18866cd9
DEPRECATE.md: add version numbers to old deprecated items
For better tracking

Closes #17424
2025-05-23 11:01:13 +02:00
Daniel Stenberg
9eaaa0748d
http_aws_sigv4: simplify, avoid many gotos
Closes #17422
2025-05-23 09:09:26 +02:00
Daniel Stenberg
6ad9230c2d
http_aws_sigv4: return error on too many query components
Instead of just silently continuing.

Closes #17421
2025-05-23 09:08:36 +02:00
Viktor Szakats
4331e7087b
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
2025-05-22 13:04:28 +02:00
Daniel Stenberg
203b4349af
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
2025-05-21 22:59:13 +02:00
Daniel Stenberg
4a2bd8e458
mprintf: move outputs into separate functions
To make everything easier to read and follow.

Closes #17409
2025-05-21 22:56:02 +02:00
Daniel Stenberg
497d3c7b01
ftplistparser: protect more cases decrementing 'len'
So that they never wrap. More Coverity remarks.

Closes #17406
2025-05-21 22:55:04 +02:00
Stefan Eissing
35e1e7be22
url: reduce complexity of url_match_conn
Split off the function code into several static helpers according to
aspects checked.

closes #17408
2025-05-21 22:54:25 +02:00
Stefan Eissing
e1f65937a9
pytest: add pinnedpubkey test cases
Add positive/negative test cases in pytest for pinned public keys.

Closes #17412
2025-05-21 22:45:42 +02:00
Andrew
2dfe421a64
build: fix OS400 build after curlx move
Fixes #17410
Closes #17411
2025-05-21 15:03:17 +02:00
Stefan Eissing
7836c3de5d
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
2025-05-21 13:58:53 +02:00
Matt Jolly
d214e62f4e
configure: suppress command not found for brew
42331cb48a 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 42331cb48a #17362

Closes #17407
2025-05-21 13:14:46 +02:00
Viktor Szakats
613308a0f1
unit1979, unit1980: fix indent, formatting, scope
Closes #17403
2025-05-21 10:43:47 +02:00
Daniel Stenberg
196afaf75c
ftplistparser: protect two more len -1 uses
Pointed out by Coverity

Closes #17400
2025-05-21 09:23:53 +02:00
Daniel Stenberg
8c8186eadc
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
2025-05-21 09:23:06 +02:00
Christian Schmitz
5b4bd55006
url: fix @param in create_conn header to new one
was async, but is now reusedp.

Closes #17401
2025-05-21 09:17:26 +02:00
Nigel Brittain
c19465ca55
http_aws_sigv4: improve sigv4 url encoding and canonicalization
Closes #17129
2025-05-21 08:07:18 +02:00
Daniel Stenberg
5763449112
RELEASE-NOTES: synced 2025-05-21 07:56:42 +02:00
Daniel Stenberg
6422005a3b
DEPRECATE: restore the Windows CE text
Accidentally wiped out with 63e513b106
2025-05-20 23:11:23 +02:00
Daniel Stenberg
155af7ac77
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
2025-05-20 16:08:29 +02:00
Stefan Eissing
be45e014c6
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
2025-05-20 14:49:17 +02:00
Daniel Stenberg
3ec6aa5c07
formdata: fix memory leak in OOM situation
Fixes #17390
Follow-up to c26da713e7
Reported-by: Viktor Szakats
Closes #17393
2025-05-20 10:44:53 +02:00
Viktor Szakats
1e4a59f8fd
DEPRECATE.md: fix typo
Bug: https://github.com/curl/curl/actions/runs/15112183952/job/42473983311

Closes #17391
2025-05-20 00:40:31 +02:00
renovate[bot]
1952467ea1
GHA/non-native: update cross-platform-actions/action digest to 97419d1
Closes #17389
2025-05-19 22:29:29 +02:00
Viktor Szakats
e785e898a6
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
2025-05-19 18:59:50 +02:00
Viktor Szakats
414ec13840
GHA/non-native: bump to FreeBSD 14.2, OpenBSD 7.7
Follow-up to f56309fdfb #17387

Closes #17388
2025-05-19 16:49:48 +02:00
renovate[bot]
f56309fdfb
GHA/non-native: update cross-platform-actions/action action to v0.28.0
Closes #17387
2025-05-19 16:24:23 +02:00
Viktor Szakats
42331cb48a
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 30ef79ed93 #17295
Follow-up to 9147903366 #16518

Closes #17362
2025-05-19 15:38:05 +02:00
Viktor Szakats
60f8f6d5cb
GHA/linux: restore native arm job
Previously deleted due to flakiness in stunnel package install step.

Follow-up to 0005f91259 #16303
Closes #17375
2025-05-19 15:38:05 +02:00
Daniel Stenberg
c0f724e887
urldata: move a struct field in ssl_primary_config
... which makes the struct eight bytes smaller with no gaps.

Closes #17386
2025-05-19 15:14:23 +02:00
Daniel Stenberg
63e513b106
DEPRECATE.md: drop support for VS2008
Closes #17380
2025-05-19 13:48:41 +02:00
Daniel Stenberg
e83e8c30a8
ftplistparser: split up into more functions
And some general cleanups

Closes #17384
2025-05-19 13:46:12 +02:00
Daniel Stenberg
8491e6574c
DEPRECATE.md: drop Windows CE support
Closes #17379
2025-05-19 13:32:26 +02:00
Stefan Eissing
a85f1df480
pytest tls: extend coverage
Add possibility to reload QUIC test server with another certificate. Add
tests for more coverage of handshakes.

Closes #17382
2025-05-19 13:30:02 +02:00
Daniel Stenberg
dd22442e3b
tool_operate: make retrycheck() a separate function
Simplifies post_per_transfer()

Closes #17381
2025-05-19 13:27:54 +02:00
Daniel Stenberg
c26da713e7
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
2025-05-19 13:26:02 +02:00
Daniel Stenberg
30e40c1a11
RELEASE-NOTES: synced 2025-05-19 10:10:40 +02:00