]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 weeks agoGHA: update dependencies
renovate[bot] [Fri, 14 Nov 2025 00:47:55 +0000 (00:47 +0000)] 
GHA: update dependencies

- github/codeql-action to 4.31.3
- google/boringssl to v0.20251110.0
- ruff to 0.14.5

Closes #19442
Closes #19455

2 weeks agohttp: avoid two strdup()s and do minor simplifications
Daniel Stenberg [Mon, 17 Nov 2025 12:54:24 +0000 (13:54 +0100)] 
http: avoid two strdup()s and do minor simplifications

Closes #19571

2 weeks agoappveyor: add VS2010 x86 Release VS project job and switch VS2013 to x64
Viktor Szakats [Mon, 17 Nov 2025 13:55:14 +0000 (14:55 +0100)] 
appveyor: add VS2010 x86 Release VS project job and switch VS2013 to x64

To have a test case for VS2010 after bumping to minimum Vista.

Ref: #18009
Closes #19570

2 weeks agoh2/h3: handle methods with spaces
Stefan Eissing [Mon, 17 Nov 2025 08:56:48 +0000 (09:56 +0100)] 
h2/h3: handle methods with spaces

The parsing of the HTTP/1.1 formatted request into the h2/h3 header
structures should detect CURLOPT_CUSTOMREQUEST methods and forward them
correctly.

Add test_01_20 to verify

Fixes #19543
Reported-by: Omdahake on github
Closes #19563

2 weeks agohttp: the :authority header should never contain user+password
Daniel Stenberg [Mon, 17 Nov 2025 12:28:48 +0000 (13:28 +0100)] 
http: the :authority header should never contain user+password

Pointed-out-by: Stanislav Fort
Closes #19568

2 weeks agoprojects/README.md: Markdown fixes
Viktor Szakats [Mon, 17 Nov 2025 13:53:33 +0000 (14:53 +0100)] 
projects/README.md: Markdown fixes

Closes #19569

2 weeks agodigest_sspi: fix a memory leak on error path
x2018 [Mon, 17 Nov 2025 11:37:35 +0000 (19:37 +0800)] 
digest_sspi: fix a memory leak on error path

Closes #19567

2 weeks agoopenssl: fix a potential memory leak of bio_out
x2018 [Mon, 17 Nov 2025 06:26:24 +0000 (14:26 +0800)] 
openssl: fix a potential memory leak of bio_out

Closes #19561

2 weeks agoopenssl: fix a potential memory leak of params.cert
x2018 [Mon, 17 Nov 2025 06:12:14 +0000 (14:12 +0800)] 
openssl: fix a potential memory leak of params.cert

Closes #19560

2 weeks agoschannel_verify: fix a memory leak of cert_context
x2018 [Sun, 16 Nov 2025 18:25:57 +0000 (02:25 +0800)] 
schannel_verify: fix a memory leak of cert_context

Closes #19556

2 weeks agolibssh: properly free sftp_attributes
x2018 [Mon, 17 Nov 2025 10:36:42 +0000 (18:36 +0800)] 
libssh: properly free sftp_attributes

Closes #19564

2 weeks agobuild: exclude clang prereleases from compiler warning options
Marcel Raad [Mon, 17 Nov 2025 08:25:22 +0000 (09:25 +0100)] 
build: exclude clang prereleases from compiler warning options

Starting with clang 18, stable clang releases start with minor version 1.
Exclude pre-releases with minor version 0 from the compiler warning
options for that major version.

This fixes the build with Android NDK r29, which uses a prerelease
version of clang 21 that doesn't know the new options yet.

Closes #19566

2 weeks agotidy-up: miscellaneous
Viktor Szakats [Sat, 25 Oct 2025 21:32:14 +0000 (23:32 +0200)] 
tidy-up: miscellaneous

- schannel: delete superfluous parenthesis.
- tftp: delete stray space from log output.
- ws: update guard comment.
- docs/examples: constify variables.
- runtests/servers: enclose unknown parameter between quotes.
- scripts/perlcheck.sh: drop redundant grep `-E` option.
- THANKS: move names from comments to THANKS.
- sync `--depth` option style across scripts.
- sync git repo URL ending between some scripts.
- BINDINGS.md: drop protocol from archive.org URL path.
- whitespace, indent, unfold lines.

Closes #19565

2 weeks agobadwords: fix issues found in tests
Viktor Szakats [Fri, 14 Nov 2025 23:27:38 +0000 (00:27 +0100)] 
badwords: fix issues found in tests

There remain some false positives, hits in test data, and `dir` use,
around 100 issues in total.

There is no plan to enforce badwords on tests.

