Commit Graph

35949 Commits

Author SHA1 Message Date
Daniel Stenberg
3833e5fea1
checksrc: check for return with parens around a value/name
Ref: #15979
Closes #15983
2025-01-13 09:10:50 +01:00
Viktor Szakats
94cfcb1e21
curl-functions.m4: fix indentation in CURL_SIZEOF()
Closes #15981
2025-01-13 02:44:41 +01:00
Viktor Szakats
c4ba49ca02
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
2025-01-13 02:44:41 +01:00
Viktor Szakats
97164e99de
tidy-up: drop parenthesis around return values
Closes #15979
2025-01-13 02:44:40 +01:00
Viktor Szakats
231f868a4d
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
2025-01-13 02:44:40 +01:00
Viktor Szakats
14e279404b
cmake: drop VS2010 "Dialog Hell" workaround added in 2013
Delete the workaround added via a94a68a3c1
(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
2025-01-13 02:44:40 +01:00
Viktor Szakats
a1184525a6
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 7eb4ddb850 #15968

Closes #15971
2025-01-13 02:44:39 +01:00
Viktor Szakats
410c4629f2
system.h: fix indentation
Closes #15974
2025-01-12 06:03:05 +01:00
Viktor Szakats
0ad30f0f64
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: 8b76a8aeb2 #15526

Closes #15958
2025-01-12 01:40:42 +01:00
Viktor Szakats
81680a4070
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
2025-01-12 00:34:21 +01:00
Viktor Szakats
7eb4ddb850
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
2025-01-12 00:34:21 +01:00
Viktor Szakats
b9840814ad
tidy-up: curl_setup.h, curl_setup_once.h, config-win32ce.h
- drop unused `LIBIDN_REQUIRED_VERSION` macro.
  Unused since 9c91ec7781

- 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 7d7346519d #1542 (2017)
  Follow-up to c2aeb1b3ba #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
2025-01-12 00:34:21 +01:00
Viktor Szakats
de3e662ce1
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
2025-01-12 00:34:21 +01:00
Viktor Szakats
c8d800a2f0
cmake: formatting [ci skip] 2025-01-12 00:34:21 +01:00
renovate[bot]
603224fe52
ci: update actions/upload-artifact digest to 65c4c4a
Closes #15964
2025-01-11 14:34:00 +01:00
renovate[bot]
7cfc245a37
ci: update rojopolis/spellcheck-github-actions digest to 9e0a5fb
Closes #15933
2025-01-11 14:33:02 +01:00
Viktor Szakats
b3752d502e
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
2025-01-10 22:46:20 +01:00
Viktor Szakats
ccf43ce91d
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
835682661c #10597 (v8.0.0).

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

Closes #15957
2025-01-10 22:46:19 +01:00
Viktor Szakats
95658f9ca3
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
2025-01-10 18:21:10 +01:00
Viktor Szakats
fdc588dc10
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
2025-01-10 18:20:52 +01:00
Viktor Szakats
0494566ae8
msvc: assume _INTEGRAL_MAX_BITS >= 64
curl requires C compilers supporting 64-bit `curl_off_t` type since
835682661c #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 ca18198dd4 #15952
Closes #15955
2025-01-10 11:27:55 +01:00
Stefan Eissing
34cebd8735
ssl session cache: change cache dimensions
Use a larger one when shared.

Closes #15953
2025-01-10 10:51:26 +01:00
Daniel Stenberg
423be24edb
RELEASE-NOTES: bump cmdline options and number of public funcs 2025-01-10 08:54:49 +01:00
Daniel Stenberg
b2a845c8ad
RELEASE-NOTES: synced 2025-01-10 08:47:27 +01:00
Asger Hautop Drewsen
cacceef5a6
completion.pl: add completion for paths after @ for fish
Closes #15928
2025-01-10 08:37:55 +01:00
sftcd
1ae47b91a3
ECH: update APIs to those agreed with OpenSSL maintainers
Closes #15945
2025-01-10 08:36:25 +01:00
Daniel Stenberg
386f570df6
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
2025-01-10 08:20:03 +01:00
Stefan Eissing
533dc84e6e
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
2025-01-09 17:27:10 +01:00
Daniel Stenberg
a19b759dea
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
2025-01-09 17:25:48 +01:00
Daniel Stenberg
779908df43
tool_ssls: fix "ignored return value" warning
Pointed out by CodeSonar. While harmless, we might as well address it.

Closes #15949
2025-01-09 17:24:47 +01:00
Daniel Stenberg
d0607b27b0
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
2025-01-09 17:23:26 +01:00
Viktor Szakats
ca18198dd4
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
2025-01-09 14:52:45 +01:00
Viktor Szakats
8363dd51bc
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
2025-01-09 11:58:14 +01:00
Tal Regev
a394b78446
GHA/windows: add wolfSSL to MSVC MultiSSL job
Follow-up to 98932f3487 #15765

Closes #15438
2025-01-09 11:02:08 +01:00
Daniel Stenberg
d1c1c96e0a
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
2025-01-09 09:23:03 +01:00
Viktor Szakats
703e053110
cmake: update a comment [ci skip]
Follow-up to 421e592db2 #15832
2025-01-09 04:11:38 +01:00
Viktor Szakats
a19b79ce87
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
2025-01-09 02:12:53 +01:00
Viktor Szakats
8a266ac488
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 3829759bd0 #12489
Closes #15939
2025-01-09 02:12:52 +01:00
Daniel Stenberg
115ea7633e
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
2025-01-08 23:57:36 +01:00
Neil Horman
957eb240ed
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
2025-01-08 23:52:49 +01:00
Daniel Stenberg
616b66e68f
scripts/delta: add number of days since first httpget release 2025-01-08 23:48:48 +01:00
Stefan Eissing
4e15605896
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
2025-01-08 23:44:51 +01:00
Stefan Eissing
515a21f350
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
2025-01-08 23:32:07 +01:00
Viktor Szakats
8a1ee2b47d
appveyor: tidy up shell code
Closes #15940
2025-01-08 18:16:50 +01:00
Viktor Szakats
d34aeecb08
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
2025-01-08 12:33:31 +01:00
Viktor Szakats
38ff7ba501
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
2025-01-08 00:33:02 +01:00
Viktor Szakats
cba0d3abcb
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 08ff33e483 #15923
Follow-up to 50f6a6b1d4 #15926

Closes #15932
2025-01-07 20:14:03 +01:00
Viktor Szakats
0cacdd6dd1
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
2025-01-07 18:27:32 +01:00
Viktor Szakats
24ef9de9f4
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
2025-01-07 17:54:19 +01:00
Daniel Stenberg
0cc458686c
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
2025-01-07 16:47:18 +01:00