]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
11 months agoGHA: disable building tests, apps, docs in dependencies
Viktor Szakats [Thu, 21 Nov 2024 18:22:43 +0000 (19:22 +0100)] 
GHA: disable building tests, apps, docs in dependencies

Also:
- for LibreSSL download the official source tarball instead of
  using the tagged Git repo and running the build script which
  merged the OpenBSD libressl repo into it. The latter method
  was also broken at the time of this commit.

Build times:
```
                       before   after
aws-lc:                 1m55s    ~40s
libressl:               1m16s  ~1m20s
openssl-tsan:           5m47s   3m43s
openssl:                6m38s   4m49s
quictls-no-deprecated:  2m28s   1m51s
quictls:               ~6m08s   4m16s
wolfssl-all:            1m36s     52s
wolfssl-master:         1m34s     53s
wolfssl-opensslextra:     50s     32s
```

LibreSSL build options are unchanged, but by using the tarball now
instead of two repos and a generator script, it also should be faster,
and more stable.

Closes #15622

11 months agocmake: include `wolfssl/options.h` first
Viktor Szakats [Thu, 21 Nov 2024 19:07:21 +0000 (20:07 +0100)] 
cmake: include `wolfssl/options.h` first

It was missing while detecting `wolfSSL_DES_ecb_encrypt`,
`wolfSSL_BIO_new` and `wolfSSL_BIO_set_shutdown`.

We have not seen it causing issues in stable wolfSSL releases as of
v5.7.4, until a recent commit in wolfSSL master, which broke detections:
```
curl/CMakeFiles/CMakeScratch//CheckSymbolExists.c:8:19: error: ‘wolfSSL_BIO_new’ undeclared (first use in this function); did you mean ‘wolfSSL_CTX_new’?
curl/CMakeFiles/CMakeScratch//CheckSymbolExists.c:8:19: error: ‘wolfSSL_BIO_set_shutdown’ undeclared (first use in this function); did you mean ‘wolfSSL_set_shutdown’?
```
This in turn disabled `HTTPS-proxy` and failed related pytests:
https://github.com/curl/curl/actions/runs/11953800545/job/33324250039?pr=15620

wolfSSL source diff causing the regression:
https://github.com/wolfSSL/wolfSSL/compare/be70bea687526a51e3d751d425bbaaa412b451ee..c06f65a8ace311667d9b9d7fd320b6b25f8b1bf8

The wolfSSL build says:
```
Note: Make sure your application includes "wolfssl/options.h" before any other wolfSSL headers.
      You can define "WOLFSSL_USE_OPTIONS_H" in your application to include this automatically.
```

This patch makes sure to follow this rule across the curl codebase.

Also:
- include `wolfssl/options.h` first in `lib/vtls/wolfssl.c`.
  It was preceded by `wolfssl/version.h`, which did not cause issues.
  Background for the pre-existing include order:
  Ref: deb9462ff2de8e955c67ed441f5f48619a31198d #3903
  Ref: https://curl.se/mail/lib-2015-04/0069.html

Bug: https://github.com/curl/curl/pull/15620#issuecomment-2491872463
Follow-up to d68a121266671c806b5065c2fdce52d292bf7830 #14064

Closes #15623

11 months agoschannel: remove TLS 1.3 ciphersuite-list support
Wyatt O'Day [Thu, 21 Nov 2024 14:08:31 +0000 (09:08 -0500)] 
schannel: remove TLS 1.3 ciphersuite-list support

Drop TLS 1.3 ciphersuite-list support from SChannel because of the
number of bugs in SChannel itself (a closed-source TLS library). TLS 1.3
with SChannel still works, however the ciphersuite negotiation is left
entirely to SChannel.

Bug: https://hackerone.com/reports/2792484
Reported-by: newfunction on hackerone
Fixes https://github.com/curl/curl/issues/15482
Closes https://github.com/curl/curl/pull/15621

11 months agocmake: do not echo most inherited `LDFLAGS` to config files
Viktor Szakats [Thu, 14 Nov 2024 21:25:15 +0000 (22:25 +0100)] 
cmake: do not echo most inherited `LDFLAGS` to config files

Sync with autotools and filter out most linker flags inherited via
`CMAKE_SHARED_LINKER_FLAGS` (that includes `LDFLAGS` env) before
echoing them in `libcurl.pc` `Libs.private` and `curl-config`
`--static-libs`.

Keep inheriting `-l`, `-L`, `-F`, `--library-path=`, `-framework`
options.

Follow-up to e244d50064a56723c2ba4f0df8c847d6b70de0cb #15550
Follow-up to 9f56bb608ecfbb8978c6cb72a04d9e8b23162d82 #14681
Follow-up to 8ed66f98a954cfce92f770adeb2320deb1ea700e

Closes #15617

11 months agocurl_multi_socket_all.md: soften the deprecation warning
Jay Satiro [Wed, 13 Nov 2024 21:17:37 +0000 (16:17 -0500)] 
curl_multi_socket_all.md: soften the deprecation warning

- Instead of saying "do not use", explain that the function was
  deprecated for performance reasons.

Some users may have a legitimate use of this function even though we
deprecated it. Since there are no plans to remove it from the API get
rid of the "do not use" warning.

Bug: https://curl.se/mail/lib-2024-11/0029.html
Reported-by: Jacob Champion
Closes https://github.com/curl/curl/pull/15576

11 months agodocs: document default `User-Agent`
Brendon Smith [Sun, 17 Nov 2024 21:38:31 +0000 (16:38 -0500)] 
docs: document default `User-Agent`

curl offers a `--user-agent` option for modifying the `User-Agent`
header supplied in its requests.

The man page section for this option explains how to use the
`--user-agent` option, but does not explain which `User-Agent` curl uses
by default.

By default, curl uses curl/VERSION, such as `User-Agent: curl/8.11.0`.

Note that this appears to be different from the libcurl default (no
User-Agent header).

This commit documents the default `User-Agent` in the man page section
for the `--user-agent` option, as well as on the "Art of Scripting"
page.

The `%VERSION` placeholder will be used to insert the current version
as described in the man page generator docs.

Closes #15608

