Commit graph

36886 commits

Author SHA1 Message Date
Viktor Szakats
2dc71ba8bf
badwords: check indented lines in source code, fix fallouts
- badwords.pl: add `-a` option to check all lines in source code files.
  Before this patch indented lines were skipped (to avoid Markdown code
  fences.)
- GHA/checksrc: use `-a` when verifying the source code.
- GHA/checksrc: disable `So` and `But` rules for source code.
- GHA/checksrc: add docs/examples to the verified sources.
- badwords.txt: delete 4 duplicates.
- badwords.txt: group and sort contractions.
- badwords.txt: allow ` url = `, `DIR`, `<file name`.

Closes #19536
2025-11-15 13:25:02 +01:00
Viktor Szakats
8a968095df
mk-ca-bundle.pl: default to SHA256 fingerprints with -t option
Replacing previous default: MD5.

You can use the existing `-s` option to override the default.

Also bump version to 1.30.

Closes #19359
2025-11-15 03:06:33 +01:00
Viktor Szakats
7bb59a7dc7
badwords.pl: fix variable in printf mask
Causing warnings if a matched line has mask patterns.

Closes #19534
2025-11-14 18:14:31 +01:00
Viktor Szakats
231e8a71e1
docs: fix checksrc warning, fix checkdocs CI filter
Also:
- GHA/checkdocs: fix CI filters to catch it early.
  Follow-up to 28dd14aafe #15797

Closes #19533
2025-11-14 17:32:04 +01:00
Viktor Szakats
af4c789e00
badwords: fix two exceptions and drop them
Also:
- extend `dir` rule to exclude C assignments.

Closes #19532
2025-11-14 17:32:04 +01:00
Viktor Szakats
f3095f0dbd
GHA/checksrc: check XML files for errors
Closes #19528
2025-11-14 17:32:04 +01:00
nait-furry
57b4fe1817
limit-rate: add example using --limit-rate and --max-time together
Closes #19473
2025-11-14 17:09:07 +01:00
Stefan Eissing
f37c956d0f
test07_22: fix flakiness
The HTTP/3 tests did send 20 transfers against nghttpx with a backend
that failed the uploads with a 400 and an incomplete response body. This
causes stream resets.

Apache keeps the connection open, but newer nghttpx closes the front
connection after "too many" reset. When that bites, it depends on the
number of transfers ongoing how the test case fails. This led to flaky
outcomes.

Reduce the transfers to just a single one and check the result of
that one. Parallelism is not important here.

refs #19489
Closes #19530
2025-11-14 17:06:23 +01:00
Daniel Stenberg
3d91ca8cdb
vquic-tls/gnutls: call Curl_gtls_verifyserver unconditionally
Closes #19531
2025-11-14 17:05:11 +01:00
Stefan Eissing
dc34498d18
cf-socket: trace ignored errors
Instead of blasting the user with infof() statements.

Reported-by: Aleksandr Sergeev
Fixes #19520
Closes #19527
2025-11-14 17:04:15 +01:00
Stefan Eissing
9f979ea683
vtls: pinned key check
Cleanup the vtls pinned key matching somewhat. Add a DEBUGF
for pinned key hashes that do not match, so we can see in
traces what was going on.

Ref #19489
Closes #19529
2025-11-14 17:01:44 +01:00
Stefan Eissing
0abb72210e
getinfo: improve perf in debug mode
Save some cpu cycles in debug mode for getinfo. Look up env vars for
overwriting variables only when variables are actually requested.

Closes #19525
2025-11-14 16:47:47 +01:00
Daniel Stenberg
9a633ec04f
connect: reshuffle Curl_timeleft_ms to avoid 'redundant condition'
Line 143: "if(duringconnect)" would always equal true. While this is
harmless, I believe this minor tweak makes the flow slightly more
obvious to the reader and avoids the redundant condition.

Pointed out by CodeSonar

Closes #19523
2025-11-14 15:12:58 +01:00
Stefan Eissing
971e8d661c
examples/multithread: fix race condition
Reported-by: Nick Korepanov
Fixes #19524
Closes #19526
2025-11-14 15:11:53 +01:00
Daniel Stenberg
5f4cd4c689
DEPRECATE: remove RTMP support in April 2026
URL: https://curl.se/mail/lib-2025-11/0008.html
2025-11-14 09:42:03 +01:00
Daniel Stenberg
3fc31c4ee2
config2setopts: bail out if curl_url_get() returns OOM
Closes #19518
2025-11-14 09:39:42 +01:00
Viktor Szakats
ae7b4eeade
curl_setup.h: drop stray #undef stat (Windows)
Follow-up to 9678ff5b1b #18776

Closes #19519
2025-11-14 01:47:12 +01:00
Viktor Szakats
96500f466e
tidy-up: result code variable names in tests and examples
Sync outliers with the rest of the code.

Also:
- return error in some failed init cases, instead of `CURLE_OK`:
  1908, 1910, 1913, 2082, 3010
- lib1541: delete unused struct member.

