Commit Graph

35998 Commits

Author SHA1 Message Date
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
Max Dymond
ab03ea99a3 ldap: If ldap-lib is sufficient, add it to LIBS. 2025-07-15 14:54:44 +01:00
Max Dymond
272ec86925 ldap: avoid automake caching issues with LDAP library names 2025-07-15 14:54:44 +01:00
Max Dymond
fd820733dd test: add a test for static LDAP 2025-07-15 14:54:44 +01:00
Max Dymond
c538bf5419 ldap: initial support for --with-ldap option
Add the --with-ldap option so we can specify an include and library path for LDAP.
2025-07-15 14:54:44 +01:00
Viktor Szakats
4b86d369b6
DEPRECATE.md: add VS2005 removal to the list
Follow-up to e0fd5790d9 #16004

Closes #17934
2025-07-15 15:47:31 +02:00
Daniel Stenberg
e507f9347a
test3207: allow more allocations
This limit was triggered in a PR that did not change any sizes, showing
the previous limit for this was a little tight.

Ref: #17894
Closes #17932
2025-07-15 14:14:50 +02:00
Viktor Szakats
8535068c24
config-win32: fix to set target version early
To set it before checking for it while enabling `HAVE_INET_NTOP` and
`HAVE_INET_PTON` for Vista (and up) targets.

May have affected winbuild or Visual Studio IDE Project Files.

Follow-up to 68fa9bf3f5 #9712

Closes #17928
2025-07-15 12:56:05 +02:00
Viktor Szakats
464fc67fbe
test1706: pass include directory to managen for out-of-tree builds
Fixing:
```
readline() on closed filehandle INC at ../../curl-99.98.97/tests/../scripts/managen line 1299.
```
Ref: https://github.com/curl/curl/actions/runs/16224106087/job/45811979199?pr=17877#step:3:8545

Cherry-picked from #17877
Closes #17926
2025-07-14 21:23:37 +02:00
Viktor Szakats
c680aa11af
genserv.pl: fix newline in usage text
Cherry-picked from #17877
2025-07-14 20:54:07 +02:00
Viktor Szakats
3222eabe18
tidy-up: whitespace/indent
Closes #17925
2025-07-14 18:33:43 +02:00
Stefan Eissing
e9ae1bd404
connection: clarify transport
The `transport` to use for a transfer, e.g. TCP/QUIC/UNIX/UDP, is
initially selected by options and protocol used. This is set at the
`struct connectdata` as `transport` member.

During connection establishment, this transport may change due to
Alt-Svc or Happy-Eyeballing. Most common is the switch from TCP to QUIC.

Rename the connection member to `transport_wanted` and add a way to
query the connection for the transport in use via a new connection
filter query.

The filter query can also be used in the happy eyeballing attempts when
code needs to know which transport is used by the "filter below". This
happens in wolfssl initialization, as one example.

Closes #17923
2025-07-14 14:33:18 +02:00
Stefan Eissing
674ad27f77
http/3: report handshake with version and cipher as for TCP connections
Make reporting into separate functions, to be called from QUIC handshakes
as well.

Closes #17922
2025-07-14 14:08:32 +02:00
Viktor Szakats
f98c0ba834
GHA/windows: drop Windows CE jobs from CI
In preparation for the removal of Windows CE support.

These jobs were also using a macOS runner, which is a waste. And it'd be
too much effort to move them over to Windows or Linux.

Follow-up to 8491e6574c #17379

Closes #17924
2025-07-14 14:01:46 +02:00
Viktor Szakats
8675c9e3f3
GHA: move iOS jobs from non-native to macos workflow
No instant benefit, but it brings all Apple jobs into the same workflow.

Then perhaps allows intergrating iOS jobs with macOS ones, and in
the meantime keep them more tightly aligned.

Closes #17912
2025-07-14 14:01:46 +02:00
Viktor Szakats
2f3890baaf
config-win32: fix default targets, shorten macro logic
When using winbuild or Visual Studio IDE Project Files.
To simplify and prepare for dropping support for VS2008.

Details:
- fix VS2012 default target to be Windows 8 (was Vista).
  Confirmed by CI:
  ```
  -- The C compiler identification is MSVC 17.0.61030.0
  -- Found _WIN32_WINNT=0x0602
  ```
  Ref: https://ci.appveyor.com/project/curlorg/curl/builds/51594696/job/elbl0w5n7fmoos2f#L45
  It also aligns with the default being Windows 7 for VS2010,
  and Windows Vista for VS2008.
- bump minimum target to XP (was Windows 2000) when using VS2008.
  curl requires XP.
- add Windows release names to comments for clarity.
- add hex Windows version to a comment for clarity.
- merge VS2008/VS2012 minimum/default logic and comments.
- reduce scope of local minimum/default macros.
- shorten comments to fit within line limit.

Closes #17916
2025-07-14 13:18:32 +02:00
Viktor Szakats
245783338c
runner.pm: use dirname() in singletest_prepare()
Replacing a regex, for portability.

Reported-by: Stefan Eissing
Bug: https://github.com/curl/curl/issues/17871#issuecomment-3051830614

Cherry-picked from #17877
Closes #17900
2025-07-14 11:24:28 +02:00