11 months agoshow-headers.md: clarify the headers are saved with the data
Daniel Stenberg [Sun, 17 Nov 2024 16:44:47 +0000 (17:44 +0100)] 
show-headers.md: clarify the headers are saved with the data

Fixes #15605
Reported-by: tkzv on github
Closes #15606

11 months agoGHA/macos: enable ECH in wolfSSL jobs
Viktor Szakats [Sun, 17 Nov 2024 19:02:56 +0000 (20:02 +0100)] 
GHA/macos: enable ECH in wolfSSL jobs

Homebrew wolfSSL builds recently enabled all features.
It allows to enable ECH in curl for these jobs.

https://github.com/Homebrew/homebrew-core/commit/97d1ed6e6db63071853f0d0c5b3b02cb22983be9
https://github.com/Homebrew/homebrew-core/pull/191561

Closes #15607

11 months agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 17 Nov 2024 16:13:33 +0000 (17:13 +0100)] 
RELEASE-NOTES: synced

11 months agomulti: add clarifying comment for wakeup_write()
Daniel Stenberg [Sun, 17 Nov 2024 10:48:07 +0000 (11:48 +0100)] 
multi: add clarifying comment for wakeup_write()

Coverity raised it as a "suspicious sizeof".

Closes #15600

11 months agonetrc: fix pointer to bool conversion
Viktor Szakats [Sun, 17 Nov 2024 11:46:25 +0000 (12:46 +0100)] 
netrc: fix pointer to bool conversion

with MSVC 2008 and 2010:
```
lib/netrc.c(107): error C2440: 'initializing' : cannot convert from 'char *' to 'bool'
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/51002792/job/jtoxd4mk984oi6fd#L164
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/51002792/job/0wxlw9a8g04e56vt#L177

Follow-up to e9b9bbac22c26cf67316fa8e6c6b9e831af31949 #15586
Closes #15601

11 months agosocket: handle binding to "host!<ip>"
Daniel Stenberg [Sat, 16 Nov 2024 17:53:56 +0000 (18:53 +0100)] 
socket: handle binding to "host!<ip>"

Regression since 3060557af702d (shipped in 8.9.0)

Fixes #15553
Reported-by: marcos-ng on github
Closes #15583

11 months agonetrc: address several netrc parser flaws
Daniel Stenberg [Fri, 15 Nov 2024 10:06:36 +0000 (11:06 +0100)] 
netrc: address several netrc parser flaws

- make sure that a match that returns a username also returns a
  password, that should be blank if no password is found

- fix handling of multiple logins for same host where the password/login
  order might be reversed.

- reject credentials provided in the .netrc if they contain ASCII control
  codes - if the used protocol does not support such (like HTTP and WS do)

Reported-by: Harry Sintonen
Add test 478, 479 and 480 to verify. Updated unit 1304.

Closes #15586

11 months agoGHA/linux: enable ECH in wolfSSL jobs
Viktor Szakats [Sun, 17 Nov 2024 02:18:13 +0000 (03:18 +0100)] 
GHA/linux: enable ECH in wolfSSL jobs

wolfSSL `--enable-all` builds support ECH. Enable it for 3 jobs using
such builds.

Also:
- GHA/windows: drop ECH from the job name.

Closes #15598

11 months agocurl.h: mark two error codes as obsolete
Daniel Stenberg [Sun, 10 Nov 2024 15:11:02 +0000 (16:11 +0100)] 
curl.h: mark two error codes as obsolete

Not used by libcurl since many years

Closes #15538

11 months agoCI: update dependencies
renovate[bot] [Tue, 12 Nov 2024 07:35:29 +0000 (07:35 +0000)] 
CI: update dependencies

- debian:bookworm-slim Docker digest to c00d13c
- github/codeql-action digest to ea9e4e3
- fsfe/reuse-action action to v5
- awslabs/aws-lc to v1.39.0

Closes #15555
Closes #15556
Closes #15579
Closes #15594

11 months agoGHA/windows: enable GSS-API in an MSVC job
Tal Regev [Thu, 14 Nov 2024 22:27:18 +0000 (00:27 +0200)] 
GHA/windows: enable GSS-API in an MSVC job

Ref: #15545
Ref: #15564
Ref: #15585

Closes #15549

11 months agokrb5: fix socket/sockindex confusion, MSVC compiler warnings
Viktor Szakats [Fri, 15 Nov 2024 01:32:18 +0000 (02:32 +0100)] 
krb5: fix socket/sockindex confusion, MSVC compiler warnings

- fix socket/sockindex confusion on writes:

  The callstack used to end with `Curl_write_plain()` accepting a socket
  till 7.87.0. This call got swapped for `Curl_conn_send()`, expecting
  a sockindex. `socket_write()` was updated accordingly. Its callers
  missed it and continued operating on sockets: `do_sec_send()`,
  `sec_write()`, passing it down the stack and `Curl_conn_send()`
  resolving it as if it were a sockindex.
  It affected FTP Kerberos authentication.

  Discovered through MSVC warnings:
  ```
  curl\lib\krb5.c(652,28): warning C4244: 'function': conversion from 'curl_socket_t' to 'int', possible loss of data
  curl\lib\krb5.c(654,28): warning C4244: 'function': conversion from 'curl_socket_t' to 'int', possible loss of data
  curl\lib\krb5.c(656,26): warning C4244: 'function': conversion from 'curl_socket_t' to 'int', possible loss of data
  curl\lib\krb5.c(657,26): warning C4244: 'function': conversion from 'curl_socket_t' to 'int', possible loss of data
  curl\lib\krb5.c(665,24): warning C4244: 'function': conversion from 'curl_socket_t' to 'int', possible loss of data
  curl\lib\krb5.c(666,24): warning C4244: 'function': conversion from 'curl_socket_t' to 'int', possible loss of data
  ```
  Ref: https://github.com/curl/curl/actions/runs/11846599621/job/33014592805#step:9:32

  Follow-up to 5651a36d1ae46db61a31771a8d4d6dcf2a510856 #10280
  Bug: https://github.com/curl/curl/pull/15549#issuecomment-2474154067
  Fixes #15582

- fix uninitialized buffer:
  ```
  curl\lib\krb5.c(288,1): warning C4701: potentially uninitialized local variable '_gssresp' used
  ```
  Ref: https://github.com/curl/curl/actions/runs/11848626645/job/33020501026?pr=15585#step:9:31

- silence unreachable code compiler warning:
  ```
  curl\lib\krb5.c(370,1): warning C4702: unreachable code
  ```
  Ref: https://github.com/curl/curl/actions/runs/11848626645/job/33020501026?pr=15585#step:9:30

Closes #15585

11 months agoCURLOPT_PREREQFUNCTION.md: add result code on failure
Logan Buth [Fri, 8 Nov 2024 05:58:17 +0000 (23:58 -0600)] 
CURLOPT_PREREQFUNCTION.md: add result code on failure

Closes #15542

11 months agoRename struct var to fix AIX build
andrewkirillov-ibm [Thu, 14 Nov 2024 15:50:33 +0000 (15:50 +0000)] 
Rename struct var to fix AIX build

Fixing issue #15580 by renaming struct var to tool_var to avoid conflict
with the same structure name defined in AIX system headers.

Fixes #15580
Closes #15581

11 months agotidy-up: indentation [ci skip]
Viktor Szakats [Fri, 15 Nov 2024 01:51:30 +0000 (02:51 +0100)] 
tidy-up: indentation [ci skip]

11 months agoconfigure: replace `$#` shell syntax
Viktor Szakats [Thu, 14 Nov 2024 22:28:42 +0000 (23:28 +0100)] 
configure: replace `$#` shell syntax