Closes #19515
2025-11-14 01:47:12 +01:00
Daniel Stenberg
e3e0559ed2
config2setopts: exit if curl_url_set() fails on OOM
An error case that previously did not properly return error.

Closes #19517
2025-11-13 22:57:08 +01:00
Daniel Stenberg
42098d1ee6
checksrc: verify close brace indent level
Closes #19512
2025-11-13 17:27:48 +01:00
Daniel Stenberg
0afb52a0cd
code: minor indent fixes before closing braces
Closes #19512
2025-11-13 17:27:40 +01:00
Daniel Stenberg
75955c0851
tool_operate: exit on curl_share_setopt errors
Continuing when one of these has failed is fragile and error-prone.

Closes #19513
2025-11-13 17:24:40 +01:00
Daniel Stenberg
f2a75a14dd
sws: repair --port, and accept any port
Also for mqttd and sockfilt. The < 1025 check was not serving any
purpose.

Follow-up to bb1391f943
2025-11-13 17:20:41 +01:00
Viktor Szakats
6384e2aca0
checksrc: disallow atoi and atol globally
No longer used in core and test code.

Also: allowlist in docs/examples.

Closes #19508
2025-11-13 14:28:25 +01:00
Viktor Szakats
bb1391f943
tests/server: replace atoi() and atol() with curlx_str_number()
Closes #19510
2025-11-13 14:09:03 +01:00
Daniel Stenberg
833c429627
wolfssl: simplify wssl_send_earlydata
Move out logic from a switch() expression and return error directly
instead of using goto. This also removes the odd-looking two subsequent
closing braces at the same indent level.

Closes #19509
2025-11-13 13:46:28 +01:00
Stefan Eissing
cb2bcb681f
lib: eliminate size_t casts
Add new functions in `curlx/warnless.h` for controlled type
conversions:

* curlx_uitouz, convert unsigned into to size_t (should always work)
* curlx_uztoso, convert size_t to curl_off_t, capping at CURL_OFF_T_MAX
* curlx_sztouz, convert ssize_t to size_t, return TRUE when ok
* curlx_sotouz_range, convert curl_off_t to size_t interval, capping
  values to interval bounds

Remove some unnecesary casts, convert some internal recv functions
to the "return result, have size_t* arg" pattern.

Closes #19495
2025-11-13 13:32:19 +01:00
Stefan Eissing
78a610cb83
lib: rename curlx_timediff to curlx_timeleft_ms
Rename `Curl_timeleft()` to `Curl_timeleft_ms()` to make the units in
the returned `timediff_t` clear. (We used to always have ms there, but
with QUIC started to sometimes calc ns as well).

Rename some assigned vars without `_ms` suffix for clarity as well.

Closes #19486
2025-11-13 13:12:58 +01:00
Viktor Szakats
ca27404d27
tests/data: add %includetext, dedupe XML payloads into external file
To reduce duplication and to avoid keeping XML-like markup within XML
markup (`test*`), that was tripping `xmllint`.

Ref: #19470

Closes #19504
2025-11-13 12:24:50 +01:00
Viktor Szakats
85cfc15601
RELEASE-NOTES: codespell 2025-11-13 11:46:13 +01:00
Viktor Szakats
e18ad59e46
runtests: add missing Perl semicolon
Follow-up to f477f3efc3 #19398

Closes #19507
2025-11-13 11:41:12 +01:00
Viktor Szakats
4415e865ad
libtests: replace atoi() with curlx_str_number()
Also:
- lib1568: fail in global initialization error.

Closes #19506
2025-11-13 11:41:12 +01:00
Viktor Szakats
e496bcfd0a
FILEFORMAT.md: drop some text from the command section
Special meanings of URLs became outdated, and it's also no longer
necessary to pass the test number via the URL or domain anymore.
Delete the text.

Follow-up to c6f1b0ff49 #19429

Closes #19503
2025-11-13 11:41:11 +01:00
Daniel Stenberg
3f0629ca44
cookie: propagate errors better, cleanup the internal API
Overhaul of the internal cookie APIs and an attempt to better return
errors for OOM and similar critical problems, separate from ordinary and
benign parsing problems.

Closes #19493
2025-11-13 10:07:24 +01:00
Daniel Stenberg
296ffc45c3
schannel: replace atoi() with curlx_str_number()
The last atoi() call removed from libcurl

Closes #19483
2025-11-13 09:06:02 +01:00
Daniel Stenberg
f1fec22776
RELEASE-NOTES: synced
curlver: 8.18.0 is the next planned release version
2025-11-13 08:49:49 +01:00
Viktor Szakats
3d42510118
runtests: allow client/command to span multiple lines, and use it
Some curl command-lines are long, often repetitive, and difficult
to read or write:

Before this patch (1 test == 1 line):
- <=78 characters: 1099 tests
- 79-132 characters: 500 tests
- 133+ characters: 217 tests: patch meant to help with some of these.

After this patch:
- <=78 characters: 1288 lines
- 79-132 characters: 526 lines
- 133+ characters: 190 lines

