Commit Graph

35764 Commits

Author SHA1 Message Date
Viktor Szakats
c85ee70e21
cmake: fix ENABLE_UNIX_SOCKETS=OFF with pre-fill enabled on unix
Cherry-picked from #17988
2025-07-23 19:52:18 +02:00
Viktor Szakats
f99210b49c
cmake: keep websockets disabled if HTTP is disabled
Syncing with autotools, and fixing the `Protocols:` verifier test.

Cherry-picked from #17988
2025-07-23 19:50:16 +02:00
Viktor Szakats
548d8a8421
cmake: capitalize 'Rustls' in the config summary
Cherry-picked from #17988
2025-07-23 19:48:35 +02:00
Stefan Eissing
ab5e0bfddc
pytest: add SOCKS tests and scoring
Configure curl with `--with-test-sockd=<path to sockd>` for a locally
installed dante sockd server and new `test_40_*` will verify that
down- and uploads work via SOCKS.

Invoke scorecard.py with `--socks4` or `--socks5` to run performance
tests with SOCKS. Note that SOCKS is not supported for HTTP/3.

Ref: #17969
Closes #17986
2025-07-23 18:12:31 +02:00
Caolán McNamara
fb0b4c8710
http: const up readonly H2_NON_FIELD
Closes #17996
2025-07-23 16:23:39 +02:00
Stefan Eissing
293d922916
test1: raise alloc limits
After failures on certain build/platform combinations.

See: https://github.com/curl/curl/actions/runs/16464320627/job/46537983882?pr=17992

Closes #18004
2025-07-23 16:22:35 +02:00
Stefan Eissing
338f7e9e89
docs: fix name in curl_easy_ssls_export man page
The name of the man page was wrongly given as curl_easy_sssl_export
which seems to have confused our HTTML man page generation.

Reported-by: Qriist on github
Ref: https://github.com/curl/curl-www/issues/458

Closes #17995
2025-07-23 00:56:11 +02:00
Viktor Szakats
31b2c537e6
test1148: drop redundant LC_NUMBER= env setting
No longer necessary after a previous change made sure to strip
the '100.0%' number from the result, before checking it. The dot is
a regex character catching any decimal separator.

Follow-up to 17c18fbc30 #5194
Ref: #2436
Cherry-picked from #17988
Closes #17993
2025-07-22 23:06:10 +02:00
Viktor Szakats
2c0a9c26c8
GHA/non-native: FreeBSD 14.3
Follow-up to f097eaea18 #18000
Closes #18001
2025-07-22 20:18:26 +02:00
renovate[bot]
f097eaea18
GHA: update cross-platform-actions/action action to v0.29.0
Closes #18000
2025-07-22 19:47:47 +02:00
renovate[bot]
6ac97b091d
GHA: update debian:bookworm-slim Docker digest to 2424c18
Closes #17999
2025-07-22 19:47:47 +02:00
Viktor Szakats
5cdb9b44bd
lib1560: fix memory leak when run without UTF-8 support
The issue is missed in CI, because valgrind jobs all run with UTF-8
support.

Fixing:
```
test 1560...[URL API]
 valgrind ERROR ==13362== 104 bytes in 1 blocks are definitely lost in loss record 1 of 1
==13362==    at 0x484D953: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==13362==    by 0x48E1302: curl_dbg_calloc (in /curl/bld/lib/libcurl.so.4.8.0)
==13362==    by 0x4931D12: curl_url (in /curl/bld/lib/libcurl.so.4.8.0)
==13362==    by 0x14F658: get_parts (in /curl/bld/tests/libtest/libtests)
==13362==    by 0x150AC6: test_lib1560 (in /curl/bld/tests/libtest/libtests)
==13362==    by 0x17F5D5: main (in /curl/bld/tests/libtest/libtests)
```
Ref: https://github.com/curl/curl/actions/runs/16446352985/job/46479298080?pr=17988#step:41:3007

Follow-up to 7d1ca2e7e1 #17933

Closes #17998
2025-07-22 17:16:32 +02:00
Stefan Eissing
9657a2041e
curl: tool_read_cb fix of segfault
When transfers read client input without an upload file, the check if
upload file is '.' strcompared a NULL.

