]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
10 months agosetopt: use a single function for HTTPAUTH and PROXYAUTH
Daniel Stenberg [Mon, 7 Oct 2024 22:35:28 +0000 (00:35 +0200)] 
setopt: use a single function for HTTPAUTH and PROXYAUTH

Avoid duplicated almost-the-same code.

Closes #15182

10 months agocmake: do not propagate unused `HAVE_GSSAPI_GSSAPI_KRB5_H` to C
Viktor Szakats [Mon, 7 Oct 2024 10:56:04 +0000 (12:56 +0200)] 
cmake: do not propagate unused `HAVE_GSSAPI_GSSAPI_KRB5_H` to C

Closes #15174

10 months agocmake: detect `HAVE_NETINET_IN6_H`, `HAVE_CLOSESOCKET_CAMEL`, `HAVE_PROTO_BSDSOCKET_H`
Viktor Szakats [Sun, 6 Oct 2024 00:54:25 +0000 (02:54 +0200)] 
cmake: detect `HAVE_NETINET_IN6_H`, `HAVE_CLOSESOCKET_CAMEL`, `HAVE_PROTO_BSDSOCKET_H`

To sync with `./configure`.

- `HAVE_NETINET_IN6_H` is
  needed by HPE NonStop NSE and NSX systems.
  Follow-up to 76ebd54175bad02b29769d797adf72fdf3df119f #2155

- `HAVE_CLOSESOCKET_CAMEL`, `HAVE_PROTO_BSDSOCKET_H`
  are for AmigaOS.
  (Note: `./configure` tries to detect these for all targets, cmake does
  it only for AmigaOS, to not inflate configure time.)

Closes #15172

10 months agoconfigure: drop unused bare `socket.h` detection
Viktor Szakats [Mon, 7 Oct 2024 02:07:30 +0000 (04:07 +0200)] 
configure: drop unused bare `socket.h` detection

Added in 37eba37019388f767f5de67b4071641044d7b026 (2009-06-17) to help
detecting socket functions.

But, this `socket.h` isn't used in the source code since
90dd1fc66401d5bb7814f4edeb16a06c925b1f1e #8288 (2022-01-16).

Closes #15173

10 months agosws: fix unused static function with `TCP_NODELAY` undefined
Viktor Szakats [Sun, 6 Oct 2024 09:37:38 +0000 (11:37 +0200)] 
sws: fix unused static function with `TCP_NODELAY` undefined

Closes #15171

10 months agoconfigure: drop duplicate feature checks for `poll()`, `if_nametoindex()`
Viktor Szakats [Sun, 6 Oct 2024 00:26:48 +0000 (02:26 +0200)] 
configure: drop duplicate feature checks for `poll()`, `if_nametoindex()`

Before this patch they were detected via manual methods, then with
`AC_CHECK_FUNCS()`.

Delete the manual checks and keep the latter.

Also delete `CURL_INCLUDES_POLL()` which is no longer used after
the above.

Closes #15170

10 months agobuild: detect and use `_setmode()` with Cygwin/MSYS, also use on Windows
Viktor Szakats [Sun, 6 Oct 2024 13:41:48 +0000 (15:41 +0200)] 
build: detect and use `_setmode()` with Cygwin/MSYS, also use on Windows

Before this patch `setmode()` was not detected with Cygwin/MSYS, because
it's a macro, not a function, and detection is looking for a function.

Switching to symbol detection doesn't work because it mis-detects it on
BSD systems which features a function with the same name but different
functionality and arguments.

Fix it by looking for a `_setmode()` function on Cygwin/MSYS, and use it
if available.

`_setmode()` is recommended over `setmode()` by Windows documentation so
use that on Windows too. It seems to be available on all supported
compilers, so omit detection.

https://learn.microsoft.com/cpp/c-runtime-library/reference/posix-setmode
https://learn.microsoft.com/cpp/c-runtime-library/reference/setmode

Officially Windows requires argument `_O_BINARY` with an underscore.
`O_BINARY` is also supported but bound to conditions. Continue to use it
for simplicity. Cygwin supports `O_BINARY` (no underscore).

Closes #15169

10 months agoech: spelling, whitespace, say `--ech` default config
Viktor Szakats [Sat, 5 Oct 2024 21:29:22 +0000 (23:29 +0200)] 
ech: spelling, whitespace, say `--ech` default config

Closes #15167

10 months agoGHA/macos: comment spelling and clarity
Viktor Szakats [Sun, 6 Oct 2024 11:02:12 +0000 (13:02 +0200)] 
GHA/macos: comment spelling and clarity

Closes #15166

10 months agobuild: add `ldap` to `libcurl.pc` `Requires:`
Viktor Szakats [Fri, 4 Oct 2024 23:57:33 +0000 (01:57 +0200)] 
build: add `ldap` to `libcurl.pc` `Requires:`

Closes #15163

10 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 7 Oct 2024 06:33:32 +0000 (08:33 +0200)] 
RELEASE-NOTES: synced

10 months agoINSTALL-CMAKE.md: mention focus on shared libraries
Daniel Stenberg [Sun, 6 Oct 2024 21:13:29 +0000 (23:13 +0200)] 
INSTALL-CMAKE.md: mention focus on shared libraries

Match what the INSTALL.md document says for configure builds.

Reported-by: Nemos2024 on github
Fixes #14845
Closes #15168

10 months agoci: update dependency ngtcp2/nghttp3 to v1.6.0
renovate[bot] [Sat, 5 Oct 2024 18:38:57 +0000 (18:38 +0000)] 
ci: update dependency ngtcp2/nghttp3 to v1.6.0

