Commit Graph

33687 Commits

Author SHA1 Message Date
renovate[bot]
46bd595b77
ci: update dependency wolfSSL/wolfssh to v1.4.19
Closes #15476
2024-11-04 08:44:33 +01:00
Daniel Stenberg
6b2bc8130c
openssl: extend the OpenSSL error messages
Previously there were three error situations that only added the (unhelpful)
OpenSSL error strings, now we prefix those with a short explanation for the
error situation.

Reported-by: Jeroen Ooms
Fixes #15473
Closes #15474
2024-11-04 08:42:05 +01:00
Jonas 'Sortie' Termansen
78c3172921
curl_addrinfo: support operating systems with only getaddrinfo(3)
The gethostbyname(3) family was removed in POSIX-1.2008 in favor of
getaddrinfo(3) introduced in POSIX-1.2001. Modern POSIX systems such as
Sortix does not have gethostbyname nor the related definitions and
structures.

curl already only uses getaddrinfo(3) if available and thread safe,
although there is mild breakage if the related gethostbyname definitions
are missing.

This change attempts to fix that breakage:

Remove an unnecessary configure error if gethostbyname is missing since
getaddrinfo is enough as a fallback.

Rewrite Curl_ip2addr to not use struct hostent as it no longer is
standardized and create the struct Curl_addrinfo directly.

Only define the Curl_he2ai function on non-getaddrinfo systems where it
is going to be used with struct hoestent.

Revoke the fallback logic for when it's unknown whether getaddrinfo is
thread safe. It doesn't appear to make any sense since h_errno is
unrelated to getaddrinfo. The logic prevents new POSIX.1-2024 systems
from passing the thread safety test since h_errno does not exist anymore
and POSIX already requires getaddrinfo to be thread safe. There's
already a denylist in place for operating systems with known buggy
implementations.

Closes #15475
2024-11-02 22:28:59 +01:00
Viktor Szakats
25025419c9
pytest: include curl version string and python platform in log
For the Test Clutch matrix.

https://testclutch.curl.se/static/reports/feature-matrix.html

Assisted-by: Dan Fandrich
Closes #15470
2024-11-02 01:56:55 +01:00
Viktor Szakats
9d32724c12
certs: add missing -CAcreateserial option for LibreSSL
Also:
- display openssl path and version.
- quote a string.

Follow-up to 9b0c0d6ade #15129

Closes #15471
2024-11-01 15:36:48 +01:00
Viktor Szakats
97d69ec0da
winbuild: drop gen_resp_file.bat
`gen_resp_file.bat` could be reduced to 3 lines.
Those lines are simple to use from `Makefile.vc` as-is.

Also drop the unnecessary tabs.

Closes #15463
2024-11-01 11:36:54 +01:00
Dan Fandrich
d88db0b6b2 tests: use a set for several of the curl_props
These are used for member-of testing, so a set is more appropriate and
efficient. Also, fix a couple cases of bad exceptions.

Closes #15462
2024-10-31 20:14:44 -07:00
Stefan Eissing
9b863ac670
vquic: recv_mmsg, use fewer, but larger buffers
Reported-by: koujaz on github
Fixes #15267
Closes #15454
2024-10-31 23:40:51 +01:00
Stefan Eissing
922235e56b
ngtcp2: do not loop on recv
The vquic_recv_packets() function already loops when not all requested
packets can be received (until EAGAIN) and there is not need to do that
again in ngtcp2.

Closes #15466
2024-10-31 14:08:58 +01:00
Viktor Szakats
2f22fc10e5
GHA/linux-old: adjust configure job name 2024-10-31 13:26:27 +01:00
Viktor Szakats
329a8e9daa
unit1307: tidy up Apple OS detection
Use `__APPLE__` macro to detect Apple OS instead of relying on
the string in `CURL_OS`.

This also fixes detection with default CMake builds where `CURL_OS` is
`Darwin`. The code before this patch was expecting this substring in
lowercase.

Closes #15461
2024-10-31 09:09:01 +01:00
edmcln
9640a8ef6f
schannel: fix TLS cert verification by IP SAN
Reported-by: elvinasp on github
Fixes #15149
Closes #15421
2024-10-31 08:59:37 +01:00
Viktor Szakats
fb711b5098
build: fix clang-cl builds, add CI job
- appveyor: add build-only job for clang-cl.

- cmake: `-pedantic-errors` enables `-Werror,-Wlanguage-extension-token`
  automatically, which makes `__int64` detection fail.
  Explictly disable this compiler warning for clang-cl to make the
  feature detection work and to accept `__int64` in the source code.