Add test 1548 to reproduce and verify fix.

Reported-by: d1r3ct0r
Fixes #17978
Closes #17987
2025-07-21 19:11:37 +02:00
Viktor Szakats
c221c0ee59
test1560: set locale/codeset with LC_ALL (was: LANG), test in CI
To fix running test 1560 when `LC_ALL` is set to something unexpected
(e.g. `C`). Also syncing it with the rest of tests.

Also:
- GHA/linux: enable `libidn2` in more jobs.
  Also to enable test 1560 reproducing this issue in more jobs.
- GHA/linux: run tests with `LC_ALL=C` in one of the jobs.
- GHA/linux: switch to the non-deprecated package name for libidn2.
- GHA/macos: run tests with non-default locale settings in one job.
- GHA/macos: enable AppleIDN in that job.

Ref: https://github.com/curl/curl/pull/17933#issuecomment-3074582840
Follow-up to f27262b179 #10196

Closes #17938
2025-07-21 17:27:23 +02:00
Viktor Szakats
ee232917dc
tidy-up: Curl_thread_create() callback return type
Replace repeat `#ifdef` code with a macro for the return type of
the thread function.

Also:
- always define `CURL_STDCALL`, allowing to use it without guards.
- lib1307: drop single-use macro `CAINFO`.

Closes #17889
2025-07-21 16:17:42 +02:00
Viktor Szakats
8ae93a95f8
curl_fnmatch, servers: drop local macros in favour of sizeof()
Closes #17898
2025-07-21 16:14:14 +02:00
Viktor Szakats
0260e8465a
GHA/checksrc: expand spellcheck, fix issues found
- codespell: break logic out into its own runnable script. Allowing
  to run it on local machines.
- codespell: install via `pip`, bump to latest version.
- codespell: show version number in CI log.
- codespell: drop no longer needed word exception: `msdos`.
- codespell: include all curl source tree, except `packages` and
  `winbuild`. Drop an obsolete file exclusion.
- add new spellchecker job using the `typos` tool. It includes
  the codespell dictionary and a couple more. Use linuxbrew to install
  it. This takes 10 seconds, while installing via `cargo` from source
  would take over a minute.
- codespell: introduce an inline ignore filter compatible with `cspell`
  Make `typos` recognize it, too. Move single exceptions inline.

Fix new typos found. Also rename variables and words to keep
spellchecking exceptions at minumum. This involves touching some tests.
Also switch base64 strings to `%b64[]` to avoid false positives.

Ref: https://github.com/crate-ci/typos/blob/master/docs/reference.md
Ref: https://github.com/codespell-project/codespell?tab=readme-ov-file#inline-ignore
Ref: https://github.com/codespell-project/codespell/issues/1212#issuecomment-1721152455
Ref: https://cspell.org/docs/Configuration/document-settings

Closes #17905
2025-07-21 16:09:01 +02:00
Viktor Szakats
792a61e204
curl_setup.h: move UWP detection after config-win32.h
To honor a `_WIN32_WINNT` set by `config-win32.h`.

Closes #17980
2025-07-21 15:02:21 +02:00
Viktor Szakats
a75110570a
windows: fix if_nametoindex() detection with autotools, improve with cmake
- autotools: fix auto-detection on the Windows platform.
  It was mis-detected when targeting Windows XP/2003 64-bit.
  It was permanently undetected when building for Windows 32-bit.
  ```
  lib/url.c: In function 'zonefrom_url':
  lib/url.c:1802:18: error: implicit declaration of function 'if_nametoindex' [-Wimplicit-function-declaration]
   1802 |       scopeidx = if_nametoindex(zoneid);
        |                  ^~~~~~~~~~~~~~
  lib/url.c:1802:18: error: nested extern declaration of 'if_nametoindex' [-Werror=nested-externs]
  ```
  Ref: https://github.com/curl/curl/actions/runs/16405598782/job/46351023138?pr=17982#step:10:29

  Reported-by: LoRd_MuldeR
  Fixes #17979

  Without this patch the workaround for the 8.15.0 release is:
  `export ac_cv_func_if_nametoindex=0` for Windows XP/2003 64-bit.

  Background: Checking for the `if_nametoindex()` function via
  `AC_CHECK_FUNCS()` (autotools) or `check_function_exists()` (cmake) do
  not work on Windows, for two reasons:
  - the function may be disabled at compile-time in Windows headers
    when targeting old Windows versions (XP or WS2003 in curl context)
    via `_WIN32_WINNT`. But it's always present in the system implib
    `iphlpapi` where these checks are looking.
  - for 32-bit Windows the function signature in the implib requires
    a 4-byte argument, while these checks always use no arguments,
    making them always fail.