Also:
- badwords.txt: let a few `manpage[s]` occurrences through
  (in Perl code).

Closes #19541

2 weeks agocf-socket: limit use of `TCP_KEEP*` to Windows 10.0.16299+ at runtime
Viktor Szakats [Mon, 17 Nov 2025 00:16:07 +0000 (01:16 +0100)] 
cf-socket: limit use of `TCP_KEEP*` to Windows 10.0.16299+ at runtime

Before this patch `TCP_KEEP*` socket options were unconditionally used
if the build-time SDK supported them. This caused curl logging errors
(or trace messages since #19527) on Windows versions missing support
for them. After this patch, use them only when the runtime environment
supports it and fall back to the alternate method (`SIO_KEEPALIVE_VALS`)
dynamically.

Also:
- log a trace message when using the Win10 method.
- document which SDK versions offer `TCP_KEEP*` macros.

Ref: https://learn.microsoft.com/windows/win32/winsock/ipproto-tcp-socket-options
Ref: https://learn.microsoft.com/windows/win32/winsock/sio-keepalive-vals

Reported-by: Aleksandr Sergeev
Fixes #19520
Follow-up to dc34498d18d3303d67364423b4aa0daab4afb3ba #19527
Closes #19559

2 weeks agoRELEASE-NOTES: update upcoming removals
Viktor Szakats [Sun, 16 Nov 2025 22:54:54 +0000 (23:54 +0100)] 
RELEASE-NOTES: update upcoming removals

Also add a missed commit (noticed by accident)

Closes #19558

2 weeks agopytest fixes and improvements
Stefan Eissing [Sat, 15 Nov 2025 11:45:54 +0000 (12:45 +0100)] 
pytest fixes and improvements

- fix test_17_20 flakiness: the test case did not have `nghttpx` in
  its parameters, causing it to no check if a reload was necessary.
  When that test ran behind one that gave nghttpx another certificate,
  eg. in parallel mode, it used the wrong pinned pubkey.
- Have `env` provide lists of HTTP protocol versions available for
  testing. Replace parameterized tests on a fixed protocol list with
  the dynamic one from env. This makes checks for protocol availability
  in the test function bodies superfluous.

refs #19489
Closes #19540

2 weeks agocurl_sasl: make Curl_sasl_decode_mech compare case insenstively
Daniel Stenberg [Fri, 14 Nov 2025 22:00:05 +0000 (23:00 +0100)] 
curl_sasl: make Curl_sasl_decode_mech compare case insenstively

The provided mechanisms should be compared case insenstively.

Found by ZeroPath

Closes #19535

2 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 16 Nov 2025 22:38:48 +0000 (23:38 +0100)] 
RELEASE-NOTES: synced

2 weeks agowolfssl: fix a potential memory leak of session
x2018 [Sun, 16 Nov 2025 17:52:02 +0000 (01:52 +0800)] 
wolfssl: fix a potential memory leak of session

Closes #19555

2 weeks agoruntests: detect bad libssh differently for test 1459 (fixing CircleCI libssh job)
Viktor Szakats [Sun, 16 Nov 2025 18:56:39 +0000 (19:56 +0100)] 
runtests: detect bad libssh differently for test 1459 (fixing CircleCI libssh job)

test 1459 "SFTP with corrupted known_hosts" was seen failing in the past.
To fix it, the test was automatically disabled when detecting libssh
0.9.3 or older, as in the curl CircleCI job, running on Ubuntu 20.04.
This work for a long time, until bumping the CircleCI runner to Ubuntu
22.04 (to have OpenSSL 3), where the test was running again, and failing
with the isssue seen in the past.

- Test skipped with Ubuntu 20.04 (libssh 0.9.3):
  https://app.circleci.com/pipelines/github/curl/curl/16445/workflows/7f198763-e0b0-4037-9245-4c4b40ab8726/jobs/155164
- Failure seen with Ubuntu 22.04 (libssh 0.9.6):
  https://app.circleci.com/pipelines/github/curl/curl/16452/workflows/b817a808-0fd4-40b0-8eb0-d064926efe12/jobs/155206?invite=true#step-107-211709_45
- Failure seen with Ubuntu 24.04 (libssh 0.10.6):
  https://app.circleci.com/pipelines/github/curl/curl/16455/workflows/86c631f1-3c5f-4438-b398-3df2bdab5d20/jobs/155218

Turns out the issue issue isn't libssh 0.9.3 itself, but
a CircleCI-specific default configuration in `/etc/ssh/ssh_config`:
```
# BEGIN ANSIBLE MANAGED BLOCK
Host *
StrictHostKeyChecking no     <------ this particular line
HashKnownHosts no
SendEnv LANG LC_*
# END ANSIBLE MANAGED BLOCK
```

