]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
5 months agobuild: enable -Wjump-misses-init for GCC 4.5+ 16252/head
Marcel Raad [Fri, 7 Feb 2025 23:03:47 +0000 (00:03 +0100)] 
build: enable -Wjump-misses-init for GCC 4.5+

This should have caught https://github.com/curl/curl/issues/16246.

Closes https://github.com/curl/curl/pull/16252

5 months agoopenssl: remove bad `goto`s into other scope
Marcel Raad [Sun, 16 Feb 2025 20:52:52 +0000 (21:52 +0100)] 
openssl: remove bad `goto`s into other scope

All the `goto` did in these cases was effectively `return 0`, so just
use that explicitly.

Closes https://github.com/curl/curl/pull/16356

5 months agoRevert "openssl: fix out of scope variables in goto"
Marcel Raad [Sun, 16 Feb 2025 20:37:24 +0000 (21:37 +0100)] 
Revert "openssl: fix out of scope variables in goto"

This reverts the main part of commit
3f79695be9e4628d246740bcd36c627daab676ca, but keeping the
formatting fix.

Closes https://github.com/curl/curl/pull/16356

5 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 17 Feb 2025 07:43:08 +0000 (08:43 +0100)] 
RELEASE-NOTES: synced

5 months agoasyn-thread: fix `CURL_DISABLE_SOCKETPAIR` build
Marcel Raad [Sun, 16 Feb 2025 20:29:56 +0000 (21:29 +0100)] 
asyn-thread: fix `CURL_DISABLE_SOCKETPAIR` build

Since commit 074048ae803, `td` is used also with
`CURL_DISABLE_SOCKETPAIR`.

Closes https://github.com/curl/curl/pull/16355

5 months agovariable.md: clarify 'trim' example
Jay Satiro [Sun, 16 Feb 2025 08:05:15 +0000 (03:05 -0500)] 
variable.md: clarify 'trim' example

- Use the variable name 'var' instead of 'url' since the latter is also
  a function name and that may confuse the user.

Closes https://github.com/curl/curl/pull/16346

5 months agoscripts/managen: fix parsing of markdown code sections
Jay Satiro [Sun, 16 Feb 2025 07:49:43 +0000 (02:49 -0500)] 
scripts/managen: fix parsing of markdown code sections

- Terminate a code section before parsing a heading line.

Prior to this change when a code line (eg "    code") was followed
by a heading line (eg "## heading") the code section in the output
was terminated after converting the header instead of before. That led
to some weird formatting outputs depending on the nroff or roffit etc.

With this change:

.nf
curl \--expand\-url https.//example.com/{{url:trim}}
.fi
.IP json

Without this change:

.nf
curl \--expand\-url https.//example.com/{{url:trim}}
.IP json
.fi

Closes https://github.com/curl/curl/pull/16345

5 months agoscripts/managen: fix option 'single'
Jay Satiro [Sun, 16 Feb 2025 07:09:57 +0000 (02:09 -0500)] 
scripts/managen: fix option 'single'

- Fix option 'single' to generate single manpages.

As far as I can tell the option did not work prior to this change.

Example: scripts/managen -d docs/cmdline-opts single variable.md

Closes https://github.com/curl/curl/pull/16344

5 months agocmake: fix ECH detection in custom-patched OpenSSL
Viktor Szakats [Sun, 16 Feb 2025 19:07:40 +0000 (20:07 +0100)] 
cmake: fix ECH detection in custom-patched OpenSSL

Typo found via #16352
Regression-from fd067bfb5b028ac41660decc5abb87f1cd093b6b #15596
Closes #16354

5 months agobuild: drop more unused `HAVE_STRTOLL`
Viktor Szakats [Sun, 16 Feb 2025 19:05:50 +0000 (20:05 +0100)] 
build: drop more unused `HAVE_STRTOLL`

Follow-up to e5326bfb4477f54df64e2a7d0c2627f236a7130d #16350
Closes #16353

5 months agobuild: remove checks for strtoll()
Daniel Stenberg [Sun, 16 Feb 2025 13:52:43 +0000 (14:52 +0100)] 
build: remove checks for strtoll()

Follow-up to b4538ec5229d716baa5e09b

It is not being used anymore.

Closes #16350

5 months agoCODE_STYLE: readability and banned functions
Daniel Stenberg [Sun, 16 Feb 2025 13:50:45 +0000 (14:50 +0100)] 
CODE_STYLE: readability and banned functions

Closes #16349

5 months agoasyn-thread: remove 'status' from struct Curl_async
Daniel Stenberg [Thu, 6 Feb 2025 21:05:10 +0000 (22:05 +0100)] 
asyn-thread: remove 'status' from struct Curl_async

While it gets stored, nothing needs nor uses it.

Closes #16347

5 months agolib: strparse.h include where missing
Stefan Eissing [Sun, 16 Feb 2025 12:39:24 +0000 (13:39 +0100)] 
lib: strparse.h include where missing

Closes #16348

5 months agocmake: misc tidy-ups
Viktor Szakats [Fri, 7 Feb 2025 12:44:39 +0000 (13:44 +0100)] 
cmake: misc tidy-ups

- replace `add_compile_options()`,  `add_definitions()` with directory
  properties. To harmonize this across all scripts. The new commands are
  verbose, but describe better how they work. The syntax is also closer
  to setting target properties, helps grepping.

- prefer `CMAKE_INSTALL_PREFIX` over `--prefix` (in tests, CI).

- tidy up cmake invocations.

- formatting.

Closes #16238

5 months agobuild: fix compiler warnings in feature detections
Viktor Szakats [Tue, 11 Feb 2025 01:46:29 +0000 (02:46 +0100)] 
build: fix compiler warnings in feature detections

Fix or silence compiler warnings happening in feature detections
to reduce log noise. Warnings may also get promoted to errors in certain
cases, causing missed detections.

It reduces the number of warnings by 4500+ across the linux, linux-old,
macos, non-native and windows GHA workflows (~142 jobs).

