Commit Graph

33687 Commits

Author SHA1 Message Date
Viktor Szakats
45862f2221
cmake: tidy up and shorten symbol hiding initialization
- drop redundant local variables.

- drop extra Intel C feature check that always returned success due
  to not passing the tested compiler option. Nobody reported an issue
  with this since 2016, suggesting the version check alone is enough.

Closes #15400
2024-10-24 22:12:58 +02:00
Viktor Szakats
1da1fcc43d
cmake: tidy up picky warning initialization
- use CMake 3.12 syntax when available, in clang-cl branch.
  Follow-up to e89491e1f0 #15337

- rename internal variables to underscore-lowercase.
  Follow-up to d8de4806e1 #14571

- update comment.

Closes #15404
2024-10-24 21:20:04 +02:00
Viktor Szakats
fff6afb0f8
cmake: rename local variables to underscore-lowercase
Also drop `_curl` prefix, which isn't necessary for underscore variables
and wasn't used in most other cases.

Follow-up to d8de4806e1 #14571
Closes #15397
2024-10-24 21:20:03 +02:00
Viktor Szakats
f48609d4c1
cmake: limit CURL_STATIC_CRT to MSVC
`CURL_STATIC_CRT` supports MSVC only. Limit its effect to this compiler.

Closes #15403
2024-10-24 19:16:10 +02:00
Viktor Szakats
c9b54fadd7
cmake: use list(APPEND) on CURL_INCLUDES
It does the same as the `set()` used before this patch.
Makes the code easier to read.

Closes #15399
2024-10-24 19:16:10 +02:00
Viktor Szakats
7e94680c9a
cmake: tidy up CURL_DISABLE_FORM_API initialization
Initialization of `CURL_DISABLE_FORM_API` depends on another option.
Make sure the other option is initialized before this one.

Due to the defaults and logic this did not cause an issue.

Also fix the order of two other lines to match with the rest.

Closes #15394
2024-10-24 19:16:10 +02:00
Viktor Szakats
ec68fb5a6c
cmake: drop obsolete items from TODO and INSTALL-CMAKE
- INSTALL-CMAKE: delete `Current flaws in the curl CMake build` section.
  #1123 was fixed in 7e93637acd #2443

- TODO: delete item 3.2.
  Follow-up to 1cb4f5d6e8 #1879

Closes #15405
2024-10-24 19:13:10 +02:00
Daniel Stenberg
02ac5547c7
docs/libcurl/opts/Makefile.inc: alphasort the options list 2024-10-24 16:20:36 +02:00
Daniel Stenberg
469f53686a
curl: detect ECH support dynamically, not at build time
Closes #15402
2024-10-24 16:10:39 +02:00
Stefan Eissing
8cb2d5f48a
quic: use the session cache with wolfSSL as well
Use session cache for QUIC when built with quictls or wolfSSL.

Add test_017_10 for verifying QUIC TLS session reuse when built with
quictls, gnutls or wolfssl.

Closes #15358
2024-10-24 14:55:23 +02:00
Kazuho Oku
b34b757c2e
ngtcp2: set max window size to 10x of initial (128KB)
Just as the quiche backend does

Closes #15392
2024-10-24 14:47:26 +02:00
Stefan Eissing
358eae42a4
bearssl: improved session handling, test exceptions
Add length to session saves, making it clear that we are storing a byte
blob and allowing memcmp() on sameness check.

Remove some pytest skips for bearssl to see if they now work properly in
CI.

Closes #15395
2024-10-24 14:40:01 +02:00
Stefan Eissing
30f66c8ba4
mbedtls: handle session as blobs
Use mbedtls_ssl_session_load() and mbedtls_ssl_session_save() to convert
TLS sessions to byte blobs for the session cache.

Fix a skip message to better indicate why the test is skipped for
mbedtls.