libssh will consult configuration files on hard-coded default system
locations and alter its behavior based on settings found in them.

This libssh behavior is present in all supported versions:
https://gitlab.com/libssh/libssh-mirror/-/commit/5a2abd34ce9ad97c69906c5fb7b07e26e96fceaa
https://gitlab.com/libssh/libssh-mirror/-/tags/libssh-0.9.0

It means the existing disable logic based on libssh version worked by
coincidence, and what needs to be checked is these configurations
to decide if it's safe to run the test. Another, simpler option is
to also accept the result code 67, though in that case the test
wouldn't actually test what we want, but would pass anyway.

With the old `oldlibssh` workaround deleted, and the problematic setting
manually overridden (`StrictHostKeyChecking yes`):
- CircleCI Ubuntu 20.04 passes with 1459 enabled:
  https://app.circleci.com/pipelines/github/curl/curl/16483/workflows/87a9f389-76a2-4a32-acde-c0b411a4c842/jobs/155302
- CircleCI Ubuntu 22.04 does too:
  https://app.circleci.com/pipelines/github/curl/curl/16483/workflows/87a9f389-76a2-4a32-acde-c0b411a4c842/jobs/155303

To fix, replace the `runtests` `oldlibssh` detection logic to parse
libssh config files (instead of checking for libssh version) and disable
test 1459 based on that. Notice the detection is making a light attempt
to parse these files, and does not implement most config file features
(such as includes, quoted values and `=` operator.)

The new runtests workaround tests OK with the:
- default CircleCI configuration, disabling 1459 automatically.
- a sudoless configuration fix, with 1459 run successfully.
  Also keep setting this option in CircleCI jobs.
- a sudo configuration fix, with 1459 run successfully.
Ref: https://app.circleci.com/pipelines/github/curl/curl/16492/workflows/56f39335-97ba-412c-9a9b-3d662694375a

GHA jobs are not affected and they work fine, with 1459 running successfully
before and after this patch.

It's possible the libssh API offers ways to control config file use
and/or set the strict host checking option programatically. Maybe
to enable in debug mode (albeit CircleCI job are not debug-enabled),
or offer an option for them. It may be something for a future patch.

Follow-up to 23540923e1b09ce00dc08bab3bb3a2c0e62ba4e7 #8622
Follow-up to 4b01a57c95fd4c041dfa4a41834c761658ea89ee #8548
Follow-up to bdc664a64002a7df66f34159454844e6b6f5515f #8490
Follow-up to 7c140f6b2d90975629ba81a23acbef4363a3e6fe #8444

Ref: 6d9c5c91b9fd5f3a2733363d1ded8f70b6c24e5d #19549

Closes #19557

2 weeks agoGHA/codeql: limit cron job to the origin repository
Viktor Szakats [Sun, 16 Nov 2025 12:14:04 +0000 (13:14 +0100)] 
GHA/codeql: limit cron job to the origin repository

To avoid running it in every fork, every week.

Closes #19552

2 weeks agoCI: avoid restart prompt on libssh-dev install in CircleCI
Viktor Szakats [Sun, 16 Nov 2025 00:06:24 +0000 (01:06 +0100)] 
CI: avoid restart prompt on libssh-dev install in CircleCI

By setting `DEBIAN_FRONTEND=noninteractive`.

Also:
- add `curl -V` step to CircleCI jobs.
- drop duplicate `libpsl` from `apt install`.
- replace sudo pip with venv, fixing a warning and syncing with GHA.
- Note that test 1459 was disabled on Ubuntu 20.04 due to past issues.
  When running on newer CircleCI Ubuntu runners (22.04 or 24.04), the
  test is not disabled, and also fails with the issue seen in the past.
  I've identified the root cause and will fix it in a separate PR.

Ref: https://circleci.com/developer/images?imageType=machine
Ref: https://discuss.circleci.com/t/ubuntu-20-04-22-04-24-04-q3-current-release/51856/7
Ref: https://app.circleci.com/pipelines/github/curl/curl/16450/workflows/af1f2a99-6452-4cc3-96c1-18a217ebabfc/jobs/155194

Follow-up to 8ba10a790a39dd48536c38e1d4569ab9fac537a1 #19546

Closes #19549

2 weeks agorustls: minor adjustment of sizeof()
Daniel Stenberg [Sat, 15 Nov 2025 22:56:31 +0000 (23:56 +0100)] 
rustls: minor adjustment of sizeof()

The mistake is harmless because it is still a size of a pointer, but
this is the correct pointer.

Acked-by: Daniel McCarney
Reported-by: pelioro on hackerone
Bug: https://hackerone.com/reports/3427460
Closes #19545