Also move picky warning logic for MSVC/Borland to
`CMake/PickyWarnings.cmake. To make them listed in the picky-warnings
log output, and to also apply to feature detections to make them compile
under the same conditions as source code. The hope is to help catching
issues faster. It also improves code quality of feature tests.

Fixed/silenced:
```
warning #177: variable "dummy" was declared but never referenced
warning #177: variable "flag" was declared but never referenced
warning #177: variable "res" was declared but never referenced
warning #592: variable "s" is used before its value is set
warning #1011: missing return statement at end of non-void function "main"
warning #1786: function "SSL_CTX_set_srp_password" (declared at line 1888 of "/usr/include/openssl/ssl.h") was declared deprecated ("Since OpenSSL 3.0")
warning #1786: function "SSL_CTX_set_srp_username" (declared at line 1887 of "/usr/include/openssl/ssl.h") was declared deprecated ("Since OpenSSL 3.0")
warning #2332: a value of type "const char *" cannot be assigned to an entity of type "char *" (dropping qualifiers)
warning: 'SSL_CTX_set_srp_password' is deprecated [-Wdeprecated-declarations]
warning: 'SSL_CTX_set_srp_password' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
warning: 'SSL_CTX_set_srp_username' is deprecated [-Wdeprecated-declarations]
warning: 'SSL_CTX_set_srp_username' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
warning: 'b' is used uninitialized [-Wuninitialized]
warning: 'gethostname' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
warning: Undefined or garbage value returned to caller [core.uninitialized.UndefReturn]
warning: Value stored to 'i' is never read [deadcode.DeadStores]
warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
warning: control reaches end of non-void function [-Wreturn-type]
warning: empty expression statement has no effect; remove unnecessary ';' to silence this warning [-Wextra-semi-stmt]
warning: excess elements in struct initializer
warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
warning: macro "_FILE_OFFSET_BITS" is not used [-Wunused-macros]
warning: macro "_REENTRANT" is not used [-Wunused-macros]
warning: missing braces around initializer [-Wmissing-braces]
warning: no previous extern declaration for non-static variable 'off_t_is_large' [-Wmissing-variable-declarations]
warning: no previous prototype for 'check' [-Wmissing-prototypes]
warning: no previous prototype for function 'check' [-Wmissing-prototypes]
warning: null argument where non-null required (argument 2) [-Wnonnull]
warning: passing 'const char[1]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
warning: passing argument 2 of 'SSL_CTX_set_srp_password' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
warning: passing argument 2 of 'SSL_CTX_set_srp_username' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
warning: unused parameter 'c' [-Wunused-parameter]
warning: unused parameter 'f' [-Wunused-parameter]
warning: unused variable 'data' [-Wunused-variable]
warning: unused variable 'dummy' [-Wunused-variable]
warning: unused variable 'flag' [-Wunused-variable]
warning: unused variable 'res' [-Wunused-variable]
warning: unused variable 's' [-Wunused-variable]
warning: variable 's' set but not used [-Wunused-but-set-variable]
warning: variable 'ts' set but not used [-Wunused-but-set-variable]
```

Closes #16287

5 months agoconfigure: use `curl_cv_apple` variable
Viktor Szakats [Sat, 15 Feb 2025 10:57:55 +0000 (11:57 +0100)] 
configure: use `curl_cv_apple` variable

Follow-up to 876db1070bf3bee5e35ac0d2ebe612e313093262 #16338

Closes #16340

5 months agocmake: allow empty custom `IMPORT_LIB_SUFFIX`, add suffix collision detection
Viktor Szakats [Fri, 14 Feb 2025 10:35:12 +0000 (11:35 +0100)] 
cmake: allow empty custom `IMPORT_LIB_SUFFIX`, add suffix collision detection

Allow overriding the `IMPORT_LIB_SUFFIX` default with an empty value.

Also:
- add a fatal error if the implib and static lib filename are identical.
- clarify `IMPORT_LIB_SUFFIX` default value in the documentation.

Reported-by: RubisetCie on Github
Fixes #16324
Ref: 1199308dbc902c52be67fc805c72dd2582520d30 #11505

Closes #16332

5 months agocmake: add pre-fill for Unix, enable in GHA/macos, verify pre-fills
Viktor Szakats [Fri, 27 Dec 2024 23:27:26 +0000 (00:27 +0100)] 
cmake: add pre-fill for Unix, enable in GHA/macos, verify pre-fills

TL;DR: Save 10 minutes of CI time for GHA/macos jobs using pre-fills and
add pre-fill verification for Apple and Windows. Also restores Xcode job
and saves 1.5-10 minutes configuring iOS jobs.

Pre-filling feature detection results can bring down the CMake configure
step to ~5 seconds on most GHA runners, ~10 seconds in slow envs like
Cygwin/MSYS2.

The potential savings per job are:
- 5-40 (average 19) seconds on GHA/macos (33 jobs)
- ~10 seconds on GHA for iOS GNU Makefile (1 job)
- 1.5-10 minutes on GHA for iOS Xcode generator (1 job)
- 10 seconds on GHA/linux with native Ubuntu (12 jobs)
- 40 seconds for Cygwin/MSYS2 (2 jobs)
- 5-10 seconds for virtualized BSDs, native CPU (3 jobs)
- ~60 seconds for virtualized BSDs, emulated CPU (1 job)

On native Windows pre-filling has been in place for a long time and
saving 8 minutes (VS2019-VS2015) to 1.5-2 minutes (VS2022), 3 minutes
(VS2022 UWP), and 30-60 seconds (MinGW), per CI job.

The downside is that detection results need to be manually collected and
filtered to those that universally apply to all platforms that they are
enabled on. Another downside is that by using a cache, we're not running
the actual detections, and thus won't catch regressions in them. It
means we must make sure that the cache is solid and matches with actual
detections results. An upside is that it gives a rough overview of which
features are available on which platforms. Another upside is pre-filled
values do work for feature detections skipped for cross-builds, e.g.
`HAVE_WRITABLE_ARGV`.

This PR adds a pre-fill cache that supports all Unixes (except OmniOS)
used in CI, and makes it usable with an internal option. It also enables
it for GHA/macos CI jobs, where the maximum savings are. And also for
the two iOS [1] and two Cygwin/MSYS2 jobs. The latters don't have
pre-fill checks and we can drop them if they turn into a hassle.

Saving:
- 10 minutes of CI time per GHA/macos workflow run. [2]
- ~80 seconds per GHA/windows workflow run with Cygwin/MSYS2.
  (offsetting the cost of pre-fill verifications)
- 1.5-10 minutes per GHA/non-native runs with iOS jobs. [3]

You can enable pre-fill locally with `-D_CURL_PREFILL=ON`. It's
experimental, and if you experience a problem, file a PR or an Issue.

This PR also adds a pre-fill checker for macOS and MinGW/MSVC Windows
GHA jobs to catch if the cache diverges from real detections. It also
adds this logic to AppVeyor, but doesn't enable it due to the perf
penalty of 2 minutes mininum.

The pre-fill checker works by configuring out-of-tree with and without
pre-fill, then diffing their `lib/curl_config.h` outputs.

Exceptions are 3 detection results exposed indirectly [4], and missing
to expose 2, of which one is the C89 header `stddef.h`. While we assume
the C99 `stdint.h` available outside iOS. We can expose them in the
future, if necessary.

The pre-fill checks cost in total:
- ~20 seconds for macOS
- ~40 seconds for MinGW on GHA
- ~80 seconds for MSVC on GHA (UWP would be 2x this)

An extra time saving potential is caching type sizes. They are
well-known, and seldom change, esp. in CI. GHA/Windows jobs spend 8-17
seconds per job on these ~12 feature checks. ~5s on Cygwin/MSYS2. Couple
of seconds on other platforms. (This PR doesn't make this optimization.)

Another opportunity is doing the same for autotools, which typically
spends more time in the configuration step than cmake.

[1] Xcode job restored as a
follow-up to be5f20202c1618788b3d8f6d255543638f48bd65 #16302

[2] GHA/macos cmake configure times in seconds:
Job                                              |  Bef. | After |  Gain
:----------------------------------------------- | ----: | ----: | ----:
CM clang GnuTLS !ldap krb5                       |  21.2 |   4.5 |  16.7
CM clang LibreSSL !ldap heimdal c-ares +examples |  13.3 |   3.9 |   9.4
CM clang OpenSSL +static libssh +examples        |  20.0 |   4.6 |  15.4
CM clang OpenSSL IDN clang-tidy~ (w/chkprefill)  |  15.7 |  18.6 |  -2.9
CM clang OpenSSL gsasl rtmp AppleIDN             |  25.0 |   4.7 |  20.3
CM clang OpenSSL torture !FTP                    |  15.3 |   4.5 |  10.8
CM clang OpenSSL torture FTP                     |  25.0 |   5.9 |  19.1
CM clang SecureTransport debug                   |  18.0 |   3.8 |  14.2
CM clang macos-13 SecureTransport                |  45.8 |  12.4 |  33.4
CM clang macos-14 SecureTransport                |  15.8 |   4.6 |  11.2
CM clang macos-15 SecureTransport                |  26.8 |   6.1 |  20.7
CM clang mbedTLS openldap brotli zstd            |  15.1 |   6.5 |   8.6
CM clang wolfSSL !ldap brotli zstd               |  27.0 |   4.4 |  22.6
CM gcc-12 GnuTLS !ldap krb5                      |  39.1 |   8.7 |  30.4
CM gcc-12 LibreSSL !ldap heimdal c-ares +examples|  23.8 |   7.2 |  16.6
CM gcc-12 OpenSSL +static libssh +examples       |  20.7 |   8.5 |  12.2
CM gcc-12 OpenSSL gsasl rtmp AppleIDN            |  23.1 |  10.1 |  13.0
CM gcc-12 SecureTransport debug                  |  21.1 |   4.8 |  16.3
CM gcc-12 mbedTLS openldap brotli zstd           |  21.4 |   5.8 |  15.6
CM gcc-12 wolfSSL !ldap brotli zstd              |  21.1 |   6.9 |  14.2
CM gcc-14 macos-13 SecureTransport               |  61.9 |  18.7 |  43.2
CM gcc-14 macos-14 SecureTransport               |  30.5 |   6.4 |  24.1
CM gcc-14 macos-15 SecureTransport               |  32.7 |   8.4 |  24.3
CM llvm@15 GnuTLS !ldap krb5                     |  21.1 |   7.5 |  13.6
CM llvm@15 LibreSSL !ldap heimdal c-ares +exampl~|  24.6 |   6.8 |  17.8
CM llvm@15 OpenSSL +static libssh +examples      |  19.0 |   6.4 |  12.6
CM llvm@15 OpenSSL gsasl rtmp AppleIDN           |  19.0 |   8.2 |  10.8
CM llvm@15 SecureTransport debug                 |  18.0 |   5.4 |  12.6
CM llvm@15 macos-13 SecureTransport              |  66.2 |  25.7 |  40.5
CM llvm@15 macos-14 SecureTransport              |  31.9 |   6.1 |  25.8
CM llvm@15 mbedTLS openldap brotli zstd          |  19.5 |   8.9 |  10.6
CM llvm@15 wolfSSL !ldap brotli zstd             |  24.3 |   5.9 |  18.4
CM llvm@18 macos-15 SecureTransport              |  33.8 |   6.4 |  27.4
Total                                            | 856.8 | 257.3 | 599.5
Before: https://github.com/curl/curl/actions/runs/13311042735/job/37173478424
After: https://github.com/curl/curl/actions/runs/13313927119/job/37183206426?pr=15841

[3] iOS:
Before: https://github.com/curl/curl/actions/runs/13326401704?pr=15841
After: https://github.com/curl/curl/actions/runs/13332177764?pr=15841

[4] detection results exposed indirectly in `curl_config.h`:
- `HAVE_FILE_OFFSET_BITS` via `_FILE_OFFSET_BITS`
- `HAVE_GETHOSTBYNAME_R_*_REENTRANT` via `NEED_REENTRANT`
- `HAVE_SOCKADDR_IN6_SIN6_ADDR` via `USE_IPV6`

Closes #15841

5 months agocurl_msh3: remove verify bypass from DEBUGBUILDs
Jay Satiro [Sat, 15 Feb 2025 18:32:34 +0000 (13:32 -0500)] 
curl_msh3: remove verify bypass from DEBUGBUILDs

- Remove the workaround that disabled peer verification in DEBUGBUILDs
  when CA certs were provided.

The workaround was part of a TODO that disabled verification in
DEBUGBUILDs with a CAfile/path because apparently there's no way to set
those options in msh3 and that caused some tests to fail. Instead the
tests should fail and this problem should not be covered up.

Ref: https://github.com/curl/curl/pull/16327#issuecomment-2661039423

Closes https://github.com/curl/curl/pull/16342

5 months agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 15 Feb 2025 21:32:44 +0000 (22:32 +0100)] 
RELEASE-NOTES: synced

5 months agodocs: correct argument names & URL redirection
kriztalz [Fri, 14 Feb 2025 12:34:47 +0000 (13:34 +0100)] 
docs: correct argument names & URL redirection

Closes #16334

5 months agowolfssh: retrieve the error using wolfSSH_get_error
Joseph Chen [Fri, 14 Feb 2025 13:53:51 +0000 (21:53 +0800)] 
wolfssh: retrieve the error using wolfSSH_get_error

Closes #16335

5 months agoasyn-thread: avoid the separate curl_mutex_t alloc
Daniel Stenberg [Thu, 6 Feb 2025 16:22:36 +0000 (17:22 +0100)] 
asyn-thread: avoid the separate curl_mutex_t alloc

Just make it a part of the thread_sync_data struct.

Closes #16323

5 months agostrparse: switch to curl_off_t as base data type
Daniel Stenberg [Fri, 14 Feb 2025 10:29:08 +0000 (11:29 +0100)] 
strparse: switch to curl_off_t as base data type

- add hex and octal parsers to the Curl_str_* family
- make curlx_strtoofft use these parsers
- remove all use of strtol() and strtoul() in library code
- generally use Curl_str_* more than strtoofft, for stricter parsing
- supports 64-bit universally, instead of 'long' which differs in size
  between platforms

Extended the unit test 1664 to verify hex and octal parsing.

Closes #16336

5 months agobuild: set `HAVE_WRITABLE_ARGV` for Apple cross-builds
Viktor Szakats [Fri, 14 Feb 2025 16:41:09 +0000 (17:41 +0100)] 
build: set `HAVE_WRITABLE_ARGV` for Apple cross-builds

Enable this feature for Apple cross-builds to match native macOS builds.

Closes #16338

5 months agocmake: drop two stray TLS feature checks for wolfSSL
Viktor Szakats [Fri, 14 Feb 2025 21:38:15 +0000 (22:38 +0100)] 
cmake: drop two stray TLS feature checks for wolfSSL

Drop check for `SSL_set0_wbio`, `SSL_CTX_set_srp_username`.

The wolfSSL backend doesn't implement these features. The checks were
wrong, and also missing from `./configure`.

If they get implemented, the feature checks should use distinct macros
from OpenSSL; they should check for the `wolfSSL_`-prefixed APIs via
wolfSSL headers; and matching checks should be added to `./configure`.

Follow-up to 781242ffa44a9f9b95b6da5ac5a1bf6372ec6257 #11967 #11964

Closes #16339

5 months agowolfssl: when using PQ KEM, use ML-KEM, not Kyber
Anthony Hu [Fri, 14 Feb 2025 16:29:21 +0000 (11:29 -0500)] 
wolfssl: when using PQ KEM, use ML-KEM, not Kyber

Closes #16337

5 months agowarnless: drop curlx_ultous as it is no longer used
Daniel Stenberg [Thu, 13 Feb 2025 13:52:09 +0000 (14:52 +0100)] 
warnless: drop curlx_ultous as it is no longer used

Closes #16319

5 months agotests: change from curlx_ultous to util_ultous
Daniel Stenberg [Thu, 13 Feb 2025 13:50:47 +0000 (14:50 +0100)] 
tests: change from curlx_ultous to util_ultous

Since the former function is getting removed from the lib.

Closes #16319

5 months agolib: use Curl_str_number() for parsing decimal numbers
Daniel Stenberg [Thu, 13 Feb 2025 07:45:43 +0000 (08:45 +0100)] 
lib: use Curl_str_number() for parsing decimal numbers

Instead of strtoul() and strtol() calls.

Easier API with better integer overflow detection and built-in max check
that now comes automatic everywhere this is used.

Closes #16319

5 months agostrparse: make Curl_str_number() return error for no digits
Daniel Stenberg [Fri, 14 Feb 2025 07:46:26 +0000 (08:46 +0100)] 
strparse: make Curl_str_number() return error for no digits

Closes #16319

5 months agocmake: mention 'insecure' in the debug build warning
Viktor Szakats [Thu, 13 Feb 2025 21:02:25 +0000 (22:02 +0100)] 
cmake: mention 'insecure' in the debug build warning

Closes #16327

5 months agotidy-up: delete, comment or scope C macros reported unused
Viktor Szakats [Sun, 9 Feb 2025 17:12:14 +0000 (18:12 +0100)] 
tidy-up: delete, comment or scope C macros reported unused

To reduce the number `-Wunused-macro` compiler warnings:
- delete unused macros.
- comment out unused macro that are part of a set.
- move macros into the scope they are used.

This may be useful to enable by default, but there are tricky cases that
I didn't manage to fix and paused the effort. E.g. internal features
checks in `openssl.c`. There is more, once those are fixed.

Closes #16279

5 months agolib: strtoofft.h header cleanup
Daniel Stenberg [Fri, 14 Feb 2025 09:11:39 +0000 (10:11 +0100)] 
lib: strtoofft.h header cleanup

Drop the include from five C files, add it to one.

Closes #16331

5 months agoHTTP3.md: only speak about minimal versions
Stefan Eissing [Thu, 13 Feb 2025 13:33:26 +0000 (14:33 +0100)] 
HTTP3.md: only speak about minimal versions

Closes #16320

5 months agodocs: add FD_ZERO to curl_multi_fdset example
Harry Sintonen [Thu, 13 Feb 2025 18:33:33 +0000 (20:33 +0200)] 
docs: add FD_ZERO to curl_multi_fdset example

While the examples are not intended to complete applications this is
quite relevant for the correct function of the code.

Closes #16325

5 months agocmake: drop `HAVE_IN_ADDR_T` from pre-fill too [ci skip]
Viktor Szakats [Fri, 14 Feb 2025 00:48:54 +0000 (01:48 +0100)] 
cmake: drop `HAVE_IN_ADDR_T` from pre-fill too [ci skip]

Follow-up to 90b72607fa63d54dc280d20cb73f6df9ee665e02 #16318

5 months agoasyn-thread: avoid the separate 'struct resdata' alloc
Daniel Stenberg [Thu, 6 Feb 2025 16:11:26 +0000 (17:11 +0100)] 
asyn-thread: avoid the separate 'struct resdata' alloc

Instead move the only struct field (start) into the thread_data struct.

Closes #16321

5 months agoasyn-thread: do not allocate thread_data separately
Daniel Stenberg [Thu, 6 Feb 2025 15:05:56 +0000 (16:05 +0100)] 
asyn-thread: do not allocate thread_data separately

Put the full struct into Curl_async since it will be used for every name
resolve anyway.

Closes #16241

5 months agohttp: fix NTLM info message typo
Daniel Stenberg [Wed, 12 Feb 2025 13:50:59 +0000 (14:50 +0100)] 
http: fix NTLM info message typo

Closes #16305

5 months agourlapi: simplify junkscan
Daniel Stenberg [Wed, 12 Feb 2025 14:59:16 +0000 (15:59 +0100)] 
urlapi: simplify junkscan

Makes it smaller and possibly somewhat faster

Closes #16307

5 months agocookie: simplify invalid_octets()
Daniel Stenberg [Wed, 12 Feb 2025 14:36:22 +0000 (15:36 +0100)] 
cookie: simplify invalid_octets()

should also make it marginally faster and smaller.

Closes #16306

5 months agotimediff: fix comment for curlx_mstotv()
Daniel Stenberg [Wed, 12 Feb 2025 21:36:27 +0000 (22:36 +0100)] 
timediff: fix comment for curlx_mstotv()

The max value when explaining the math was wrong.

Closes #16310

5 months agotidy-up: drop unused `CURL_INADDR_NONE` macro and `in_addr_t` type
Viktor Szakats [Thu, 13 Feb 2025 11:05:30 +0000 (12:05 +0100)] 
tidy-up: drop unused `CURL_INADDR_NONE` macro and `in_addr_t` type

Closes #16318

5 months agotests: fix enum/int confusion (Intel C), fix autotools `CFLAGS` for `servers`
Viktor Szakats [Thu, 13 Feb 2025 01:38:51 +0000 (02:38 +0100)] 
tests: fix enum/int confusion (Intel C), fix autotools `CFLAGS` for `servers`

By dropping the unused enum wrappers for `AF_*` macros.

Also fix `./configure` to apply `--enable-werror` options to
`tests/servers`, to catch this next time.

Seen with Intel C compiler:
```
socksd.c(184): warning #188: enumerated type mixed with another type
socksd.c(881): warning #188: enumerated type mixed with another type
[...]
sws.c(76): warning #188: enumerated type mixed with another type
sws.c(229): warning #188: enumerated type mixed with another type
[...]
```
Ref: https://github.com/curl/curl/actions/runs/13296520425/job/37129676921#step:40:338

Closes #16314

5 months agocmake: fix `HAVE_ATOMIC`/`HAVE_STDATOMIC` pre-fill for clang-cl
Viktor Szakats [Thu, 13 Feb 2025 01:56:11 +0000 (02:56 +0100)] 
cmake: fix `HAVE_ATOMIC`/`HAVE_STDATOMIC` pre-fill for clang-cl

`HAVE_ATOMIC` and `HAVE_STDATOMIC` is available in clang-cl builds.
Adjust the pre-filled values accordingly.

Detected by a temporary job comparing pre-filled and actual values
on AppVeyor CI:
https://ci.appveyor.com/project/curlorg/curl/builds/51506692/job/2v8qrytgdnlah348#L416

Closes #16313

5 months agoaddrinfo: add curl macro to avoid redefining foreign symbols
Viktor Szakats [Sun, 9 Feb 2025 04:12:24 +0000 (05:12 +0100)] 
addrinfo: add curl macro to avoid redefining foreign symbols

Before this patch curl code was redefining `getaddrinfo` and
`freeaddrinfo` system symbols to plug in its debug wrappers. This was
causing pains to avoid applying the redefinitions to system headers
defining these functions, and to the local debug wrappers. Especially
in unity builds. It also required workarounds for systems where these
symbols are already macros.

Introduce curl-namespaced macros for these functions and use them.
This allows to drop all workarounds and makes it work in all envs,
local targets and unity/bundle combinations.

Also drop GHA/windows workaround and use the same unity batch across
all jobs. Follow-up to 29e4eda631f46368c2adf833ba3065b1b46c2a7d #16272

Ref: #16272
Ref: 71cf0d1fca9e1f53524e1545ef0c08d174458d80 #14772
Ref: 3efba94f773db5d8ae19e33aa749ab7914cafeea #14765
Ref: f7d5f47059c381502824ef9c1c9a2ca484930c91 #14399

Closes #16274

5 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 13 Feb 2025 10:22:47 +0000 (11:22 +0100)] 
RELEASE-NOTES: synced

Bump to 8.12.2 for now

5 months agomanagen: correct the warning for un-escaped '<' and '>'
Daniel Stenberg [Thu, 13 Feb 2025 07:51:22 +0000 (08:51 +0100)] 
managen: correct the warning for un-escaped '<' and '>'

1. make sure the check is done before the backticks are replaced

2. ignore less-than and greater-than used within backticks

(adjust proxy.md that now showed a two-space warning)

Closes #16315

5 months agostrparse: switch the API to work on 'const char *'
Daniel Stenberg [Thu, 13 Feb 2025 08:00:08 +0000 (09:00 +0100)] 
strparse: switch the API to work on 'const char *'

The functions are not meant to touch the input anyway.

Closes #16316

5 months agolib: better optimized casecompare() and ncasecompare()
Sergey [Thu, 13 Feb 2025 01:14:08 +0000 (17:14 -0800)] 
lib: better optimized casecompare() and ncasecompare()

Less 'jne` or `je` CPU instructions.

