Commit Graph

7141 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
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
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
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
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
0afb52a0cd
code: minor indent fixes before closing braces
Closes #19512
2025-11-13 17:27:40 +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
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
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
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
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
4841e4290d
badwords: re-sync with curl-www, fix issues found
Also:
- replace `manpage` with `man page`, add to `badwords.txt`.
- badwords.pl: import `-w` feature from curl-www, syncing the two
  scripts fully.
- badwords.txt: import missing items from curl-www, syncing the two
  files fully.
- pyspelling.words: drop `cURL` allowed word.

Closes #19468
2025-11-12 00:53:44 +01:00
Dan Fandrich
f544eb97da docs: Line endings are no longer significant in test files
Since commit f477f3efc, CR/LF characters in test files are no longer
significant, making the files a little more XML-like.

Closes #19469
2025-11-11 10:07:41 -08:00
Viktor Szakats
b39c158e4a
scripts: fix shellcheck SC2046 warnings
Fix SC2046: "Quote this to prevent word splitting."
Ref: https://www.shellcheck.net/wiki/SC2046

Also:
- shellcheck.sh: add `set -eu`.
- shellcheck.sh, yamlcheck.sh: always run from repo root.
- pass `--` before passing the list of files, where missing.
- badwords.pl, cleancmd.pl: rework to accept `git ls-files` arguments.
  Requires Perl 5.22+ (2015-Jun-01) on Windows.
  Ref: https://perldoc.perl.org/functions/open
- INTERNALS.md: require Perl 5.22 on Windows.
- spacecheck.pl: formatting.
- GHA/http3-linux: rework command to avoid SC2046.
- stop suppressing SC2046 warnings.

The yamlcheck.sh issue reported-by: Stanislav Fort (Aisle Research)
Ref: 20251109163515_6eb31da3-deb2-4f4d-8327-935904f27da5

Closes #19432
2025-11-10 14:21:35 +01:00
Daniel Stenberg
8e321a53df
examples/crawler: fix variable
A variable missed in the previous rename cleanup

Follow-up to 928363f28c
Reported-by: Gisle Vanem
Closes #19446
2025-11-10 13:40:13 +01:00
Viktor Szakats
49ef2f8d1e
cmake: adjust defaults for target platforms not supporting shared libs
If CMake reports the target platform not supporting shared libs, turn
`BUILD_SHARED_LIBS` off by default. CMake 3.30+ fails with an error
when trying to create a `SHARED` target for such platforms. Earlier
versions used a workaround that may or may not have worked in practice.

Ref: https://cmake.org/cmake/help/v3.30/policy/CMP0164.html

Seen this with a build setting `-DCMAKE_SYSTEM_NAME=Generic`, e.g.
AmigaOS.

Note this may introduce incompatibility for "Generic" targets, which
support shared libs. If that's the case, set `BUILD_SHARED_LIBS=ON`
manually.

Also drop AmigaOS-specific logic handled automatically after this patch.

Ref: https://cmake.org/cmake/help/v3.7/command/get_property.html
Ref: https://cmake.org/cmake/help/v3.7/prop_gbl/TARGET_SUPPORTS_SHARED_LIBS.html

Closes #19420
2025-11-09 17:56:20 +01:00
Viktor Szakats
d35c880a75
INSTALL-CMAKE.md: document static option defaults more
Closes #19419
2025-11-09 13:16:02 +01:00
Daniel Stenberg
7aa50124c2
TODO: improve code for large MQTT payloads
Closes #19416
2025-11-09 11:53:39 +01:00
Daniel Stenberg
7e0d4dd4a8
CURLOPT_SSH_KEYFUNCTION.md: fix minor indent mistake in example 2025-11-08 17:49:30 +01:00
Daniel Stenberg
64489bc3be
CURLOPT_READFUNCTION.md: clarify the size of the buffer
No need to multiply with size as size is always 1 - and documented so.

Closes #19402
2025-11-08 17:11:28 +01:00
Daniel Stenberg
d083f529e8
CURLINFO_SCHEME/PROTOCOL: they return the "scheme" for a "transfer"
Not protocol. Not for connection.

Closes #19403
2025-11-08 17:09:50 +01:00
Daniel Stenberg
a5c0dfc19f
CURLINFO_TLS_SSL_PTR.md: remove CURLINFO_TLS_SESSION text
That option is properly documented in its own page.

Closes #19404
2025-11-08 17:07:23 +01:00
Daniel Stenberg
8442c24c9a
CURLINFO: remove 'get' and 'get the' from each short desc
The short descriptions describe the data each info retrieves. The info
itself does not 'get' the data.

This simplifies and shortens the descriptions and make them more
consistent.

Closes #19406
2025-11-08 17:05:55 +01:00
Daniel Stenberg
d8bad9926c
docs: mention umask need when curl creates files
for cookies, alt-svc and HSTS, command line and library

Closes #19396
2025-11-07 14:12:59 +01:00
Viktor Szakats
904e7ecb66
tests: replace remaining CR bytes with the new macro %CR
There is no more mixed-newline file in the repository after this patch.
Except for`.bat` and `.sln` files (4 in total), all files use LF
newlines.

