]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
3 weeks agoscripts: fix to quote the copyright email address
Viktor Szakats [Fri, 11 Jul 2025 12:42:13 +0000 (14:42 +0200)] 
scripts: fix to quote the copyright email address

Also:
- fix the generated output in repo files.

Cherry-picked from #17877
Closes #17903

3 weeks agolib: stop `time()` debug overrides at the end of source in altsvc, hsts
Viktor Szakats [Fri, 11 Jul 2025 11:45:06 +0000 (13:45 +0200)] 
lib: stop `time()` debug overrides at the end of source in altsvc, hsts

To avoid applying it to all other sources in unity mode.

This may have affected tests setting a custom time via `CURL_TIME`,
in unity builds: 446, 780, 781, 782, 783, 970, 972, 1654, 1660

Closes #17897

3 weeks agotidy-up: drop redundant `#ifdef` before `#undef`
Viktor Szakats [Tue, 8 Jul 2025 12:15:45 +0000 (14:15 +0200)] 
tidy-up: drop redundant `#ifdef` before `#undef`

Closes #17899

3 weeks agotidy-up: whitespace (more in Perl)
Viktor Szakats [Fri, 11 Jul 2025 14:04:24 +0000 (16:04 +0200)] 
tidy-up: whitespace (more in Perl)

Follow-up to 8eab2b70860e285525130f69b22ac5567292c659 #17896
Cherry-picked from #17877
Closes #17901

3 weeks agotidy-up: whitespace
Viktor Szakats [Tue, 8 Jul 2025 11:59:32 +0000 (13:59 +0200)] 
tidy-up: whitespace

Cherry-picked from #17877
Cherry-picked from #17876

Closes #17896

3 weeks agotest1222: fix for out-of-tree and no-libcurl-manual builds
Viktor Szakats [Thu, 10 Jul 2025 23:39:36 +0000 (01:39 +0200)] 
test1222: fix for out-of-tree and no-libcurl-manual builds

Before this patch this test succeeded silently and unconditionally,
when run on an out-of-tree curl build.

Also fix to exit gracefully if no libcurl manuals are found.

Fixing:
```
readline() on closed filehandle $m at ../../tests/test1222.pl line 153.
```

Cherry-picked from #17877
Closes #17892

3 weeks agotest1175: fix to run, and fix documentation issues detected
Viktor Szakats [Wed, 9 Jul 2025 22:36:03 +0000 (00:36 +0200)] 
test1175: fix to run, and fix documentation issues detected

Fix test 1175 by passing the source root directory (was: tests).

Before this patch this caused silent Perl warnings and returning success
without executing the tests, due to:
```
readline() on closed filehandle $f at ../../tests/test1175.pl line 55.
readline() on closed filehandle $f at ../../tests/test1175.pl line 39.
```

Running the test revealed these issues:
```
CURLE_FUNCTION_NOT_FOUND is not in libcurl-errors.md
CURLE_HTTP_POST_ERROR is not in libcurl-errors.md
CURLE_TELNET_OPTION_SYNTAX is not in libcurl-errors.md
CURLM_CALL_MULTI_SOCKET is not in libcurl-errors.md
```

Apply fixes:
- mark `CURLE_FUNCTION_NOT_FOUND` deprecated by 7.53.0
- mark `CURLE_HTTP_POST_ERROR` deprecated by 7.56.0
- mark `CURLE_TELNET_OPTION_SYNTAX` deprecated by 7.78.0
- document `CURLM_CALL_MULTI_SOCKET` as a synonym for
  `CURLM_CALL_MULTI_PERFORM`
- test1477: exclude `CURLM_CALL_MULTI_SOCKET`.

But, these weren't officially deprecated. It may need more updates
to reflect that in other places, or fix the issues differently.

Follow-up to 66ec950004cd45350ad81134557be86391397048 #12424
Follow-up to 74f441c6d31ff8f8bfd242c3d4027d4a56230ce1 #4628

Cherry-picked from #17877
Closes #17880

3 weeks agochecksrc-all: rewrite in Perl, remove `checksrc.bat`
Viktor Szakats [Thu, 10 Jul 2025 07:55:02 +0000 (09:55 +0200)] 
checksrc-all: rewrite in Perl, remove `checksrc.bat`

`checksrc.bat` was outdated and required Perl for `checksrc.pl` anyway.
Rewrite `checksrc-all.sh` in Perl, making it usable in envs without
a POSIX shell.

Closes #17882

3 weeks agocurl: remove the global argument from many functions
Daniel Stenberg [Thu, 10 Jul 2025 16:33:50 +0000 (18:33 +0200)] 
curl: remove the global argument from many functions

Since the config struct has a pointer to it, both pointers don't need to
be passed on.

Closes #17890

3 weeks agocurl: unify pointer names to global config
Daniel Stenberg [Thu, 10 Jul 2025 14:10:59 +0000 (16:10 +0200)] 
curl: unify pointer names to global config

Use 'config' for pointing to a OperationConfig

Use 'global' for pointing to GlobalConfig

Bonus: add config_alloc(), an easier way to allocate + init a new
OperationConfig struct.

Closes #17888

3 weeks agoh3: fix query of concurrent streams
Stefan Eissing [Thu, 10 Jul 2025 11:18:03 +0000 (13:18 +0200)] 
h3: fix query of concurrent streams

Queries gave wrong value or ran into NULL pointers when called at
times when connection filter was not fully initialized.

Closes #17886

3 weeks agosocks: fix query when filter context is null
Stefan Eissing [Thu, 10 Jul 2025 10:29:25 +0000 (12:29 +0200)] 
socks: fix query when filter context is null

socks connection filter context may be NULL at the time
of a query, accomodate for that.

Closes #17885

3 weeks agohttp2: fix var types in is_alive() implementations
Stefan Eissing [Thu, 10 Jul 2025 07:36:19 +0000 (09:36 +0200)] 
http2: fix var types in is_alive() implementations

Closes #17881