Closes #16311

5 months agoRELEASE-NOTES: synced curl-8_12_1
Daniel Stenberg [Thu, 13 Feb 2025 07:11:06 +0000 (08:11 +0100)] 
RELEASE-NOTES: synced

5 months agoTHANKS: add contributors from 8.12.1
Daniel Stenberg [Thu, 13 Feb 2025 07:11:05 +0000 (08:11 +0100)] 
THANKS: add contributors from 8.12.1

5 months agowrite-out.md: add 'header' and 'output' to the variable list
Jay Satiro [Wed, 12 Feb 2025 04:20:22 +0000 (23:20 -0500)] 
write-out.md: add 'header' and 'output' to the variable list

Prior to this change %header{} and %output{} were explained in remarks
but not listed in the --write-out variable list.

Closes https://github.com/curl/curl/pull/16299

5 months agoGHA/linux: drop Linux arm job for runner image flakiness with stunnel4
Viktor Szakats [Wed, 12 Feb 2025 09:35:39 +0000 (10:35 +0100)] 
GHA/linux: drop Linux arm job for runner image flakiness with stunnel4

Since last week the Ubuntu arm runner became flaky while installing `stunnel`.

```
08:07:26 Setting up stunnel4 (3:5.72-1build2) ...
08:07:26 Failed to check if group stunnel4 already exists: Connection refused
08:07:26 Group stunnel4 not found.
08:07:28 Reload daemon failed: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)
08:07:28 Created symlink /etc/systemd/system/multi-user.target.wants/stunnel.target -> /usr/lib/systemd/system/stunnel.target.
08:08:18 Failed to get unit file state for stunnel.target: Connection timed out
08:08:43 Failed to retrieve unit state: Connection timed out
08:08:43 stunnel.target is a disabled or a static unit, not starting it.
08:08:43 /bin/chown: invalid user: â€˜stunnel4:stunnel4’
08:08:43 dpkg: error processing package stunnel4 (--configure):
08:08:43  installed stunnel4 package post-installation script subprocess returned error exit status 1
08:08:43 [...]
08:08:47 Errors were encountered while processing:
08:08:47 stunnel4
08:08:54 Error: Timeout was reached
08:08:55 E: Sub-process /usr/bin/dpkg returned an error code (1)
08:08:55 Error: Process completed with exit code 100.
```
Ref: https://github.com/curl/curl/actions/runs/13280736653/job/37078440398?pr=16300#step:2:94