2 weeks agoGHA/linux: add missing condition for nghttp2-filc cache step
Viktor Szakats [Sat, 15 Nov 2025 23:42:14 +0000 (00:42 +0100)] 
GHA/linux: add missing condition for nghttp2-filc cache step

Follow-up to 67ef4a34f2e11aa45f0965909d0dd542643deede #19457

Closes #19548

2 weeks agoruntests: drop Python 2 support remains
Viktor Szakats [Sat, 1 Nov 2025 01:20:32 +0000 (02:20 +0100)] 
runtests: drop Python 2 support remains

Used in the test SMB and telnet servers.

Closes #19544

2 weeks agoCI: drop no longer used `install-wolfssl` step in Circle CI
Viktor Szakats [Sat, 15 Nov 2025 23:22:59 +0000 (00:22 +0100)] 
CI: drop no longer used `install-wolfssl` step in Circle CI

Follow-up to b011e3fcfb06d6c0278595ee2ee297036fbe9793 #18700

Closes #19547

2 weeks agoCI: bump Circle CI jobs to Ubuntu 22.04 runners for OpenSSL 3
Viktor Szakats [Sat, 15 Nov 2025 23:18:31 +0000 (00:18 +0100)] 
CI: bump Circle CI jobs to Ubuntu 22.04 runners for OpenSSL 3

Ref: https://packages.ubuntu.com/jammy/libssl-dev

Follow-up to 69c89bf3d3137fcbb2b8bc57233182adcf1e2817 #18330

Closes #19546

2 weeks agoDEPRECATE.md: move OpenSSL to past removals (fixup)
Viktor Szakats [Sat, 15 Nov 2025 21:32:56 +0000 (22:32 +0100)] 
DEPRECATE.md: move OpenSSL to past removals (fixup)

Follow-up to bb213bd76915368ac49c5db9da9d6462c6b8e6cf #19542

2 weeks agoDEPRECATE.md: move OpenSSL to past removals
Viktor Szakats [Sat, 15 Nov 2025 18:33:37 +0000 (19:33 +0100)] 
DEPRECATE.md: move OpenSSL to past removals

Follow-up to 69c89bf3d3137fcbb2b8bc57233182adcf1e2817 #18330

Closes #19542

2 weeks agoopenssl: bump minimum OpenSSL version to 3.0.0
Viktor Szakats [Tue, 26 Aug 2025 22:54:22 +0000 (00:54 +0200)] 
openssl: bump minimum OpenSSL version to 3.0.0

It also means that all supported OpenSSL versions and forks support
TLSv1.3 after this patch.

It reduces `openssl.c` size by more than 10%, or 400 LOC.

Ref: #18822
Closes #18330

2 weeks agobuild: drop support for VS2008 (Windows)
Viktor Szakats [Sun, 13 Jul 2025 10:57:26 +0000 (12:57 +0200)] 
build: drop support for VS2008 (Windows)

Require Visual Studio 2010 or newer.

Ref: https://github.com/curl/curl/discussions/15972

Follow-up to dc28bb86c1e466c667ce220fd2e51355cd8bae8d #17798
Follow-up to 63e513b106113db0b1b68bab347b80cb4cef4e65 #17380

Closes #17931

2 weeks agobuild: drop Windows CE / CeGCC support
Viktor Szakats [Mon, 14 Jul 2025 22:36:08 +0000 (00:36 +0200)] 
build: drop Windows CE / CeGCC support

Windows CE support was limited to successful builds with ming32ce
(a toolchain that hasn't seen an update since 2009, using an ancient gcc
version and "old mingw"-style SDK headers, that curl deprecated earlier).
Builds with MSVC were broken for a long time. mingw32ce builds were never
actually tested and runtime and unlikely to work due to missing stubs.
Windows CE toolchains also miss to comply with C89. Paired with lack of
demand and support for the platform, curl deprecated it earlier.

This patch removes support from the codebase to ease maintaining Windows
codepaths.

Follow-up to f98c0ba834d4b4da480373b732a86976f9064ccd #17924
Follow-up to 8491e6574cde770b227ca0e1cd66548291f49661 #17379
Follow-up to 2a292c39846107228201674d686be5b3ed96674d #15975

Closes #17927

2 weeks agobadwords: check indented lines in source code, fix fallouts
Viktor Szakats [Fri, 14 Nov 2025 16:55:33 +0000 (17:55 +0100)] 
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

2 weeks agomk-ca-bundle.pl: default to SHA256 fingerprints with `-t` option
Viktor Szakats [Tue, 4 Nov 2025 11:55:25 +0000 (12:55 +0100)] 
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