- cmake: call `if_nametoindex` dynamically with mingw-w64 v1.0.
  This mingw-w64 version lacks prototype and implib entry for it.

- cmake: add auto-detection for Windows and use as a fallback for
  non-pre-fill cases.

- cmake: disable pre-fill with `_CURL_PREFILL=OFF`. (for testing)

- cmake: disable pre-fill for untested compilers. (i.e. non-MSVC,
  non-mingw64)

- GHA/windows: make an autotools job build for Windows XP.

Follow-up to 0d71b18153 #17413

Closes #17982
2025-07-21 13:30:01 +02:00
Stefan Eissing
3d302250ec
multi event: remove only announced
When a socket is closed, only inform the application
socket callback about it if the socket had been announced
before to the callback.

Reported-by: yaoy6 on github
Fixes #17949
Closes #17950
2025-07-20 23:17:28 +02:00
Stefan Eissing
53e5cdc47b
pytest: increase server KeepAliveTimeout
When CI is not able to give clients enough cpu, the default Apache
KeepAliveTimeout of 5 seconds may trigger and cause tests to fail.

Increase the timeout to 30 seconds for reliability.

Ref: #17963
Closes #17968
2025-07-20 23:15:11 +02:00
Pino Toscano
bed83d9d33
build: enable _GNU_SOURCE on GNU/Hurd
Unconditionally enable _GNU_SOURCE when building on GNU/Hurd; this way
it is possible to properly use/rely on GNU extensions e.g. accept4(),
memrchr(), and the GNU strerror_r().

Closes #17975
2025-07-20 23:13:41 +02:00
Stefan Eissing
960fb49245
easy handle: check validity on external calls
In each external API function passing a `CURL *` into the library, check
`GOOD_EASY_HANDLE()` if its magic is still there.

Ref: #17957
Closes #17958
2025-07-20 23:11:05 +02:00
Stefan Eissing
a15a5f4d29
vquic-tls: fix SSL backend type for QUIC connections using gnutls
Fix the copy&paste error when querying ssl info for gnutls
on QUIC connections.

Reported-by: Harry Sintonen
Closes #17976
2025-07-20 23:10:15 +02:00
Viktor Szakats
bf9d9fe0bd
multissl: initialize when requesting a random number
To fix test 1308 in MultiSSL builds.

Failure was caused by the random number generator virtual function being
NULL, instead of pointing to the implementation in the runtime-selected
TLS backend. This could happen in MultiSSL builds when a functionality
was asking for a random number without triggering a VTLS function table
initialization first. Such functionality is MIME, or form data via MIME.

The reason CI did not catch it in an earlier MultiSSL GHA/windows job,
is that it was a debug-enabled one. In debug-enabled builds the test
runner was overriding the random number generator for all tests.

Fixed this by moving the override to the tests requiring it, via
1fcf22585f #17971, enabling debug builds
to catch this issue.

Enable MultiSSL in two CI jobs, to verify this patch.

Fixing:
```
test 1308...[formpost tests]

libtests returned 44, when expecting 0
 1308: exit FAILED
[...]
=== Start of file stderr1308
 URL: log/3/test-1308
 tests/libtest/lib1308.c:70 Assertion 'res == 0' FAILED: curl_formget returned error
 tests/libtest/lib1308.c:72 Assertion 'total_size == 518' FAILED: curl_formget got wrong size back
 tests/libtest/lib1308.c:88 Assertion 'res == 0' FAILED: curl_formget returned error
 tests/libtest/lib1308.c:89 Assertion 'total_size == 899' FAILED: curl_formget got wrong size back
```
Ref: https://github.com/curl/curl/actions/runs/16387693424/job/46309536359?pr=17963#step:16:2515