Closes #15161

10 months agoci: update dependency ngtcp2/ngtcp2 to v1.8.0
renovate[bot] [Sat, 5 Oct 2024 18:39:02 +0000 (18:39 +0000)] 
ci: update dependency ngtcp2/ngtcp2 to v1.8.0

Closes #15162

10 months agoGHA/non-native: fix OmniOS job to fail on tests
Viktor Szakats [Sat, 5 Oct 2024 15:23:17 +0000 (17:23 +0200)] 
GHA/non-native: fix OmniOS job to fail on tests

Before this patch a failed test did not result in a failed CI job.

Closes #15160

10 months agocmake: use OpenSSL for LDAP detection only if available
Viktor Szakats [Fri, 4 Oct 2024 19:24:54 +0000 (21:24 +0200)] 
cmake: use OpenSSL for LDAP detection only if available

Also unset `CMAKE_REQUIRED_LIBRARIES` in two error branches.

Reported-by: Vollstrecker on github
Fixes #15077
Closes #15152

10 months agowarnless: remove curlx_sktosi and curlx_sitosk
Daniel Stenberg [Fri, 4 Oct 2024 20:32:04 +0000 (22:32 +0200)] 
warnless: remove curlx_sktosi and curlx_sitosk

They were only used by test server code. Use plain old typecasts there.

Closes #15153

10 months agotests: enable additional ruff Python lint options
Dan Fandrich [Thu, 26 Sep 2024 21:31:39 +0000 (14:31 -0700)] 
tests: enable additional ruff Python lint options

These all seem reasonable to enable for this code.

10 months agoCI: run pytype and ruff on Python code
Dan Fandrich [Thu, 26 Sep 2024 18:33:58 +0000 (11:33 -0700)] 
CI: run pytype and ruff on Python code

These ensure a more consistent style and can find some errors statically
that would otherwise only be seen at run-time. Also, bump the Ubuntu
version of some other checks to get newer versions of some linters.

Closes #15067

10 months agotests: change Python code style to pass ruff checks
Dan Fandrich [Thu, 26 Sep 2024 19:40:43 +0000 (12:40 -0700)] 
tests: change Python code style to pass ruff checks

Most of the changes consisted of removing unused imports and unnecessary
f-strings.

10 months agotests: fix some Python typing issues
Dan Fandrich [Thu, 26 Sep 2024 18:58:57 +0000 (11:58 -0700)] 
tests: fix some Python typing issues

These otherwise raise errors in pytype. A few problematic methods
weren't being used and are deleted.

10 months agoCURLOPT_HEADERFUNCTION.md: do not modify the passed in buffer
Daniel Stenberg [Fri, 4 Oct 2024 11:53:20 +0000 (13:53 +0200)] 
CURLOPT_HEADERFUNCTION.md: do not modify the passed in buffer

Closes #15148

10 months agoasyn-ares: remove typecast, fix expire
Daniel Stenberg [Thu, 3 Oct 2024 21:53:10 +0000 (23:53 +0200)] 
asyn-ares: remove typecast, fix expire

- Use the appropriate variable type for the curlx_tvtoms() return code:
  timediff_t and remove the typecast.

- Simplify the function and avoid the odd expire adjustment that
  probably is a rest from ancient days when the expire function did not
  handle zero millisecond timeouts.

Closes #15145

10 months agocmake: add missed variable to comment [ci skip]
Viktor Szakats [Fri, 4 Oct 2024 00:10:00 +0000 (02:10 +0200)] 
cmake: add missed variable to comment [ci skip]

Follow-up to 9f56bb608ecfbb8978c6cb72a04d9e8b23162d82 #14681

10 months agotest1915: add tracing and connect timeout
Stefan Eissing [Tue, 1 Oct 2024 10:48:46 +0000 (12:48 +0200)] 
test1915: add tracing and connect timeout

Since we see Windows fails of 1915, add tracing and a connect timeout.
The test uses a port no one is supposed to listen on, but Windows has
this weird wait logic. So, set a short timeout.

Closes #15107

10 months agourlapi: normalize the IPv6 address
Daniel Stenberg [Thu, 3 Oct 2024 12:37:00 +0000 (14:37 +0200)] 
urlapi: normalize the IPv6 address

As the parsing and address "regeneration" are done anyway, we might as
well use the updated version in the result and thereby A) get a
normalized (and lower cased) version of the address and B) avoid a
strcpy().

Updated test 1560 to verify.

Closes #15143

10 months agotests/valgrind.supp: remove a travis suppression, add a Debian
Daniel Stenberg [Thu, 3 Oct 2024 12:32:54 +0000 (14:32 +0200)] 
tests/valgrind.supp: remove a travis suppression, add a Debian

We have not used Travis for years. The Debian one appears on my dev
machine since a while back.

Closes #15142

10 months agoopenssl quic: populate x509 store before handshake
Stefan Eissing [Thu, 3 Oct 2024 08:51:26 +0000 (10:51 +0200)] 
openssl quic: populate x509 store before handshake

Since OpenSSL does its own send/recv internally, we may miss the moment
to populate the x509 store right before the server response. Do it
instead before we start the handshake, at the loss of the time to set
this up.

Closes #15137

10 months agopytest: improve pytest_07_42a reliability
Stefan Eissing [Thu, 3 Oct 2024 09:10:29 +0000 (11:10 +0200)] 
pytest: improve pytest_07_42a reliability

Due to timings on paused response receive, the error code may vary due
to the location where it is detected that the server closed the transfer
prematurely.

Be more lenient in always allowing PARTIAL_FILE as ok.

Closes #15138