Closes #16303

5 months agoGHA/non-native: drop cmake Xcode generator iOS job for poor performance
Viktor Szakats [Wed, 12 Feb 2025 09:06:09 +0000 (10:06 +0100)] 
GHA/non-native: drop cmake Xcode generator iOS job for poor performance

The Xcode configure phase is slow. In most cases it's >10x slower than
the GNU Makefile configuration. This is after days of attempts to make
it faster. With GNU Makefile it takes 20-30 seconds, while Xcode can
take 3 to 10 minutes, which sometimes makes the job run out of its time
limit and fail.

CMake recommends this generator, but with such poor, and inconsistent
performance, it isn't practical. It helped detecting an Xcode-specific
CMake script issue, but aside from that it's not adding much value.

9m33s: https://github.com/curl/curl/actions/runs/13280738423/job/37078441164
8m18s: https://github.com/curl/curl/actions/runs/13281140850/job/37079589779
2m50s: https://github.com/curl/curl/actions/runs/13280725335/job/37078375179

Follow-up to 12a6de2f660dd692cce93cb65ce6e3ec126bb531 #16043

Closes #16302

5 months agoGHA: update openssl/openssl to v3.4.1
renovate[bot] [Wed, 12 Feb 2025 08:05:38 +0000 (08:05 +0000)] 
GHA: update openssl/openssl to v3.4.1