Bug: https://github.com/curl/curl/pull/17963#issuecomment-3092282057

Closes #17970
2025-07-20 12:03:56 +02:00
Viktor Szakats
f2d1d4747d
GHA/macos: drop redundant build option
Follow-up to 7c23e88d17 #17973
2025-07-20 12:03:53 +02:00
Viktor Szakats
7c23e88d17
GHA/macos: enable QUIC API with OpenSSL
In one autotools and one cmake job.

Also:
- enable OpenSSL QUIC in two more jobs.
- pytest: add checks to skip h3 tests when there is no h3 server to
  tests 26, 27a, 27b, 27c, 29 in test_02_download. Fixing:
  ```
  FAILED tests/http/test_02_download.py::TestDownload::test_02_26_session_shared_reuse[h3] - AssertionError: expected exit code 0, got 1
  [...]
  ```
  Ref: https://github.com/curl/curl/actions/runs/16392680316/job/46320739635?pr=17973

Ref: https://github.com/Homebrew/homebrew-core/pull/230515
Ref: 6c8e3eed12

Closes #17973
2025-07-20 00:02:19 +02:00
Viktor Szakats
3fd8846680
cmake: make runtests targets build the curl tool
To allow running tests just by building the `test-full` (or similar) in
a single step.

Closes #17967
2025-07-19 22:37:17 +02:00
Viktor Szakats
319d27e568
GHA/macos: add Rustls, aws-lc jobs
Bind them to the (arbitrary choice of) Apple clang and gcc compilers,
respectively.

Also:
- bind existing mbedTLS job to the llvm compiler, to keep the number of
  jobs the same as before this patch.
- move OpenLDAP from mbedTLS over to LibreSSL to keep testing it with
  all 3 compilers.
- simplify exclusions for clang-tidy and torture jobs.
- tag clang-tidy and torture jobs via `install_steps`.
  To avoid keeping around special bool fields.

Closes #17963
2025-07-19 22:37:17 +02:00
Sergio Durigan Junior
7d1ca2e7e1
test1560: skip some URLs if UTF-8 is not supported
Debian CI found that `lib1560` implements tests that will fail when
UTF-8 isn't supported.  We can detect that with `nl_langinfo` and skip
the specific URLs that fail (i.e., those whose `getflags` are either
`CURLU_PUNYCODE` or `CURLU_PUNY2IDN`).

Co-authored-by: Viktor Szakats
Closes #17933
2025-07-19 22:37:17 +02:00
Viktor Szakats
1fcf22585f
tests: set CURL_ENTROPY per test, not globally
Setting `CURL_ENTROPY` in debug-enabled builds overrides the code paths
responsible for random number generation. To avoid masking issue there,
this patch moves `CURL_ENTROPY` settings to each test that requires it,
and stop setting it by default for all tests (in `runner.pm`).

This makes it possible to catch random generator issues in debug-enabled
builds; extending test coverage.

To keep offering a well-defined state for tests, make `runner.pm` delete
the `CURL_ENTROPY` env, if present.

Ref: #17970

Closes #17971
2025-07-19 21:30:32 +02:00
Viktor Szakats
7946bbbbe2
tests: drop unused CURL_FORCEHOST envs
Also match case of the `Debug` feature name in comments.

Closes #17972
2025-07-19 20:35:48 +02:00
renovate[bot]
e9a4f5cad0
GHA: update dependency wolfSSL/wolfssl to v5.8.2
Closes #17956
2025-07-18 00:54:34 +02:00
Viktor Szakats
2d4e166b65
curl/system.h: fix for GCC 3.3.x and older
The guards implicitly and intentionally include clang, which reports
itself as GCC 4.2.1.

Ref: https://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Other-Builtins.html#Other-Builtins
Ref: https://www.haiku-os.org/guides/building/gcc-hybrid (Haiku uses gcc 2.95.3)

Follow-up to 909af1a43b #16761