- cmake: disable `-Wlanguage-extension-token` warning for clang-cl
  to fix these when encountering `__int64`:
  ```
  lib/formdata.c(797,29): error : extension used [-Werror,-Wlanguage-extension-token]
  lib/warnless.c(117,33): error : extension used [-Werror,-Wlanguage-extension-token]
  lib/warnless.c(60,28): message : expanded from macro 'CURL_MASK_SCOFFT'
  lib/warnless.c(59,38): message : expanded from macro 'CURL_MASK_UCOFFT'
  include\curl/system.h(352,40): message : expanded from macro 'CURL_TYPEOF_CURL_OFF_T'
  ```

- make `__GNUC__` warning suppressions apply to `__clang__` too.
  Necessary for clang-cl, which defines the latter, but not the former.
  (Regular clang defines both.)

- examples: fix clang-cl compiler warning in `http2-upload.c`.
  ```
  docs\examples\http2-upload.c(56,5): error : no previous prototype for function 'my_gettimeofday' [-Werror,-Wmissing-prototypes]
  docs\examples\http2-upload.c(56,1): message : declare 'static' if the function is not intended to be used outside of this translation unit
  ```

- unit2604: add missing `#pragma GCC diagnostic pop`.
  Follow-up to e53523fef0 #14859

- unit1652: limit compiler warning suppression to GCC.
  They do not affect clang builds.
  Follow-up to 71cf0d1fca #14772

Closes #15449
2024-10-30 23:15:32 +01:00
Viktor Szakats
9acecc923d
tidy-up: whitespace, fix CI spacecheck for docs
Also: fixup CI spacecheck to apply to docs again.

Closes #15423
2024-10-30 23:15:28 +01:00
Daniel Stenberg
0cececef0f
config: rename the OS define to CURL_OS to reduce collision risk
Reported-by: Jon Rumsey
Fixes #15455
Closes #15457
2024-10-30 14:59:54 +01:00
Daniel Stenberg
c0d2b9bee7
MQTT: remove trailing newline 2024-10-30 14:04:08 +01:00
Daniel Stenberg
98561a3bef
RELEASE-NOTES: synced 2024-10-30 09:47:06 +01:00
Viktor Szakats
bc6212004a
pytest: show curl features and protocols
For the Test Clutch matrix.

https://testclutch.curl.se/static/reports/feature-matrix.html

Closes #15452
2024-10-30 09:32:29 +01:00
Marwan Yassini
e4aa07b526
mqtt: fix mqtt.md wording and add clearer explanation
Some of the wording in the mqtt.md confused me as to how the commands
were used and what they did, so I cleared up some of the wording to
better explain what each command does.

Closes #15451
2024-10-30 08:44:05 +01:00
Jay Satiro
22e7b1512b winbuild/README: consolidate command prompt section
- Remove reference to 'Developer Command Prompt for Visual Studio'
  shortcut since it opens in x86 mode.

That prompt may confuse users since it is not easily switched to x64.
Our instruction says vcvarsall can be used to change the platform but it
is not in the path in any version that I checked (VS 2010, 2013, 2022).

Instead users will now only see the remaining instruction to use a
platform specific command prompt to build curl, like "x64 Native Tools".

There's several links as well to Microsoft documentation for users that
have more complicated requirements, such as using vcvarsall.

Closes https://github.com/curl/curl/pull/15313
2024-10-30 01:30:15 -04:00
renovate[bot]
85ee614020
ci: update rojopolis/spellcheck-github-actions digest to 74c2a14
Closes #15412
2024-10-29 15:52:30 +01:00
Jon Rumsey
b57e9c8f9b
OS400: don't delete source files when building with debug
Debugger not able to work against curl *SRVPGM when using temporary
source files.

Fixes #15445
Closes #15446
2024-10-29 15:44:05 +01:00
Stefan Eissing
0d475da1c4
pytest: fix run against multissl curl
Changes to make a curl built with OpenSSL + GnuTLS to run successfully
in our pytests. Run

CURL_SSL_BACKEND=openssl pytest

to test a TLS backend other than the default.

Closes #15443
2024-10-29 11:13:56 +01:00
Daniel Stenberg
a70f5bc4b5
curl/config2setopts: move SSH related options into same block
Move the code setting SSH specific libcurl options into the same block
to avoid having a separate almost identical condition later.

Closes #15444
2024-10-29 11:05:22 +01:00
Daniel Stenberg
84f96e3363
tool_operate: url_proto improvements
- renamed to url_proto_and_rewrite to better reveal what it does
- clarify the functionality in the top comment
- make it return CURLE_OUT_OF_MEMORY appropriately
- remove check for URL being set, use assert instead

Closes #15442
2024-10-29 10:07:37 +01:00
Daniel Stenberg
a273cc255f
multi: fix "Useless Assignment"
CodeSonar pointed out "This code assigns the variable the same value it
already had"