3 weeks agoprojects/build-openssl.bat: remove
Daniel Stenberg [Wed, 9 Jul 2025 20:51:37 +0000 (22:51 +0200)] 
projects/build-openssl.bat: remove

This is a script for building OpenSSL to be used with legacy Visual
Studio builds.

I don't think it is our job to provide nor maintain OpenSSL build
scripts.

Remove

Closes #17879

3 weeks agolibtests: more header tidy-ups
Viktor Szakats [Wed, 9 Jul 2025 14:33:17 +0000 (16:33 +0200)] 
libtests: more header tidy-ups

- make `test*` sources include `first.h`, like all others.
- drop redundant `curlx/*` includes after the above.
- merge `test.h` into `first.h`, now that no other file uses it.
  (and `first.h` had almost no content.)
  To simplify and sync header structure with other tests.

Closes #17875

3 weeks agodocs: mention the as-is concept generically
Daniel Stenberg [Sun, 6 Jul 2025 10:33:51 +0000 (12:33 +0200)] 
docs: mention the as-is concept generically

for curl command line options and for curl_easy_setopt

Closes #17829

3 weeks agotest1499, 1599: use `%LOGDIR`
Viktor Szakats [Wed, 9 Jul 2025 11:01:57 +0000 (13:01 +0200)] 
test1499, 1599: use `%LOGDIR`

Fixing test 1599 also fixes these warnings in the test log:
```
Use of uninitialized value in join or string at /home/runner/work/curl/curl/tests/runner.pm line 774.
```
https://github.com/curl/curl/actions/runs/16157402085/job/45602590085?pr=17768#step:39:743

Assisted-by: Daniel Stenberg
Fixes #17871
Closes #17874

3 weeks agoGHA/macos: adapt to macos-15 for upcoming macos-latest bump
Viktor Szakats [Wed, 9 Jul 2025 08:44:39 +0000 (10:44 +0200)] 
GHA/macos: adapt to macos-15 for upcoming macos-latest bump

macos-latest is soon to switch to macos-15. Make sure it keeps working.

Closes #17873

3 weeks agoGHA: update dependency gnutls/gnutls to v3.8.10
renovate[bot] [Wed, 9 Jul 2025 08:41:47 +0000 (08:41 +0000)] 
GHA: update dependency gnutls/gnutls to v3.8.10

Closes #17872

3 weeks agorenovate.json: migrate config to new format rc-8_15_0-3
renovate[bot] [Mon, 7 Jul 2025 17:21:22 +0000 (17:21 +0000)] 
renovate.json: migrate config to new format

Closes #17854

3 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 9 Jul 2025 08:32:26 +0000 (10:32 +0200)] 
RELEASE-NOTES: synced

3 weeks agotests: move `curlcheck.h` to libtest as `unitcheck.h`
Viktor Szakats [Tue, 8 Jul 2025 22:43:44 +0000 (00:43 +0200)] 
tests: move `curlcheck.h` to libtest as `unitcheck.h`

To simplify dependencies, and sync tunits and units builds further.

`curlcheck.h` already depended on logic implemented within libtests:
it referenced a global variable (`unitfail`) defined in `first.c` and
declared in `test.h`.

Also:
- rename to `unitcheck.h` to indicate it's meant for unit tests.
- make `unitcheck.h` include `first.h` instead of `test.h`.
  This brings header use closer to libtests. It also includes
  `curlx/curlx.h` for all unit tests by default now.
- move `unitfail` declaration from `test.h` to `first.h`.
  To match its definition in `first.c`.
- drop now redundant per-test curlx header includes.

Closes #17868

3 weeks agotests: fix 1301, 1308 to fail on error
Viktor Szakats [Tue, 8 Jul 2025 20:38:02 +0000 (22:38 +0200)] 
tests: fix 1301, 1308 to fail on error

They were using a macro designed for unit tests. It does not fail when
used in libtests. Make similar macros for these tests, and make them
return a failure.

Also:
- makes these two tests align with the rest of libtests, by including
  `first.h` instead of `curlcheck.h`.
- since libtests no longer need to depend on tests/unit, drop this
  dependency from build scripts.

Closes #17867

3 weeks agocurl_osslq: fix missing include of url.h
Karthik Dasari [Tue, 8 Jul 2025 16:28:47 +0000 (21:58 +0530)] 
curl_osslq: fix missing include of url.h

Follow-up to 4ccf3a31f596b1055d9f128e45d0a647d59b6f53 #17783
Follow-up to b270fec68dc66c7a3d37a283cc147ba3c6fa7297 #17858
Ref: #17857
Closes #17864

3 weeks agowindows: drop redundant `curl_wcsdup_callback` callback
Viktor Szakats [Mon, 7 Jul 2025 09:46:26 +0000 (11:46 +0200)] 
windows: drop redundant `curl_wcsdup_callback` callback

This callback was permanently mapped to libcurl's internal
`Curl_wcsdup()`, which always uses the customizable malloc for
allocation, thus making a custom mapping redundant anyway.

To simplify, drop the callback and map `_tcsdup()` in Unicode mode
directly to `Curl_wcsdup()`.

Also fixes:
- `curl_global_init()` which, before this patch, (re)initialized its
  mapping to `_wcsdup()`, returning buffers potentially incompatible
  with a custom allocator.
  Bug: https://github.com/curl/curl/pull/17840#issuecomment-3044361245
  Bug: https://github.com/curl/curl/pull/7540#issuecomment-2380995349
Co-reported-by: Luca Kellermann
Follow-up to 76e047fc27b3a0b9e6d6d00cacf536e7b7c1b532 #7540
Assisted-by: Jay Satiro
Closes #17843

3 weeks agoexamples: beef up websocket.c
Stefan Eissing [Tue, 8 Jul 2025 10:05:09 +0000 (12:05 +0200)] 
examples: beef up websocket.c