Closes #15398
2024-10-24 14:37:59 +02:00
Daniel Stenberg
3722ed0376
RELEASE-NOTES: synced 2024-10-24 14:35:24 +02:00
Daniel Stenberg
1056889f91
url.md: clarify
- the specified URL can also get data sent to it
- rephrase the scheme guessing part
- mention target options for each URL for saving data
- mention --remote-name-all
- remove "warning" and make it into normal text

Closes #15396
2024-10-24 14:32:13 +02:00
Daniel Stenberg
9255e7a105
version: minor cleanups
- remove typecasts and parentheses in zstd_version()
- create and use oldap_version() for OpenLDAP
- create and use psl_version() for libpsl
- reduce the size of the 40 byte buffers to 30 bytes
- use the brotil/zstd like the others (add the lib name in the functions)
- create and use idn_version for IDN builds
- handle (unlikely) error from ldap_get_option

Closes #15393
2024-10-24 14:04:59 +02:00
Jay Satiro
ac7ae08f02
schannel: reclassify extra-verbose schannel_recv messages
- Create a new macro SCH_DEV() to manage verbose debug messages that are
  only useful for debugging Schannel recv decryption.

schannel_recv contains a lot of useful debug messages to help debug the
function, however in practice they are not otherwise useful and showing
them in debug builds adds a lot of noise.

To show these messages curl must now be built with
CURL_SCHANNEL_DEV_DEBUG defined.

Prior to this change many, but not all, extra-verbose messages were
wrapped in DEBUGF() so they were only shown in debug builds.

Ref: https://github.com/curl/curl/issues/14807

Closes #14826
2024-10-24 10:34:20 +02:00
ArtSin
0325e1b9b2
mprintf: treat %o as unsigned, add tests for %o, %x, %X
`%x` and `%X` were already treated as unsigned, but `%o` was not, even
though it was used with unsigned numbers.

Closes #15348
2024-10-24 10:17:24 +02:00
ArtSin
7ca164faba
mprintf: do not ignore length modifiers of %o, %x, %X
There are uses of `%lx` and `%zx` in the codebase, but `parsefmt`
interpreted them as `%x`.

Closes #15348
2024-10-24 10:16:19 +02:00
Stefan Eissing
f901ab84e6
schannel: ignore error on recv beyond close notify
When receiving data, schannel does a recv from the lower filters, e.g.
the socket, *before* it decrypts and analyses the buffered data it
already has. When that buffer contains a close-notify, e.g. the end of
the TLS stream, any error on the previous receive from the socket are
not applicable to its return codes.

Example from #153345: a server sends a close notify and closes its
connection. The encrypted data, including the close notify is received.
Another receive on the sockets gets a CONNABORTED which curl reports as
CURLE_RECV_ERROR. Schannel analyses its bufferi, sees the close notify
and early returns to the caller. On this return, the error on the
attempted receive does not apply.

Closes #15381
2024-10-24 10:06:40 +02:00
renovate[bot]
38c57bdf0d
GHA: update five dependencies
- rojopolis/spellcheck-github-actions digest to ab8ac45
- nghttp2/nghttp2 to v1.64.0
- actions/cache digest to 6849a64
- github/codeql-action digest to 6624720
- Update actions/checkout digest to 11bd719

Closes #15341
Closes #15346
Closes #15365
Closes #15366
Closes #15387
2024-10-24 10:03:31 +02:00
Daniel Stenberg
59831f8061
tool_operate: split up the huge single_transfer into sub functions
- split up in a few smaller and easier to read functions
- simplify several sections
- avoid superfluous extra allocations
- remove unused debug code

Closes #15385
2024-10-23 23:12:54 +02:00
Daniel Stenberg
30da1f5974
setopt: split Curl_vsetopt() into several sub functions
Reduce the ~3000 line super function into smaller pieces, easier to read and
manage.

Extract the option's argument earlier and use a fixed type instead of using
va_arg() everywhere.

Closes #15376
2024-10-23 23:09:48 +02:00
Viktor Szakats
b3816f67b9
cmake: avoid setting BUILD_TESTING
`BUILD_TESTING` variable is used by other projects and CMake internally.
Replace `cmake_dependent_option()` with `option()` and introduce an
internal variable to track if want and can do testing.