Follow-up to e77326403d

Closes #15441
2024-10-29 09:41:43 +01:00
Daniel Stenberg
b7a06dee50
setopt: return error for bad input to CURLOPT_RTSP_REQUEST
And leave the value untouched. Previously, an unrecognized argument
would reset it to RTSPREQ_NONE (and still return OK).

Closes #15440
2024-10-29 09:40:56 +01:00
Viktor Szakats
74c7b672d9
runtests: add comment for handle64 pathsep requirement [ci skip]
Cherry-picked from #14949
2024-10-29 09:27:42 +01:00
Daniel Stenberg
cbc39a88d7
setopt_cptr: make overflow check only done when needed
An overflow check for if the value of a curl_off_t is larger than a
size_t can hold, is only necessary if the two types are actually
differently sized, now checked by the preprocessor. To avoid
"Unreachable Conditional".

Closes #15439
2024-10-29 09:25:29 +01:00
Viktor Szakats
1a2d38c47c
GHA/windows: avoid curl.exe libtool wrapper
Avoid the `curl.exe` wrapper binary created by libtool, and run the real
`curl.exe` directly for tests and version information.

This solution was used in Azure jobs. I missed it when migrating jobs
to GHA.

Applies to tests run in the `mingw, AM x86_64 c-ares U` job, which has
seen unexplained flakiness.

Ref: 354afc891d #6049
Follow-up to e53523fef0 #14859

Closes #15437
2024-10-29 09:20:37 +01:00
Viktor Szakats
ef7399b8b5
runtests: pass single backslashes with Windows Perl
handle/handle64 requires a literal match with the filenames it's
listing.

Also:
- make handle64 log messages more unique to help text searches.
- update a comment with Windows Perl info.

Cherry-picked from #14949
Closes #15436
2024-10-29 09:20:37 +01:00
Daniel Stenberg
cd2b45201a
src/lib: remove redundant ternary operators
Closes #15435
2024-10-29 08:18:30 +01:00
Daniel Stenberg
080973dcdb
lib: msnprintf tidy-ups
doh: avoid an msnprintf()

openssl: skip a superfluous return code check

Closes #15434
2024-10-28 22:56:11 +01:00
Daniel Stenberg
cb011ac096
tls: avoid abusing CURLE_SSL_ENGINE_INITFAILED
That error code was introduced and has been used for OpenSSL ENGINE
things and not others, so switch the other use cases over to other TLS
related error codes.

Closes #15430
2024-10-28 16:13:14 +01:00
Daniel Stenberg
974f6bcf80
RELEASE-NOTES: synced 2024-10-28 16:01:08 +01:00
Stefan Eissing
701813b23f
tests/http: add --insecure tests
Add two test cases that connection using a hostname the server has no
certificate for. First, verify that the peer verification fail, as
expected. Second, provide '--insecure' to test that the connection
succeeded and returned some data.

Closes #15429
2024-10-28 13:04:28 +01:00
Stefan Eissing
0e0c8cdf89
tests/scorecard: allow remote server test
New args for scorecard.py:
* --remote ip:port to run tests against a remote server
* --start-only: to only start the servers, listing their ports

Start the server using "scorecard.py --start-only" on one machine and
then run the tests with "scorecard.py --remote ip:port" against that
machine.

Closes #15415
2024-10-28 11:41:19 +01:00
Daniel Stenberg
770702fa3d
CI: bump wolfSSH and wolfSSL
- wolfSSH 1.4.18
- wolfSSL 5.7.4

Closes #15427
2024-10-28 09:38:37 +01:00
Daniel Stenberg
80aa1fe462
tool_getparam: drop unused time() call
The second argument to curl_getdate() once took a time argument, but
that feature has been gone for decades, thus passing in a date there
makes no difference.

Closes #15420
2024-10-27 23:32:34 +01:00
Viktor Szakats
398025a41f
appveyor: fix job names, tidy-up
- add 'Shared' to job names where missing.
- dedupe setting the default `HTTP_ONLY` env.
- fix typo in job name.

Cherry-picked from #15414
Closes #15422
2024-10-27 14:26:45 +01:00
Viktor Szakats
1db9af2b9e
cmake: tweaks around debug mode and hidden symbols
- emit warning for `ENABLE_DEBUG` builds.

- add words to clarify that `ENABLE_DEBUG` is meant for developing curl
  itself.