With a more portable alternative.

Fixes (seen on macOS):
```
../configure: line 47131: 1: command not found
```
Ref: https://github.com/curl/curl/actions/runs/11846071276/job/33012894013#step:7:635

Follow-up to e244d50064a56723c2ba4f0df8c847d6b70de0cb #15550
Closes #15584

11 months agocmake: restore cmake args list in `buildinfo.txt`
Viktor Szakats [Wed, 13 Nov 2024 01:16:31 +0000 (02:16 +0100)] 
cmake: restore cmake args list in `buildinfo.txt`

This feature was recently dropped because of a bad side-effect of
silencing unused cmake command-line option warnings.

Fix this issue by retrieving variable values using `get_property()`,
instead of accessing the variables directly. It allows restoring
this feature without the bad side-effect.

Also limit the logic to CI runs.

Follow-up to 96edb5f611c9e54da1ae824d9dc0e219619c24c0 #15501
Closes #15563

11 months agoconfigure: add FIXMEs for disabled pkg-config references
Viktor Szakats [Thu, 14 Nov 2024 21:42:20 +0000 (22:42 +0100)] 
configure: add FIXMEs for disabled pkg-config references

Follow-up to d511ec8b0a56b2a99226fe556abe9f815153c648 #15573

11 months agobuild: omit certain deps from `libcurl.pc` unless found via `pkg-config`
Viktor Szakats [Wed, 13 Nov 2024 13:44:05 +0000 (14:44 +0100)] 
build: omit certain deps from `libcurl.pc` unless found via `pkg-config`

The idea of linking dependencies found to `libcurl.pc` turns out not
to work in practice in some cases.

Specifically: gss, ldap, mbedtls, libmsh3, rustls

A `.pc` may not work or be missing for a couple of reasons:
- not all build methods generate it: mbedTLS, Rustls
- generated file is broken: msh3
  Ref: https://github.com/nibanks/msh3/pull/225
- installed package flavour isn't shipping with one:
  FreeBSD GSS, OmniOS LDAP, macOS LDAP

The effect of such issues shall be subtle in theory, because
`libcurl.pc` normally lists these dependencies in the `Requires.private`
section meant for static linking. But, e.g. `pkg-config --exists`
requires these to be present, and builds sometimes use this check
regardless of build type. This bug is not present in `pkgconf`; it only
checks for them when `--static` is also passed.

Fix these by adding affected `.pc` references to `libcurl.pc` only when
we detected the dependency via `pkg-config`.