Closes #16301

5 months agolibssh2: drop obsolete macros and version checks
Viktor Szakats [Mon, 10 Feb 2025 23:14:47 +0000 (00:14 +0100)] 
libssh2: drop obsolete macros and version checks

Follow-up to 553248f501762735c6aa5531f5748e88aefb5314 #16199

Closes #16292

5 months agocmake: fix/add missing feature detections for Windows/MS-DOS
Viktor Szakats [Sat, 8 Feb 2025 02:20:02 +0000 (03:20 +0100)] 
cmake: fix/add missing feature detections for Windows/MS-DOS

Almost all feature detection results are pre-filled on Windows
for performance, so none of the issues fixed here affected builds.

For good measure, this patch add missing detections and fixes others
to make sure they work even when omitting the pre-fill.

It also fixes detecting IPv6 for MS-DOS.

- fix `HAVE_STRUCT_TIMEVAL` detection for MSVC.
  Follow-up to c1bc090d65b8d7d14e811dd36f5e8674be43dff3 #12495
- add `HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID` detection for Windows.
- fix `HAVE_STRDUP` detection for MSVC.
- fix `HAVE_SNPRINTF` detection for Windows.
  Regression from 8e345057761a8f796403923a96f2c8fd3edca647 #15164
- fix `HAVE_IOCTLSOCKET` detection for non-UWP MSVC.
- exclude `if_nametoindex` detection for Windows.
  Although it exists on Windows, detection, usage and availability is
  complicated, and curl doesn't use it on this platform.
  Regression from 8e345057761a8f796403923a96f2c8fd3edca647 #15164
- move IPv6 detections so that pre-filling and MS-DOS Watt-32
  configuration applies to them. This fixes
  `HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID` detection with MS-DOS.
  Ref: https://github.com/curl/curl/actions/runs/13260511764/job/37015877585#step:7:306
  Follow-up to a3585c9576abccddbd27200058912cef900c3c0f #15543