2 weeks agobadwords.pl: fix variable in printf mask
Viktor Szakats [Fri, 14 Nov 2025 16:57:03 +0000 (17:57 +0100)] 
badwords.pl: fix variable in printf mask

Causing warnings if a matched line has mask patterns.

Closes #19534

2 weeks agodocs: fix checksrc warning, fix checkdocs CI filter
Viktor Szakats [Fri, 14 Nov 2025 16:09:50 +0000 (17:09 +0100)] 
docs: fix checksrc warning, fix checkdocs CI filter

Also:
- GHA/checkdocs: fix CI filters to catch it early.
  Follow-up to 28dd14aafe2692a3e7dceb40340554c03c127cf1 #15797

Closes #19533

2 weeks agobadwords: fix two exceptions and drop them
Viktor Szakats [Fri, 14 Nov 2025 15:58:05 +0000 (16:58 +0100)] 
badwords: fix two exceptions and drop them

Also:
- extend `dir` rule to exclude C assignments.

Closes #19532

2 weeks agoGHA/checksrc: check XML files for errors
Viktor Szakats [Fri, 14 Nov 2025 14:39:40 +0000 (15:39 +0100)] 
GHA/checksrc: check XML files for errors

Closes #19528

2 weeks agolimit-rate: add example using --limit-rate and --max-time together
nait-furry [Tue, 11 Nov 2025 22:51:37 +0000 (01:51 +0300)] 
limit-rate: add example using --limit-rate and --max-time together

Closes #19473

2 weeks agotest07_22: fix flakiness
Stefan Eissing [Fri, 14 Nov 2025 15:26:14 +0000 (16:26 +0100)] 
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

2 weeks agovquic-tls/gnutls: call Curl_gtls_verifyserver unconditionally
Daniel Stenberg [Fri, 14 Nov 2025 15:42:23 +0000 (16:42 +0100)] 
vquic-tls/gnutls: call Curl_gtls_verifyserver unconditionally

Closes #19531

2 weeks agocf-socket: trace ignored errors
Stefan Eissing [Fri, 14 Nov 2025 13:18:12 +0000 (14:18 +0100)] 
cf-socket: trace ignored errors

Instead of blasting the user with infof() statements.

Reported-by: Aleksandr Sergeev
Fixes #19520
Closes #19527

2 weeks agovtls: pinned key check
Stefan Eissing [Fri, 14 Nov 2025 14:25:04 +0000 (15:25 +0100)] 
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

2 weeks agogetinfo: improve perf in debug mode
Stefan Eissing [Fri, 14 Nov 2025 11:45:58 +0000 (12:45 +0100)] 
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

2 weeks agoconnect: reshuffle Curl_timeleft_ms to avoid 'redundant condition'
Daniel Stenberg [Fri, 14 Nov 2025 09:52:43 +0000 (10:52 +0100)] 
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

2 weeks agoexamples/multithread: fix race condition
Stefan Eissing [Fri, 14 Nov 2025 11:51:31 +0000 (12:51 +0100)] 
examples/multithread: fix race condition

Reported-by: Nick Korepanov
Fixes #19524
Closes #19526

2 weeks agoDEPRECATE: remove RTMP support in April 2026
Daniel Stenberg [Mon, 10 Nov 2025 08:59:25 +0000 (09:59 +0100)] 
DEPRECATE: remove RTMP support in April 2026

URL: https://curl.se/mail/lib-2025-11/0008.html

2 weeks agoconfig2setopts: bail out if curl_url_get() returns OOM
Daniel Stenberg [Thu, 13 Nov 2025 22:03:52 +0000 (23:03 +0100)] 
config2setopts: bail out if curl_url_get() returns OOM

Closes #19518

2 weeks agocurl_setup.h: drop stray `#undef stat` (Windows)
Viktor Szakats [Thu, 13 Nov 2025 22:47:10 +0000 (23:47 +0100)] 
curl_setup.h: drop stray `#undef stat` (Windows)

Follow-up to 9678ff5b1bfea1c847aee4f9edf023e8f01c9293 #18776

Closes #19519

2 weeks agotidy-up: result code variable names in tests and examples
Viktor Szakats [Thu, 13 Nov 2025 19:31:51 +0000 (20:31 +0100)] 
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

2 weeks agoconfig2setopts: exit if curl_url_set() fails on OOM
Daniel Stenberg [Thu, 13 Nov 2025 21:24:32 +0000 (22:24 +0100)] 
config2setopts: exit if curl_url_set() fails on OOM

An error case that previously did not properly return error.

Closes #19517

2 weeks agochecksrc: verify close brace indent level
Daniel Stenberg [Tue, 11 Nov 2025 14:52:33 +0000 (15:52 +0100)] 
checksrc: verify close brace indent level