Follow-up to #6036
Follow-up to 3a1e798009 #6072

Reported-by: Robert Maynard
Fixes #15351
Closes #15355
2024-10-23 21:24:02 +02:00
Viktor Szakats
7c023c3f6e
libssh2: delete duplicate break
```
lib/vssh/libssh2.c:2495:7: warning: 'break' will never be executed [-Wunreachable-code-break]
      break;
      ^~~~~
```

CI did not catch it due to llvm skipping this check for all #included
files. It's designed this way to avoid performance issues and false
positive when checking headers:
https://github.com/llvm/llvm-project/issues/71046

Closes #15384
2024-10-23 19:36:04 +02:00
Viktor Szakats
6b440704d8
GHA: drop "3" from openssl names and keys
Also:
- drop patch suffix from cache key for thread-sanitizer local build
  Follow-up to 73d2779196 #15379

Closes #15383
2024-10-23 19:36:03 +02:00
Viktor Szakats
b8de0dadd9
cmake: tidy up line order [ci skip] 2024-10-23 13:13:01 +02:00
Viktor Szakats
5f9411f953
GHA/windows: work around Git for Windows perf regression
Fix the significant perf regression for vcpkg jobs by switching to the
MSYS2 shell environment from Git for Windows. This env is already used
for old-mingw-w64 job that remained unaffected by this issue.

The issue began with the windows-runner update 20241015.1.0. It bumped
Git for Windows from Git 2.46.2.windows.1 to Git 2.47.0.windows.1. GfW
bumped its MSYS2 components, including `msys-2.0.dll`. That's Cygwin
code, which may have contributed to this. Pipes were involved and
`runtests.pl` relies on pipes heavily in parallel mode. (The issue was
not seen with parallel tests disabled, in retrospect.)

This is useful as a permanent solution too. It drop GfW as a dependency
and makes Windows jobs use one less shell/env flavour.

Long term it might help to use native Windows Perl to avoid the MSYS
layer completely, if there is a way to make that work.

Assortment of possibly related links:
https://cygwin.com/pipermail/cygwin/2024-August/256398.html
f78009cb1c
7f3c225325

https://github.com/actions/runner-images/issues/10843
https://github.com/git-for-windows/git/issues/5199
https://github.com/git-for-windows/msys2-runtime/pull/75
7913a41703
555afcb2f3
1c5f4dcdc5

Follow-up to c33174d42f #15364
Follow-up to 1e0305973c #15356

Closes #15380
2024-10-23 13:00:41 +02:00
Viktor Szakats
73d2779196
GHA/linux: drop patch from openssl3 thread sanitizer
The patch is now part of the 3.4.0 stable release.
(Turns out it was part of 3.3.2 already.)

Also:
- rename this local build to match the scheme used with wolfssl.
- drop '3' from local openssl build name.
- sync job name with others.
- quote step names where missing.

Follow-up to a2bcec0ee0 #14751
Closes #15379
2024-10-23 12:02:17 +02:00
renovate[bot]
e1099726a5
CI: update dependency openssl/openssl to v3.4.0
Closes #15377
2024-10-23 11:24:21 +02:00
Viktor Szakats
53fdc5faf3
runtests: use deterministic sort for TESTINFO lines
Sort TESTINFO lines by description within the number of skipped test.
It makes the list of skipped test groups easier to diff/compare between
jobs and runs.

Closes #15374
2024-10-23 10:42:30 +02:00
Max Dymond
e43d37c541
ci: fix renovate's matching for OpenSSL and quictls
Renovate only matches on the raw version numbers of a package, but
OpenSSL includes `openssl-` as a prefix in the version number. This
change means that the match string now expects the `openssl-` prefix
and will just update the version portion.

This also updates quictls so that renovate can detect and update the
version correctly.