10 months agotest1515: add tracing and more debug info
Stefan Eissing [Thu, 3 Oct 2024 11:09:17 +0000 (13:09 +0200)] 
test1515: add tracing and more debug info

Test failed on some Windows CI and log files did not really
tell why. Add more output.

Closes #15140

10 months agoGHA/curl-for-win: tidy up `DOCKER_CONTENT_TRUST`
Viktor Szakats [Thu, 3 Oct 2024 11:19:00 +0000 (13:19 +0200)] 
GHA/curl-for-win: tidy up `DOCKER_CONTENT_TRUST`

Follow-up to 08d13c0e46ab535b04c4099d6c51d51f7c288b6c
Closes #15141

10 months agobufq: unwrite fix
Stefan Eissing [Thu, 3 Oct 2024 08:15:07 +0000 (10:15 +0200)] 
bufq: unwrite fix

`Curl_bufq_unwrite()` used the head instead of the tail chunk to shrink
the bufq's content. Fix this and add test case that checks correct
behaviour.

Amended test 2601 accordingly.

Reported-by: Chris Stubbs
Closes #15136

10 months agoGHA/curl-for-win: re-enable image verification for debian:bookworm-slim
Viktor Szakats [Thu, 3 Oct 2024 10:51:05 +0000 (12:51 +0200)] 
GHA/curl-for-win: re-enable image verification for debian:bookworm-slim

Follow-up to a35f223cd8b29739dab7e8490674093c4024191d

10 months agoGHA/windows: add workaround for upstream vcpkg issue
Tal Regev [Thu, 3 Oct 2024 04:15:01 +0000 (07:15 +0300)] 
GHA/windows: add workaround for upstream vcpkg issue

Fixes:
```
error: https://github.com/google/brotli/archive/v1.1.0.tar.gz: WinHttpSendRequest failed with exit code 10106
```

Apply workaround:
https://github.com/microsoft/vcpkg/issues/41199#issuecomment-2378255699

Bug commit: https://github.com/microsoft/vcpkg-tool/commit/d3fc35774f86782f356ef0f9352ba857fa57302e#diff-33cf7c311a76d4a838f91b078c2f8cbc984557379f7b345a268ec6deb665a91eR666-R675
Fix commit: https://github.com/microsoft/vcpkg-tool/commit/3122da72b1e4bf98bfc3d51937e6ad6cc4292cdf
Fix PR: https://github.com/microsoft/vcpkg-tool/pull/1501

Fixes #15128
Reported-by: Viktor Szakats
Closes #15133

10 months agoGHA/curl-for-win: disable `DOCKER_CONTENT_TRUST`
Viktor Szakats [Thu, 3 Oct 2024 09:03:05 +0000 (11:03 +0200)] 
GHA/curl-for-win: disable `DOCKER_CONTENT_TRUST`

As a workaround for the latest Debian image missing the necessary keys:
```
No signatures for debian:testing-20240926-slim

Administrative keys for debian:testing-20240926-slim

  Repository Key:       5717dcd81d9fb5b73aa15f2d887a6a0de543829ab9b2d411acce9219c2f8ba3a
  Root Key:     575d013f89e3cbbb19e0fb06aa33566c22718318e0c9ffb1ab5cc4291e07bf84
No valid trust data for testing-20240926-slim
```
https://github.com/curl/curl/actions/runs/11067644862/job/30752034560?pr=15065

Ref: https://github.com/curl/curl-for-win/commit/0ad1ad511bcbfbad8935685f7c130b281e66f7f4

10 months agoDEPRECATE: remove hyper in January 2025
Daniel Stenberg [Thu, 3 Oct 2024 07:21:45 +0000 (09:21 +0200)] 
DEPRECATE: remove hyper in January 2025

Previously this document stated we would do it after February, but now
it will be done already for the first January 2025 release.

The reason being that since we decided to deprecate hyper, the
degradation speed has increased as now no one bothers to fix issues in
the hyper side of things. Also: not a single soul has yet spoken up in
favor of keeping the support.

Closes #15135

10 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 3 Oct 2024 07:34:53 +0000 (09:34 +0200)] 
RELEASE-NOTES: synced

10 months agolib: use bool/TRUE/FALSE properly
Daniel Stenberg [Wed, 2 Oct 2024 09:53:20 +0000 (11:53 +0200)] 
lib: use bool/TRUE/FALSE properly

booleans should use the type 'bool' and set the value to TRUE/FALSE

non-booleans should not be 'bool' and should not set the value to
TRUE/FALSE

Closes #15123

10 months agowolfssl: add proper colon separator
Daniel Stenberg [Thu, 3 Oct 2024 06:26:44 +0000 (08:26 +0200)] 
wolfssl: add proper colon separator

Follow-up to 6fd5a9777acb720e1ac872478151e8b1

Fixes #15132
Reported-by: Viktor Szakats
Closes #15134

10 months agovtls: convert Curl_pin_peer_pubkey to use dynbuf
Daniel Stenberg [Wed, 2 Oct 2024 12:26:57 +0000 (14:26 +0200)] 
vtls: convert Curl_pin_peer_pubkey to use dynbuf

Closes #15126

10 months agovtls: convert pubkey_pem_to_der to use dynbuf
Daniel Stenberg [Wed, 2 Oct 2024 12:14:18 +0000 (14:14 +0200)] 
vtls: convert pubkey_pem_to_der to use dynbuf

... instead of malloc and "manual" buffer stuffing

Closes #15126

10 months agotests: let openssl generate random cert serials
Viktor Szakats [Wed, 2 Oct 2024 21:20:00 +0000 (23:20 +0200)] 
tests: let openssl generate random cert serials