Closes #19512

2 weeks agocode: minor indent fixes before closing braces
Daniel Stenberg [Thu, 13 Nov 2025 12:50:49 +0000 (13:50 +0100)] 
code: minor indent fixes before closing braces

Closes #19512

2 weeks agotool_operate: exit on curl_share_setopt errors
Daniel Stenberg [Thu, 13 Nov 2025 15:26:24 +0000 (16:26 +0100)] 
tool_operate: exit on curl_share_setopt errors

Continuing when one of these has failed is fragile and error-prone.

Closes #19513

2 weeks agosws: repair --port, and accept any port
Daniel Stenberg [Thu, 13 Nov 2025 15:39:10 +0000 (16:39 +0100)] 
sws: repair --port, and accept any port

Also for mqttd and sockfilt. The < 1025 check was not serving any
purpose.

Follow-up to bb1391f94394e635c1a5c58253e7a3d3b36bde57

2 weeks agochecksrc: disallow `atoi` and `atol` globally
Viktor Szakats [Wed, 12 Nov 2025 22:37:06 +0000 (23:37 +0100)] 
checksrc: disallow `atoi` and `atol` globally

No longer used in core and test code.

Also: allowlist in docs/examples.

Closes #19508

2 weeks agotests/server: replace `atoi()` and `atol()` with `curlx_str_number()`
Viktor Szakats [Thu, 13 Nov 2025 11:46:59 +0000 (12:46 +0100)] 
tests/server: replace `atoi()` and `atol()` with `curlx_str_number()`

Closes #19510

2 weeks agowolfssl: simplify wssl_send_earlydata
Daniel Stenberg [Thu, 13 Nov 2025 12:19:01 +0000 (13:19 +0100)] 
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

2 weeks agolib: eliminate size_t casts
Stefan Eissing [Wed, 12 Nov 2025 14:58:49 +0000 (15:58 +0100)] 
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

2 weeks agolib: rename curlx_timediff to curlx_timeleft_ms
Stefan Eissing [Wed, 12 Nov 2025 11:15:42 +0000 (12:15 +0100)] 
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

2 weeks agotests/data: add `%includetext`, dedupe XML payloads into external file
Viktor Szakats [Thu, 13 Nov 2025 01:11:48 +0000 (02:11 +0100)] 
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

2 weeks agoRELEASE-NOTES: codespell
Viktor Szakats [Thu, 13 Nov 2025 10:46:13 +0000 (11:46 +0100)] 
RELEASE-NOTES: codespell

2 weeks agoruntests: add missing Perl semicolon
Viktor Szakats [Thu, 13 Nov 2025 03:44:15 +0000 (04:44 +0100)] 
runtests: add missing Perl semicolon

Follow-up to f477f3efc3ec58f7effc2aa01e7f4565b12be976 #19398

Closes #19507

2 weeks agolibtests: replace `atoi()` with `curlx_str_number()`
Viktor Szakats [Thu, 13 Nov 2025 02:40:42 +0000 (03:40 +0100)] 
libtests: replace `atoi()` with `curlx_str_number()`

Also:
- lib1568: fail in global initialization error.

Closes #19506

2 weeks agoFILEFORMAT.md: drop some text from the `command` section
Viktor Szakats [Wed, 12 Nov 2025 22:20:58 +0000 (23:20 +0100)] 
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 c6f1b0ff49268817101ac1734f43074fcc8775b2 #19429

Closes #19503

2 weeks agocookie: propagate errors better, cleanup the internal API
Daniel Stenberg [Wed, 12 Nov 2025 12:16:33 +0000 (13:16 +0100)] 
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

2 weeks agoschannel: replace atoi() with curlx_str_number()
Daniel Stenberg [Wed, 12 Nov 2025 10:27:36 +0000 (11:27 +0100)] 
schannel: replace atoi() with curlx_str_number()

The last atoi() call removed from libcurl

Closes #19483

2 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 13 Nov 2025 07:49:49 +0000 (08:49 +0100)] 
RELEASE-NOTES: synced

curlver: 8.18.0 is the next planned release version

2 weeks agoruntests: allow `client/command` to span multiple lines, and use it
Viktor Szakats [Wed, 12 Nov 2025 16:26:27 +0000 (17:26 +0100)] 
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

2 weeks agoOS400: fix build
Patrick Monnerat [Wed, 12 Nov 2025 14:45:59 +0000 (15:45 +0100)] 
OS400: fix build

- Fix failed build due to missing parameter.

Follow-up to 8c9946d3 from yesterday.

Closes https://github.com/curl/curl/pull/19494