After this patch it's possible to fold long lines into multiple ones.
Folding can reduce greppability, thus this is primarily useful for cases
when the options are repetitive, e.g. a list of form options, headers,
mail parameters and the like.

Closes #19500
2025-11-13 01:05:01 +01:00
Patrick Monnerat
64c03bbdf2 OS400: fix build
- Fix failed build due to missing parameter.

Follow-up to 8c9946d3 from yesterday.

Closes https://github.com/curl/curl/pull/19494
2025-11-12 17:46:37 -05:00
Daniel Stenberg
c6eb9bb3dc
_PROGRESS.md: add the E unit, mention kibibyte
The suffixes used are not standard since we want them to be single
characters and the proper ones would be KiB, MiB etc.

Closes #19502
2025-11-12 23:44:25 +01:00
Viktor Szakats
4b2da75bca
test716: use repeat macro
Closes #19501
2025-11-12 21:40:21 +01:00
Viktor Szakats
6b26d465e1
tests/data: use more repeat macro
Found in `client/command` sections.

Closes #19499
2025-11-12 20:07:19 +01:00
Viktor Szakats
8a19bf862a
test2045: replace HTML multi-line comment markup with # comments
As used everywhere else in tests/data. To play nice with XML.

Follow-up to 9756d1da76

Closes #19498
2025-11-12 20:07:18 +01:00
Viktor Szakats
d7b0b654ea
test1404, 1547: replace & char in comment and name for XML-friendliness
Closes #19497
2025-11-12 17:10:22 +01:00
Viktor Szakats
d077d5473d
test1554: make test output XML-friendly
Meaning no `<` and `>` characters.
Reducing the number of `xmllint` failures by 1.

Closes #19496
2025-11-12 16:26:57 +01:00
Viktor Szakats
ce329affa7
test557: avoid & symbol in test output to be XML-friendly
Closes #19492
2025-11-12 16:26:57 +01:00
Viktor Szakats
1e5cb75218
test363: delete stray character (typo) from a section tag
Did not cause an issue in runtests. Caught by `xmllint`.

Follow-up to 63e9721b63 #19313

Closes #19490
2025-11-12 16:26:57 +01:00
Viktor Szakats
a9ec2a676c
tests/data: avoid tag markup in comments
To avoid confusing `xmllint`, and reducing the number of files failing
`xmllint --format` from 169 to 144.

Closes #19491
2025-11-12 16:26:57 +01:00
Viktor Szakats
2c7e1792a0
test2405: split off H2 tests to new test 2407, fix callback prototype
To untangle the different curl/server requirements of these tests.
Also to make this test run for non-H2 builds. Searching the cause of
the flakiness documented in #19481.

Also:
- fix the callback function prototype. Detected by ASAN with this patch,
  though the issue was pre-existing.
  ```
  lib/cw-out.c:211:14: runtime error: call to function emptyWriteFunc
    through pointer to incorrect function type
    'unsigned long (*)(char *, unsigned long, unsigned long, void *)'
  tests/libtest/lib2405.c:72: note: emptyWriteFunc defined here
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior lib/cw-out.c:211:14
  ```
  Ref: https://github.com/curl/curl/actions/runs/19296686908/job/55180334364?pr=19487#step:44:3768

Follow-up to 96a5ce5a82 #19481

Closes #19487
2025-11-12 13:56:02 +01:00
Viktor Szakats
ebead15f4e
lib1509: make callbacks static
Closes #19488
2025-11-12 13:49:30 +01:00
Viktor Szakats
96a5ce5a82
test2405: report fd_count* variables on failure
This test is frequently failing in macOS !ssl jobs:

"curl_multi_waitfds() should return at least the number of fds needed":
https://github.com/curl/curl/actions/runs/19290229745/job/55159015942 AM clang !ssl !debug brotli zstd
https://github.com/curl/curl/actions/runs/19289578332/job/55157058146 AM clang !ssl !debug brotli zstd
https://github.com/curl/curl/actions/runs/19188515879/job/54859474947 AM clang !ssl
https://github.com/curl/curl/actions/runs/19165077858/job/54783776869 AM clang !ssl libssh2 AppleIDN
https://github.com/curl/curl/actions/runs/19046554157/job/54396096298 AM gcc-12 !ssl !debug

"curl_multi_waitfds() should return the amount of fds needed if enough isn't passed in":
https://github.com/curl/curl/actions/runs/19184546172/job/54848549080 AM gcc-13 !ssl !debug

Also high on the test clutch list:
2405 FAIL times: 165
Ref: https://testclutch.curl.se/static/reports/results-count.html

```
libtests returned 44, when expecting 0

FAIL 2405: 'checking curl_multi_waitfds functionality' multi, HTTP, HTTP/2
```
44 = `CURLE_OBSOLETE44` = `TEST_ERR_FAILURE`

Also: fix a newline in log output.

Follow-up to c78044c07e #15146 #15155

Closes #19481
2025-11-12 12:51:29 +01:00