Also:
- `spacecheck.pl`: drop mixed-EOL exception for test data.
- runtests: add option `-w` to check if test data has stray CR bytes in
  them.
- build: enable the option above in test targets, except the CI-specific
  one where `spacecheck.pl` does this job already.
- tested OK (with expected failures) in CI with stray CRs added.
- cmake: enable option `-a` for the `tests` target. To continue testing
  after a failed test.

Follow-up to 63e9721b63 #19313
Follow-up to 6cf3d7b1b1 #19318
Follow-up to 4d2a05d3fe #19284

Closes #19347
2025-11-06 20:45:45 +01:00
Viktor Szakats
58023ba522
docs: fix checksrc EQUALSPACE warnings
```
docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.md:86:16
docs/libcurl/opts/CURLOPT_SSL_CTX_FUNCTION.md:139:16
```

Also sync `CURL *` and result variable names with rest of docs.

Follow-up to 6d7e924e80 #19375

Closes #19379
2025-11-06 00:04:15 +01:00
Viktor Szakats
403a2c2b06
tests: shorten space and tab macro names
Easier to write and read.

Follow-up to d29f14b9cf #19300

Closes #19349
2025-11-05 15:59:43 +01:00
Daniel Stenberg
33e7745eef
RELEASE-NOTES: synced
bumped to 8.17.1 for now

fixed typo in THANKS-filter
2025-11-05 14:12:23 +01:00
Daniel Stenberg
6687379389
VERSIONS: 8.18.0 is now pending 2025-11-05 08:00:05 +01:00
Daniel Stenberg
7872ec968f
THANKS: add contributors from 8.17.0 2025-11-05 07:57:28 +01:00
Daniel Stenberg
775add6e90
HISTORY: extend
With recent events and some more in the past

Closes #19361
2025-11-04 16:25:28 +01:00
Samuel Henrique
913c1f28c9
wcurl: import v2025.11.04
Closes #19353
2025-11-04 14:15:46 +01:00
Daniel Stenberg
70a11c6f06
CURLOPT_COPYPOSTFIELDS.md: used with MQTT and RTSP as well
Follow-up to 5ec87346a9

Closes #19351
2025-11-04 09:08:16 +01:00
Daniel Stenberg
f8e7b1377b
BINDINGS: change dead link to archive.org version
The Hollywood binding host name www.hollywood-mal.com does not seem to
work anymore.

Closes #19352
2025-11-04 09:07:41 +01:00
Daniel Stenberg
5ec87346a9
CURLOPT_POSTFIELDSIZE*: these also work for MQTT and RTSP
Closes #19346
2025-11-03 22:29:28 +01:00
Viktor Szakats
63e9721b63
tests: avoid hard-coded CRLFs in more sections
- `reply/data*`, `verify/stdout`, `verify/stderr`, `verify/file*`,
  `verify/proxy`:
  - make `crlf="yes"` force CRLF to all lines, instead of just applying
    to HTTP protocol headers.
  - add support for `crlf="headers"` that only converts HTTP protocol
    header lines to CRLF. (previously done via `crlf="yes"`.)
  - use `crlf="headers"` where possible.

- `reply/connect*`:
  - add support for `crlf="yes"` and `crlf="headers"`.
  - use them where possible.

- `client/file*`, `client/stdin`:
  - add support for `crlf="yes"`.
  - use it where possible.

- `reply/data*`, `verify/protocol`:
  - replace existing uses of `crlf="yes"` with `crlf="headers`" where it
    does not change the result.

Reducing the number of `tests/data/test*`:
- CRLF newlines from 10295 to 1985. (119985 lines total)
- files with mixed newlines from 656 to 113. (1890 files total)

After this patch there remain 141 sections with mixed newlines, where
the mixing is not split between headers/non-headers. There is no obvious
pattern here. Some of the CRLF uses might be accidental, or
non-significant. They will be tackled in a future patch.

Follow-up to 6cf3d7b1b1 #19318
Follow-up to 4d2a05d3fe #19284

Closes #19313
2025-11-03 21:15:12 +01:00
Viktor Szakats
6cf3d7b1b1
tests: avoid more hard-coded CRLFs in protocol sections
- fix regex to not catch CR (from CRLF), in `PORT`, `EPRT`
  commands, allowing to use `crlf="yes"` more.
- add `crlf="headers"` mode for `protocol` sections.
  To call `subnewlines()` without its force option.
  This is the mode used in `data` sections when `crlf="yes"`.
  (This confusion may be subject to a future commit.)
- subnewlines: apply CRLF to `HEAD` and `CONNECT` HTTP requests.
- subnewlines: apply CRLF to RTSP requests.
- delete remaining empty `protocol` sections.

Reducing the number of `tests/data/test*`:
- CRLF newlines from 11325 to 10295. (119984 lines total)
- files with mixed newlines from 707 to 656. (1890 files total)

Follow-up to 4d2a05d3fe #19284