Make `docs/examples/websocket.c more complete by showing how to handle
CURLE_AGAIN return codes and incomplete sends.

Reported-by: Markus Unterwaditzer
Fixes #13288
Closes #17860

3 weeks agoKNOWN_BUGS: 10.2 Does not acknowledge getaddrinfo sorting policy
Daniel Stenberg [Tue, 8 Jul 2025 10:47:58 +0000 (12:47 +0200)] 
KNOWN_BUGS: 10.2 Does not acknowledge getaddrinfo sorting policy

Closes #16718
Closes #17861

3 weeks agolibssh: fix readdir issues
Eshan Kelkar [Tue, 8 Jul 2025 07:12:29 +0000 (12:42 +0530)] 
libssh: fix readdir issues

Signed-off-by: Eshan Kelkar <eshankelkar@galorithm.com>
Closes #17856

3 weeks agoquiche: fix missing include of url.h
Stefan Eissing [Tue, 8 Jul 2025 08:47:51 +0000 (10:47 +0200)] 
quiche: fix missing include of url.h

Reported-by: Karthik Dasari
Fixes #17857
Closes #17858

3 weeks agoruntests: support memory-limits per test
Daniel Stenberg [Fri, 4 Jul 2025 21:57:03 +0000 (23:57 +0200)] 
runtests: support memory-limits per test

The idea here is to set limits per test how many allocations and maximum
amount of memory it is allowed to use. This is a means to make sure the
number and total size of allocations are kept in check and don't
mistakenly "blow up".

If runtests.pl detects that the given limits have been exceeded it fails
the test case with an error.

The `<verify>` part now supports `<limits>`, and in this section two
limits can be set for each test (verified in debug builds only):

    Allocations: [number of allocation calls]
    Maximum allocated: [maximum concurrent memory allocated]

Default limits (used if nothing is set in the test file):

    Allocations: 1000
    Maximum allocated: 1000000

Closes #17821

3 weeks agoGHA: update dependency cloudflare/quiche to v0.24.4
renovate[bot] [Mon, 7 Jul 2025 17:22:15 +0000 (17:22 +0000)] 
GHA: update dependency cloudflare/quiche to v0.24.4

Closes #17849

3 weeks agoGHA: update dependency nghttp2/nghttp2 to v1.66.0
renovate[bot] [Mon, 7 Jul 2025 15:40:47 +0000 (15:40 +0000)] 
GHA: update dependency nghttp2/nghttp2 to v1.66.0

Closes #17850

3 weeks agoGHA: update dependency awslabs/aws-lc to v1.55.0
renovate[bot] [Mon, 7 Jul 2025 15:40:02 +0000 (15:40 +0000)] 
GHA: update dependency awslabs/aws-lc to v1.55.0

Closes #17847

3 weeks agoGHA: update dependency Mbed-TLS/mbedtls to v3.6.4
renovate[bot] [Mon, 7 Jul 2025 15:39:58 +0000 (15:39 +0000)] 
GHA: update dependency Mbed-TLS/mbedtls to v3.6.4

Closes #17846

3 weeks agoGHA/distcheck: add missing timeout, reduce existing
Viktor Szakats [Mon, 7 Jul 2025 17:07:28 +0000 (19:07 +0200)] 
GHA/distcheck: add missing timeout, reduce existing

Also hung around an `apt update`:
https://github.com/curl/curl/actions/runs/16121486815/job/45488127176?pr=17847

Closes #17853

3 weeks agoGHA/curl-for-win: reduce job timeout to 10m, apply to Windows jobs
Viktor Szakats [Mon, 7 Jul 2025 16:51:15 +0000 (18:51 +0200)] 
GHA/curl-for-win: reduce job timeout to 10m, apply to Windows jobs

The timeout was missing from two Windows jobs, making them linger for
a long time due to a command waiting forever.

As seen today with/after `apt update`:
https://github.com/curl/curl/actions/runs/16121485403/job/45488122962?pr=17846

Closes #17852

3 weeks agoCI: sync curl download command-line options
Viktor Szakats [Mon, 7 Jul 2025 14:19:24 +0000 (16:19 +0200)] 
CI: sync curl download command-line options

- circleci: pipe to tar.
- use long options uniformly.
- sync option order.
- set timeout where missing.
- set retry where missing.
- set `--retry-connrefused` where missing.
- set `--disable` where missing.
- lower 999s timeouts to 120s.

Closes #17851

3 weeks agoGHA/linux: fix output in download-decompress commands
Viktor Szakats [Mon, 7 Jul 2025 14:13:04 +0000 (16:13 +0200)] 
GHA/linux: fix output in download-decompress commands

Regression from 17a669426f36b467dfd945b4b35f6211598b7977 #17537

Closes #17848

3 weeks agomemory: tidy up `_tcsdup()` override
Viktor Szakats [Mon, 7 Jul 2025 13:11:53 +0000 (15:11 +0200)] 
memory: tidy up `_tcsdup()` override

Follow-up to ef2ccf862f8fbfe5cb86cb716aead57694a95ef5 #17840
Closes #17845

3 weeks agorenovate.json: fix patterns for OpenSSL, QuicTLS and generic
Daniel Stenberg [Mon, 7 Jul 2025 11:03:14 +0000 (13:03 +0200)] 
renovate.json: fix patterns for OpenSSL, QuicTLS and generic

Follow-up to 17a669426f

Closes #17842

3 weeks agomemory: stop overriding unused `wcsdup()`/`_wcsdup()` system functions
Viktor Szakats [Mon, 7 Jul 2025 09:46:26 +0000 (11:46 +0200)] 
memory: stop overriding unused `wcsdup()`/`_wcsdup()` system functions

Also ban them via `checksrc`.

The code continues to use `_tcsdup()`.

Assisted-by: Daniel Stenberg
Closes #17840

3 weeks agoGHA: update cygwin/cygwin-install-action version number to v6
renovate[bot] [Mon, 7 Jul 2025 12:20:55 +0000 (12:20 +0000)] 
GHA: update cygwin/cygwin-install-action version number to v6

Existing hash received a release tag.

Follow-up to 4c20eb71083268c20f1018145e0de1dff18d5878 #17118
Closes #17844

3 weeks agocurl.h: make CURL_IPRESOLVE_* symbols defined as longs
Christian Hesse [Tue, 1 Jul 2025 08:29:13 +0000 (10:29 +0200)] 
curl.h: make CURL_IPRESOLVE_* symbols defined as longs

... as `curl_easy_setopt()` expects them to be.

Also remove some casting workarounds.

Closes #17790

3 weeks agoGHA: bump OpenSSL to 3.5.1
Daniel Stenberg [Mon, 7 Jul 2025 10:54:31 +0000 (12:54 +0200)] 
GHA: bump OpenSSL to 3.5.1

Closes #17841

3 weeks agolibssh2: remove use of 'initialised' for cleanup
Daniel Stenberg [Mon, 7 Jul 2025 06:23:15 +0000 (08:23 +0200)] 
libssh2: remove use of 'initialised' for cleanup

It could previously cause a memory-leak when the cleanup was not
performed because it was not set.

Reported-by: albrechtd on github
Fixes #17819
Closes #17837

3 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 7 Jul 2025 07:35:19 +0000 (09:35 +0200)] 
RELEASE-NOTES: synced

3 weeks agodocs,tests: fix english grammar "allow to" -> "allow <something> to"
Carlos Henrique Lima Melara [Wed, 2 Jul 2025 00:18:46 +0000 (21:18 -0300)] 
docs,tests: fix english grammar "allow to" -> "allow <something> to"

This was spotted by Debian's lintian tool. It adds an informational
warning at every run, so my OCD was kicking in and I had to fix it :-)

Closes #17787

3 weeks agoscorecard: flame graphs and documentation
Stefan Eissing [Tue, 1 Jul 2025 10:19:28 +0000 (12:19 +0200)] 
scorecard: flame graphs and documentation

Add `--flame` option to scorecard.py for generating flame graphs.
Add documentation in docs/internal/SCORECARD.md on how to use this.

Closes #17792

3 weeks agongtcp2: fix coverity warning about result handling
Stefan Eissing [Mon, 30 Jun 2025 07:07:54 +0000 (09:07 +0200)] 
ngtcp2: fix coverity warning about result handling

Closes #17783

3 weeks agoGHA/curl-for-win: enable unity batches to improve build perf
Viktor Szakats [Sun, 6 Jul 2025 19:17:31 +0000 (21:17 +0200)] 
GHA/curl-for-win: enable unity batches to improve build perf

Job                 | Before |  After |
:------------------ | -----: | -----: |
Linux gcc glibc     |  4m44s |  4m13s |
Linux llvm MUSL     |  4m17s |  4m00s |
macOS clang         |  1m59s |  1m54s |
Windows llvm        |  3m56s |  3m18s |
Windows gcc ... x86 |  3m26s |  3m11s |

Before: https://github.com/curl/curl/actions/runs/16101989848
After: https://github.com/curl/curl/actions/runs/16102353747?pr=17836

Closes #17836

3 weeks agoquic: implement CURLINFO_TLS_SSL_PTR
Stefan Eissing [Thu, 3 Jul 2025 10:06:41 +0000 (12:06 +0200)] 
quic: implement CURLINFO_TLS_SSL_PTR

Replace the old Curl_ssl_get_internals() with a new connection filter
query to retrieve the information. Implement that filter query for TCP
and QUIC TLS filter types.

Add tests in client tls_session_reuse to use the info option and check
that pointers are returned.

Reported-by: Larry Campbell
Fixes #17801
Closes #17809

3 weeks agounit3214: verify struct sizes
Daniel Stenberg [Sat, 5 Jul 2025 09:47:35 +0000 (11:47 +0200)] 
unit3214: verify struct sizes

This test makes sure that a number of internal and public structs are
within their maximum allowed size limits.

The public structs can only grow in controlled ways, while the internal
ones may be allowed to grow if deemed right.

The idea here is to control, to know and make sure all important struct
growth is intentional.

Closes #17823

3 weeks agomemdebug.h: eliminate global macro `CURL_MT_LOGFNAME_BUFSIZE`
Viktor Szakats [Sat, 5 Jul 2025 09:23:09 +0000 (11:23 +0200)] 
memdebug.h: eliminate global macro `CURL_MT_LOGFNAME_BUFSIZE`

It had a single use in `src/tool_main.c`. Replace with a literal and
`sizeof()`s.

Follow-up to aaab5fa299e13c0c3abba929cb187a8ec3b006f9
Cherry-picked from #17827
Closes #17833

3 weeks agows: drop redundant `CURL_EXTERN` from function definitions
Viktor Szakats [Sat, 5 Jul 2025 16:32:08 +0000 (18:32 +0200)] 
ws: drop redundant `CURL_EXTERN` from function definitions

Cherry-picked from #17827
Closes #17832

3 weeks agocurl_memory.h: fix to undefine `accept4`
Viktor Szakats [Sun, 6 Jul 2025 13:16:49 +0000 (15:16 +0200)] 
curl_memory.h: fix to undefine `accept4`

Follow-up to 3d02872be7cfe6dcdef4b02321b47af19e1ce268 #16979
Cherry-picked from #17827
Closes #17831

3 weeks agorustls: apply memory function overrides, fixing an ECH buffer free
Viktor Szakats [Sun, 6 Jul 2025 10:35:00 +0000 (12:35 +0200)] 
rustls: apply memory function overrides, fixing an ECH buffer free

Fixing:

- a raw `free()` in ECH code that's malloced in lib code, causing
  an invalid free, also reported by valgrind (in non-unity builds).

  And in unity builds adjusted to behave like non-unity via #17827:
  Ref: https://github.com/curl/curl/actions/runs/16093372427/job/45421778472?pr=17827#step:39:3321

- a local pair of `malloc()`/`free()` to use curl's memory allocators,
  and participate in memory tracking when enabled.

Cherry-picked from #17827
Closes #17830

3 weeks agomemdebug.h: #undef `fclose` before defining it
Viktor Szakats [Sun, 6 Jul 2025 16:59:32 +0000 (18:59 +0200)] 
memdebug.h: #undef `fclose` before defining it

Just in case, and to match the pattern used for similar redefines.

Cherry-picked from #17827

3 weeks agomemdebug.h: fix whitespace/indentation
Viktor Szakats [Sun, 6 Jul 2025 17:00:26 +0000 (19:00 +0200)] 
memdebug.h: fix whitespace/indentation

Cherry-picked from #17827

3 weeks agotests: make all names < 75 characters long
Daniel Stenberg [Sat, 5 Jul 2025 11:56:41 +0000 (13:56 +0200)] 
tests: make all names < 75 characters long

- no need to make them long and complicated
- increases the chances of them looking better in terminal outputs

Closes #17824

4 weeks agotests/http/requirements: remove multipart
Daniel Stenberg [Sat, 5 Jul 2025 16:00:30 +0000 (18:00 +0200)] 
tests/http/requirements: remove multipart

This is not actually used.

Reported-by: defnull
URL: https://chaos.social/@defnull/114801392456999379

Closes #17825

4 weeks agoos400: upgrade ILE/RPG bindings with latest definitions.
Patrick Monnerat [Sat, 5 Jul 2025 06:58:45 +0000 (08:58 +0200)] 
os400: upgrade ILE/RPG bindings with latest definitions.

Closes #17822

4 weeks agocmake: `curl_add_clang_tidy_test_target` tidy-ups
Viktor Szakats [Fri, 4 Jul 2025 04:15:54 +0000 (06:15 +0200)] 
cmake: `curl_add_clang_tidy_test_target` tidy-ups

- simplify gathering header directories and compiler definitions
  recursively.

- handle the case when the cmake directory object doesn't define header
  directories or compiler definitions.

- honor more corners cases:
  - `INTERFACE_INCLUDE_DIRECTORIES` of the initial target.
  - handle no header directory for initial target.

- de-duplicate header directories and compiler redefinitions to mimic
  CMake.

- drop unnecessary `unset()`s.

Note that the order of header directories remains different compared to
how CMake passes them to the compiler when building tests. The order is
already different in the test target `INCLUDE_DIRECTORIES` property,
preventing to reproduce the exact CMake order. The distinction between
`-I` and `-isystem` is also missing from target properties.

Cherry-picked from #17768

Closes #17814

4 weeks agolib: fix unused parameter/function compiler warnings
Viktor Szakats [Fri, 4 Jul 2025 13:45:23 +0000 (15:45 +0200)] 
lib: fix unused parameter/function compiler warnings

- hostip: fix unused variable with `CURL_DISABLE_SHUFFLE_DNS`
  ```
  lib/hostip.c: In function 'Curl_dnscache_mk_entry':
  lib/hostip.c:490:42: warning: unused parameter 'data' [-Wunused-parameter]
    490 | Curl_dnscache_mk_entry(struct Curl_easy *data,
        |                        ~~~~~~~~~~~~~~~~~~^~~~
  ```

- setopt: fix unused function with `CURL_DISABLE_HTTP`
  ```
  lib/setopt.c:214:17: warning: 'httpauth' defined but not used [-Wunused-function]
    214 | static CURLcode httpauth(struct Curl_easy *data, bool proxy,
        |                 ^~~~~~~~
  ```

- url: fix unused function with `CURL_DISABLE_NETRC`
  ```
  lib/url.c:2760:13: warning: 'str_has_ctrl' defined but not used [-Wunused-function]
   2760 | static bool str_has_ctrl(const char *input)
        |             ^~~~~~~~~~~~
  ```

Seen with a minimal curl-for-win build:
```
CW_CONFIG=dev-x64-zero-osnotls-osnoidn-nohttp-nocurltool-linux-unity
```

Closes #17818

4 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 4 Jul 2025 10:58:03 +0000 (12:58 +0200)] 
RELEASE-NOTES: synced

4 weeks agodocs: warn about lifetime in CURLOPT_CLOSESOCKET*
Stefan Eissing [Fri, 4 Jul 2025 07:08:39 +0000 (09:08 +0200)] 
docs: warn about lifetime in CURLOPT_CLOSESOCKET*

Callback and data set via CURLOPT_CLOSESOCKETFUNCTION and
CURLOPT_CLOSESOCKETDATA may get used after the easy handle has been
cleaned up. Inform about that.

Closes #17816

4 weeks agotest1499: verify two chunked responses on reused connection
Daniel Stenberg [Fri, 4 Jul 2025 07:00:29 +0000 (09:00 +0200)] 
test1499: verify two chunked responses on reused connection

It triggered a memory leak back in 7.88.1

Closes #17815

4 weeks agoopenssl: fix pkcs11 provider available check
Piotr Nakraszewicz [Wed, 2 Jul 2025 12:29:43 +0000 (14:29 +0200)] 
openssl: fix pkcs11 provider available check

Commit f2ce6c46 among other things added the use of own library context
instead of the default context. Default context has access to OpenSSL
configuration file, own context doesn't have it.
Therefore if a pkcs11 provider is loaded via config file, the function
OSSL_PROVIDER_available() incorrectly detects the provider as
unavailable.

Fix this by loading the OpenSSL config to the library context according
to OpenSSL documentation:
"OSSL_LIB_CTX_load_config() loads a configuration file using the given
ctx. This can be used to associate a library context with providers that
are loaded from a configuration."

Moreover use the provider_loaded flag instead of provider pointer to
determine if a provider is available, as the latter is not set when the
provider is loaded from a configuration.

Closes #17804

4 weeks agocmake: fix `curl_add_clang_tidy_test_target` when no `-D` option
Viktor Szakats [Sat, 28 Jun 2025 01:38:35 +0000 (03:38 +0200)] 
cmake: fix `curl_add_clang_tidy_test_target` when no `-D` option

Fix `curl_add_clang_tidy_test_target` generating an invalid option for
`clang-tidy` if the tested target has no custom macro definition.

Current build doesn't hit this case, but a pending PR does.

Fixing:
```
[...] -Ilib -Itests/client -DCURL_HIDDEN_SYMBOLS -DHAVE_CONFIG_H -D_definitions_t-NOTFOUND
```
error: ISO C99 requires whitespace after the macro name [clang-diagnostic-c99-extensions,-warnings-as-errors]

Cherry-picked from #17768
Closes #17813

4 weeks agocmake: gather options recursively in `curl_add_clang_tidy_test_target`
Viktor Szakats [Fri, 4 Jul 2025 03:25:27 +0000 (05:25 +0200)] 
cmake: gather options recursively in `curl_add_clang_tidy_test_target`

Also look into `INTERFACE_INCLUDE_DIRECTORIES` target properties
for include directories.

Ref: #16973

Closes #17812

4 weeks agotool1621: drop unused internal libcurl headers
Viktor Szakats [Thu, 3 Jul 2025 17:28:36 +0000 (19:28 +0200)] 
tool1621: drop unused internal libcurl headers

Closes #17811

4 weeks agotests/unit: hook up unitprotos to the `units-clang-tidy` target
Viktor Szakats [Thu, 3 Jul 2025 17:47:58 +0000 (19:47 +0200)] 
tests/unit: hook up unitprotos to the `units-clang-tidy` target

To make `ninja units-clang-tidy` target work without manually building
core components first.

Also rename the clang-tidy test target generator macro to align its name
with the built-in `add_custom_target()` function.

Follow-up to c9bb9cd165c1b25c2fe005befdcfe479fc9b68e1 #17750

Closes #17810

4 weeks agocmake/FindGSS: initialize result variables
Viktor Szakats [Thu, 3 Jul 2025 01:26:12 +0000 (03:26 +0200)] 
cmake/FindGSS: initialize result variables

Also rename `_GSS*` local variables to `_gss*` to please `clang-lint`,
which emitted new warnings after adding the initializations.

Ref: https://github.com/curl/curl/issues/17802#issuecomment-3029455984

Closes #17806

4 weeks agocmake/FindGSS: fix processing C header path options
Viktor Szakats [Thu, 3 Jul 2025 00:16:11 +0000 (02:16 +0200)] 
cmake/FindGSS: fix processing C header path options

When processing `--cflags` received from `krb5-config` for `gssapi`:

- fix to not break on multiple `-I` options. Before this patch only
  the first `-I` option was processed as a header directory, subsequent
  ones ended up in C flags as a raw directory, without the `-I` arg.
  Follow-up to 558814e16d84aa202c5ccc0c8108a9d728e77a58

- fix to not duplicate C flags.
  Regression from 146759716cbacfd453b9fb13d1096f0595424a6c #14430

- drop local variable `_val` by re-using `_flag`.

- tidy up comments.

Ref: https://github.com/curl/curl/issues/17802#issuecomment-3029455984

Closes #17805

4 weeks agoCI: skip CI builds that just touch Dockerfile
Dan Fandrich [Thu, 3 Jul 2025 01:26:59 +0000 (18:26 -0700)] 
CI: skip CI builds that just touch Dockerfile

This file sees regular updates but isn't used by any CI build.

4 weeks agoCURLSHOPT_SHARE.md: mention multi-threading requires callbacks
Jay Satiro [Mon, 30 Jun 2025 05:53:43 +0000 (01:53 -0400)] 
CURLSHOPT_SHARE.md: mention multi-threading requires callbacks

- Explain that if data is shared in multiple threads then the user must
  set mutex callbacks.

Reported-by: afengsoft@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/17774
Closes https://github.com/curl/curl/pull/17782

4 weeks agoVULN-DISCLOSURE-POLICY: minor language polish
Daniel Stenberg [Tue, 1 Jul 2025 20:45:03 +0000 (22:45 +0200)] 
VULN-DISCLOSURE-POLICY: minor language polish

Closes #17799

4 weeks agodocs: fix two typos
Ameda Amahru [Tue, 1 Jul 2025 12:33:19 +0000 (14:33 +0200)] 
docs: fix two typos

Closes #17795

4 weeks agoVULN-DISCLOSURE-POLICY.md: fix typos
Marcel Lang [Tue, 1 Jul 2025 13:06:24 +0000 (15:06 +0200)] 
VULN-DISCLOSURE-POLICY.md: fix typos

Closes #17796

4 weeks agoappveyor: drop VS2008 CI job, move OpenSSL 1.0.2 to VS2010
Viktor Szakats [Tue, 1 Jul 2025 17:16:02 +0000 (19:16 +0200)] 
appveyor: drop VS2008 CI job, move OpenSSL 1.0.2 to VS2010

It became flaky today, possible due to an upstream issue. Drop this CI job
also because VS2008 is going to be deprecated soon.

Example:
```
1>------ Build started: Project: curlu, Configuration: Debug Win32 ------
1>Compiling...
1>Project : error PRJ0003 : Error spawning 'cl.exe'.
1>Build log was saved at "file://c:\projects\curl\_bld\lib\curlu.dir\Debug\BuildLog.htm"
1>curlu - 1 error(s), 0 warning(s)
[...]
8>Linking...
8>LINK : fatal error LNK1104: cannot open file '..\..\lib\Debug\curlu-d.lib'
8>Build log was saved at "file://c:\projects\curl\_bld\tests\unit\units.dir\Debug\BuildLog.htm"
8>Test units - 1 error(s), 0 warning(s)
[...]
========== Build: 7 succeeded, 2 failed, 5 up-to-date, 0 skipped ==========
[...]
Command exited with code 1
```

Other times with no visible error all:
```
========== Build: 9 succeeded, 0 failed, 5 up-to-date, 0 skipped ==========
[...]
Command exited with code 1
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/52330703/job/ooqxq0b8ftbsv640#L413

Follow-up to 8c9a9b87c20fd9184e0a6c7b5e2c42d727f0db62 #17725
Follow-up to 63e513b106113db0b1b68bab347b80cb4cef4e65 #17380

Closes #17798

4 weeks agoDockerfile: update debian:bookworm-slim Docker digest to 6ac2c08
renovate[bot] [Tue, 1 Jul 2025 07:54:29 +0000 (07:54 +0000)] 
Dockerfile: update debian:bookworm-slim Docker digest to 6ac2c08

Closes #17788

4 weeks agoeasygetopt: fix curl logo in header comment
Viktor Szakats [Tue, 1 Jul 2025 11:14:18 +0000 (13:14 +0200)] 
easygetopt: fix curl logo in header comment

Closes #17793

4 weeks agocurlinfo: provide the 'digest' feature
Daniel Stenberg [Mon, 30 Jun 2025 22:09:37 +0000 (00:09 +0200)] 
curlinfo: provide the 'digest' feature

... since the tests check for the feature using this name, we
accidentally had lots tests not run because this provided the
`digest-auth` feature that was not checked for.

Closes #17786

4 weeks agotests: move GSS-API dynamic stub into debug-mode libcurl
Viktor Szakats [Tue, 24 Jun 2025 23:45:04 +0000 (01:45 +0200)] 
tests: move GSS-API dynamic stub into debug-mode libcurl

Replace the `libstubgss.so`-based overload solution with one built into
libcurl at compile-time.

The previous, `LD_PRELOAD`-based, solution was non-portable, allowlisted
for Linux, BSD and Solaris. It also required non-debug builds, which
turned out to be an accidental condition:
7d342c723c5ae8e9312210936287810741f40bc5. It also required a curl tool
built against a shared libcurl. Detecting this condition wasn't always
accurate, e.g. with certain cmake configurations.

The overload solution also didn't work on macOS, though it theoretically
should have:
- #17653
- #2394

Experiments on making the overload solution work in more envs:
- #17759
  That revealed that it also did not work on NetBSD, in CI.

The replacement solution is overloading the necessary GSS-API functions
for test 2056 and 2057 at compile time. It requires a debug-enabled curl
build (due to its insecure nature).

This makes these tests run on all platforms. Including most GSS jobs in
CI, that are running tests. (the exception is old-linux, non-debug jobs,
where it felt overkill to enable debug for this.)

The refactored GSS stub code needs to overload less than before because
it's free to use the official GSS API. (This didn't work with
the overload solution on Alpine for example). It can also use libcurl
functions, allowing to replace `snprintf()` with `msnprintf()`.

OS/400 is also overloading GSS API functions. I haven't tested how this
works after this PR. In theory it should, because this PR doesn't rely
on preprocessor overrides.

Note that for future GSS tests, it may be necessary to stub these GSS
API functions: `gss_inquire_context()`, `gss_unwrap()`, `gss_wrap()`.
They are on codepaths not (yet) touched by tests.

Also:
- stub-gss: check for token buffer overrun.
- stub-gss: replace size macros with `sizeof()`.
- GHA: enable debug for some jobs with GSS.
- GHA/linux: ignore results for 2056 and 2057 in the valgrind job.
  They leak the same way as seen with 2077 and 2078.
  Ref: 7020ba797961d38c3bf24539f9bb407e0586274d #17462
  Ref: 146759716cbacfd453b9fb13d1096f0595424a6c #14430
- GHA/linux: fix to ignore `gss_import_name()` leaks in valgrind builds.
  only.
- lib/vauth/krb5_gssapi: reduce variable scope.
- lib/vauth/spnego_gssapi: reduce variable scope.
- tests/libtest: drop code and build logic dealing with `libstubgss`.
- runtests:
  - drop `ld_preload` feature.
  - drop special handling of `LD_PRELOAD` env in tests.
  - drop logic dealing with shared curl tool detection.
  - drop `LD_PRELOAD` envs from tests.

Follow-up to 56d949d31ad182a22bd3bad25b1a902b635d549d #1687

Closes #17752

4 weeks agounit tests: extract "private" prototypes at build time
Daniel Stenberg [Sun, 29 Jun 2025 12:33:13 +0000 (14:33 +0200)] 
unit tests: extract "private" prototypes at build time

In order to do unit tests for private functions, functions that are
marked UNITTEST but without a global scope in the library, functions
that do not have prototypes in their corresponding header file, unit
tests previously brought their own private prototype *copy* into the
unit test.

This was error-prone when the internal function changes but the change
might be missed in the unit test which then uses an outdated prototype
copy for testing.

This change removes the private prototypes from unit tests and instead
introduces a C file parser that parses the specific C files and extracts
the necessary unit test prototypes into a generated header file for unit
tests to use. This geneated lib/unitprotos.h header is then included by
unit tests that need private prototypes.

Assisted-by: Viktor Szakats
Closes #17750

4 weeks agoGHA: fix zizmor 1.10.0 warnings, update names
Viktor Szakats [Sat, 28 Jun 2025 18:22:11 +0000 (20:22 +0200)] 
GHA: fix zizmor 1.10.0 warnings, update names

Job `name:` now mandatory in zizmor.

Also:
- enclose `name:` values in single-quotes, for uniformity.
- drop `name: checkout` where set, for uniformity.
- dist: also install with cmake.
- dist: replace `make` with `cmake --build` for cmake.
  (to make this make-tool agnostic)
- appveyor-status: double-quote shell arguments.
- tweak existing names to be shorter, to sync terms and style across
  jobs and steps.

Ref: https://github.com/zizmorcore/zizmor/releases/tag/v1.10.0

Closes #17773

4 weeks agolib: drop two interim macros in favor of native libcurl API calls
Viktor Szakats [Sat, 28 Jun 2025 10:17:30 +0000 (12:17 +0200)] 
lib: drop two interim macros in favor of native libcurl API calls

Drop `strcasecompare` and `strncasecompare` in favor of libcurl API
calls `curl_strequal` and `curl_strnequal` respectively.

Also drop unnecessary `strcase.h` includes. Include `curl/curl.h`
instead where it wasn't included before.

Closes #17772

4 weeks agodocs/CONTRIBUTE: fix broken link
Fabrício Canedo [Sun, 29 Jun 2025 16:18:06 +0000 (13:18 -0300)] 
docs/CONTRIBUTE: fix broken link

Add the missing "docs" directory in the link.

Closes #17780

4 weeks agomulti: remove careful bounds check as coverity says it is not needed
Stefan Eissing [Mon, 30 Jun 2025 07:24:13 +0000 (09:24 +0200)] 
multi: remove careful bounds check as coverity says it is not needed

And we all hope that future code changes will not make it necessary
again or this will all be blamed on you, coverity!

Closes #17784

4 weeks agocf-socket: make socket data_pending a nop
Stefan Eissing [Mon, 30 Jun 2025 06:53:31 +0000 (08:53 +0200)] 
cf-socket: make socket data_pending a nop

Eliminating the socket readability check in the socket connection
filters for the 'data_pending' callback. Improves performance of
handling of transfers, up to ~30%, depending on parallelism and response
size.

Whatever `data_pending()` once was, its semantics are now:
"Is there anything buffered in the connection filters that needs
 receive?"
Any checks of the socket's readability are done via `multi_wait()`
and friends.

Fix the one place in HTTP/1 proxy code that checked `data_pending()` and
did an early return if false. Remove that check and actually try to
receive data every time.

Closes #17785

4 weeks agoRELEASE-NOTES: synced rc-8_15_0-2
Daniel Stenberg [Sun, 29 Jun 2025 15:02:37 +0000 (17:02 +0200)] 
RELEASE-NOTES: synced

4 weeks agoGHA: make the spacecheck say line number for trailing space errors
Daniel Stenberg [Sun, 29 Jun 2025 12:48:05 +0000 (14:48 +0200)] 
GHA: make the spacecheck say line number for trailing space errors

As it can be quite confusing and frustrating without it.

Closes #17777

4 weeks agoVULN-DISCLOSURE-POLICY: all reports should be disclosed
Daniel Stenberg [Sun, 29 Jun 2025 14:17:49 +0000 (16:17 +0200)] 
VULN-DISCLOSURE-POLICY: all reports should be disclosed

As a matter of policy.

Closes #17778

4 weeks agofirefox-db2pem: avoid use of eval in script
Dan Fandrich [Fri, 27 Jun 2025 18:07:10 +0000 (11:07 -0700)] 
firefox-db2pem: avoid use of eval in script

This could potentially be exploited by manipulating nicknames in the
cert DB.

Reported-by: behindtheblackwall on hackerone
Closes #17766

5 weeks agocmake: fix generator expression in docs/examples
Viktor Szakats [Fri, 27 Jun 2025 23:41:33 +0000 (01:41 +0200)] 
cmake: fix generator expression in docs/examples

To pass the MSVC-specific macro to MSVC only.

Closes #17767

5 weeks agochecksrc: reduce exceptions, apply again to curlx
Viktor Szakats [Fri, 27 Jun 2025 12:21:44 +0000 (14:21 +0200)] 
checksrc: reduce exceptions, apply again to curlx

- tests/libtest: move exception to `stub_gssapi.h`.
- tests/libtest: move remaining exception to `testtrace.c`.
- tests/server: drop obsolete exception.
- docs/examples: move `BANNEDFUNC` exceptions to local files (3 lines).
- docs/examples: move `ERRNOVAR` exception to `ephiperfifo.c`.
- docs/examples: drop `typedef struct` (8 files).
- lib/curlx: add `.checksrc` with banned funcs copied from lib.
- checksrc: ban `strncpy`, `strtok_r`, `strtoul` by default.
  Drop local bans. Add exception for `strtoul` to `tests/server'.
- lib, src: sync banned funcs.

Also:
- REUSE: drop `stunnel.pem`, it no longer exists.
- docs/examples: formatting.
- docs/examples: simplify some `sizeof()`s.

Closes #17764

5 weeks agolib: replace scache no-op macros with `#ifdef`
Viktor Szakats [Fri, 27 Jun 2025 07:03:24 +0000 (09:03 +0200)] 
lib: replace scache no-op macros with `#ifdef`

To avoid warning/error in no-SSL, non-unity builds:
```
lib/multi.c:273:5: error: code will never be executed [-Werror,-Wunreachable-code]
273 |     goto error;
    |     ^~~~~~~~~~
```

Reported-by: Marcel Raad
Fixes #17754
Closes #17760

5 weeks agolib2082: drop `typedef struct`
Viktor Szakats [Fri, 27 Jun 2025 09:13:13 +0000 (11:13 +0200)] 
lib2082: drop `typedef struct`

To not need the checksrc exception `disable TYPEDEFSTRUCT`.

Follow-up to a517378de58358a85b7cfe9efecb56051268f629 #7477

Closes #17763

5 weeks agotests/libtest: drop a checksrc exception
Viktor Szakats [Fri, 27 Jun 2025 09:09:45 +0000 (11:09 +0200)] 
tests/libtest: drop a checksrc exception

Follow-up to a0a1df5af9b3f11125d1a995c01b7c04cfec54e4 #17414

Closes #17762

5 weeks agobufq: change read/write signatures
Stefan Eissing [Thu, 26 Jun 2025 08:26:35 +0000 (10:26 +0200)] 
bufq: change read/write signatures

Change the signature of `bufq` functions from

* `ssize_t Curl_bufq_*(..., CURLcode *err)` to
* `CURLcode Curl_bufq_*(..., size_t *pn)`

This allows us to write slightly less code and avoids the ssize_t/size_t
conversions in many cases. Also, it gets the function in line with all
the other send/recv signatures.

Added helper functions in `cfilters.h` for sending from/receving into
a bufq.

Fuzzer now fails to build due to these changes and its testing of
the bufq API.

Closes #17396

5 weeks agoVULN-DISCLOSURE-POLICY: exclude not installed software
Daniel Gustafsson [Fri, 27 Jun 2025 10:08:01 +0000 (12:08 +0200)] 
VULN-DISCLOSURE-POLICY: exclude not installed software

Flaws in any script or compiled artifact which isn't installed by
default is not considered to be security vulnerabilities.

Closes #17761
Reviewed-by: Daniel Stenberg <daniel@haxx.se>