Generate the certificate serial numbers automatically instead of doing
from shell (or Perl earlier).

Fixes intermittent CI failures due to the shell-based random generator
generating the same serial number twice:
```
$ openssl ca -config EdelCurlRoot-ca.cnf -revoke Server-localhost0h-sv.crt
Using configuration from EdelCurlRoot-ca.cnf
ERROR:Already revoked, serial number 66FDB23A
make: *** [../../../tests/certs/Server-localhost0h-sv.pem] Error 1
```
https://github.com/curl/curl/actions/runs/11151401083/job/30994755798?pr=15128#step:10:498

Follow-up to fa461b4eff52b413f88debf543b5350a6cef4724 #14486
Follow-up to fa69b41c7790fab86fd363242c81d8ef2e89e183 #13307
Closes #15129

10 months agoGHA/linux: fix wolfSSL version in cache key
Viktor Szakats [Wed, 2 Oct 2024 21:46:29 +0000 (23:46 +0200)] 
GHA/linux: fix wolfSSL version in cache key

This needs the version in the GHA context, so move those back
from external file `VERSIONS`.

Also move back `VERSIONS` content in it previous place to
`.circleci/config.yml`. Update renovate config.

Renovate bot should keep updating the wolfSSL version, but from now on
not in one, but two files.

Follow-up to 820afa2b7cb33a0daaca5b61e8755546b46136d5 #15030
Follow-up to 73a36021207284ad2b4340ffde34a51b0ba4d47a
Closes #15130

10 months agoGHA/linux: drop duplicate names from cache keys
Viktor Szakats [Wed, 2 Oct 2024 22:03:54 +0000 (00:03 +0200)] 
GHA/linux: drop duplicate names from cache keys

Closes #15131

10 months agotests: simplify `pathhelp.pm`, avoid using external tools
Viktor Szakats [Sat, 28 Sep 2024 18:26:44 +0000 (20:26 +0200)] 
tests: simplify `pathhelp.pm`, avoid using external tools

Instead of calling the shell and external tools, rely on Perl functions
like `Cwd::getcwd()`, `Cwd::abs_path()`, `Cygwin::posix_to_win_path()`,
`Cygwin::win_to_posix_path()` to retrieve the current directory and
convert between POSIX and Windows formats.

This adds native Windows Perl support, avoids most failure modes and
makes format guessing and other internal functions unnecessary.

Also:
- delete unused `sys_native_path()`.
- delete redundant `normalize_path()` because Perl `abs_path()` already
  does it.

Cherry-picked from #14949
Closes #15111

10 months agowolfssl: convert malloc + memcpys to dynbuf for cipher string
Daniel Stenberg [Wed, 2 Oct 2024 12:00:56 +0000 (14:00 +0200)] 
wolfssl: convert malloc + memcpys to dynbuf for cipher string

Closes #15124

10 months agolib: avoid assigning 'result' temporarily
Daniel Stenberg [Wed, 2 Oct 2024 09:45:19 +0000 (11:45 +0200)] 
lib: avoid assigning 'result' temporarily

Closes #15122

10 months agomulti: make multi_handle_timeout use the connect timeout
Daniel Stenberg [Wed, 2 Oct 2024 07:01:56 +0000 (09:01 +0200)] 
multi: make multi_handle_timeout use the connect timeout

For all states before MSTATE_DO the connect timeout needs to be
considered.

Regression since #13371 (be659030ba078d6) shipped in 8.8.0

Reported-by: Deniz Sökmen
Fixes #15100
Closes #15119

10 months agoGHA/labeler: adjust some docs patterns
Daniel Stenberg [Wed, 2 Oct 2024 08:50:22 +0000 (10:50 +0200)] 
GHA/labeler: adjust some docs patterns

Follow-up to 20aa8d8f31527 and 0e06603b23183 that moved and removed some
docs.

Closes #15121

10 months agotests: remove debug requirement on 38 tests
Daniel Stenberg [Tue, 1 Oct 2024 22:01:27 +0000 (00:01 +0200)] 
tests: remove debug requirement on 38 tests

For all tests using -O that were previously relying on a debug build and
the CURL_TESTDIR environment variable, use the plain --output-dir option
instead so that they can run proper in non-debug builds.

Closes #15114

10 months agovtls: skip a "useless assignment"
Daniel Stenberg [Wed, 2 Oct 2024 05:41:47 +0000 (07:41 +0200)] 
vtls: skip a "useless assignment"

Pointed out by CodeSonar

Closes #15117

10 months agotool: support --show-headers AND --remote-header-name
Daniel Stenberg [Mon, 30 Sep 2024 13:38:56 +0000 (15:38 +0200)] 
tool: support --show-headers AND --remote-header-name

By keeping the headers in memory until we know the target file name,
then output them all.

Previously this option combination would cause an error.

Add test 1310 and 1492 to verify. Adjusted test 1460 to work in the new
conditions.

Closes #15110

10 months agoGHA/macos: update comment with new Xcode default for macos-13 [ci skip]
Viktor Szakats [Wed, 2 Oct 2024 00:16:59 +0000 (02:16 +0200)] 
GHA/macos: update comment with new Xcode default for macos-13 [ci skip]

10 months agoGHA/macos: drop unsupported Xcode version references
Viktor Szakats [Tue, 1 Oct 2024 23:31:53 +0000 (01:31 +0200)] 
GHA/macos: drop unsupported Xcode version references

Closes #15115