Also:
- add debug option to test without pre-filling.
- replace `NOT LESS` with `GREATER_EQUAL`

Closes #16278

5 months agocmake: fix to detect `HAVE_OPENSSL_SRP` in MSVC UWP builds
Viktor Szakats [Sat, 8 Feb 2025 14:15:31 +0000 (15:15 +0100)] 
cmake: fix to detect `HAVE_OPENSSL_SRP` in MSVC UWP builds

A deprecation error prevented correct detection in MSVC UWP builds:
```
curl\\bld\\CMakeFiles\\CMakeScratch\\TryCompile-ks2aa4\\CheckSymbolExists.c(8,19):
  error C4996: 'SSL_CTX_set_srp_username': Since OpenSSL 3.0
```
Ref: https://github.com/curl/curl/actions/runs/13242285473/job/36960223663#step:8:898

It seems to be caused by different default warning levels used by
the toolchain (or CMake?): `/W3` for UWP and `/W1` for Windows desktop.

https://github.com/curl/curl/actions/runs/13242285473/job/36960223663#step:8:893 UWP
https://github.com/curl/curl/actions/runs/13242285473/job/36960223262#step:8:445 desktop

Fix by passing the OpenSSL macro suppressing its deprecation warnings.

Cherry-picked from #16287
Closes #16293

5 months agolibssh2: fix to use non-deprecated `libssh2_scp_send64()`
Viktor Szakats [Mon, 10 Feb 2025 22:09:55 +0000 (23:09 +0100)] 
libssh2: fix to use non-deprecated `libssh2_scp_send64()`

Seen in curl-for-win daily, building against libssh2 1.11.2_DEV:
```
curl-for-win/curl/lib/vssh/libssh2.c:2644:9: warning: 'libssh2_scp_send_ex' is deprecated:
  since libssh2 1.2.6. Use libssh2_scp_send64() [-Wdeprecated-declarations]
 2644 |         SCP_SEND(sshc->ssh_session, sshp->path, data->set.new_file_perms,
```
Ref: https://github.com/curl/curl-for-win/actions/runs/13229370277/job/36924363438#step:3:5805

Follow-up to 553248f501762735c6aa5531f5748e88aefb5314 #16199

Closes #16291

5 months agoci: update dependency gnutls/gnutls to v3.8.9
renovate[bot] [Sat, 8 Feb 2025 08:24:49 +0000 (08:24 +0000)] 
ci: update dependency gnutls/gnutls to v3.8.9

Closes #16257

5 months agovquic: make the "disable GSO" use infof, not failf
Daniel Stenberg [Tue, 11 Feb 2025 08:00:08 +0000 (09:00 +0100)] 
vquic: make the "disable GSO" use infof, not failf

... because it is not actually a fail.

Closes #16294

5 months agoKNOWN_BUGS: --interface with link-scoped IPv6 address
Daniel Stenberg [Tue, 11 Feb 2025 08:17:47 +0000 (09:17 +0100)] 
KNOWN_BUGS: --interface with link-scoped IPv6 address

Reported-by: Aaron Deadman
Closes #14782
Closes #16295

5 months agoverbose.md: mention how carriage-return might occur in headers
Daniel Stenberg [Mon, 10 Feb 2025 11:10:57 +0000 (12:10 +0100)] 
verbose.md: mention how carriage-return might occur in headers

Fixes #16285
Reported-by: Andrei Korshikov
Closes #16286

5 months agoruntests.pl: reapply accidental revert
Viktor Szakats [Tue, 11 Feb 2025 00:38:11 +0000 (01:38 +0100)] 
runtests.pl: reapply accidental revert

Reapply an accidental, and unrelated, change committed in
3c128966edc86c89de85f72671f9f627c984af53 which unwantedly reverted
the preceding commit fcd5c2baffff95b858b43bfbc3d03dac2ef1b5ce.

Caused by doing a local rebase when `git am` did not apply cleanly,
and most likely using a local base behind master.

5 months agotests: fix test 558, 1330 for MSVC, allow TrackMemory with MSVC in cmake
Viktor Szakats [Mon, 10 Feb 2025 18:39:41 +0000 (19:39 +0100)] 
tests: fix test 558, 1330 for MSVC, allow TrackMemory with MSVC in cmake

Extend output filter to pick up backslashes. This makes them pass in CI
when run in the vcpkg MSVC job, for example.

Also:
- cmake: allow TrackMemory, aka `ENABLE_CURLDEBUG` again. Drop FIXME.
- cmake: drop stale TODO.
- runtests: include the word 'TrackMemory' in the message disabling it.

Follow-up to 9f23c8f201f55f1a148b41b16a5e71f3385faa5e #14541
Follow-up to 94c596bbc588ff5f37390754be778c47cd70cc91 #16283

Closes #16289

5 months agochecksrc.pl: warn on FIXME/TODO comments
Daniel Stenberg [Mon, 10 Feb 2025 10:20:36 +0000 (11:20 +0100)] 
checksrc.pl: warn on FIXME/TODO comments

5 months agoall: remove FIXME and TODO comments
Daniel Stenberg [Mon, 10 Feb 2025 10:20:48 +0000 (11:20 +0100)] 
all: remove FIXME and TODO comments

We can always improve. These comments tend to linger and go misleading
or plain wrong over time.

Closes #16283

5 months agocmake: fix `HAVE_GETHOSTBYNAME_R_*` detections with `CURL_WERROR=ON`
Viktor Szakats [Mon, 10 Feb 2025 04:57:49 +0000 (05:57 +0100)] 
cmake: fix `HAVE_GETHOSTBYNAME_R_*` detections with `CURL_WERROR=ON`

Fix `HAVE_GETHOSTBYNAME_R_*` feature detections always failing with
`CURL_WERROR=ON` due to stripping a const.

Also fix the GHA/cmake-vs-configure to enable `CURL_WERROR=ON` to sync
this setting with `./configure` which enables it by default. With that,
CI detects this issue.

