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

2 months agotests/FILEFORMAT.md: clarify %hex[] formatting
Daniel Stenberg [Tue, 13 May 2025 06:15:57 +0000 (08:15 +0200)] 
tests/FILEFORMAT.md: clarify %hex[] formatting

Closes #17332

2 months agospacecheck.pl: verify `tests/data/test*` for non-ASCII chars
Viktor Szakats [Mon, 12 May 2025 17:20:40 +0000 (19:20 +0200)] 
spacecheck.pl: verify `tests/data/test*` for non-ASCII chars

Exclude test data files (4 of them) based on existing feature tags:
`codeset-utf8` and `Unicode`.

Add the new keyword `non-ascii` to mark remaining exceptions (9 files).

Follow-up to 838dc53bb7bf52039b23af0e9ccffa51cf9ad7d0 #17247

Closes #17329

2 months agodocs: update distros links
Dan Fandrich [Mon, 12 May 2025 20:51:38 +0000 (13:51 -0700)] 
docs: update distros links

2 months agotests/server: stop using libcurl's printf functions
Daniel Stenberg [Fri, 9 May 2025 08:46:42 +0000 (10:46 +0200)] 
tests/server: stop using libcurl's printf functions

Since the test servers are not built with libcurl the *printf code
needed to get built separately, and they are not in the curlx
collection.

snprintf() is provided in all modern systems these days.

Move curlx functions from lib/strerror.c to lib/curlx/winapi.c

Assisted-by: Viktor Szakats
Closes #17294

3 months agoasny-thrdd: fix detach from running thread
Stefan Eissing [Mon, 12 May 2025 08:08:21 +0000 (10:08 +0200)] 
asny-thrdd: fix detach from running thread

When cancelling a threaded resolve and the thread is
still running, detach from it under the mutex lock.

Otherwise, the detach might happen after the thread finished
and access already freed memory.

Fixes #17256
Reported-by: Mathieu Garaud
Closes #17320

3 months agoTODO: Retry SOCKS handshake
Daniel Stenberg [Mon, 12 May 2025 11:51:27 +0000 (13:51 +0200)] 
TODO: Retry SOCKS handshake

Closes #17222
Closes #17326

3 months agotests/server: remove TEST use, include <memdebug.h>
Daniel Stenberg [Mon, 12 May 2025 10:13:15 +0000 (12:13 +0200)] 
tests/server: remove TEST use, include <memdebug.h>

- The TEST define is never set
- memdebug.h is not in the local dir, using angle bracket include

Closes #17323

3 months agotests/server: check for `stream != NULL` in mqttd
Viktor Szakats [Mon, 12 May 2025 10:33:35 +0000 (12:33 +0200)] 
tests/server: check for `stream != NULL` in mqttd

To avoid an assert in `fgets()` on MSVC when the test case is missing.

Bug: https://github.com/curl/curl/pull/17294#issuecomment-2867501300

Closes #17324

3 months agomk-ca-bundle: switch URLs to GitHub versions
Daniel Stenberg [Mon, 12 May 2025 08:09:39 +0000 (10:09 +0200)] 
mk-ca-bundle: switch URLs to GitHub versions

The offical Firefox source code has moved to GitHub:
https://github.com/mozilla-firefox/firefox

This change adjusts to the new URLs. The old branches nss and central
are not provided so they are removed and the new 'autoland' is added.

Closes #17321

3 months agoimap: remove redundant condition
Daniel Stenberg [Mon, 12 May 2025 07:17:00 +0000 (09:17 +0200)] 
imap: remove redundant condition

'imap' always evaluates to true. Spotted by CodeSonar.

Closes #17318

3 months agortsp: remove redundant condition
Daniel Stenberg [Mon, 12 May 2025 07:13:10 +0000 (09:13 +0200)] 
rtsp: remove redundant condition

'rtsp' always evaluates to true. Spotted by CodeSonar.

Closes #17317

3 months agonetrc: avoid strdup NULL
Daniel Stenberg [Mon, 12 May 2025 07:21:31 +0000 (09:21 +0200)] 
netrc: avoid strdup NULL

Coverity found a code path where this might happen. Avoid it.

Closes #17319

3 months agohttp_chunks: narrow variable scope for 'trlen'
Daniel Stenberg [Mon, 12 May 2025 07:07:50 +0000 (09:07 +0200)] 
http_chunks: narrow variable scope for 'trlen'