2 weeks ago_PROGRESS.md: add the E unit, mention kibibyte
Daniel Stenberg [Wed, 12 Nov 2025 22:15:37 +0000 (23:15 +0100)] 
_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

2 weeks agotest716: use `repeat` macro
Viktor Szakats [Wed, 12 Nov 2025 19:34:53 +0000 (20:34 +0100)] 
test716: use `repeat` macro

Closes #19501

2 weeks agotests/data: use more `repeat` macro
Viktor Szakats [Wed, 12 Nov 2025 17:16:55 +0000 (18:16 +0100)] 
tests/data: use more `repeat` macro

Found in `client/command` sections.

Closes #19499

2 weeks agotest2045: replace HTML multi-line comment markup with `#` comments
Viktor Szakats [Wed, 12 Nov 2025 16:41:54 +0000 (17:41 +0100)] 
test2045: replace HTML multi-line comment markup with `#` comments

As used everywhere else in tests/data. To play nice with XML.

Follow-up to 9756d1da7637d1913b7ca2b589e4635f32ed3e00

Closes #19498

2 weeks agotest1404, 1547: replace `&` char in comment and name for XML-friendliness
Viktor Szakats [Wed, 12 Nov 2025 15:36:14 +0000 (16:36 +0100)] 
test1404, 1547: replace `&` char in comment and name for XML-friendliness

Closes #19497

2 weeks agotest1554: make test output XML-friendly
Viktor Szakats [Wed, 12 Nov 2025 15:05:52 +0000 (16:05 +0100)] 
test1554: make test output XML-friendly

Meaning no `<` and `>` characters.
Reducing the number of `xmllint` failures by 1.

Closes #19496

2 weeks agotest557: avoid `&` symbol in test output to be XML-friendly
Viktor Szakats [Tue, 11 Nov 2025 20:51:06 +0000 (21:51 +0100)] 
test557: avoid `&` symbol in test output to be XML-friendly

Closes #19492

2 weeks agotest363: delete stray character (typo) from a section tag
Viktor Szakats [Wed, 12 Nov 2025 14:21:27 +0000 (15:21 +0100)] 
test363: delete stray character (typo) from a section tag

Did not cause an issue in runtests. Caught by `xmllint`.

Follow-up to 63e9721b63d01518db83a664bc1e8373c352879e #19313

Closes #19490

2 weeks agotests/data: avoid tag markup in comments
Viktor Szakats [Wed, 12 Nov 2025 14:40:44 +0000 (15:40 +0100)] 
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

2 weeks agotest2405: split off H2 tests to new test 2407, fix callback prototype
Viktor Szakats [Wed, 12 Nov 2025 09:27:36 +0000 (10:27 +0100)] 
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 96a5ce5a82eb0f08650649ffafb7bb4e51fc4444 #19481

Closes #19487

2 weeks agolib1509: make callbacks static
Viktor Szakats [Wed, 12 Nov 2025 12:30:12 +0000 (13:30 +0100)] 
lib1509: make callbacks static

Closes #19488

2 weeks agotest2405: report `fd_count*` variables on failure
Viktor Szakats [Wed, 12 Nov 2025 09:17:48 +0000 (10:17 +0100)] 
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 c78044c07e97cb720049579f4fe3cab33a7ea8d3 #15146 #15155

Closes #19481

2 weeks agohostip: don't store negative lookup on OOM
Daniel Stenberg [Wed, 12 Nov 2025 10:59:25 +0000 (11:59 +0100)] 
hostip: don't store negative lookup on OOM

When convert_ipaddr_direct() returns error due to OOM, it must not be
stored as a negative cache result.

Closes #19484

2 weeks agoOS400/makefile.sh: fix shellcheck warning SC2038 differently
Viktor Szakats [Wed, 12 Nov 2025 08:50:10 +0000 (09:50 +0100)] 
OS400/makefile.sh: fix shellcheck warning SC2038 differently

Reported-by: Patrick Monnerat
Bug: https://github.com/curl/curl/pull/19451#discussion_r2517335957
Follow-up to af5a1647afa8aaf7cafc1e87af529a4cd48cb240 #19451

Closes #19482

2 weeks agolibssh2: replace atoi() in ssh_force_knownhost_key_type
Daniel Stenberg [Wed, 12 Nov 2025 07:49:13 +0000 (08:49 +0100)] 
libssh2: replace atoi() in ssh_force_knownhost_key_type

Closes #19479

2 weeks agolibssh2: cleanup ssh_force_knownhost_key_type
Daniel Stenberg [Wed, 12 Nov 2025 07:45:56 +0000 (08:45 +0100)] 
libssh2: cleanup ssh_force_knownhost_key_type