Closes #15359
2024-10-23 10:40:43 +02:00
Viktor Szakats
b327a53f09
GHA: use --no-install-suggests --no-install-recommends where missing
It prevents `apt-get install` commands installing unnecessary packages.

Makes the 8 HTTP/3 jobs around 30 seconds faster each.

before: https://github.com/curl/curl/actions/runs/11466168597
after:  https://github.com/curl/curl/actions/runs/11469013245?pr=15373

Closes #15373
2024-10-23 01:29:52 +02:00
Daniel Stenberg
0e18bd3940
mk-lib1521: fix the long return code check
It worked mostly by accident since it checked the variable from the
previous setopt invoke.

Closes #15372
2024-10-23 00:41:05 +02:00
Viktor Szakats
605bc2d2c6
GHA/linux: merge 32-bit Linux workflow
Also:
- tidy up a step condition.

Closes #15370
2024-10-22 23:38:13 +02:00
Yedaya Katsman
acd134cfe1 tests: Fix FILEFORMAT <file name=""> directive
Follow-up to dcc52095

Closes #15371
2024-10-22 13:41:02 -07:00
Viktor Szakats
b6219cd932
GHA/linux: merge torture jobs into the main workflow
They complete in 4 and 7 minutes, and do not hold back the main Linux
workflow.

Also:
- bump default parallelism for `test-torture` target to `-j20`
  (was: `-j2`).
- drop redundant package install from `rustls` jobs.

Closes #15360
2024-10-22 20:20:42 +02:00
Viktor Szakats
52851d3256
GHA/macos: use test-torture target for torture tests
They used `test-ci` before this patch.

Closes #15369
2024-10-22 20:20:42 +02:00
Viktor Szakats
096bfdeff6
cmake/FindCares: fix version detection for c-ares 1.34.1
Due to a regression in c-ares 1.34.1, the non-pkg-config version
detection method broke for this version. c-ares 1.34.2 fixes it,
but update our detection code anyway to also work with 1.34.1.

Ref:
126e274159
https://github.com/c-ares/c-ares/pull/903

Closes #15368
2024-10-22 20:20:42 +02:00
Viktor Szakats
825a800e0e
cmake: use the BSD variable
- use `BSD` in addition to backwards-compatible method.
- add `BSD` to the configuration log and `buildinfo.txt` if detected.
- add `BSD` tag to `buildinfo.txt` also via `./configure`.

The `BSD` variable is supported by CMake 3.25.0 and upper.

Ref: https://cmake.org/cmake/help/latest/variable/BSD.html

Closes #15367
2024-10-22 20:20:41 +02:00
Viktor Szakats
9126eb5a8a
cmake: replace CURL_*_DIR with {PROJECT,CMAKE_CURRENT}_*_DIR
It reduces the number of synonym variables in the code.
Makes it easier to grok and grep.

- replace `CURL_SOURCE_DIR`
  with `PROJECT_SOURCE_DIR`.

- replace `CURL_BINARY_DIR`
  with `PROJECT_BINARY_DIR` or `CMAKE_CURRENT_BINARY_DIR`.

- replace a single use of `CMAKE_BINARY_DIR`
  with `PROJECT_BINARY_DIR`.

- replace `CMAKE_CURRENT_*_DIR`
  with `PROJECT_*_DIR` where it makes the code more uniform.

- quote an argument (formatting).

Closes #15331
2024-10-22 19:13:08 +02:00
Viktor Szakats
c33174d42f
GHA/windows: increase timeout for vcpkg jobs due to slowness
The openssl job no longer fits into 10 minutes since the 20241015.1.0
GHA windows-latest image update. This caused all runs to fail.

The `run tests` step takes ~10 minutes now, up from ~4. This is
6 minutes more than before these updates. It's seen with other vcpkg
jobs too, tests run slower than half speed since.

Bump the timeout to make it, though the headroom is now less than it
was.

Before:
https://github.com/curl/curl/actions/runs/11386748199/job/31679733295
https://github.com/curl/curl/actions/runs/11347976608/job/31560690219