```
CMake/CurlTests.c:73:19: error: initialization discards â€˜const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   73 |   char *address = "example.com";
      |                   ^~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/13225827821/job/36916564107#step:33:4198

Closes #16282

5 months agoGHA/windows: improve build perf with cmake unity batches
Viktor Szakats [Sat, 8 Feb 2025 23:50:07 +0000 (00:50 +0100)] 
GHA/windows: improve build perf with cmake unity batches

Default curl unity builds make a single unit for each target. It means
all target sources are batched together and built in a single compiler
invocation. With multi-core CPUs this doesn't always result in the best
possible performance. This patch enables smaller batches for jobs where
this resulted in shorter build times. These jobs are Cygwin, MSYS2,
MinGW, running on the Windows runners.

Use batch of 30 (meaning 30 sources batched into units), and 32 for
Cygwin/MSYS2 to avoid a unity fallout that's subject to a different PR.

(CMake allows to set the number of sources per unit, not the number
of units, though the latter may be more practical to max out CPU cores.)

Also override to not batch the `curlu` target because batching lost
a little bit of time there, due to the already existing parallelism when
building the `testdeps` targets.

For jobs on the macOS and Linux runners jobs were already mostly single
digit or below teen seconds, and batching didn't improve on them
noticeably. On VM jobs, the virtual CPUs are limited, so I didn't
make a try. In AppVeyor and GHA vcpkg jobs (using msbuild), batching
didn't result in conclusive or any gains.

Build times in seconds (curl + testdeps):
Job                  |          Before | After w curlu=0 | Gain
:--------------------| :-------------- | :-------------- | :---
cygwin, CM           |   19 + 32 =  51 |  12 +  32 =  44 |    7
msys2, CM            |    7 + 15 =  22 |   5 +  14 =  19 |    3
mingw gcc U, CM      |   19 + 30 =  49 |  13 +  32 =  45 |    4
mingw ucrt, CM       |   32 + 42 =  74 |  15 +  43 =  58 |   16
mingw clang, CM      |   15 + 21 =  36 |   8 +  21 =  29 |    7
mingw uwp, CM        |   30 + 40 =  70 |  14 +  40 =  54 |   16
mingw gcc, CM        |   20 + 31 =  51 |  12 +  31 =  43 |    8
mingw x86, CM        |   35 + 40 =  75 |  15 +  38 =  53 |   22
dl-mingw, CM 9.5.0   |   88 + 99 = 187 |  42 + 101 = 143 |   44
dl-mingw, CM 7.3.0 U |   24 + 32 =  56 |  17 +  35 =  52 |    4
Total                |                 |                 |  131

Total gain per GHA/windows workflow runs: 2m11s

Runs:
Before: https://github.com/curl/curl/actions/runs/13220256084/job/36904342259
After: https://github.com/curl/curl/actions/runs/13220383702/job/36904602981
       https://github.com/curl/curl/actions/runs/13220613141/job/36905170104
       https://github.com/curl/curl/actions/runs/13222019443/job/36908358550
With curlu tweak: https://github.com/curl/curl/actions/runs/13222239255/job/36908782462

Ref: 116950a25066257f86461f9d1dfa5f787f55e73c #16265

Closes #16272

5 months agotool_progress: fix percent output of large parallel transfers
Daniel Stenberg [Mon, 10 Feb 2025 09:15:44 +0000 (10:15 +0100)] 
tool_progress: fix percent output of large parallel transfers

When the total transfered amount (upload or download) for parallel
transfers was larger than 2^63/100 bytes (81 petabytes) the progress
percent counter would show wrong.

Closes #16284

5 months agoKNOWN_BUGS: remove 2.5 client cert handling differs between backends
jethrogb [Tue, 4 Feb 2025 22:52:21 +0000 (23:52 +0100)] 
KNOWN_BUGS: remove 2.5 client cert handling differs between backends

This was resolved in #4958

Closes #16175

5 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 10 Feb 2025 07:43:23 +0000 (08:43 +0100)] 
RELEASE-NOTES: synced

5 months agoGHA/linux: hide progress bar in `apt remove`
Viktor Szakats [Mon, 10 Feb 2025 01:50:06 +0000 (02:50 +0100)] 
GHA/linux: hide progress bar in `apt remove`

Also switch to `apt-get` and drop redundant `--yes` for conistency with
other GHA scripts.

Follow-up to b13e9066b3dfd65ba8aadc336232ae7832ac687a #16127
Closes #16281

5 months agocurl_global_sslset.md: Add SSL backend names
Jay Satiro [Sat, 8 Feb 2025 08:19:27 +0000 (03:19 -0500)] 
curl_global_sslset.md: Add SSL backend names

- Add the names that can be used to select an SSL backend by name.

This change syncs the names in 3 places: curl_global_sslset
documentation, the curl tool environment variable documentation for
CURL_SSL_BACKEND and the libcurl environment variable documentation for
CURL_SSL_BACKEND.

Closes https://github.com/curl/curl/pull/16256

5 months agolib: silence LibreSSL collision warning on non-MSVC Windows
Viktor Szakats [Sun, 9 Feb 2025 01:35:07 +0000 (02:35 +0100)] 
lib: silence LibreSSL collision warning on non-MSVC Windows

LibreSSL headers emit this warning because we included `wincrypt.h`
before them. We have to include `wincrypt.h` before OpenSSL headers
to avoid symbol collisions when using other forks. LibreSSL 3.8.2+
offers a macro to silence its warnings to avoid this issue. This patch
sets it.

This allows to stop setting this macro in curl-for-win builds.

Warnings seen with MinGW with cmake non-unity (also unity batch=30):
```
[156/219] Building C object lib/CMakeFiles/libcurl_object.dir/vtls/openssl.c.obj
In file included from lib/vtls/openssl.h:35,
                 from lib/vtls/openssl.c:53:
dep/libressl-win-x64/include/openssl/ossl_typ.h:90:2: warning: #warning overriding WinCrypt defines [-Wcpp]
   90 | #warning overriding WinCrypt defines
      |  ^~~~~~~
In file included from dep/libressl-win-x64/include/openssl/pem.h:71,
                 from dep/libressl-win-x64/include/openssl/ssl.h:151,
                 from lib/vtls/openssl.h:36:
dep/libressl-win-x64/include/openssl/x509.h:108:2: warning: #warning overriding WinCrypt defines [-Wcpp]
  108 | #warning overriding WinCrypt defines
      |  ^~~~~~~
In file included from dep/libressl-win-x64/include/openssl/x509.h:319:
dep/libressl-win-x64/include/openssl/pkcs7.h:77:2: warning: #warning overriding WinCrypt defines [-Wcpp]
   77 | #warning overriding WinCrypt defines
      |  ^~~~~~~
