]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
11 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 13 Jan 2025 09:41:12 +0000 (10:41 +0100)] 
RELEASE-NOTES: synced

11 months agomultihandle: add an ssl_scache here
Daniel Stenberg [Sun, 12 Jan 2025 16:35:39 +0000 (17:35 +0100)] 
multihandle: add an ssl_scache here

The TLS session cache is now held by the multi handle unless it is
shared, so that all easy handles within a multi handle get the benefit
of sharing the same, larger, cache.

The multi handle session cache size is set to 25, unless it is the
internal one used for the easy interface - which still uses only 3.

Closes #15982

11 months agochecksrc: use 'banfunc' proper in more places
Daniel Stenberg [Mon, 13 Jan 2025 07:26:15 +0000 (08:26 +0100)] 
checksrc: use 'banfunc' proper in more places

11 months agoexamples: use return according to code style
Daniel Stenberg [Mon, 13 Jan 2025 07:24:00 +0000 (08:24 +0100)] 
examples: use return according to code style

11 months agochecksrc: check for return with parens around a value/name
Daniel Stenberg [Sun, 12 Jan 2025 21:52:13 +0000 (22:52 +0100)] 
checksrc: check for return with parens around a value/name

Ref: #15979
Closes #15983

11 months agocurl-functions.m4: fix indentation in `CURL_SIZEOF()`
Viktor Szakats [Sat, 11 Jan 2025 11:55:02 +0000 (12:55 +0100)] 
curl-functions.m4: fix indentation in `CURL_SIZEOF()`

Closes #15981

11 months agocmake: pick a better IPv6 feature flag when assembling the feature list
Viktor Szakats [Sat, 11 Jan 2025 12:27:51 +0000 (13:27 +0100)] 
cmake: pick a better IPv6 feature flag when assembling the feature list

Before this patch it used `ENABLE_IPV6`, the configuration intent.
Replace with `USE_IPV6` which is the actual setting passed to C.

The two can be different for targets without IPv6 support.

Closes #15980

11 months agotidy-up: drop parenthesis around `return` values
Viktor Szakats [Sat, 11 Jan 2025 17:46:39 +0000 (18:46 +0100)] 
tidy-up: drop parenthesis around `return` values

Closes #15979

11 months agoconfig: drop unused code and variables
Viktor Szakats [Sun, 12 Jan 2025 10:57:24 +0000 (11:57 +0100)] 
config: drop unused code and variables

- cmake, config-*: drop unused `PACKAGE*`, `VERSION` variables.
- config-win32: indentation
- config-win32ce: drop mingw-specific code.
  This header is not used with MinGW.
- config-win32ce: `_WIN64` is never true for Windows CE, drop.

Closes #15978

11 months agocmake: drop VS2010 "Dialog Hell" workaround added in 2013
Viktor Szakats [Sun, 12 Jan 2025 02:25:36 +0000 (03:25 +0100)] 
cmake: drop VS2010 "Dialog Hell" workaround added in 2013

Delete the workaround added via a94a68a3c1d04ccb53e46baa69753bbf6354ee14
(2013-02-04). The commit message has no details. The comment mentions
"Dialog Hell", and seems to fix CMake missing to regenerate `CURL.sln`
with VS2010. It also added a FIXME saying the workaround can be deleted
with future versions of CMake.

At the time CMake's latest version was v2.8.10.

curl now requires v3.7 (2018) minimum, and v3.24 (2022) was the
latest CMake natively supporting VS2010. Assume this has since been
fixed.

Also: format an MSVC version reference in comment.

Closes #15973

11 months agoconfigure: streamline Windows large file feature check
Viktor Szakats [Sat, 11 Jan 2025 23:55:32 +0000 (00:55 +0100)] 
configure: streamline Windows large file feature check