There are a few side-effects of this solution:
- references are never added for dependencies where curl doesn't
  implement `pkg-config` detection. These are:
  - autotools: ldap, mbedtls, msh3
  - cmake: ldap (pending #15273)
- generated `libcurl.pc` depends on the build-time environment.
- generated `libcurl.pc` depends on curl build tool (cmake, autotools).
- generated `libcurl.pc` depends on curl build implementation details.

Make an exception for GNU GSS, where I blindly guess that `gss.pc` is
always available, as no issues were reported.

Other, not mentioned, dependencies continue to be added regardless
of the detection method.

Reported-by: Harmen Stoppels, Thomas, Daniel Engberg, Andy Fiddaman
Fixes #15469
Fixes #15507
Fixes #15535
Fixes https://github.com/curl/curl/pull/15163#issuecomment-2473358444
Closes #15573

11 months agocmake: sync GSS config code with other deps
Viktor Szakats [Mon, 11 Nov 2024 10:03:08 +0000 (11:03 +0100)] 
cmake: sync GSS config code with other deps

- stop passing explicit libpaths via `CMAKE_SHARED_LINKER_FLAGS` and
  `CMAKE_EXE_LINKER_FLAGS`. `link_directories()` is doing that already.
- use `curl_required_libpaths()` to pass libpaths to the feature test.
Reported-by: Daniel Engberg
  Fixes #15536
  Also fixes GSS feature detection with non-gcc/clang compilers,
  such as MSVC.
- add libpaths to `CURL_LIBPATHS`.
- move `GSS_CFLAGS`, `GSS_LDFLAGS` stringifications to FindGSS.
  To match the `CFLAGS` format returned by the rest of Find modules.
- reorder calls to match other dependencies.
- don't extend system `LDFLAGS` when FindGSS did not return any.
- ignore `LDFLAGS` when detecting GSS via `pkg-config`. `LDFLAGS` holds
  a copy of libpaths and libs in this case. Ignore those to avoid these
  duplicates making into `libcurl.pc` and `curl-config`. Also syncing
  behavior with other Find modules which also ignore raw `LDFLAGS`.
- ignore raw `LDFLAGS` coming from `krb5-config --libs`. FindGSS
  no longer returns dependency-specific `LDFLAGS` after this. Syncing
  behavior with other Find modules.
- reduce scope of checker state push/pop/set.

Closes #15545

11 months agostrtok: use namespaced `strtok_r` macro instead of redefining it
Viktor Szakats [Tue, 12 Nov 2024 12:37:33 +0000 (13:37 +0100)] 
strtok: use namespaced `strtok_r` macro instead of redefining it

krb5 defines `strtok_r` for Windows unconditionally in its public
header:
https://github.com/krb5/krb5/blob/dc5554394e5a4363b3e109623edbeb9ad6c18a62/src/include/win-mac.h#L214-L215
resulting in this warning:
```
lib\strtok.h(31,9): warning C4005: 'strtok_r': macro redefinition
      C:\vcpkg\installed\x64-windows\include\win-mac.h(215,9):
      see previous definition of 'strtok_r'
```

The krb5 macro collides with curl's internal definition, in case
the `strtok_r` function is undetected and falling back to a local
replacement.

Reported-by: Tal Regev
Bug: https://github.com/curl/curl/pull/15549#issuecomment-2468251761
Closes #15564

11 months agosocketpair: fix enabling `USE_EVENTFD`
Viktor Szakats [Tue, 12 Nov 2024 17:04:35 +0000 (18:04 +0100)] 
socketpair: fix enabling `USE_EVENTFD`

Follow-up to 23fe1a52dc8a2ffd74e19b956927bbccdc07f15f #13874
Closes #15561

11 months agoconfigure: do not echo most inherited `LDFLAGS` to config files
Viktor Szakats [Mon, 11 Nov 2024 12:21:58 +0000 (13:21 +0100)] 
configure: do not echo most inherited `LDFLAGS` to config files

`libcurl.pc` `Libs.private` (since 8.11.0, and in `Libs` before 7.20.0)
and `curl-config` `--static-libs` (since 7.17.1, and in `Libs` between
7.7.2-7.25.0). This included all flags inherited from the environment,
in addition to those coming from dependency detections.

To avoid spilling all linker flags inherited from the environment to
the libcurl config files, this patch omits them all, except `-L`, `-F`,
`--library-path=` and `-framework` options, which are still passed.
The rationale for the exceptions is that `LIBS` is passed as-is, and
`LDFLAGS`, `LIBS` are the canonical way to pass custom libs options
to a build. `LIBS` may not work without a matching custom libpath.

This brings autotools behaviour closer to cmake, and `curl-config`
closer to `libcurl.pc`.

Follow-up to 9f56bb608ecfbb8978c6cb72a04d9e8b23162d82 #14681
Follow-up to 4c8adc8fee5e55754da3d8f8d982733a7bf3dece
Reported-by: Peter Marko
Fixes #15533
Closes #15550

11 months agoGHA/linux: fix `pip3 install impacket` breakage
Viktor Szakats [Wed, 13 Nov 2024 22:43:49 +0000 (23:43 +0100)] 
GHA/linux: fix `pip3 install impacket` breakage

An upstream update `impacket` pip package started requiring `blinker`.
An older version is shipping with Ubuntu, causing this on install:
```
  Attempting uninstall: blinker
    Found existing installation: blinker 1.7.0
ERROR: Cannot uninstall blinker 1.7.0, RECORD file not found. Hint: The package was installed by debian.
```

Fix it by switching to venv and install everything separate from the
system.

The overhead is the same as using `pip --ignore-installed`, which also
installs everything from scratch.

The 3rd option is to uninstall the system `python3-blinker` package, but
it was the slowest.

Closes #15578

11 months agoos400: Fix IBMi builds
andrewkirillov-ibm [Wed, 13 Nov 2024 14:07:47 +0000 (14:07 +0000)] 
os400: Fix IBMi builds

- Use a separate variable for CURL type dereference.

Prior to this change, eed3c8f4 (precedes 8.11.0), changed CURL type from
Curl_easy to void which broke dereferences to the former.

Reported-by: Andrew Kirillov
Fixes https://github.com/curl/curl/issues/15566
Closes https://github.com/curl/curl/pull/15572

11 months agoos400: Fix IBMi EBCDIC conversion of arguments
andrewkirillov-ibm [Wed, 13 Nov 2024 14:40:44 +0000 (14:40 +0000)] 
os400: Fix IBMi EBCDIC conversion of arguments

- Fix the length of strings passed to iconv_open.

IBM's iconv_open expects parameters to be a pointer to a 32 byte
character array with the unused fields set to 0.

Prior to this change, since 8c62479a (precedes 8.11.0), it was
incorrectly passed pointers to smaller length const strings and curl
would fail with error "blank argument where content is expected".

Reported-by: Andrew Kirillov
Ref: https://www.ibm.com/docs/en/i/7.5?topic=ssw_ibm_i_75/apis/iconvopn.html

Fixes https://github.com/curl/curl/issues/15570
Closes https://github.com/curl/curl/pull/15574

11 months agocmake: typo in comment [ci skip]
Viktor Szakats [Wed, 13 Nov 2024 18:07:00 +0000 (19:07 +0100)] 
cmake: typo in comment [ci skip]

Follow-up to 93e6e4b823d4b62119e5d464ae733b68245772e6 #15559

11 months agoGHA/macos: follow Homebrew and switch to `pkgconf`
Viktor Szakats [Wed, 13 Nov 2024 17:00:34 +0000 (18:00 +0100)] 
GHA/macos: follow Homebrew and switch to `pkgconf`

Homebrew switched to `pkgconf`, and now pkg-config installs an extra
package. Update package list to avoid that.

The side-effect of `pkgconf` is that this former log message:
```
--   Package 'libcrypto', required by 'libssh2', not found
```
https://github.com/curl/curl/actions/runs/11779568834/job/32808325442#step:7:84

is replaced by this, and repeated 10 times:
```
Package libcrypto was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcrypto.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libcrypto', required by 'libssh2', not found
```
https://github.com/curl/curl/actions/runs/11792711391/job/32846858320#step:7:85

Closes #15575

11 months agocmakelint: fix to check root `CMakeLists.txt`
Viktor Szakats [Wed, 13 Nov 2024 09:44:32 +0000 (10:44 +0100)] 
cmakelint: fix to check root `CMakeLists.txt`

Closes #15565

11 months agocmake: work around `ios.toolchain.cmake` breaking feature-detections
Viktor Szakats [Tue, 12 Nov 2024 14:22:50 +0000 (15:22 +0100)] 
cmake: work around `ios.toolchain.cmake` breaking feature-detections

Fix builds with CMake configured to falsely return successful detection
when using `check_function_exists()` (and `check_library_exists()`, and
anything based on `try_compile()` that's relying on the linker). After
such mis-detection the build fails when trying to use the feature that
doesn't in fact exist.

The mis-detection is caused by this CMake setting:
```
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
```
It is set by default (or on conditions) when using 3rd-party toolchain:
https://github.com/leetal/ios-cmake/blob/master/ios.toolchain.cmake

After this patch the curl build overrides this setting for the duration
of feature tests, and logs a message about it.

Also preset and skip feature tests for known mis-detections:
- `connect()` in `libsocket`
- `getpass_r()`
- `eventfd()` (did not cause an issue due to a separate bug)
- `sendmmsg()` (did not cause an issue because it's Linux-only)

If mis-detections are still seen, the workaround is to force-set the
specific feature by passing `-DHAVE_*=OFF` to cmake.
Also consider passing `-DENABLE_STRICT_TRY_COMPILE=ON` for
`ios.toolchain.cmake` to fix the root cause.

Interestingly curl itself uses this setting to speed up compile-only
detections: be17f298ff508d62d493d4a8d43e56a1e2861a50 #3744

Also:
- OtherTests.cmake: restore original value of
  `CMAKE_TRY_COMPILE_TARGET_TYPE`. Before this patch it reset it
  to empty.
- OtherTests.cmake: unset a local variable after use, quote a string.

Follow-up to 8e345057761a8f796403923a96f2c8fd3edca647 #15164
Follow-up to 8b76a8aeb21c8ae2261147af1bddd0d4637c252c #15525
Ref: https://github.com/leetal/ios-cmake/issues/47
Ref: https://gitlab.kitware.com/cmake/cmake/-/issues/18121
Ref: https://cmake.org/cmake/help/latest/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.html
Reported-by: Dan Rosser
Fixes #15557
Closes #15559

11 months agotests: use the standard format of an IGNORED line
Dan Fandrich [Wed, 13 Nov 2024 06:01:54 +0000 (22:01 -0800)] 
tests: use the standard format of an IGNORED line

This is more consistent and allows Test Clutch to parse it properly.
Also, add --test-duphandle and --test-event to the runtests.pl help
text.

11 months agoGHA/non-native: streamline installed packages on FreeBSD
Daniel Engberg [Sun, 10 Nov 2024 21:23:26 +0000 (22:23 +0100)] 
GHA/non-native: streamline installed packages on FreeBSD

Instead of installing the cmake package which is a meta-port (includes
documentation and manpages etc) install cmake-core which is cmake itself
to save a few cpu cycles.

Also drop nghttp2 in favour of the slimmer libnghttp2.

Closes #15540

11 months agomk-ca-bundle: remove CKA_NSS_SERVER_DISTRUST_AFTER conditions
Daniel Stenberg [Tue, 12 Nov 2024 07:33:53 +0000 (08:33 +0100)] 
mk-ca-bundle: remove CKA_NSS_SERVER_DISTRUST_AFTER conditions

The script's previous treatment of this meta-data was a
misunderstanding. (Added in 1ebc53df25181908) The mistrust is not for
the root cert at this date (it would simply be removed from the bundle
then instead) but for created server certificates:

    If a builtin certificate has a CKA_NSS_SERVER_DISTRUST_AFTER
    timestamp before the SCT or NotBefore date of a certificate that
    builtin issued, then clients can elect not to trust it.

That is however information that cannot be provided in the generated PEM
output.

Fixes #15547
Reported-by: Andrew Ayer
Closes #15552

11 months agocurl-rustls.m4: keep existing `CPPFLAGS`/`LDFLAGS` when detected
Viktor Szakats [Mon, 11 Nov 2024 12:59:08 +0000 (13:59 +0100)] 
curl-rustls.m4: keep existing `CPPFLAGS`/`LDFLAGS` when detected

Different variable names were used in flag save and restore operations,
which could cause existing `CPPFLAGS` and `LDFLAGS` be accidentally lost
when detecting Rustls.

Follow-up to 647e86a3efe1eea7a2a456c009cfe1eb55fe48eb #13179
Closes #15546

11 months agobuild: use `_fseeki64()` on Windows, drop detections
Viktor Szakats [Fri, 8 Nov 2024 17:51:45 +0000 (18:51 +0100)] 
build: use `_fseeki64()` on Windows, drop detections

A recent update caused CMake builds to mis-detect this symbol on iOS.
Auto-detection also seems redundant given that it's a Windows-only
function and most Windows builds were already opted-in.

Drop detections and use it in all Windows builds with large file support
enabled.

Feature history:
- pririotizing for Windows: aaacd02466f77d03b8fdc19e91a0a3ec72f4c38a #14678
- Windows opt-in cmake: 8e74c0729d0cace00a202fc6c33c1b35703e220a #11950
- Windows opt-in: aa6c94c5bf4f5caa31c0213d9cd7058c29a9b30b #11944
- use in libcurl: 9c7165e96a3a9a2d0b7059c87c699b5ca8cdae93 #11918
- use in example: 817d1c01064ac81e9609819b15738ee540ef056c

Regression from 8e345057761a8f796403923a96f2c8fd3edca647 #15164

Reported-by: Maarten Billemont
Fixes #15525
Closes #15526

11 months agoGHA: update four dependencies
renovate[bot] [Tue, 5 Nov 2024 12:40:24 +0000 (12:40 +0000)] 
GHA: update four dependencies

- gnutls/gnutls to v3.8.8
- rojopolis/spellcheck-github-actions digest to 403efe0
- awslabs/aws-lc to v1.38.0
- github/codeql-action digest to 4f3212b

Closes #15487
Closes #15490
Closes #15516
Closes #15528

11 months agolibssh: when using IPv6 numerical address, add brackets
Daniel Stenberg [Fri, 8 Nov 2024 15:31:41 +0000 (16:31 +0100)] 
libssh: when using IPv6 numerical address, add brackets

Reported-by: henrikjehgmti on github
Fixes #15522
Closes #15524

11 months agoGHA/non-native: enable nghttp2 in OmniOS job
Viktor Szakats [Fri, 8 Nov 2024 23:57:07 +0000 (00:57 +0100)] 
GHA/non-native: enable nghttp2 in OmniOS job

Closes #15530

11 months agoci: Update vmactions/omnios-vm digest to 16b5996
renovate[bot] [Fri, 8 Nov 2024 22:21:36 +0000 (22:21 +0000)] 
ci: Update vmactions/omnios-vm digest to 16b5996

Closes #15529

11 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 8 Nov 2024 22:24:50 +0000 (23:24 +0100)] 
RELEASE-NOTES: synced

11 months agonghttp2: use custom memory functions
Ethan Everett [Fri, 8 Nov 2024 19:49:32 +0000 (11:49 -0800)] 
nghttp2: use custom memory functions

Provide libcurl's memory functions as callbacks to replace nghttp2's own memory
functions. This allows custom memory callbacks provided by users of libcurl to
be used by nghttp2 as well.

Closes #15527

12 months agoECH: enable support for the AWS-LC backend
Viktor Szakats [Wed, 6 Nov 2024 15:37:07 +0000 (16:37 +0100)] 
ECH: enable support for the AWS-LC backend

Extend existing ECH support for BoringSSL to its AWS-LC fork.

Also enable ECH in AWS-LC CI jobs.

```
curl 8.11.0-DEV (x86_64-pc-linux-gnu) libcurl/8.11.0-DEV AWS-LC/1.37.0 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libpsl/0.21.2
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli ECH HSTS HTTPS-proxy IPv6 Largefile libz NTLM PSL SSL threadsafe UnixSockets zstd
```

Closes #15499

12 months agocurl: --test-duphandle in debug builds runs "duphandled"
Daniel Stenberg [Thu, 7 Nov 2024 09:22:32 +0000 (10:22 +0100)] 
curl: --test-duphandle in debug builds runs "duphandled"

Using this option (only available in debug builds) makes curl always
call curl_easy_duphandle() on the handle before using it.

To help us catch curl_easy_duphandle() mistakes better.

Add a CI job using this.

Bonus: the previous runtests option -e is now also supported as
--test-event

Closes #15504

12 months agomacos: disable gcc `availability` workaround as needed
Viktor Szakats [Thu, 7 Nov 2024 07:09:30 +0000 (08:09 +0100)] 
macos: disable gcc `availability` workaround as needed

Homebrew gcc 14.2.0_1 fixed the issue, and the workaround is no longer
needed. Not only not needed, but the workaround is breaking builds with
the fixed gcc.

Auto-detect the upstream fix and stop applying the local workaround if
detected.

Assisted-by: Bo Anderson
Ref: https://github.com/Homebrew/homebrew-core/issues/194778#issuecomment-2462764619
Follow-up to e91fcbac7d86292858718a0bfebad57978761af4 #14155
Closes #15508

12 months agoRELEASE-PROCEDURE.md: adjust release dates
Daniel Stenberg [Fri, 8 Nov 2024 10:01:51 +0000 (11:01 +0100)] 
RELEASE-PROCEDURE.md: adjust release dates

Due to the calendar tweak with the pending patch release on December 11.

12 months agocmake: drop cmake args list from `buildinfo.txt`
Viktor Szakats [Wed, 6 Nov 2024 21:35:18 +0000 (22:35 +0100)] 
cmake: drop cmake args list from `buildinfo.txt`

Collecting the args list has the undesired side-effect of silencing
CMake warnings about unused variables passed via the command-line.

Drop it till a better method is found to retrieve them.

Reported-by: Kai Pastor
Ref: https://github.com/curl/curl/pull/14936#issuecomment-2460350977
Follow-up to 1fdea1684602a1ae2870c67b5f3e8fd34f63da95 #14802
Closes #15501

12 months agoGHA/macos: let gcc dictate the configured Apple SDK
Viktor Szakats [Fri, 8 Nov 2024 00:29:50 +0000 (01:29 +0100)] 
GHA/macos: let gcc dictate the configured Apple SDK

As discovered earlier, Homebrew gcc is built against a specific Apple
SDK version and doesn't work when matched up with a different version,
e.g. the one advertised as default by the macos runner image.

Before this patch this was resolved with brute force by zapping the
hack-layer gcc component to avoid the bad interference. This worked
for us, but it's fragile, accidental and doesn't translate to
real-world build environments. Thus, impractical.

Avoid this by explicitly selecting the SDK version gcc was built for and
meant to be used with, as shown by `gcc --print-sysroot`.

It assumes that the gcc binaries preinstalled on the runner images
always ship with the SDK version they reference. It also assumes
this works with and without `brew update`.

Also:
- add 4 quick build-only jobs to test all gcc/macos combos.
- list SDKs offered via CommandLineTools.

Suggested-by: Bo Anderson
Ref: https://github.com/Homebrew/homebrew-core/issues/194778#issuecomment-2462764619

Follow-up to c349bd668c91f2484ae21c0f361ddf497143093c #14097
Closes #15518

12 months agoGHA: add `apt update` where missing
Viktor Szakats [Fri, 8 Nov 2024 02:17:44 +0000 (03:17 +0100)] 
GHA: add `apt update` where missing

To mitigate this kind of (repeat) errors:
```
Err:14 http://azure.archive.ubuntu.com/ubuntu noble-updates/main amd64 python3-werkzeug all 3.0.1-3ubuntu0.1
  404  Not Found [IP: 40.81.13.82 80]
E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/main/p/python-werkzeug/python3-werkzeug_3.0.1-3ubuntu0.1_all.deb
Fetched 10.4 MB in 4s (2593 kB/s)
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
```
https://github.com/curl/curl/actions/runs/11732257460/job/32684111508#step:3:74

Follow-up to 842f88434f627c0330e263a3881b2d9438786b32 #15082
Closes #15519

12 months agoTODO: consider OCSP stapling by default
Daniel Stenberg [Fri, 8 Nov 2024 06:58:48 +0000 (07:58 +0100)] 
TODO: consider OCSP stapling by default

Suggested-by: Nicolas F.
Closes #15483
Closes #15521

12 months agovtls: fix compile warning when ALPN is not available
Ben Greear [Thu, 7 Nov 2024 17:08:55 +0000 (18:08 +0100)] 
vtls: fix compile warning when ALPN is not available

Ref: https://curl.se/mail/lib-2024-11/0013.html

Closes #15515

12 months agocmdline/ech.md: formatting cleanups
Daniel Stenberg [Thu, 7 Nov 2024 22:21:14 +0000 (23:21 +0100)] 
cmdline/ech.md: formatting cleanups

Reported-by: Samuel Henrique
Fixes #15506
Closes #15517

12 months agonetrc: support large file, longer lines, longer tokens
Daniel Stenberg [Thu, 7 Nov 2024 16:03:54 +0000 (17:03 +0100)] 
netrc: support large file, longer lines, longer tokens

Regression from 3b43a05e000aa8f6 (shipped in 8.11.0)

Reported-by: Moritz
Fixes #15513
Closes #15514

12 months agosetopt: fix CURLOPT_HTTP_CONTENT_DECODING
Jesus Malo Poyatos [Thu, 7 Nov 2024 13:00:53 +0000 (14:00 +0100)] 
setopt: fix CURLOPT_HTTP_CONTENT_DECODING

Regression from 30da1f5974d34841b30c4f (shipped in 8.11.0)

Fixes #15511
Closes #15510

12 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 7 Nov 2024 12:16:47 +0000 (13:16 +0100)] 
RELEASE-NOTES: synced

Bump to 8.11.1

12 months agombedtls: call psa_crypt_init() in global init
Stefan Eissing [Thu, 7 Nov 2024 09:26:03 +0000 (10:26 +0100)] 
mbedtls: call psa_crypt_init() in global init

Run mbedtls' psa_crypt_init() in the general global init, optionally
protected by mbedtls locks when available.

CI: when building mbedtls, enabled thread safety

Reported-by: wxiaoguang on github
Fixes #15500
Closes #15505

12 months agoduphandle: also init netrc
Daniel Stenberg [Thu, 7 Nov 2024 07:52:38 +0000 (08:52 +0100)] 
duphandle: also init netrc

The netrc init was only done in the Curl_open, meaning that a duplicated
handle would not get inited properly.

Added test 2309 to verify. It does netrc auth with a duplicated handle.

Regression from 3b43a05e000aa8f65bda513f733a

Reported-by: tranzystorekk on github
Fixes #15496
Closes #15503

12 months agocookie: treat cookie name case sensitively
Daniel Stenberg [Wed, 6 Nov 2024 10:26:25 +0000 (11:26 +0100)] 
cookie: treat cookie name case sensitively

Extend test 31 to verify

Reported-by: delogicsreal on github
Fixes #15492
Closes #15493

12 months agoRELEASE-NOTES: synced curl-8_11_0
Daniel Stenberg [Wed, 6 Nov 2024 07:03:58 +0000 (08:03 +0100)] 
RELEASE-NOTES: synced

Release time

12 months agoTHANKS: contributors from the 8.11.0 release
Daniel Stenberg [Wed, 6 Nov 2024 07:03:57 +0000 (08:03 +0100)] 
THANKS: contributors from the 8.11.0 release

12 months agoGHA/non-native: fix installing OpenLDAP on OpenBSD
Viktor Szakats [Wed, 6 Nov 2024 01:01:05 +0000 (02:01 +0100)] 
GHA/non-native: fix installing OpenLDAP on OpenBSD

Also:
- drop failing manual install of perl. It's there by default now.
- add link to OpenBSD package management FAQ page.

Closes #15491

12 months agoGHA/macos: drop WebSockets from job names
Viktor Szakats [Wed, 6 Nov 2024 00:43:08 +0000 (01:43 +0100)] 
GHA/macos: drop WebSockets from job names

It's enabled in all jobs by default now.

Follow-up to cd63629733895c273b5ece82483d37114355f2ce #15076

12 months agoRELEASE-NOTES: update cmake LDAP-related entry [ci skip]
Viktor Szakats [Tue, 5 Nov 2024 20:17:26 +0000 (21:17 +0100)] 
RELEASE-NOTES: update cmake LDAP-related entry [ci skip]

Reported-by: Kai Pastor
Bug: https://github.com/curl/curl/pull/15255#issuecomment-2457558219
Follow-up to 2c90f7f69e117543a9f0102bb89112125f0032bd #15255

12 months agombedtls: remove failf() use from mbedtls_random
Daniel Stenberg [Tue, 5 Nov 2024 10:52:38 +0000 (11:52 +0100)] 
mbedtls: remove failf() use from mbedtls_random

Since data can be NULL in here, calling failf() can be bad. This should
also be a terribly rare error so the lack of error message for this
should be manageable.

Reported-by: wxiaoguang on github
Fixes #15485
Closes #15486

12 months agowolfssl: coexist with openssl, further work
Stefan Eissing [Mon, 4 Nov 2024 11:26:47 +0000 (12:26 +0100)] 
wolfssl: coexist with openssl, further work

Build wolfSSL master with

./configure --prefix=/path --enable-ip-alt-name --enable-quic
--enable-earlydata --enable-psk --enable-opensslcoexist

and configure curl with openssl + wolfssl. Normal tests run.

pytest session resumption fails, as wolfssl does not handle the
new_session callback without opensslextra right now.

Closes #15481

12 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 4 Nov 2024 09:40:42 +0000 (10:40 +0100)] 
RELEASE-NOTES: synced