- Use arrays instead pointers
- Narrow variable scopes

Closes #19479

2 weeks agohttp: replace atoi use in Curl_http_follow with curlx_str_number
Daniel Stenberg [Wed, 12 Nov 2025 07:38:45 +0000 (08:38 +0100)] 
http: replace atoi use in Curl_http_follow with curlx_str_number

In an attempt to weed out atoi() use all over.

Closes #19478

2 weeks agotelnet: replace atoi for BINARY handling with curlx_str_number
Daniel Stenberg [Wed, 12 Nov 2025 07:32:31 +0000 (08:32 +0100)] 
telnet: replace atoi for BINARY handling with curlx_str_number

Also, only consider 0 to be a valid switch-off. Previously any value
except 1 had the same effect.

Closes #19477

2 weeks agonoproxy: replace atoi with curlx_str_number
Daniel Stenberg [Wed, 12 Nov 2025 07:17:48 +0000 (08:17 +0100)] 
noproxy: replace atoi with curlx_str_number

To better reject junk and detect overflows. There were already
additional precautions and protections in place, but this is cleaner.

Extended the 1614 unit tests with some more bad syntax cases.

Closes #19475

2 weeks agosrc/checksrc: ban atoi use
Daniel Stenberg [Wed, 12 Nov 2025 08:31:48 +0000 (09:31 +0100)] 
src/checksrc: ban atoi use

2 weeks agotool_operate: use curlx_str_number intead of atoi
Daniel Stenberg [Wed, 12 Nov 2025 08:30:37 +0000 (09:30 +0100)] 
tool_operate: use curlx_str_number intead of atoi

For consistency. This instance is for debug-only code and is not
important.

Closes #19480

2 weeks agobadwords: re-sync with curl-www, fix issues found
Viktor Szakats [Tue, 11 Nov 2025 16:43:06 +0000 (17:43 +0100)] 
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

2 weeks agoautotools: drop autoconf <2.59 compatibility code (zz60-xc-ovr)
Viktor Szakats [Tue, 11 Nov 2025 14:28:36 +0000 (15:28 +0100)] 
autotools: drop autoconf <2.59 compatibility code (zz60-xc-ovr)

The minimum required autoconf is 2.59, since curl 7.76.0 (2021).

Follow-up to a59f04611629f0db9ad8e768b9def73b9b4d9423 #6748

Closes #19464

2 weeks agomk-ca-bundle.pl: use `open()` with argument list to replace backticks
Viktor Szakats [Tue, 11 Nov 2025 10:09:36 +0000 (11:09 +0100)] 
mk-ca-bundle.pl: use `open()` with argument list to replace backticks

On Windows this requires Perl 5.22 from year 2015.

Also:
- mdlinkcheck: delete redundant error handling logic.
  Follow-up to 77be4a7ab2b5a0c633b9107fd286bda1f57e4725 #19437

Closes #19461

2 weeks agodocs: Line endings are no longer significant in test files 19469/head
Dan Fandrich [Tue, 11 Nov 2025 08:50:52 +0000 (00:50 -0800)] 
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

2 weeks agocf-socket: split out the MTU and GRO setopts into sep functions
Daniel Stenberg [Tue, 11 Nov 2025 15:41:57 +0000 (16:41 +0100)] 
cf-socket: split out the MTU and GRO setopts into sep functions

It simplifies the #ifdefs and declaring of local variables slightly.

Closes #19467

2 weeks agoccsidcurl: make curl_mime_data_ccsid() use the converted size
Daniel Stenberg [Tue, 11 Nov 2025 14:53:07 +0000 (15:53 +0100)] 
ccsidcurl: make curl_mime_data_ccsid() use the converted size

dynconvert() now offers to return the size of the converted data as it
might be different that the provided input size.

Bonus: minor indent fixing of some closing braces.

Reported-by: Stanislav Fort (Aisle Research)
Closes #19465

2 weeks agonoproxy: simplify Curl_check_noproxy
Daniel Stenberg [Tue, 11 Nov 2025 15:12:21 +0000 (16:12 +0100)] 
noproxy: simplify Curl_check_noproxy

By creating two separate matching functions for name and IP.

Closes #19466

2 weeks agoftp: remove #ifdef for define that is always defined
Daniel Stenberg [Tue, 11 Nov 2025 13:39:20 +0000 (14:39 +0100)] 
ftp: remove #ifdef for define that is always defined

The CURL_FTP_HTTPSTYLE_HEAD logic was added back in 2007 with the
intention to remove that logic one day, but since we never bump the
SONAME it is not likely to happen anytime soon. Remove again for
readability.

Follow-up to 3217809294b

Closes #19463