Commit graph

35636 commits

Author SHA1 Message Date
Viktor Szakats
a920c85444
TEST-SUITE.md: use C.UTF-8 2025-07-22 23:07:57 +02:00
Viktor Szakats
1abbdb2b06
runtests.pl: use C.UTF-8 2025-07-22 23:07:57 +02:00
Viktor Szakats
7f13b0c9a1
drop placeholders 2025-07-22 23:07:57 +02:00
Viktor Szakats
df56ad6a27
try with LC_ALL=C.UTF-8 only 2025-07-22 23:07:57 +02:00
Viktor Szakats
a5a153cdc2
962 set just LC_ALL 2025-07-22 23:07:57 +02:00
Viktor Szakats
9af5d0bfde
set both 2025-07-22 23:07:57 +02:00
Viktor Szakats
e6ef591136
try something 2 963 2025-07-22 23:07:57 +02:00
Viktor Szakats
7b8ffd7400
try something 1 2025-07-22 23:07:57 +02:00
Viktor Szakats
2d47171703
GHA: display original LC_ before override 2025-07-22 23:07:57 +02:00
Viktor Szakats
abc2015b41
try something to fix codeset-test job 2025-07-22 23:07:57 +02:00
Viktor Szakats
ec589cf27b
macos try fix again 2025-07-22 23:07:57 +02:00
Viktor Szakats
635dac1853
test165 test to fail (temp) 2025-07-22 23:07:57 +02:00
Viktor Szakats
10b3454706
macos backtrack 2025-07-22 23:07:57 +02:00
Viktor Szakats
b544b018e1
put back LC_NUMERIC 2025-07-22 23:07:57 +02:00
Viktor Szakats
921a682fdf
Revert "do a test without deleting LC_ALL 1"
This reverts commit 9602e2275d1bddf3db3eac2408b86845f9a36011.
2025-07-22 23:07:56 +02:00
Viktor Szakats
e9312b693a
Revert "do a test without deleting LC_CTYPE"
This reverts commit cd34217d36f6ad838a80fc090a6cd6752d90baf4.
2025-07-22 23:07:47 +02:00
Viktor Szakats
e09321d7d3
Revert "test a few per-test combinations"
This reverts commit ecea989937db4e41d8f9dda0209b8a444b7a06bf.

962 and 965 works, that's the two setting both LC_ variables

```
FAIL 165: 'HTTP over proxy with IDN host name' HTTP, HTTP GET, HTTP proxy, IDN
FAIL 963: 'SMTP without SMTPUTF8 support (IDN) - UTF-8 recipient (host part only)' SMTP, IDN
FAIL 964: 'SMTP external VRFY without SMTPUTF8 (IDN) - UTF-8 recipient (host part)' SMTP, VRFY, IDN
FAIL 966: 'SMTP with SMTPUTF8 support - UTF-8 based recipient' SMTP, IDN
FAIL 967: 'SMTP external VRFY with SMTPUTF8 support' SMTP, VRFY, IDN
FAIL 1448: 'Redirect following to UTF-8 IDN host name' HTTP, HTTP GET, IDN, followlocation, --resolve, --write-out
FAIL 1560: 'URL API' unittest, urlapi
FAIL 2046: 'Connection reuse with IDN host name' HTTP, HTTP GET, IDN, followlocation, --resolve, --write-out
FAIL 2047: 'Connection reuse with IDN host name over HTTP proxy' HTTP, HTTP GET, HTTP proxy, IDN, followlocation, --write-out
```
2025-07-22 23:07:47 +02:00
Viktor Szakats
30b4aa68df
GHA/macos: fix to actually enable codeset-test 2025-07-22 23:07:47 +02:00
Viktor Szakats
d9d68fe7c5
finalize codeset-tests 2025-07-22 23:07:47 +02:00
Viktor Szakats
69b457ddbe
test a few per-test combinations 2025-07-22 23:07:47 +02:00
Viktor Szakats
8f2aa21525
GHA/macos: test with LC_ALL= 2025-07-22 23:07:47 +02:00
Viktor Szakats
67f0f052ae
GHA/linux drop one test tweak 2025-07-22 23:07:47 +02:00
Viktor Szakats
2aedeb8c84
fix UTF-8 detection 1 2025-07-22 23:07:47 +02:00
Viktor Szakats
a9e5ac5f99
try to trigger a codeset issue 2025-07-22 23:07:47 +02:00
Viktor Szakats
7030c89db8
do a test without deleting LC_CTYPE 2025-07-22 23:07:47 +02:00
Viktor Szakats
28335753df
do a test without deleting LC_ALL 1 2025-07-22 23:07:46 +02:00
Viktor Szakats
b54cffafba
test1560: add missing? LC_CTYPE 2025-07-22 23:07:15 +02:00
Viktor Szakats
32e90cc5f5
remove LC_ALL env to ensure LC_TYPE takes effect 2025-07-22 23:07:15 +02:00
Viktor Szakats
e4d220ebad
file LC_ALL where empty 2025-07-22 23:07:15 +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