CodeSonar found a case where it would be assigned but never used and
narrowing the scope makes sense anyway.

Closes #17316

3 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 12 May 2025 05:47:34 +0000 (07:47 +0200)] 
RELEASE-NOTES: synced

3 months agomprintf: provide hex digits for escape.c to use
Daniel Stenberg [Sun, 11 May 2025 12:56:16 +0000 (14:56 +0200)] 
mprintf: provide hex digits for escape.c to use

Since they need the exact same set, use the same set. The mprintf string
was longer than it had to be.

Closes #17311

3 months agomprintf: remove outdated comment about SIZEOF_SIZE_T
Daniel Stenberg [Sun, 11 May 2025 21:40:53 +0000 (23:40 +0200)] 
mprintf: remove outdated comment about SIZEOF_SIZE_T

It was now plain wrong

Closes #17312

3 months agoinet_ntop: rename curlx_inet_ntop to Curl_inet_ntop
Daniel Stenberg [Sun, 11 May 2025 21:48:10 +0000 (23:48 +0200)] 
inet_ntop: rename curlx_inet_ntop to Curl_inet_ntop

It is not part of the curlx club.

Closes #17313

3 months agocurl_version_info.md: clarify ssl_version for MultiSSL
Jay Satiro [Sat, 10 May 2025 07:43:04 +0000 (03:43 -0400)] 
curl_version_info.md: clarify ssl_version for MultiSSL

- Clarify that the ssl_version in MultiSSL builds contains all SSL
  backend names with the inactive backend names in parentheses.

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

3 months agotimeval.c: #include fix
Daniel Stenberg [Sun, 11 May 2025 10:24:10 +0000 (12:24 +0200)] 
timeval.c: #include fix

3 months agotest1621: Improve stripcredentials tests
Dan Fandrich [Wed, 7 May 2025 06:39:22 +0000 (23:39 -0700)] 
test1621: Improve stripcredentials tests

- add more unusual input cases
- add a valid non-http protocol
- fix tests so an input that should be stripped but isn't is a failure
- fix detection of when stripcredentials() would be available to test
- avoid using a NULL pointer

Closes #17304

3 months agomime: reuse the base64 string from the base64 code
Daniel Stenberg [Sat, 10 May 2025 09:12:22 +0000 (11:12 +0200)] 
mime: reuse the base64 string from the base64 code

Avoids duplicating an identical string here.

Closes #17309

3 months agobase64: pass in the padding byte separately
Daniel Stenberg [Sat, 10 May 2025 09:05:56 +0000 (11:05 +0200)] 
base64: pass in the padding byte separately

The makes the string with base64 octets "pure" to be used elsewhere as
well.

Closes #17309

3 months agocurl: fix memory leak when -h is used in config file
Daniel Stenberg [Fri, 9 May 2025 21:43:22 +0000 (23:43 +0200)] 
curl: fix memory leak when -h is used in config file

Reported-by: antypanty on hackerone
Add test 748 to reproduce and verify fix

Closes #17306

3 months agoCURLMOPT_TIMERFUNCTION.md: correct the example
Daniel Stenberg [Fri, 9 May 2025 13:41:48 +0000 (15:41 +0200)] 
CURLMOPT_TIMERFUNCTION.md: correct the example

Fixes #17301
Reported-by: Dirk Feytons
Closes #17303

3 months agowindows: fix to preserve error code in `curlx_winapi_strerror()`
Viktor Szakats [Fri, 9 May 2025 13:18:51 +0000 (15:18 +0200)] 
windows: fix to preserve error code in `curlx_winapi_strerror()`

Drop the interim macro `PRESERVE_WINDOWS_ERROR_CODE` and always preserve
error code for `_WIN32`. To make sure this is always done in
`curlx_winapi_strerror()`.

Follow-up to c74d3e10d2935a9a37ffe6b2f7a4ecb0f81e974f #17299

Closes #17302

3 months agocurlx: move curlx_inet_pton
Daniel Stenberg [Fri, 9 May 2025 11:26:00 +0000 (13:26 +0200)] 
curlx: move curlx_inet_pton

Used by test server code.

Closes #17300

3 months agocurlx: add curlx_winapi_ functions
Daniel Stenberg [Fri, 9 May 2025 08:21:53 +0000 (10:21 +0200)] 
curlx: add curlx_winapi_ functions

Split them out from lib/strerror. Used by test code.

Closes #17299