```

Ref: https://github.com/libressl/portable/issues/910
Ref: https://github.com/libressl/portable/pull/924
Ref: https://github.com/libressl/portable/commit/e7fe6caab2869a043514c297ce04e6995a65d79f
Ref: https://github.com/curl/curl-for-win/commit/760ccfcc9114dbb6d79710a5582323be0f152c9e

Closes #16273

5 months agoasyn-thread: survive a c-ares channel set to NULL
Daniel Stenberg [Fri, 7 Feb 2025 15:40:53 +0000 (16:40 +0100)] 
asyn-thread: survive a c-ares channel set to NULL

When the c-ares setup fails and we get a NULL channel, the resolve still
continues and we just need to survive it and just not get any HTTPS RR.

Reported-by: nono303 on github
Fixes #16216
Closes #16244

5 months agoGHA/appveyor: tidy up quotes
Viktor Szakats [Sun, 9 Feb 2025 02:04:02 +0000 (03:04 +0100)] 
GHA/appveyor: tidy up quotes

5 months agoGHA/windows: bump dl-mingw tests to `-j8`
Viktor Szakats [Sat, 8 Feb 2025 23:01:32 +0000 (00:01 +0100)] 
GHA/windows: bump dl-mingw tests to `-j8`

To match the rest of Windows jobs.

dl-mingw, CM 9.5.0-x86_64 schannel: 4m24s -> 2m56s
dl-mingw, CM 7.3.0-x86_64 schannel U: 4m37s -> 3m10s
(based on a few runs.)

Closes #16271

5 months agodocs: use valid example domain names
Terence Eden [Sat, 8 Feb 2025 22:20:30 +0000 (22:20 +0000)] 
docs: use valid example domain names

Replace .site domains and domain.com with valid example domains.

Fixes #16269
Closes #16270

5 months agoGHA/windows: restore runtests perf with last known good Git for Windows
Viktor Szakats [Sat, 8 Feb 2025 12:51:59 +0000 (13:51 +0100)] 
GHA/windows: restore runtests perf with last known good Git for Windows

Use the last known good release of Git for Windows by installing it
manually. It restores `runtests.pl` performance to the levels before
the October 2024 and this week's fallouts which gradually deployed
MSYS2 runtimes with pipe/signal/concurrency issues.

Also:
- restore vcpkg job's test parallelism to `-j8` (from `-j4`).
- keep using the default shell for jobs not running tests.
  To avoid the unnecessary Git for Windows install overhead.

Upsides:
- good performance again.
- easy to experiment with any version.

Downsides:
- installing the Git for Windows package takes 15-30 seconds.
- we're pinned to an old package version.
- no canary to tell when the issue is fixed on the runner images.

Unknown:
- stability. (no MSYS2 runtimes were ever stable and it's difficult
  to quantify if a version improves or worsens stability/flakiness, and
  intermittent env failures.

Follow-up to 1bf774df57e873d08f0c6e525e6ec3a0f6e62bce #16217
Follow-up to 5f9411f953f35ca84645b5a6824fb9fef20887ed #15380

Closes #16265

5 months agolibssh2: comparison is always true because rc <= -1
Daniel Stenberg [Sat, 8 Feb 2025 21:47:50 +0000 (22:47 +0100)] 
libssh2: comparison is always true because rc <= -1

Pointed out by CodeQL

Closes #16268

5 months agoGHA/http3-linux: fix quictls cache key mismatch
Viktor Szakats [Sat, 8 Feb 2025 17:26:04 +0000 (18:26 +0100)] 
GHA/http3-linux: fix quictls cache key mismatch

Closes #16266

5 months agolib3208: add a final easy_perform as well
Daniel Stenberg [Sat, 8 Feb 2025 11:49:15 +0000 (12:49 +0100)] 
lib3208: add a final easy_perform as well

Make the test also verify using the handle in the other order.

Closes #16262

5 months agovtsl: eliminate 'data->state.ssl_scache'
Stefan Eissing [Sat, 8 Feb 2025 11:49:34 +0000 (12:49 +0100)] 
vtsl: eliminate 'data->state.ssl_scache'

Keeping the relevant 'ssl_scache' in 'data->state' leads to problems
when the owner of the cache is cleaned up and this reference is left
dangling.

Remove the ref entirely and always find the ssl_scache at the current
share or multi.

Folded in #16260 (test 3208) to verify this fixes the bug with a
dangling reference when an easy handle is used with easy_perform first
and in a multi_perform after.

Ref: #16236
Closes #16261

5 months agovtls: fix multissl-init
Daniel Stenberg [Sat, 8 Feb 2025 09:45:31 +0000 (10:45 +0100)] 
vtls: fix multissl-init

Regression since and follow-up to 2bf48b48b3e564bcbf3249.

Don't call init functions set to NULL.

Fixes #16253
Reported-by: thisisgk on github
Closes #16258

5 months agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 8 Feb 2025 09:53:00 +0000 (10:53 +0100)] 
RELEASE-NOTES: synced

5 months agorelease-notes.pl: manage more "closes" typos
Daniel Stenberg [Sat, 8 Feb 2025 09:51:27 +0000 (10:51 +0100)] 
release-notes.pl: manage more "closes" typos

5 months agoCURLSHOPT_SHARE.md: adjust for the new SSL session cache
Michael Kaufmann [Fri, 7 Feb 2025 16:20:44 +0000 (17:20 +0100)] 
CURLSHOPT_SHARE.md: adjust for the new SSL session cache

curl 8.12.0 introduced an improved SSL session cache. All easy handles
that are added to the same multi handle automatically use the multi
handle's SSL session cache.

Clsoes #16245

5 months agoopenssl: fix out of scope variables in goto
Daniel Stenberg [Fri, 7 Feb 2025 22:34:49 +0000 (23:34 +0100)] 
openssl: fix out of scope variables in goto

Some of the 'goto fail' situations could happen without having
initialized the local variables referenced in the error code flow.

Reported-by: Marcel Raad
Fixes #16246
Closes #16251

5 months agogenerate.bat: remove curl_get_line.c from the curlx file list
Jay Satiro [Fri, 7 Feb 2025 18:08:45 +0000 (13:08 -0500)] 
generate.bat: remove curl_get_line.c from the curlx file list

Follow-up to d8618f4d which did the same for the other build systems.

Closes https://github.com/curl/curl/pull/16248

5 months agoscache: add magic checks
Stefan Eissing [Fri, 7 Feb 2025 13:57:50 +0000 (14:57 +0100)] 
scache: add magic checks

DEBUGASSERT for debug builds, otherwise log failure and return error
code where possible.

Closes #16240

5 months agocmake: save a line with `CMAKE_C_IMPLICIT_LINK_DIRECTORIES` exclusion
Viktor Szakats [Fri, 7 Feb 2025 11:04:16 +0000 (12:04 +0100)] 
cmake: save a line with `CMAKE_C_IMPLICIT_LINK_DIRECTORIES` exclusion

Also mind the quotes:
https://github.com/curl/curl/pull/16233#issuecomment-2642603412

Follow-up to f72b84809216657e4ad3c1a0184775c911080d63 #16233
Closes #16243

5 months agocmake: respect `GNUTLS_CFLAGS` when detected via `pkg-config`
Viktor Szakats [Fri, 7 Feb 2025 12:15:57 +0000 (13:15 +0100)] 
cmake: respect `GNUTLS_CFLAGS` when detected via `pkg-config`

Closes #16242

5 months agowakeup_write: make sure the eventfd write sends eight bytes
Daniel Stenberg [Fri, 7 Feb 2025 13:57:36 +0000 (14:57 +0100)] 
wakeup_write: make sure the eventfd write sends eight bytes

The eventfd manpage says:

  A write(2) fails with the error EINVAL if the size of the supplied
  buffer is less than 8 bytes

When doing x32 on a 64-bit system, pointers are still four bytes so this
code must not use the size of a pointer but the size of a 64-bit type.

Fixes #16237
Reported-by: Jan Engelhardt
Closes #16239

5 months agoasyn-thread: fix build with `CURL_DISABLE_SOCKETPAIR`
Marcel Raad [Wed, 5 Feb 2025 09:46:30 +0000 (10:46 +0100)] 
asyn-thread: fix build with `CURL_DISABLE_SOCKETPAIR`

With `CURL_DISABLE_SOCKETPAIR` defined and `USE_HTTPSRR_ARES`
undefined, the local variable `socketi` was unused.

This fixes a regression from commit 0d4fdbf15d8.

Closes https://github.com/curl/curl/pull/16179

5 months agotidy-up: make per-file `ARRAYSIZE` macros global as `CURL_ARRAYSIZE`
Viktor Szakats [Tue, 28 Jan 2025 11:09:55 +0000 (12:09 +0100)] 
tidy-up: make per-file `ARRAYSIZE` macros global as `CURL_ARRAYSIZE`

Closes #16111

5 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 7 Feb 2025 12:34:26 +0000 (13:34 +0100)] 
RELEASE-NOTES: synced