10 months agoGHA/macos: delete `macos-12` jobs, update matrix for `macos-14`
Viktor Szakats [Tue, 1 Oct 2024 20:16:25 +0000 (22:16 +0200)] 
GHA/macos: delete `macos-12` jobs, update matrix for `macos-14`

- Days of `macos-12` are numbered:
  https://github.com/actions/runner-images/issues/10721
  Drop 5 affected jobs, replaced by `macos-15` ones added earlier today.

- Drop Xcode 14 and 16 from `macos-14` jobs.
  Following up upstream announcement:
  https://github.com/actions/runner-images/issues/10703
  (No active jobs are affected by this.)

Follow-up to 4b4ff444dd68308e8938a1e5c33e0c8b9390d1da #15108
Closes #15113

10 months agoGHA/macos: Sequoia chores, fixes for llvm 18
Viktor Szakats [Tue, 1 Oct 2024 11:20:09 +0000 (13:20 +0200)] 
GHA/macos: Sequoia chores, fixes for llvm 18

- add `macos-15` Sequoia to combinations jobs.

- add `llvm@18` to combinations jobs for `macos-15`.

- fix cmake, autotools configurations for llvm 18.
  It requires `CMAKE_OSX_SYSROOT` for cmake, and `--sysroot` within `CC`
  for both cmake and autotools.
  (Also add `--target` to `CC` for all jobs.)

- stop `brew update` on `macos-12`.
  `macos-12` is Monterey. Homebrew stopped providing binaries for it
  after the latest macOS was out. It means newer versions of packages
  have to be built from source, which is slow and undesired. Try to
  avoid it using this trick. If it doesn't work, `macos-12` jobs will
  have to be dropped.

- update Xcode support matrix.

Ref: https://github.com/actions/runner-images/blob/main/images/macos/macos-15-arm64-Readme.md
Closes #15108

10 months agotests: fixup `checkcmd` `PATH` on non-unixy platforms
Viktor Szakats [Tue, 1 Oct 2024 10:25:21 +0000 (12:25 +0200)] 
tests: fixup `checkcmd` `PATH` on non-unixy platforms

Do not add unixy system directories to `PATH` when looking up commands
on Windows, MS-DOS or OS/2.

Cherry-picked from #14949
Closes #15106

10 months agotests: fix shell quoting on native Windows Perl
Viktor Szakats [Fri, 20 Sep 2024 13:10:42 +0000 (15:10 +0200)] 
tests: fix shell quoting on native Windows Perl

Cherry-picked from #14949
Closes #15105

10 months agotests: fix `%POSIX_PWD` on native Windows Perl
Viktor Szakats [Tue, 1 Oct 2024 10:16:50 +0000 (12:16 +0200)] 
tests: fix `%POSIX_PWD` on native Windows Perl

Though this variable isn't used in any of the current tests.

Cherry-picked from #14949
Closes #15104

10 months agotests: replace `%PWD` with `%SSH_PWD` in SCP/SFTP tests
Viktor Szakats [Sun, 29 Sep 2024 11:20:51 +0000 (13:20 +0200)] 
tests: replace `%PWD` with `%SSH_PWD` in SCP/SFTP tests

Cherry-picked from #14949
Closes #15103

10 months agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 1 Oct 2024 13:48:16 +0000 (15:48 +0200)] 
RELEASE-NOTES: synced

10 months agoCI: bump actions/checkout from 4.1.7 to 4.2.0
dependabot[bot] [Mon, 30 Sep 2024 14:45:57 +0000 (14:45 +0000)] 
CI: bump actions/checkout from 4.1.7 to 4.2.0

Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.7 to 4.2.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/692973e3d937129bcbf40652eb9f2f61becf3332...d632683dd7b4114ad314bca15554477dd762a938)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Closes #15095

10 months agoCI: bump github/codeql-action from 3.26.8 to 3.26.10
dependabot[bot] [Mon, 30 Sep 2024 14:45:46 +0000 (14:45 +0000)] 
CI: bump github/codeql-action from 3.26.8 to 3.26.10

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.8 to 3.26.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/294a9d92911152fe08befb9ec03e240add280cb3...e2b3eafc8d227b0241d48be5f425d47c2d750a13)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Closes #15094

10 months agodocs/libcurl: expand multi documentation
Daniel Stenberg [Tue, 1 Oct 2024 13:01:52 +0000 (15:01 +0200)] 
docs/libcurl: expand multi documentation

curl_multi_init - mention the caches held by the handle

curl_multi_cleanup - mention that the socket callback might be invoked
by this function

Closes #15109

10 months agoselect: use poll() if existing, avoid poll() with no sockets
Daniel Stenberg [Mon, 30 Sep 2024 21:43:58 +0000 (23:43 +0200)] 
select: use poll() if existing, avoid poll() with no sockets

poll() on macOS 10.12 was deemed broken in 2016 when we discovered that
it misbehaves when provided with no sockets to wait for. The
HAVE_POLL_FINE is used to mark a poll() implementation that behaves
correctly: it *should* still wait the timeout time.

curl has therefore opted to use select() on Apple operating systems ever
since. To avoid the risk that this or other breakage cause problems.

However, using select() internally is also bad because it suffers from
problems when using file descriptors beyond 1024.

This change makes poll() used if it is present, but if there is no
sockets to wait for it avoids using poll() and instead falls back to
select() - but without any sockets to wait for there is no 1024 problem.

This removes all previous special-handling involving HAVE_POLL_FINE.

ref: https://daniel.haxx.se/blog/2016/10/11/poll-on-mac-10-12-is-broken/

Closes #15096

10 months agoftp: fix 0-length last write on upload from stdin
Stefan Eissing [Tue, 1 Oct 2024 09:59:37 +0000 (11:59 +0200)] 
ftp: fix 0-length last write on upload from stdin