- add comment saying `CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON`
  CMake option may export extra, non-curl symbols.
  Ref: https://github.com/microsoft/vcpkg/issues/41761
  Unexplained exports seen also in curl CI:
  ```
  [ 742] _tcschr
  [ 743] _tcsncmp
  [ 744] _tcsncpy
  [ 745] _tcspbrk
  ```
  https://ci.appveyor.com/project/curlorg/curl/builds/50864041/job/lolledrg4h7hu6e4?fullLog=true#L2160
  CMake extracts these symbols from `.obj` files:
  https://gitlab.kitware.com/cmake/cmake/-/issues/22092#note_943718
  I have not found any new MSVC option that helps fixing this without
  decorating all functions in-source or maintaining a manual list of
  internal function names used for tests:
  https://learn.microsoft.com/cpp/build/reference/wholearchive-include-all-library-object-files

Closes #15414
2024-10-27 14:26:45 +01:00
Viktor Szakats
0da1489eb9
build: disable warning -Wunreachable-code-break
This warning remains silent in unity builds. Since we're using unity
in CI for most jobs, warnings remain undetected there.
Disable them for all builds to avoid a surprise warning outside our CI.

The issue caught by the warning is useful for a tidy codebase, but
doesn't affect executed code. It was enabled in
84338c4de2 #12331 (2023-11-15).

llvm source: fee2953f23/clang/lib/Sema/AnalysisBasedWarnings.cpp (L125-L134)
llvm issue: https://github.com/llvm/llvm-project/issues/71046

Follow-up to 7c023c3f6e #15384
Closes #15416
2024-10-27 14:11:18 +01:00
Daniel Stenberg
e77326403d
multi: split multi_runsingle into sub functions
Introduce five functions named after the state they serve:

- state_connect for MSTATE_CONNECT
- state_do for MSTATE_DO
- state_performing for MSTATE_PERFORMING
- state_ratelimiting for MSTATE_RATELIMITING
- state_resolving for MSTATE_RESOLVING

Closes #15418
2024-10-27 10:59:50 +01:00
Daniel Stenberg
522c89a134
lib: remove Curl_ prefix from static functions
'Curl_' is a prefix used for library global functions (cross-files).
Static functions should thus not use it.

Closes #15419
2024-10-27 10:57:21 +01:00
Daniel Stenberg
1160380e50
docs: clarify FTP over HTTP proxy functionality somewhat
Reported-by: newfunction

Closes #15417
2024-10-26 23:45:32 +02:00
Viktor Szakats
0910a412a9
cmake: fix missing spacing in log message
Follow-up to e89491e1f0 #15337
Closes #15411
2024-10-25 15:04:36 +02:00
Viktor Szakats
aafc074f87
cmake: clear package version after pkg-config detection
`pkg_check_modules()` seems to leave `<PACKAGE>_VERSION` defined with an
empty value, if the package is not found.

When the package is also not found in the fallback branch,
`find_package_handle_standard_args()` logs and error message. In this
message it includes the bogus empty value as: `(found version "")`:
```
Could NOT find Libssh2 (missing: LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY) (found version "")
```
https://github.com/curl/curl/actions/runs/11509727553/job/32040378958?pr=15408#step:31:99

Clear the version number to avoid the confusion:
```
Could NOT find Libssh2 (missing: LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY)
```
https://github.com/curl/curl/actions/runs/11510022503/job/32041149129?pr=15408#step:31:99

Seen with CMake v3.30.5.

Follow-up to 7bab201abe #15193
Closes #15409
2024-10-25 15:04:35 +02:00
Viktor Szakats
b8c12634fc
INSTALL-CMAKE: fix punctuation and a typo [ci skip] 2024-10-24 23:21:00 +02:00
Viktor Szakats
f66af623cf
cmake: document -D and env build options
Extend `INSTALL-CMAKE` document with the list of available options,
a short description and default values.

The list may not be 100% complete.

There are no component boundaries in CMake, so the line is blurry
between curl options, CMake options, CMake Find modules options.
I included certain CMake options that seemed useful, and/or have
dedicated use withing curl's CMake source. But, all CMake built-in
options are usable, as documented upstream in CMake.

The naming of the options has a heritage and the inconsistencies with
it, including a lack of clear namespace. This may be subject to future
updates, also after figuring out which name has special meaning within
CMake and/or CMake projects out of unwritten convention or something
more tangible.

CMake allows to initialize any internal variable via `-D`. This may be
useful to pre-initialize/override feature check results. The list
doesn't contain these, and they remain officially undocumented.

Also:
- make adjustments to keep the spellchecker happy.
- retrofit description changes to the cmake sources.
- stop documenting deprecated `Find*` variables.

Reported-by: Daniel Stenberg
Fixes https://github.com/curl/curl/discussions/14885
Closes #15388
2024-10-24 23:06:40 +02:00
Viktor Szakats
ffc4e6a886
cmake: mark as advanced some internal Find* variables
To sync with other similar variables and hide them from cmake UIs.

Follow-up to 7bab201abe #15193
Closes #15407
2024-10-24 23:06:40 +02:00