12 months agowolfssl: no more use of the OpenSSL API
Daniel Stenberg [Mon, 4 Nov 2024 07:35:43 +0000 (08:35 +0100)] 
wolfssl: no more use of the OpenSSL API

Allows curl to build with a wolfSSL built without its OpenSSL API.

It should allow curl to (soon?) build with *both* wolfSSL and OpenSSL

This change makes curl use its own sha256 implementaion when built with
wolfSSL: room for improvement.

Closes #15480

12 months agoci: update dependency wolfSSL/wolfssh to v1.4.19
renovate[bot] [Sat, 2 Nov 2024 01:04:53 +0000 (01:04 +0000)] 
ci: update dependency wolfSSL/wolfssh to v1.4.19

Closes #15476

12 months agoopenssl: extend the OpenSSL error messages
Daniel Stenberg [Fri, 1 Nov 2024 16:05:15 +0000 (17:05 +0100)] 
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

12 months agocurl_addrinfo: support operating systems with only getaddrinfo(3)
Jonas 'Sortie' Termansen [Fri, 1 Nov 2024 22:53:00 +0000 (23:53 +0100)] 
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

12 months agopytest: include curl version string and python platform in log
Viktor Szakats [Fri, 1 Nov 2024 12:18:40 +0000 (13:18 +0100)] 
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