Reported-by: Schrijvers Luc
Fixes #17951
Closes #17954
2025-07-18 00:54:34 +02:00
Viktor Szakats
1a441c3c0a
DISTROS.md: add Haiku
Closes #17953
2025-07-18 00:54:34 +02:00
Viktor Szakats
2c7902ec4a
build: link to Apple frameworks required by static wolfSSL
To fix linking a static wolfSSL library for Apple targets.
Also stop linking `m` and `dl` on Apple platforms.

Matching logic in wolfSSL build code:
8bde512676/CMakeLists.txt (L2520-L2544)

Reported-by: Kai Pastor
Reported-by: Tal Regev
Bug: https://github.com/microsoft/vcpkg/pull/46444#pullrequestreview-3026575393
Ref: 3a845c4b15

Closes #17945
2025-07-18 00:54:34 +02:00
Stefan Eissing
044de8e19b
gnutls: some small cleanups
- de-complex Curl_gtls_verifyserver() by splitting of static
  functions for parts of it.
- follow the `goto out` style with common deallocation code

Closes #17941
2025-07-18 00:41:09 +02:00
Stefan Eissing
3ad4b44073
openssl: some small cleanups
- rename Curl_oss_check_peer_cert() to Curl_ossl_check_peer_cert()
- leave altname match loop after the first success when the match
  was an ip address
- remove static subj_alt_hostcheck() since it did not really do much
- use length based infof() output of altname, even though it does
  seem always to be nul terminated

Closes #17940
2025-07-18 00:40:26 +02:00
Ammar Faizi
5cefe93eb6
socks: do_SOCKS5: Fix invalid buffer content on short send
Ahmad Gani intercepts the sendto syscall to simulate short send, but
curl incorrectly handles it. It keeps resending the version:

  sendto(4, "\x05", 1, MSG_NOSIGNAL, NULL, 0) = 1
  sendto(4, "\x05", 1, MSG_NOSIGNAL, NULL, 0) = 1

Don't restart the buffer in the `CONNECT_SOCKS_INIT` case if
`sx->outstanding` is not zero. It should continue sending the
advanced buffer.

Fixes #17942
Reported-by: Ahmad Gani <reyuki@gnuweeb.org>
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Closes #17943
2025-07-18 00:38:15 +02:00
Daniel Stenberg
bfa317c8cd
curlver: bump to 8.15.1 (for now?) 2025-07-18 00:38:14 +02:00
Daniel Stenberg
f5d7d7637c
RELEASE-NOTES: synced
And bump version
2025-07-18 00:36:15 +02:00
Daniel Stenberg
6e44631d9c
tool_operate: avoid superfluous strdup'ing output
Closes #17946
2025-07-18 00:32:13 +02:00
Daniel Stenberg
cfbfb65047
RELEASE-NOTES: synced
8.15.0 release
2025-07-16 08:21:07 +02:00
Daniel Stenberg
566428160b
THANKS: new contributors in 8.15.0 2025-07-16 08:19:39 +02:00
Viktor Szakats
4ed1c14545
autotools: stop checking for the pw32 platform
It's most likely a reference to Posix-over-Win32 layer:

https://pw32.sourceforge.net/main.html (last updated: 2001-05-01)
https://sourceforge.net/projects/pw32/
https://sourceforge.net/projects/pw32/files/ (latest date: 2001-10-12)

Closes #17936
2025-07-15 18:43:12 +02:00
Daniel Stenberg
1962573a93
release-notes.pl: ignore dupes on input and output
Re-running this script now makes it track the already mentioned
changelog entries and not add them again even if the git log contains
them.

This makes the script better handle reruns in a release branch after
rebasing on a later version of master.

Closes #17937
2025-07-15 18:28:37 +02:00
Max Dymond
48c6927f3b ci: consolidate openldap step into openssl krb5
Closes #17891
2025-07-15 14:54:44 +01:00
Max Dymond
4910ee0dc3 ci: fix ldap install location and add renovate rule for openldap 2025-07-15 14:54:44 +01:00
Max Dymond
c8a990f079 ci: install libssl-dev in the openldap static test 2025-07-15 14:54:44 +01:00
Max Dymond
b027a18456 configure: order LDAP after the SSL libraries 2025-07-15 14:54:44 +01:00