When uploading FTP with unknown length, we write a last 0-length chunk
with the EOS flag set. OpenSSL's SSL_write() errors on such a write.
Skip writing 0-length data to TLS backends instead.

Add test in FTPS for such uploads to verify.

Fixes #15101
Reported-by: Denis Goleshchikhin
Closes #15102

10 months agotests: replace hard-coded `/dev/null` with variable
Viktor Szakats [Mon, 30 Sep 2024 22:41:43 +0000 (00:41 +0200)] 
tests: replace hard-coded `/dev/null` with variable

- add variable for the null device filename and use that in Perl code.
- initialize this variable with `NUL` on native Windows.
- add `%DEV_NULL` variable and use it in tests.

Fixes `The system cannot find the path specified.` messages seen when
running `runtests.pl` with native Windows Perl.

Also adjust code to not break mcedit syntax highlighting.

Cherry-picked from #14949
Closes #15098

10 months agotests: add and use `%PERL` variable to refer to the Perl binary
Viktor Szakats [Mon, 30 Sep 2024 21:58:35 +0000 (23:58 +0200)] 
tests: add and use `%PERL` variable to refer to the Perl binary

To ensure Perl invocations within tests call the same Perl binary used
for running the tests, as specified or auto-detected via `PERL` env
(autotools) or `PERL_EXECUTABLE` setting (cmake). Instead of the first
`perl` executable found in `PATH`.)

Cherry-picked from #14949
Closes #15097

10 months agotests: replace `%PWD` with `%FILE_PWD` for `file://`
Viktor Szakats [Sun, 29 Sep 2024 10:01:37 +0000 (12:01 +0200)] 
tests: replace `%PWD` with `%FILE_PWD` for `file://`

Before this patch not all tests used `%FILE_PWD` with the `file://`
protocol.

Keep `%PWD` for test1145, to keep it fail on Windows like the test
expects.

Cherry-picked from #14949

Closes #15090

10 months agocmake: readd `generate-curl.1` dependency for `src` just in case
Viktor Szakats [Mon, 30 Sep 2024 11:06:06 +0000 (13:06 +0200)] 
cmake: readd `generate-curl.1` dependency for `src` just in case

Trying to fix intermittent build failures with MSVC 2008:
```
unity_0.obj : error LNK2019: unresolved external symbol _showhelp referenced in function _tool_help
unity_0.obj : error LNK2019: unresolved external symbol _hugehelp referenced in function _operate
```
https://ci.appveyor.com/project/curlorg/curl/builds/50700212/job/h3ekljnbccosej5k#L154
https://ci.appveyor.com/project/curlorg/curl/builds/50701615/job/61mkg9og1eooqli8#L155

Follow-up to 496da69aa0eb988ac92eb815742eb89b975ad83e #14883

Closes #15088

10 months agoruntests: drop unused code for old/classic-mingw support
Viktor Szakats [Sun, 29 Sep 2024 01:25:23 +0000 (03:25 +0200)] 
runtests: drop unused code for old/classic-mingw support

Follow-up to 38029101e2d78ba125732b3bab6ec267b80a0e72 #11625

Closes #15087

10 months agoGHA: move Cygwin jobs back into the Windows workflow
Viktor Szakats [Mon, 30 Sep 2024 09:11:49 +0000 (11:11 +0200)] 
GHA: move Cygwin jobs back into the Windows workflow

Cygwin jobs took 30 minutes and was the reason for moving them to their
own workflow. After recent changes, they finish in 8 minutes, which is
on par or lower than the longest Windows jobs. Thus, Cygwin can now be
moved back to the Windows workflow without causing extra wait for all
the workflow jobs to complete (and allowing a manual retry for the
remaining flaky jobs).

Notice that Cygwin still uses the cygwin/cygwin-install-action action to
install Cygwin itself. This action uses no caching and the time it takes
fluctuates widely depending on mirror speed, congestion and other
things. If Cygwin tends to hold up jobs again for this or other reasons,
this patch may be reverted.

Follow-up to 80a8e24956ff652e865113231649cb0c14f1e7c2 #15083
Follow-up to 2d8464c4cb9736144946701c5e632c817888eaec #14366

Closes #15086

10 months agoappveyor: bump to OpenSSL 3.3
Viktor Szakats [Mon, 30 Sep 2024 08:39:06 +0000 (10:39 +0200)] 
appveyor: bump to OpenSSL 3.3

Closes #15085

10 months agoappveyor: delete unused WebSockets option remains [ci skip]
Viktor Szakats [Mon, 30 Sep 2024 08:37:00 +0000 (10:37 +0200)] 
appveyor: delete unused WebSockets option remains [ci skip]

10 months agoCI: bump vmactions/omnios-vm from 1.0.6 to 1.0.7
dependabot[bot] [Mon, 23 Sep 2024 14:41:06 +0000 (14:41 +0000)] 
CI: bump vmactions/omnios-vm from 1.0.6 to 1.0.7