12 months agocerts: add missing `-CAcreateserial` option for LibreSSL
Viktor Szakats [Fri, 1 Nov 2024 13:59:48 +0000 (14:59 +0100)] 
certs: add missing `-CAcreateserial` option for LibreSSL

Also:
- display openssl path and version.
- quote a string.

Follow-up to 9b0c0d6ade052c46cf72d2fd43017bacb0ba07f6 #15129

Closes #15471

12 months agowinbuild: drop `gen_resp_file.bat`
Viktor Szakats [Thu, 31 Oct 2024 09:17:47 +0000 (10:17 +0100)] 
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

12 months agotests: use a set for several of the curl_props
Dan Fandrich [Wed, 30 Oct 2024 01:23:33 +0000 (18:23 -0700)] 
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

12 months agovquic: recv_mmsg, use fewer, but larger buffers
Stefan Eissing [Wed, 30 Oct 2024 11:09:07 +0000 (12:09 +0100)] 
vquic: recv_mmsg, use fewer, but larger buffers

Reported-by: koujaz on github
Fixes #15267
Closes #15454

12 months agongtcp2: do not loop on recv
Stefan Eissing [Thu, 31 Oct 2024 11:47:05 +0000 (12:47 +0100)] 
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

12 months agoGHA/linux-old: adjust configure job name
Viktor Szakats [Thu, 31 Oct 2024 11:49:53 +0000 (12:49 +0100)] 
GHA/linux-old: adjust configure job name