After:
https://github.com/curl/curl/actions/runs/11462332743/job/31893491625?pr=15364

Ref: fcc4cdb1d0
Ref: https://github.com/curl/curl/pull/15335#issuecomment-2423759953
Follow-up to 1e0305973c #15356
Closes #15364
2024-10-22 19:13:08 +02:00
Daniel Stenberg
dcb27fdd40
GHA: fix the msh3 renovate thing
Follow-up to 943df95ae7

Closes #15363
2024-10-22 15:48:27 +02:00
Stefan Eissing
943df95ae7
CI: run with standard mod_http2
We used to include a special mod_h2 in our CI that supports the
directive H2MaxDataFrameLen for test_02_20. Since then, ubuntu-lastest
includes a more recent apache httpd. Let's see if we can live without
the special.

Closes #15353
2024-10-22 15:31:46 +02:00
Tal Regev
c2e2636773
GHA/windows: add http3 to libressl vcpkg job
Also drop a libressl workaround no longer necessary.

Closes #15338
2024-10-22 14:23:12 +02:00
Viktor Szakats
1e0305973c
GHA/windows: ignore results for test 987
987 is `SMTPS with redundant explicit SSL request`.

Root cause undiscovered.

Started failing after GHA bumping the windows image to `20241015.1.0`:
fcc4cdb1d0
https://github.com/actions/runner-images/pull/10803

vcpkg packages also got bumped as a result. They seem unrelated:
c-ares  1.33.1 -> 1.34.1
nghttp2 1.62.1 -> 1.63.0
nghttp3 1.5.0  -> 1.6.0
(there may be more)

Ref: https://github.com/curl/curl/pull/15335#issuecomment-2423759953

Closes #15356
2024-10-22 14:17:58 +02:00
Viktor Szakats
0978afd7aa
GHA/linux: tidy up and performance
- replace openssl3 default local build with packaged one.
- drop valgrind from IntelC job.
- drop IntelC no-ssl job.
- bump local openssl to 3.3.2.
- disable tests in the cmake variant of a job.
- add comment to the remaining local openssl3 build.
  We can drop the patch after upgrading to upcoming 3.4.0.
- drop gcc-11 from jobs. packaged gcc is now newer at 13.2.0.
  (saves more than 1m install time for each of the 5 jobs.)
  Follow-up to 9cc9a6472c #9454

Closes #15349
2024-10-22 13:15:37 +02:00
zjyhjqs
e89491e1f0
cmake: fix compile warnings for clang-cl
clang-cl is an alternative command-line interface to Clang, designed
for compatibility with the Visual C++ compiler, `cl.exe`:
https://clang.llvm.org/docs/UsersManual.html#clang-cl

The way to test clang-cl in CMake:
- `CMAKE_<LANGUAGE>_COMPILER_ID`: "Clang"
- `CMAKE_<LANGUAGE>_COMPILER_FRONTEND_VARIANT`: "MSVC"

Note: `CMAKE_<LANGUAGE>_COMPILER_FRONTEND_VARIANT` was introduced since
CMake 3.14, but the variable `MSVC` works fine here.

https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_FRONTEND_VARIANT.html
https://cmake.org/cmake/help/latest/variable/MSVC.html

Closes #15337
2024-10-21 12:47:47 +02:00
Viktor Szakats
7dd7cbac88
version: say quictls in MSH3 builds
Before: `curl 8.11.0-DEV (x86_64-pc-linux-gnu) libcurl/8.11.0-DEV OpenSSL/3.3.0 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libpsl/0.21.2 msh3/0.6.0.0`
After:  `curl 8.11.0-DEV (x86_64-pc-linux-gnu) libcurl/8.11.0-DEV quictls/3.3.0 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libpsl/0.21.2 msh3/0.6.0.0`

Closes #15335
2024-10-21 12:47:46 +02:00
Gabriel Marin
a58584a881
checksrc: add check for spaces around logical AND operators
Closes #15144
2024-10-21 09:35:00 +02:00