Closes #19318
2025-11-01 23:52:55 +01:00
Viktor Szakats
d29f14b9cf
tests: replace significant invisible spaces with macros
To make them explicit, visible, avoid being accidentally trimmed.
Also prevents Git warnings, e.g. on `git am`.

Also:
- runtests: add support for `%spc%` and `%tab%` macros.
- test59: delete non-significant line-ending space.
- spacecheck.pl: drop line-ending whitespace exception for tests.

Closes #19300
2025-10-31 17:15:33 +01:00
Daniel Stenberg
928363f28c
examples: consistent variable naming across examples
- 'CURL *' handles are called 'curl'
- 'CURLM *' handles are called 'multi'
- write callbacks are called 'write_cb'
- read callbacs are called 'read_cb'
- CURLcode variables are called 'res'

It makes the examples look and feel more consistent. It allows for
easier copy and pasting between examples.

Closes #19299
2025-10-31 16:44:57 +01:00
Viktor Szakats
c887a3f2f2
BINDINGS.md: point flaky URL to archive.org
To avoid linkcheck CI fails. It was failing regularly in the last months.
2025-10-31 16:21:41 +01:00
Viktor Szakats
869143b194
examples: fix more potential resource leaks, and more
Also:
- delete dead code.
- sync `http2-download.c` and `http2-upload.c` sources.
- simplessl: fix constant expression.
- simplessl: avoid `expression is constant` VS2010 warning, drop pragma.
- replace large stack buffers with dynamic allocation.
- http2-download: fix to fill transfer number.

Some of these were pointed out by TIOBE scanner via Coverity 2025.3.0.

Closes #19292
2025-10-31 13:35:53 +01:00
Viktor Szakats
4b85e489a4
examples/http2-serverpush: fix file handle leaks
Also:
- tests/libtest/cli_h2_serverpush: re-sync formatting.

Previously fixed in tests based on a local clang-tidy v20 report.

Pointed out by TIOBE scanner via Coverity 2025.3.0.
Follow-up to 83a8818cfe #17706

Closes #19291
2025-10-31 13:14:12 +01:00
Daniel Stenberg
73811b4c51
header: see-also --proxy-header and vice versa
Closes #19259
2025-10-27 17:24:18 +01:00
Daniel Stenberg
05eea37e78
CURLOPT_SERVER_RESPONSE_TIMEOUT*: add default and see-also
Also move the old name mention to a HISTORY section

Closes #19258
2025-10-27 17:23:17 +01:00
Viktor Szakats
18119eb916
ECH.md: make OpenSSL branch clone instructions work
Closes #19237
2025-10-26 01:19:12 +02:00
Viktor Szakats
71d1eec675
tidy-up: miscellaneous
- cmake/Find*: make double quotes consistent.
- drop redundant parenthesis.
- GHA/checksrc: sync a step name with others.
- whitespace.

Closes #19233
2025-10-25 00:19:00 +02:00
Viktor Szakats
4a6fbd5e1d
NTLM: disable if DES support missing from OpenSSL or mbedTLS
Make autotools and cmake detect DES support in OpenSSL and mbedTLS.
Forward feature macros to C and omit NTLM from the feature preview list.
Use the feature macros in source. This ensure that `-V` output matches
the preview.

OpenSSL doesn't support DES when built with `no-des` or `no-deprecated`.
mbedTLS 4.x no longer supports it, and it's possible to disable it in
<4 with `scripts/config.py unset MBEDTLS_DES_C`.

Before this patch this worked for
mbedTLS 4 only, and with a regression for pending PR #16973.

Also:

- drop NTLM feature check from `curl_setup.h` in favour of autotools/
  cmake feature macros. This makes `curl_setup.h` no longer need
  to include an mbedTLS header, which in turn makes tests/server build
  without depending on mbedTLS.
  Fixing, in #16973:
  ```
  In file included from tests/server/first.h:40,
                   from bld/tests/server/servers.c:3:
  lib/curl_setup.h:741:10: fatal error: mbedtls/version.h: No such file or directory
    741 | #include <mbedtls/version.h>
        |          ^~~~~~~~~~~~~~~~~~~
  ```
  Ref: https://github.com/curl/curl/actions/runs/18689537893/job/53291322012?pr=16973
  Ref: #19181 (initial fix idea)
  Follow-up to 3a305831d1 #19077

- move back mbedTLS header include and version check from
  `curl_setup.h` to each source which consumes mbedTLS.

- GHA/http3-linux: drop workaround that disabled NTLM for
  `no-deprecated` OpenSSL builds.
  Follow-up to 006977859d #12384

- curl_ntlm_core: drop pointless macro `CURL_NTLM_NOT_SUPPORTED`.
  Follow-up to 006977859d #12384

Closes #19206
2025-10-24 12:12:20 +02:00
Daniel Stenberg
ab590ba62f
TODO: a fixed FTP directory listing format
Closes #19212
2025-10-24 11:21:48 +02:00
Viktor Szakats
ea6455b7a4
spelling: subdirectories
Closes #19180
2025-10-21 17:18:35 +02:00