12 months agounit1307: tidy up Apple OS detection
Viktor Szakats [Wed, 30 Oct 2024 20:09:06 +0000 (21:09 +0100)] 
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

12 months agoschannel: fix TLS cert verification by IP SAN
edmcln [Sun, 27 Oct 2024 12:01:52 +0000 (08:01 -0400)] 
schannel: fix TLS cert verification by IP SAN

Reported-by: elvinasp on github
Fixes #15149
Closes #15421

12 months agobuild: fix clang-cl builds, add CI job
Viktor Szakats [Tue, 29 Oct 2024 15:13:45 +0000 (16:13 +0100)] 
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 e53523fef07894991c69d907a7c7794c7ada4ff4 #14859

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

Closes #15449

12 months agotidy-up: whitespace, fix CI spacecheck for docs
Viktor Szakats [Fri, 25 Oct 2024 22:23:19 +0000 (00:23 +0200)] 
tidy-up: whitespace, fix CI spacecheck for docs

Also: fixup CI spacecheck to apply to docs again.

Closes #15423

12 months agoconfig: rename the OS define to CURL_OS to reduce collision risk
Daniel Stenberg [Wed, 30 Oct 2024 13:00:16 +0000 (14:00 +0100)] 
config: rename the OS define to CURL_OS to reduce collision risk