Bumps [vmactions/omnios-vm](https://github.com/vmactions/omnios-vm) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/vmactions/omnios-vm/releases)
- [Commits](https://github.com/vmactions/omnios-vm/compare/2f97978b477e0a014767f65ecf3656b933541460...bc3c64398d10bd00ecd8b3ca72db91c5a03dea77)

---
updated-dependencies:
- dependency-name: vmactions/omnios-vm
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Closes #15018

10 months agoquic: use send/recvmmsg when available
Stefan Eissing [Thu, 12 Sep 2024 10:24:42 +0000 (12:24 +0200)] 
quic: use send/recvmmsg when available

add checks for sendmmsg in configure and CmakeLists.txt for enabling use
of these functions in ngtcp2/quiche quic.

Closes #14880

10 months agoci: update dependency awslabs/aws-lc to v1.36.0
renovate[bot] [Sat, 28 Sep 2024 05:31:55 +0000 (05:31 +0000)] 
ci: update dependency awslabs/aws-lc to v1.36.0

Closes #14955

10 months agoCI: bump github/codeql-action from 3.26.6 to 3.26.8
dependabot[bot] [Mon, 23 Sep 2024 14:41:25 +0000 (14:41 +0000)] 
CI: bump github/codeql-action from 3.26.6 to 3.26.8

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.6 to 3.26.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/4dd16135b69a43b6c8efb853346f8437d92d3c93...294a9d92911152fe08befb9ec03e240add280cb3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Closes #15019

10 months agoCI/winbuild: remove enabling of websocket - done by default now
Daniel Stenberg [Fri, 27 Sep 2024 11:44:25 +0000 (13:44 +0200)] 
CI/winbuild: remove enabling of websocket - done by default now

Closes #15076

10 months agoruntests: fix indentation
Viktor Szakats [Sun, 29 Sep 2024 23:51:12 +0000 (01:51 +0200)] 
runtests: fix indentation

10 months agoGHA/cygwin, msys: move tests to cmake jobs, to finish faster
Viktor Szakats [Sun, 29 Sep 2024 10:23:01 +0000 (12:23 +0200)] 
GHA/cygwin, msys: move tests to cmake jobs, to finish faster

Move test runs from autotools jobs to cmake ones for Cygwin and MSYS.
This makes producing test results and finishing the workflows faster,
because the cmake build steps are much faster than autotools in these
envs.

Also:
- drop building examples with Cygwin autotools. It takes almost
  4 minutes. Keep building them with cmake, taking 20 seconds.
- drop building examples in MSYS autotools jobs that run tests.
  Keep building them in autotools jobs without tests. It makes
  the longest running job 2 minutes shorter.

After this patch Cygwin job times are on par with or lower than Windows
ones. It means Cygwin doesn't cause extra delay to finish the whole
workflow, allowing to re-merge these jobs into the Windows workflow.

Closes #15083

10 months agoGHA/windows: fix `find` in old-mingw-w64 `curl -V` step
Viktor Szakats [Sun, 29 Sep 2024 20:35:45 +0000 (22:35 +0200)] 
GHA/windows: fix `find` in old-mingw-w64 `curl -V` step

By default it runs the Windows `find` command and fails.
Tweak the `PATH` to find the MSYS shell implementation.

10 months agoci: tidy-ups
Viktor Szakats [Sat, 28 Sep 2024 10:23:48 +0000 (12:23 +0200)] 
ci: tidy-ups

- http3-linux: add newlines for readability.
- http3-linux: use `make pytest` to run pytest.
- checksrc: use `|` multiline to sync with other uses.
- checksrc: prefer `$()`.
- prefer `>-` over `>` for folded option lists.
- cygwin: drop a `grep` no longer necessary.

Closes #15081

10 months agocmake: websockets tidy-ups
Viktor Szakats [Fri, 27 Sep 2024 16:16:57 +0000 (18:16 +0200)] 
cmake: websockets tidy-ups

- restore change lost after websockets-default update.
  Ref: 6a1dcdc5d2f1b450de4d10739660b32d081c51a1 #14998
- delete unused line after websockets is on by default.
  Follow-up to d78e129d50b2d190f1c1bde2ad1f62f02f152db0 #14936

Closes #15078

10 months agoGHA linux: restore `apt-get update`
Viktor Szakats [Sat, 28 Sep 2024 18:42:38 +0000 (20:42 +0200)] 
GHA linux: restore `apt-get update`

It seems like the Ubuntu apt mirror list or other preloaded data on the
Linux runner can go stale (?) throughout a single week causing failures
like this, in some of the jobs:
```
Ign:16 http://security.ubuntu.com/ubuntu jammy-updates/main amd64 libapr1-dev amd64 1.7.0-8ubuntu0.22.04.1
Err:16 mirror+file:/etc/apt/apt-mirrors.txt jammy-updates/main amd64 libapr1-dev amd64 1.7.0-8ubuntu0.22.04.1
  404  Not Found [IP: 40.81.13.82 80]
Get:24 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libnghttp2-dev amd64 1.43.0-1ubuntu0.2 [117 kB]
Get:25 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 vsftpd amd64 3.0.5-0ubuntu1.1 [123 kB]
Fetched 4029 kB in 2s (1682 kB/s)
E: Failed to fetch mirror+file:/etc/apt/apt-mirrors.txt/pool/main/a/apr/libapr1-dev_1.7.0-8ubuntu0.22.04.1_amd64.deb  404  Not Found [IP: 40.81.13.82 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Error: Process completed with exit code 100.
```
https://github.com/curl/curl/actions/runs/11074211380/job/30772496037#step:32:63

Restore `apt update` to fix it.

Follow-up to 1b8449674adb57ee0f60e761d654c69b20ee8fcf #14992

Closes #15082

10 months agodocs/cmdline-opts: GnuTLS supports PKCS#11 URI in --cert option
Tatsuhiro Tsujikawa [Fri, 27 Sep 2024 08:30:06 +0000 (17:30 +0900)] 
docs/cmdline-opts: GnuTLS supports PKCS#11 URI in --cert option

Closes #15075

10 months agosingleuse: limit checks to non-unity jobs
Viktor Szakats [Thu, 26 Sep 2024 20:42:48 +0000 (22:42 +0200)] 
singleuse: limit checks to non-unity jobs

`singleuse.pl` requires non-unity builds. With unity builds, it remains
silent.

- make some jobs non-unity to allow singleuse to do its job.
- since all jobs used the `--unit` singleuse checker option, make this
  option permanent.

Closes #15065

10 months agoGHA/windows: formatting, adjust timeouts, tidy-ups
Viktor Szakats [Mon, 23 Sep 2024 11:58:51 +0000 (13:58 +0200)] 
GHA/windows: formatting, adjust timeouts, tidy-ups

- reduce job timeouts for msys2 and old-mingw-w64 jobs.
- fold long lines and reorder options in MSVC jobs.
- make some options default in MSVC jobs.

Closes #15017

10 months agoCI: update 32-bit CI to Ubuntu 24.04 and enable more
Dan Fandrich [Thu, 26 Sep 2024 20:42:09 +0000 (13:42 -0700)] 
CI: update 32-bit CI to Ubuntu 24.04 and enable more

Enable librtmp, libssh, libidn2 and c-ares support for broader 32-bit
test coverage. Bump the gcc version to 14.

Closes #15068

10 months agoCI: improvements in test reliability and performance
Stefan Eissing [Wed, 25 Sep 2024 13:14:50 +0000 (15:14 +0200)] 
CI: improvements in test reliability and performance

- CI default: raise parallelism to 20
- CI valgind: set parallelism to 6
- CI non-native: adapt parallelism for OS builds
- CI Windows: no longer ignore FTP, TFTP, MQTT and SMTP
- CI Windows: restrict test timeout to 10 minutes
- CI Windows: do not run tests for msh3 build
- tests, various: restrict curl invocation to ipv4 to avoid talking to
  any ipv6 test server running in parallel
- tests: requiring http/2 server no longer needs to mention http server
- test 190: use a fixed timeout of 10 seconds instead of %FTPTIME2, as
  that value rises under parallel load beyond what the server is waiting
  and then produces different results
- test 1540: add debug logging
- testrunner: add verify checks for http/2 and http/3 server

Closes #15040

10 months agolib: fix disabled-verbose-strings + enable-debug build warnings
Daniel Stenberg [Fri, 27 Sep 2024 11:19:55 +0000 (13:19 +0200)] 
lib: fix disabled-verbose-strings + enable-debug build warnings

10 months agoWebSockets: make support official (non-experimental)
Daniel Stenberg [Fri, 27 Sep 2024 11:19:55 +0000 (13:19 +0200)] 
WebSockets: make support official (non-experimental)

Inverts the configure/cmake options to instead provide options that
disable WebSockets and have them (ws + wss) enabled by default.

Closes #14936

10 months agocodespell: extend checks to more subdirs
Viktor Szakats [Thu, 26 Sep 2024 23:16:38 +0000 (01:16 +0200)] 
codespell: extend checks to more subdirs

- fix issues found.
- fix a few more found locally.

Closes #15072

10 months agoGHA/torture: prefer pip `--break-system-packages` for speed
Viktor Szakats [Thu, 26 Sep 2024 22:46:26 +0000 (00:46 +0200)] 
GHA/torture: prefer pip `--break-system-packages` for speed

Follow-up to c5e3d8ba94791dbc51f98a56ce07b3ba6b0aa446 #14972

Closes #15071

10 months agosingleuse: make `git grep` faster, add Apple `nm` support
Viktor Szakats [Thu, 26 Sep 2024 19:16:21 +0000 (21:16 +0200)] 
singleuse: make `git grep` faster, add Apple `nm` support

- avoid regexp in grep to make it run faster.
- add support for parsing Apple `nm` output:
  - skip leading underscore from function names.
  - pick object name from output.

Closes #15070

10 months agoGHA/http3-linux: add name to align with other Linux workflows
Viktor Szakats [Thu, 26 Sep 2024 19:38:38 +0000 (21:38 +0200)] 
GHA/http3-linux: add name to align with other Linux workflows

Closes #15069

10 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 26 Sep 2024 21:52:47 +0000 (23:52 +0200)] 
RELEASE-NOTES: synced

10 months agoGHA/linux: improve cmake use, switch to Ninja
Viktor Szakats [Mon, 23 Sep 2024 22:14:55 +0000 (00:14 +0200)] 
GHA/linux: improve cmake use, switch to Ninja

- cmake: allow easy switching of generator (= make tool).
- merge autotools/cmake job steps.
- cmake: switch to Ninja.
  (build was already fast, Ninja doesn't make it noticeably faster)

Closes #15023

10 months agomulti: avoid reading whole struct pointer from pointer
Daniel Stenberg [Thu, 26 Sep 2024 14:05:20 +0000 (16:05 +0200)] 
multi: avoid reading whole struct pointer from pointer

The proper alignment is not guaranteed. This function now instead uses
only the first and last byte of the key since they are the ones likely
to change most (one of them, depending on CPU endian) and the hash is
tiny anyway.

Closes #15063

10 months agotests: use '-4' where needed
Stefan Eissing [Thu, 26 Sep 2024 13:20:43 +0000 (15:20 +0200)] 
tests: use '-4' where needed

Our test servers run either on ipv4 *or* on ipv6, as requested.
A test case using 'localhost' or '*.local' in the url needs to
run with the specific version of the server started.

Otherwise, curl's "happy eyeball"ing will connect to another
server that may be running due to parallel testing or for some
other reasons.

Note that port reuse here depends on the OS strategy and it
seems netbsd is especially likely to hit this.

Closes #15060