Before this patch the `CURL_CHECK_WIN32_LARGEFILE` feature check was
running an `AC_COMPILE` snippet that always succeeded. (except for
Windows CE, which isn't supported in other parts of `./configure` yet.)

The only Windows toolchain autotools supports is mingw. Of them, curl
only supports mingw-w64. All mingw-w64 versions support large files.
This allows to drop the check and assume it supported on Windows. To not
lose Windows CE support, rework that too, without using `AC_COMPILE`.

Drop the feature check altogether for non-Windows targets.

Ref: https://github.com/curl/curl/pull/15968#discussion_r1912158201
Follow-up to 7eb4ddb850d3757ac9e0b60b0198bbb11e83135e #15968

Closes #15971

11 months agosystem.h: fix indentation
Viktor Szakats [Sun, 12 Jan 2025 02:53:07 +0000 (03:53 +0100)] 
system.h: fix indentation

Closes #15974

11 months agomsvc: require VS2005 for large file support
Viktor Szakats [Thu, 9 Jan 2025 15:17:08 +0000 (16:17 +0100)] 
msvc: require VS2005 for large file support

Large file support requires `_fseeki64()`. This function is offered in
VS2005 and upper.

VS2003 has it in the static CRT only, with declaration missing from
headers, so it's not usable.

Ref: https://archive.org/details/X10-38445 (MS Visual Studio .NET 2003)
Ref: 8b76a8aeb21c8ae2261147af1bddd0d4637c252c #15526

Closes #15958

11 months agocurl_setup: fix missing `ADDRESS_FAMILY` type in rare build cases
Viktor Szakats [Fri, 10 Jan 2025 15:58:48 +0000 (16:58 +0100)] 
curl_setup: fix missing `ADDRESS_FAMILY` type in rare build cases

Build failed when both `ADDRESS_FAMILY` and `sockaddr_un` stuct were
missing from the Windows SDK, with UnixSockets enabled.

Seen with GNU 4.4.0 in CeGCC 0.59.1:
```
lib/curl_setup.h:983: error: expected specifier-qualifier-list before 'ADDRESS_FAMILY'
lib/curl_setup.h:985: warning: struct has no members
```

Also reported with VS2003:
https://datagirl.xyz/posts/wolfssl_curl_w2k.html

Closes #15969

11 months agowindows: drop redundant `USE_WIN32_SMALL_FILES` macro
Viktor Szakats [Sat, 11 Jan 2025 02:22:10 +0000 (03:22 +0100)] 
windows: drop redundant `USE_WIN32_SMALL_FILES` macro

In effect it meant `_WIN32 && !USE_WIN32_LARGE_FILES`.
Replace it with these macros.

Also:
- configure: delete tautological check for small file support.
- configure: delete stray `_MSC_VER` reference. autotools does not
  support MSVC.
- drop tautological checks for WinCE in `config-win32*.h` when setting
  `USE_WIN32_LARGE_FILES`.
- merge related PP logic.
- prefer `#ifdef`, fix whitespace.

Suggested-by: Marcel Raad
Report: https://github.com/curl/curl/pull/15952#issuecomment-2580092328

Closes #15968

11 months agotidy-up: `curl_setup.h`, `curl_setup_once.h`, `config-win32ce.h`
Viktor Szakats [Fri, 10 Jan 2025 23:36:10 +0000 (00:36 +0100)] 
tidy-up: `curl_setup.h`, `curl_setup_once.h`, `config-win32ce.h`

- drop unused `LIBIDN_REQUIRED_VERSION` macro.
  Unused since 9c91ec778104ae3b744b39444d544e82d5ee9ece

- drop compatibility error for `CURL_WANTS_CA_BUNDLE_ENV`.
  This macro was once set by `Makefile.mk` and Watcom makefiles.
  They are no longer supported, making the compatibility message moot.

  Follow-up to 7d7346519d8bff513f9ed9f0c5e709782b159e5a #1542 (2017)
  Follow-up to c2aeb1b3ba09af8b2e555eafa94dd9c534426bfb #1538 (2017)

- document last MSVC supporting the `!_MT` condition
  Ref: https://stackoverflow.com/questions/2278919/are-the-time-functions-of-msvc-thread-safe

- flatten an `#if` tree, prefer `#ifdef`.

- fix/adjust indentation, whitespace.

Closes #15967

11 months agomsvc: tidy up `_CRT_*_NO_DEPRECATE` definitions
Viktor Szakats [Thu, 9 Jan 2025 17:19:35 +0000 (18:19 +0100)] 
msvc: tidy up `_CRT_*_NO_DEPRECATE` definitions

Dedupe and migrate MSVC-specific warning suppressions to `curl_setup.h`.
Make cmake set `_CRT_SECURE_NO_DEPRECATE` for examples and standalone
tests, and stop setting `_CRT_NONSTDC_NO_DEPRECATE` for them.

Details:
- drop version guards. On ancient MSVC version these macro are a no-op.
- move to `curl_setup.h` from `config-win32*.h`.
- sync macro values with CMake.
- cmake: stop setting them globally in favour of `curl_setup.h`.
- cmake: re-add these macros to `docs/examples` and `tests/http/clients`,
  which do not use `curl_setup.h`.
- cmake: drop `_CRT_NONSTDC_NO_DEPRECATE` for examples and tests.
  They build fine without.
- update comments.

Closes #15960

11 months agocmake: formatting [ci skip]
Viktor Szakats [Sat, 11 Jan 2025 12:34:43 +0000 (13:34 +0100)] 
cmake: formatting [ci skip]

11 months agoci: update actions/upload-artifact digest to 65c4c4a
renovate[bot] [Fri, 10 Jan 2025 17:22:48 +0000 (17:22 +0000)] 
ci: update actions/upload-artifact digest to 65c4c4a

Closes #15964

11 months agoci: update rojopolis/spellcheck-github-actions digest to 9e0a5fb
renovate[bot] [Tue, 7 Jan 2025 19:14:48 +0000 (19:14 +0000)] 
ci: update rojopolis/spellcheck-github-actions digest to 9e0a5fb

Closes #15933

11 months agosystem.h: drop duplicate and no-op code
Viktor Szakats [Fri, 10 Jan 2025 19:17:37 +0000 (20:17 +0100)] 
system.h: drop duplicate and no-op code

- drop duplicate declaration block under `__MVS__`.
- drop duplicate declaration block under `__IBMC__`.
- drop empty `#if` branches under `__IBMC__`.

Closes #15966

11 months agosystem.h: drop compilers lacking 64-bit integer type (Windows/MS-DOS)
Viktor Szakats [Thu, 9 Jan 2025 14:42:34 +0000 (15:42 +0100)] 
system.h: drop compilers lacking 64-bit integer type (Windows/MS-DOS)

- DJGPP 1.x (including `__GO32__`) (MS-DOS)
  DJGPP 2.x support remains unchanged.
- Salford C (Windows)
- Turbo C (Windows 16-bit)
- Borland C++ < 5.2 (Windows 16-bit?)
- Pelles C < 2.8 (Windows)

These targets mapped `curl_off_t` to `long`. On Windows and MS-DOS
`long` is always 32-bit.

curl requires C compilers supporting 64-bit `curl_off_t` type since
835682661c7a36b0e860c978204e8cd9b033be45 #10597 (v8.0.0).

Also: drop remaining `__GO32__` and Salford C guards.

Closes #15957

11 months agobuild: fix `-Wtrampolines` picky warning for gcc 4.x versions
Viktor Szakats [Fri, 10 Jan 2025 10:03:16 +0000 (11:03 +0100)] 
build: fix `-Wtrampolines` picky warning for gcc 4.x versions

Caused an error when using cmake with gcc 4.4 and 4.5.
Also 4.3 when using autotools.

Seen with GNU 4.4.0 in CeGCC 0.59.1:
```
cc1: error: unrecognized command line option "-Wtrampolines"
```

`-Wtrampolines` requires gcc 4.6 or upper.

Ref: https://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Warning-Options.html
Ref: https://master.dl.sourceforge.net/project/cegcc/cegcc/0.59.1/cegcc_mingw32ce_snowleopard_r1397.tar.bz2

Closes #15962

11 months agocmake: deprecate winbuild, add migration guide from legacy build methods
Viktor Szakats [Mon, 6 Jan 2025 22:34:19 +0000 (23:34 +0100)] 
cmake: deprecate winbuild, add migration guide from legacy build methods

We recommend migrating to CMake from winbuild and Visual Studio project
files. winbuild is deprecated and will be dropped in September 2025.

CMake supports all the features and options, with new ones added
promptly. It supports out-of-tree, unity and documentation builds.

- deprecate winbuild method in favour of CMake by September 2025.
- add migration guide from winbuild to CMake.
- add migration guide from Visual Studio Project Files to CMake.
- add deprecation message to winbuild.
  Need to ack with `WINBUILD_ACKNOWLEDGE_DEPRECATED=yes`
Authored-by: Jay Satiro
- mention `CMAKE_BUILD_TYPE` option in `INSTALL-CMAKE`.
- document missing `SSH_PATH` winbuild option.

Closes #15920

11 months agomsvc: assume `_INTEGRAL_MAX_BITS >= 64`
Viktor Szakats [Thu, 9 Jan 2025 13:58:24 +0000 (14:58 +0100)] 
msvc: assume `_INTEGRAL_MAX_BITS >= 64`

curl requires C compilers supporting 64-bit `curl_off_t` type since
835682661c7a36b0e860c978204e8cd9b033be45 #10597 (v8.0.0).

Assume the MSVC compiler offers the necessary support.

It makes curl require Visual Studio .NET 2003, v7.1 (`_MSC_VER = 1310`).
With the possibility that 1300 (Visual Studio .NET, v7.0, 2002), or 1200
(Visual C++, 32-bit, v6.0, 1998) may also work.

Follow-up to ca18198dd4d6517bd2d8b34a99fcd9d4f780d219 #15952
Closes #15955

11 months agossl session cache: change cache dimensions
Stefan Eissing [Thu, 9 Jan 2025 10:18:31 +0000 (11:18 +0100)] 
ssl session cache: change cache dimensions

Use a larger one when shared.

Closes #15953

11 months agoRELEASE-NOTES: bump cmdline options and number of public funcs
Daniel Stenberg [Fri, 10 Jan 2025 07:54:49 +0000 (08:54 +0100)] 
RELEASE-NOTES: bump cmdline options and number of public funcs

11 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 10 Jan 2025 07:47:27 +0000 (08:47 +0100)] 
RELEASE-NOTES: synced