Reported-by: Jon Rumsey
Fixes #15455
Closes #15457

12 months agoMQTT: remove trailing newline
Daniel Stenberg [Wed, 30 Oct 2024 13:04:08 +0000 (14:04 +0100)] 
MQTT: remove trailing newline

12 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 30 Oct 2024 08:47:06 +0000 (09:47 +0100)] 
RELEASE-NOTES: synced

12 months agopytest: show curl features and protocols
Viktor Szakats [Tue, 29 Oct 2024 23:24:45 +0000 (00:24 +0100)] 
pytest: show curl features and protocols

For the Test Clutch matrix.

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

Closes #15452

12 months agomqtt: fix mqtt.md wording and add clearer explanation
Marwan Yassini [Tue, 29 Oct 2024 17:22:03 +0000 (17:22 +0000)] 
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

12 months agowinbuild/README: consolidate command prompt section
Jay Satiro [Wed, 16 Oct 2024 22:19:40 +0000 (18:19 -0400)] 
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

12 months agoci: update rojopolis/spellcheck-github-actions digest to 74c2a14
renovate[bot] [Fri, 25 Oct 2024 08:40:52 +0000 (08:40 +0000)] 
ci: update rojopolis/spellcheck-github-actions digest to 74c2a14

Closes #15412

12 months agoOS400: don't delete source files when building with debug
Jon Rumsey [Mon, 28 Oct 2024 17:53:01 +0000 (17:53 +0000)] 
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

12 months agopytest: fix run against multissl curl
Stefan Eissing [Tue, 29 Oct 2024 09:07:34 +0000 (10:07 +0100)] 
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

12 months agocurl/config2setopts: move SSH related options into same block
Daniel Stenberg [Tue, 29 Oct 2024 09:15:53 +0000 (10:15 +0100)] 
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

12 months agotool_operate: url_proto improvements
Daniel Stenberg [Tue, 29 Oct 2024 08:21:37 +0000 (09:21 +0100)] 
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

12 months agomulti: fix "Useless Assignment"
Daniel Stenberg [Tue, 29 Oct 2024 07:13:02 +0000 (08:13 +0100)] 
multi: fix "Useless Assignment"

CodeSonar pointed out "This code assigns the variable the same value it
already had"

Follow-up to e77326403d3d27e7e

Closes #15441

12 months agosetopt: return error for bad input to CURLOPT_RTSP_REQUEST
Daniel Stenberg [Tue, 29 Oct 2024 07:09:32 +0000 (08:09 +0100)] 
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

12 months agoruntests: add comment for handle64 pathsep requirement [ci skip]
Viktor Szakats [Tue, 29 Oct 2024 08:26:34 +0000 (09:26 +0100)] 
runtests: add comment for handle64 pathsep requirement [ci skip]

Cherry-picked from #14949