11 months agocompletion.pl: add completion for paths after @ for fish
Asger Hautop Drewsen [Tue, 7 Jan 2025 14:56:52 +0000 (15:56 +0100)] 
completion.pl: add completion for paths after @ for fish

Closes #15928

11 months agoECH: update APIs to those agreed with OpenSSL maintainers
sftcd [Wed, 8 Jan 2025 20:08:15 +0000 (20:08 +0000)] 
ECH: update APIs to those agreed with OpenSSL maintainers

Closes #15945

11 months agocookie: cap expire times to 400 days
Daniel Stenberg [Wed, 8 Jan 2025 09:19:26 +0000 (10:19 +0100)] 
cookie: cap expire times to 400 days

The pending cookie RFC update (currently known as 6265bis draft-19) says

  Let cookie-age-limit be the maximum age of the cookie (which name of
  Max-Age and an attribute-value of expiry-time. SHOULD be 400 days or
  less.

This change makes received cookies over the wire get capped to 400 days.

It does not cap the expiry date of cookies loaded from file.

It does this by rounding the expire time to a even minute. This, to
allow the test suite to do the same and have a chance to get the same
number for stable testing without requiring a debug build.

The test script generates TWO numbers in the output file for each
%days[] used in the input test file, and the function that subsequently
compares and verifies output is fine with *either* of the two numbers.

This is done so that if the test case is generated the second
immediately before curl runs, that updated expiry number is also deemed
okay. It still checks for an exact match of either number.

Closes #15937

11 months agoGnuTLS: fix 'time_appconnect' for early data
Stefan Eissing [Thu, 9 Jan 2025 12:09:50 +0000 (13:09 +0100)] 
GnuTLS: fix 'time_appconnect' for early data

When using early data with GnuTLS, the the timer `appconnect`
had the value from the "pretended" connect, not when the actual
TLS handshake was done.

Closes #15954

11 months agovtls_scache: fix possible null ptr deref
Daniel Stenberg [Thu, 9 Jan 2025 07:31:32 +0000 (08:31 +0100)] 
vtls_scache: fix possible null ptr deref

Pointed out by CodeSonar. It is probably not reachable, but might as
well just add a precaution.

Closes #15950

11 months agotool_ssls: fix "ignored return value" warning
Daniel Stenberg [Thu, 9 Jan 2025 07:25:36 +0000 (08:25 +0100)] 
tool_ssls: fix "ignored return value" warning

Pointed out by CodeSonar. While harmless, we might as well address it.

Closes #15949

11 months agovtls_scache: avoid a "Redundant Condition"
Daniel Stenberg [Thu, 9 Jan 2025 07:20:22 +0000 (08:20 +0100)] 
vtls_scache: avoid a "Redundant Condition"

Pointed out by CodeSonar. "ssl_config" can in fact not be NULL here.
Made it an assert instead.

Closes #15948

11 months agomsvc: drop checks for `_MSC_VER >= 900`
Viktor Szakats [Thu, 9 Jan 2025 11:00:56 +0000 (12:00 +0100)] 
msvc: drop checks for `_MSC_VER >= 900`

It's Visual C++, 32-bit, version 2.0, released in 1993. Used to verify
if `_INTEGRAL_MAX_BITS` is available.

After this patch we assume `_INTEGRAL_MAX_BITS` is always available in
MSVC.

Closes #15952

11 months agomsvc: drop checks for ancient versions
Viktor Szakats [Thu, 9 Jan 2025 02:33:03 +0000 (03:33 +0100)] 
msvc: drop checks for ancient versions

- drop version guard for `__inline`.
  Supported since `_MSC_VER` 1000.
  Visual C++, 32-bit, version 4.0 (1996)

- drop version guard for `__declspec(noreturn)` and `__forceinline`.
  Supported since `_MSC_VER` 1200.
  Visual C++, 32-bit, version 6.0 (1998)

For ancient versions, it's possible to override the default behaviour
by setting these macros via `CPPFLAGS`: `CURL_NORETURN`, `CURL_INLINE`,
`CURL_FORCEINLINE`

Closes #15946

11 months agoGHA/windows: add wolfSSL to MSVC MultiSSL job
Tal Regev [Thu, 9 Jan 2025 05:13:39 +0000 (07:13 +0200)] 
GHA/windows: add wolfSSL to MSVC MultiSSL job

Follow-up to 98932f34879bba86339b8ca94ba04aa994c744f8 #15765

Closes #15438

11 months agocurl_trc: repair build with verbose strings disabled
Daniel Stenberg [Thu, 9 Jan 2025 07:49:15 +0000 (08:49 +0100)] 
curl_trc: repair build with verbose strings disabled

- moved the dummy functions into the C file, made them non-static
- added a Curl_trc_ssls dummy

Closes #15951

11 months agocmake: update a comment [ci skip]
Viktor Szakats [Thu, 9 Jan 2025 03:11:35 +0000 (04:11 +0100)] 
cmake: update a comment [ci skip]

Follow-up to 421e592db25cbbe4baadfeef8e6ed75a57579d0a #15832

11 months agotidy-up: delete stray references from autotools, docs
Viktor Szakats [Wed, 8 Jan 2025 18:37:33 +0000 (19:37 +0100)] 
tidy-up: delete stray references from autotools, docs

- autotools: delete stray `VC14_LIB*` references.
- autotools: delete (now) empty `CLEANFILES`.
- autotools: delete no longer used lib/src .inc includes in root makefile.
- autotools: delete stray `cygwinbin` target.
- autotools: delete stray `pkgadd` target (Solaris).
- lib, src: delete stray files from `.gitignore`.
- INSTALL.md: delete reference to non-existing `src/config-win32.h`.
- lib/config-win32ce.h: whitespace.
- lib/config-win32ce.h: sync comments with `config-win32.h`.

Closes #15944

11 months agobuild: delete `-Wsign-conversion` related FIXMEs
Viktor Szakats [Wed, 8 Jan 2025 11:19:11 +0000 (12:19 +0100)] 
build: delete `-Wsign-conversion` related FIXMEs

We decided last year not to pursue avoiding this warning, because it
adds noise and friction, while in most cases not revealing actual code
issues. We fixed the interesting portion of them throughout mid-2024.

Conclude this effort by deleting related FIXMEs and temporary comments.

Follow-up to 3829759bd042c03225ae862062560f568ba1a231 #12489
Closes #15939

11 months agoDEPRECATE: remove msh3 in six months
Daniel Stenberg [Tue, 7 Jan 2025 17:06:24 +0000 (18:06 +0100)] 
DEPRECATE: remove msh3 in six months

The msh3 backed for QUIC and HTTP/3 was introduced in April 2022 but has
never been made to work properly. It has seen no visible traction or
developer activity from the msh3 main author (or anyone else seemingly
interested) in two years. As a non-functional backend, it only adds
friction and "weight" to the development and maintenance.

Meanwhile, we have a fully working backend in the ngtcp2 one and we have
two fully working backends in OpenSSL-QUIC and quiche well on their way
of ending their experimental status in a future.

We remove msh3 support from the curl source tree in July 2025.

Closes #15931

11 months agoosslq: use SSL_poll to determine writeability of QUIC streams
Neil Horman [Fri, 3 Jan 2025 15:17:56 +0000 (10:17 -0500)] 
osslq: use SSL_poll to determine writeability of QUIC streams

This discussion:
https://github.com/openssl/openssl/discussions/23339#discussion-6094341

Specifically item number 2 (Send Blocking) was raised by the curl team,
noting that SSL_want_write returning false was not a good indicator of
when a stream is writeable. The suggestion in that discussion was to use
SSL_poll with an SSL_POLL_EVENT_W flag instead, as that is a proper
indication of when an SSL_object will allow writing without blocking.

While ssl_want_write updates its state based on the last error
encountered (implying a need to retry an operation to update the
last_error state again), SSL_poll checks stream buffer status during the
call, giving it more up to date information on request. This is the
method used by our guide demos (quic-hq-interop specifically), and it
works well.

This change has been run through the curl test suite, and shown to pass
all tests. However, given the initial problem description I'm not sure
if there is a test case that explicitly checks for blocking and
unblocking of streams. As such some additional testing may be warranted.

Closes #15909

11 months agoscripts/delta: add number of days since first httpget release
Daniel Stenberg [Wed, 8 Jan 2025 22:48:48 +0000 (23:48 +0100)] 
scripts/delta: add number of days since first httpget release

11 months agoHTTP/2: strip TE request header
Stefan Eissing [Wed, 8 Jan 2025 15:34:38 +0000 (16:34 +0100)] 
HTTP/2: strip TE request header

The TE request header field is invalid in HTTP/2. Since clients may not
know in advance if a connection negotiates HTTP/2, automatically strip
such a header when h2 is in play.

Add test_01_10 to verify.

Reported-by: Jiri Stary
Fixes #15941
Closes #15943

11 months agovtls: feature ssls-export for SSL session im-/export
Stefan Eissing [Tue, 7 Jan 2025 11:41:26 +0000 (12:41 +0100)] 
vtls: feature ssls-export for SSL session im-/export

Adds the experimental feature `ssls-export` to libcurl and curl for
importing and exporting SSL sessions from/to a file.

* add functions to libcurl API
* add command line option `--ssl-sessions <filename>` to curl
* add documenation
* add support in configure
* add support in cmake
+ add pytest case

Closes #15924

11 months agoappveyor: tidy up shell code
Viktor Szakats [Wed, 8 Jan 2025 12:03:20 +0000 (13:03 +0100)] 
appveyor: tidy up shell code

Closes #15940

11 months agoappveyor: bump VS2008 jobs to VS2010
Viktor Szakats [Tue, 7 Jan 2025 22:44:32 +0000 (23:44 +0100)] 
appveyor: bump VS2008 jobs to VS2010

VS2008 has been partly broken for a while with its shared-debug builds
crashing on startup. Its compiler output (UTF-16 HTML) was also barely
readable even after conversion. It's also the only platform in CI
missing `stdint.h`.

This patch migrates a VS2008 job to VS2010 and drops another that
already had a VS2010 equivalent.

We recommend switching to VS2010 or newer when using MSVC to build curl.

Ref: #15907
Closes #15934

11 months agoappveyor: always use cmake `-A` option to select x64
Viktor Szakats [Tue, 7 Jan 2025 23:04:20 +0000 (00:04 +0100)] 
appveyor: always use cmake `-A` option to select x64

The `Win64` generator suffix alternative was required by old CMake
versions (<3.1) only:
https://cmake.org/cmake/help/v3.22/generator/Visual%20Studio%2010%202010.html

Closes #15935

11 months agoappveyor: reorder builds to get useful results earlier
Viktor Szakats [Tue, 7 Jan 2025 18:32:38 +0000 (19:32 +0100)] 
appveyor: reorder builds to get useful results earlier

Also to align with existing VS2010. Keeping the VS2008 job first to give
a quick sniff test for MSVC builds.

Follow-up to 08ff33e483e15b003de169cef33ca7cb6b6a32c0 #15923
Follow-up to 50f6a6b1d419c9e6ebc4fb2a848fa20def622d38 #15926

Closes #15932

11 months agoGHA/windows: drop MSH3 job (broken after 0.7.0 bump)
Viktor Szakats [Tue, 7 Jan 2025 14:45:10 +0000 (15:45 +0100)] 
GHA/windows: drop MSH3 job (broken after 0.7.0 bump)

Starting GHA runner image 20250105.1.0.

As seen on Linux with 0.7.0:
```
/home/runner/msh3/include/msh3.h:377:18: error: width of â€˜RESERVED’ exceeds its type
  377 |             bool RESERVED                 : 5;
      |                  ^~~~~~~~
/home/runner/msh3/include/msh3.h:490:18: error: width of â€˜RESERVED’ exceeds its type
  490 |             bool RESERVED            : 7;
      |                  ^~~~~~~~
```
https://github.com/curl/curl/actions/runs/12655717818/job/35266716846#step:35:195

Bug: https://github.com/curl/curl/pull/15924#issuecomment-2575106711
Bug: https://github.com/curl/curl/pull/15930#issuecomment-2575842486

Closes #15927

11 months agocontent_encoding: namespace GZIP flag constants
Viktor Szakats [Tue, 7 Jan 2025 14:59:47 +0000 (15:59 +0100)] 
content_encoding: namespace GZIP flag constants

To avoid collision with a 3rd-party `RESERVED` symbols.

This symbol is used in the public header of MSH3 0.7.0.

Closes #15929

11 months agocookie: small variable type cleanups
Daniel Stenberg [Tue, 7 Jan 2025 08:05:58 +0000 (09:05 +0100)] 
cookie: small variable type cleanups

- bump cookie counter and "creation time" to use 'unsigned int'
- use BIT() for single-bit struct field
- make invalid_octets() return bool properly

Closes #15921

11 months agocmake: pre-fill `HAVE_STDINT_H` on Windows
Viktor Szakats [Tue, 7 Jan 2025 10:02:10 +0000 (11:02 +0100)] 
cmake: pre-fill `HAVE_STDINT_H` on Windows

Closes #15925

11 months agoappveyor: fixup job name
Viktor Szakats [Tue, 7 Jan 2025 14:02:15 +0000 (15:02 +0100)] 
appveyor: fixup job name

Follow-up to 50f6a6b1d419c9e6ebc4fb2a848fa20def622d38 #15926

11 months agomsvc: add VS2012 CI job, fix compiler warnings in LDAP and tests
Viktor Szakats [Tue, 7 Jan 2025 12:56:09 +0000 (13:56 +0100)] 
msvc: add VS2012 CI job, fix compiler warnings in LDAP and tests

Follow-up to 8cfc936f5c9d1fe9a99956a916f95e137476b27c #10674
Follow-up to d620ec67913b2c4be25e7d72f1933f0a8a3e0a2e #14700

Closes #15926

11 months agomsvc: fix building with `HAVE_INET_NTOP` and MSVC <=1900
Viktor Szakats [Tue, 7 Jan 2025 09:48:57 +0000 (10:48 +0100)] 
msvc: fix building with `HAVE_INET_NTOP` and MSVC <=1900

MSVC 1900 and older is missing a `const` specifier in the `inet_ntop()`
declaration for the second argument. A workaround was in place for it
in cmake, but it didn't cover all necessary versions.

Replace the workaround with a different one, move it to `lib/inet_ntop.c`
and extend to all necessary MSVC versions.

Also add CI jobs for the older MSVC versions: 2013, 2015, 2017.

Closes #15923

11 months agoGHA/linux: update awslabs/aws-lc to v1.42.0
renovate[bot] [Mon, 6 Jan 2025 22:11:16 +0000 (22:11 +0000)] 
GHA/linux: update awslabs/aws-lc to v1.42.0

Closes #15919

11 months agoGHA: bump cygwin/cygwin-install-action from 4 to 5
dependabot[bot] [Mon, 6 Jan 2025 14:36:47 +0000 (14:36 +0000)] 
GHA: bump cygwin/cygwin-install-action from 4 to 5

Bumps [cygwin/cygwin-install-action](https://github.com/cygwin/cygwin-install-action) from 4 to 5.
- [Release notes](https://github.com/cygwin/cygwin-install-action/releases)
- [Commits](https://github.com/cygwin/cygwin-install-action/compare/006ad0b0946ca6d0a3ea2d4437677fa767392401...f61179d72284ceddc397ed07ddb444d82bf9e559)

---
updated-dependencies:
- dependency-name: cygwin/cygwin-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

11 months agoconncache: count shutdowns against host and max limits
Stefan Eissing [Tue, 31 Dec 2024 15:24:46 +0000 (16:24 +0100)] 
conncache: count shutdowns against host and max limits

Count connections to a host against a possibly configured destination
limit. Trigger multi `connchange` when a connection has been shutdown,
so pending transfers can try to get a connection once again.

Reported-by: baranyaib90 on github
Fixes #15857
Closes #15879

11 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 6 Jan 2025 13:11:15 +0000 (14:11 +0100)] 
RELEASE-NOTES: synced

11 months agomime: explicitly rewind subparts at attachment time.
Patrick Monnerat [Sat, 4 Jan 2025 16:10:25 +0000 (17:10 +0100)] 
mime: explicitly rewind subparts at attachment time.

Subparts may have been previously used as a top-level mime structure and
thus not rewound.

New test 695 checks the proper functioning in these particular conditions.

Reported-by: Qriist on github
Fixes #15842
Closes #15911

11 months agodocs/examples/checksrc: don't allow snprintf specifically
Yedaya Katsman [Sun, 5 Jan 2025 20:47:58 +0000 (22:47 +0200)] 
docs/examples/checksrc: don't allow snprintf specifically

This isn't needed anymore after https://github.com/curl/curl/pull/15835,
since banned functions are just allowed in general in
`docs/examples/.checksrc`, and emits a warning when running make
checksrc:

`invalid warning specified in .checksrc: "SNPRINTF"`

Closes #15916

11 months agoautotools: silence gcc warnings in libtool code
Viktor Szakats [Sun, 5 Jan 2025 13:24:40 +0000 (14:24 +0100)] 
autotools: silence gcc warnings in libtool code

```
./.libs/lt-upload-pausing.c: In function 'lt_fatal':
./.libs/lt-upload-pausing.c:593:1: warning: function might be candidate for attribute 'noreturn' [-Wsuggest-attribute=noreturn]
  593 | lt_fatal (const char *file, int line, const char *message, ...)
      | ^~~~~~~~
```
https://github.com/curl/curl/actions/runs/12611924141/job/35148104431?pr=15911#step:11:264

Ref: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsuggest-attribute_003d

Closes #15915

11 months agoINFRASTRUCTURE.md: project infra
Daniel Stenberg [Fri, 3 Jan 2025 13:47:13 +0000 (14:47 +0100)] 
INFRASTRUCTURE.md: project infra

Closes #15906

11 months agocmake: publish/check supported protocols/features via `CURLConfig.cmake`
Viktor Szakats [Sun, 29 Dec 2024 21:34:09 +0000 (22:34 +0100)] 
cmake: publish/check supported protocols/features via `CURLConfig.cmake`

Via these variables, as lists:
- `CURL_SUPPORTED_PROTOCOLS`
- `CURL_SUPPORTED_FEATURES`

As individual flags:
- `CURL_SUPPORTS_<protocol/feature>` = `TRUE`

Also:
- set `CURL_VERSION_STRING` which was missing when using
  `find_package(CURL CONFIG)` or
  `find_package(CURL NO_MODULE)`.
- set `CURL_<prototol/feature>_FOUND` for compatibility.
- show full list of missing but required `COMPONENTS`.

Assisted-by: Derek Huang
Fixes #15854
Closes #15858

11 months agocheckdocs: trim links off docs/ markdowns before spellcheck
Daniel Stenberg [Fri, 3 Jan 2025 16:47:37 +0000 (17:47 +0100)] 
checkdocs: trim links off docs/ markdowns before spellcheck

So that we can use words in links without having them spellchecked.

Closes #15910

11 months agocleancmd.pl: strip out backticked words
Daniel Stenberg [Fri, 3 Jan 2025 17:15:44 +0000 (18:15 +0100)] 
cleancmd.pl: strip out backticked words

To make sure they are not spellchecked. Also, leaving two backticks is
not good because they cause the spellchecker to misinterpret the
markdown file so they have to be removed as well.

11 months agonetrc: 'default' with no credentials is not a match
Daniel Stenberg [Fri, 3 Jan 2025 15:22:27 +0000 (16:22 +0100)] 
netrc: 'default' with no credentials is not a match

Test 486 verifies.

Reported-by: Yihang Zhou
Closes #15908

11 months agoCURLOPT_SEEKFUNCTION.md: used for FTP, HTTP and SFTP (only)
Daniel Stenberg [Thu, 2 Jan 2025 16:52:45 +0000 (17:52 +0100)] 
CURLOPT_SEEKFUNCTION.md: used for FTP, HTTP and SFTP (only)

The same goes for *SEEKDATA.

Closes #15903

11 months agoGHA/http3-linux: fix cache rebuild conditions, switch to wolfSSL stable
Viktor Szakats [Wed, 1 Jan 2025 02:59:25 +0000 (03:59 +0100)] 
GHA/http3-linux: fix cache rebuild conditions, switch to wolfSSL stable

ngtcp2 depends on crypto backends. nghttp2 depends on ngtcp2 and nghttp3
(for nghttpx server used in pytests).

Before this patch, ngtcp2, nghttp2 weren't rebuilt when their
dependencies changes. This worked fine until wolfSSL bumped its
soversion and caused CI to fail because ngtcp2 was not rebuilt and was
still referring to the old soname that was no longer offered by the
wolfSSL package.

Make sure to rebuild ngtcp2/nghttp2 when any of their dependencies bump.
To avoid rebuilding everything on every wolfSSL commit, switch to use
wolfSSL stable versions.

Bug: https://github.com/curl/curl/pull/15882#issuecomment-2566821417
Closes #15885

11 months agosmb: fix compiler warning
prpr19xx on github [Thu, 2 Jan 2025 16:22:01 +0000 (16:22 +0000)] 
smb: fix compiler warning

An old version of GCC (4.5.2 on a mipsel) moans about the constant being
too big to fit in a long.

Closes #15902

11 months agodocs: use lowercase curl and libcurl
Daniel Stenberg [Thu, 2 Jan 2025 13:43:23 +0000 (14:43 +0100)] 
docs: use lowercase curl and libcurl

Adjusted badwords to find them.

Plus: make badwords run on all markdown files in the repo and update
markdowns previously unchecked

Closes #15898

11 months agodocs/libcurl/opts: clarify the return values
Daniel Stenberg [Thu, 2 Jan 2025 14:54:12 +0000 (15:54 +0100)] 
docs/libcurl/opts: clarify the return values

Expand a little.

- mention the type name of the return code
- avoid stating which exact return codes that might be returned, as that
  varies over time, builds and conditions
- avoid stating some always return OK
- refer to the manpage documenting all the return codes

Closes #15900

11 months agodocs/cmdline-opts/_ENVIRONMENT.md: minor language fix
Daniel Stenberg [Thu, 2 Jan 2025 13:07:11 +0000 (14:07 +0100)] 
docs/cmdline-opts/_ENVIRONMENT.md: minor language fix

Closes #15897

11 months agodocs/libcurl: return value overhall
Daniel Stenberg [Thu, 2 Jan 2025 14:43:12 +0000 (15:43 +0100)] 
docs/libcurl: return value overhall

Unified, extended, clarified the return values for numerous functions

Closes #15899

11 months agosrc: drop support for `CURL_TESTDIR` debug env
Viktor Szakats [Wed, 1 Jan 2025 22:14:13 +0000 (23:14 +0100)] 
src: drop support for `CURL_TESTDIR` debug env

No longer used by curl tests.

`--output-dir` option can be used as an alternative in all builds.

Follow-up to 39697dead3e7e3366941fe740226d56f30e6fc9e #15114
Closes #15893

11 months agocmake/FindLDAP: avoid framework locations for libs too (Apple)
Viktor Szakats [Thu, 2 Jan 2025 01:46:00 +0000 (02:46 +0100)] 
cmake/FindLDAP: avoid framework locations for libs too (Apple)

We already avoid system framework paths while looking for LDAP headers
to avoid issues.

Do the same while looking for LDAP libraries. This makes sure to find
the regular ldap library (`libldap.tbd`) instead of picking up
`ldap.framework` and let that seep into `libcurl.pc` with a full path.

This makes LDAP detection work on Apple as before introducing FindLDAP.

Follow-up to 49f2a23d509645d534cbb2e2ffbd6347fac6e59e #15273
Closes #15895

11 months agocmake: make system libraries `dl`, `m`, `pthread` customizable
Viktor Szakats [Wed, 1 Jan 2025 21:55:07 +0000 (22:55 +0100)] 
cmake: make system libraries `dl`, `m`, `pthread` customizable

via `DL_LIBRARY`, `MATH_LIBRARY`, `PTHREAD_LIBRARY` variables.

They are used in Rustls, wolfSSL Find modules.

Also:
- always use `NAMES` keyword in `find_library()` calls.
- respect `find_library()` results for `dl`, `m`, `pthread`.
- formatting.

Closes #15892

11 months agocurl_sha512_256: rename symbols to the curl namespace
Viktor Szakats [Wed, 1 Jan 2025 22:32:40 +0000 (23:32 +0100)] 
curl_sha512_256: rename symbols to the curl namespace

Closes #15894

11 months agodocs/HTTP-COOKIES.md: link to more information
Daniel Stenberg [Wed, 1 Jan 2025 20:18:11 +0000 (21:18 +0100)] 
docs/HTTP-COOKIES.md: link to more information

Closes #15891

11 months agohash: add asserts in hash_element_dtor()
Daniel Stenberg [Wed, 1 Jan 2025 19:37:47 +0000 (20:37 +0100)] 
hash: add asserts in hash_element_dtor()

This just adds a precaution and shows a clear intention in the code.
Added because CodeSonar is reporting a false positive Use After Free on
this function.

Closes #15889

11 months agoCOPYING: bump copyright year range to 1996 - 2025
Daniel Stenberg [Wed, 1 Jan 2025 19:58:42 +0000 (20:58 +0100)] 
COPYING: bump copyright year range to 1996 - 2025

Closes #15890

11 months agoselect: avoid a NULL deref in cwfds_add_sock
Daniel Stenberg [Wed, 1 Jan 2025 00:00:33 +0000 (01:00 +0100)] 
select: avoid a NULL deref in cwfds_add_sock

curl_multi_waitfds(m, NULL, ...);

=> Curl_waitfds_init(&cwfds, ufds, size);

=> Curl_waitfds_add_ps(&cwfds);

=>   cwfds_add_sock(cwfds, ...);

Would then try to use the ->wfds array while set to NULL previously.
This should not happen, which this is now also protected with an assert
to trigger debug builds if it happens.

Caught by CodeSonar

Assisted-by: Jay Satiro
Closes #15881

11 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 1 Jan 2025 13:50:59 +0000 (14:50 +0100)] 
RELEASE-NOTES: synced

11 months agoopenssl: add support to use keys and certificates from PKCS#11 provider
Jakub Jelen [Thu, 14 Nov 2024 16:57:48 +0000 (17:57 +0100)] 
openssl: add support to use keys and certificates from PKCS#11 provider

In OpenSSL < 3.0, the modularity was provided by mechanism called
"engines". This is supported in curl, but the engines got deprecated
with OpenSSL 3.0 in favor of more versatile providers.

This adds a support for OpenSSL Providers, to use PKCS#11 keys, namely
through the pkcs11 provider. This is done using similar approach as the
engines and this is automatically built in when the OpenSSL 3 and newer
is used.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Closes #15587

11 months agoGHA/http3-linux: drop redundant `pkg-config` paths for ngtcp2/nghttp2
Viktor Szakats [Wed, 1 Jan 2025 13:10:53 +0000 (14:10 +0100)] 
GHA/http3-linux: drop redundant `pkg-config` paths for ngtcp2/nghttp2

- ngtcp2: drop `$PWD/build` (= self)
- ngtcp2: drop nghttp3. It's only used for examples, which we do not use
  here and are disabled by default.
- nghttp2: drop `$HOME/build` (does not exist)

Closes #15887

11 months agourlapi: cleanup the redirect logic somewhat
Daniel Stenberg [Tue, 31 Dec 2024 12:27:12 +0000 (13:27 +0100)] 
urlapi: cleanup the redirect logic somewhat

Closes #15877

11 months agolib: remove `__EMX__` guards
Viktor Szakats [Wed, 1 Jan 2025 02:33:26 +0000 (03:33 +0100)] 
lib: remove `__EMX__` guards

Follow-up to 179ee78e8672ec44c50aa36279c48b28e008ea29 #2166
Closes #15884

11 months agofile: fix Android compiler warning
Viktor Szakats [Wed, 1 Jan 2025 02:28:09 +0000 (03:28 +0100)] 
file: fix Android compiler warning

Apply the fix already used in `lib/fopen.c`.

```
lib/file.c:326:41: warning: implicit conversion loses integer precision: 'unsigned int' to 'mode_t' (aka 'unsigned short') [-Wimplicit-int-conversion]
  326 |   fd = open(file->path, mode, data->set.new_file_perms);
      |        ~~~~                   ~~~~~~~~~~^~~~~~~~~~~~~~
```

Closes #15883

11 months agofile: drop `OPEN_NEEDS_ARG3` option
Viktor Szakats [Wed, 1 Jan 2025 02:19:24 +0000 (03:19 +0100)] 
file: drop `OPEN_NEEDS_ARG3` option

Not set since 1bf3643f7b1760f7f92cbb42df2dbdc94e29bf96 #8362 (2022)
Added in 00883822be245d2660a569e6bde38892b9433aa2 (2009) for VxWorks.

Closes #15882

11 months agomultissl: auto-enable `OPENSSL_COEXIST` for wolfSSL + OpenSSL
Viktor Szakats [Wed, 1 Jan 2025 04:16:24 +0000 (05:16 +0100)] 
multissl: auto-enable `OPENSSL_COEXIST` for wolfSSL + OpenSSL

When building with both OpenSSL and wolfSSL set this necessary option.
Otherwise fail with an error.

Requires wolfSSL v5.7.6 or upper.

Closes #15765

11 months agoCI: update dependency wolfSSL/wolfssl to v5.7.6
renovate[bot] [Wed, 1 Jan 2025 03:56:57 +0000 (03:56 +0000)] 
CI: update dependency wolfSSL/wolfssl to v5.7.6

Closes #15886

11 months agobuild: replace configure check with PP condition (Android <21)
Viktor Szakats [Tue, 31 Dec 2024 01:22:42 +0000 (02:22 +0100)] 
build: replace configure check with PP condition (Android <21)

To make it build again with CMake + Android 20 and earlier.

8e345057761a8f796403923a96f2c8fd3edca647 synced `getpwuid_r()` detection
in cmake with autotools. It means cmake started detecting it with
Android <21 just like autotools, and thus cmake builds also need to
tackle the missing declaration with old Android SDK versions. Use a PP
solution, allowing to drop the autotools-specific on used before this
patch.

Follow-up to 8e345057761a8f796403923a96f2c8fd3edca647 #15164
Follow-up to 9c33813d835dde214c1a9449f789dd72ab3d9dc3 #2609
Ref: #2058
Closes #15871

11 months agotest483: require cookie support
Marcel Raad [Tue, 31 Dec 2024 09:35:40 +0000 (10:35 +0100)] 
test483: require cookie support

The test fails with `--disable-cookies`.

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

11 months agotest3105: verify multi_remove_handle done twice
Daniel Stenberg [Mon, 30 Dec 2024 09:06:24 +0000 (10:06 +0100)] 
test3105: verify multi_remove_handle done twice

It should be ok.

Ref: #15852
Closes #15860

11 months agocmp-config: drop 3 exceptions
Viktor Szakats [Tue, 31 Dec 2024 01:43:36 +0000 (02:43 +0100)] 
cmp-config: drop 3 exceptions

Follow-up to fd067bfb5b028ac41660decc5abb87f1cd093b6b #15596
Closes #15872

11 months agoGHA/configure-vs-cmake: trigger by `CMake/**` updates
Viktor Szakats [Tue, 31 Dec 2024 03:22:30 +0000 (04:22 +0100)] 
GHA/configure-vs-cmake: trigger by `CMake/**` updates

Closes #15875

11 months agocmake: sync OpenSSL QUIC fork detection with autotools
Viktor Szakats [Tue, 31 Dec 2024 01:49:51 +0000 (02:49 +0100)] 
cmake: sync OpenSSL QUIC fork detection with autotools

Before this patch, detection used a function which wasn't called
from curl since d2c6d8be18adfe4c49ca8948d04e228ba1a6e9fb #8968.

Follow-up to b3f02e1d927f10b48bdaa573fe09e28bdc25d94d #12683
Closes #15873