Commit Graph

34384 Commits

Author SHA1 Message Date
Daniel Stenberg
13afb1128f
asyn-ares: acknowledge CURLOPT_DNS_SERVERS set to NULL
Since c-ares has no function to restore this value to default, it
instead closes and re-inits the c-ares channel.

Reported-by: Deniz Sökmen
Fixes #16015
Closes #16016
2025-01-16 20:22:12 +01:00
Viktor Szakats
f241ccf714
GHA/labeler: fix INSTALL-CMAKE.md references
Follow-up to 0f4c19b66a #12772

Closes #16021
2025-01-16 19:42:13 +01:00
Viktor Szakats
f7bb6c1f64
autotools: add support for mingw UWP builds
To match cmake builds.

- GHA/windows: allow autotools UWP builds.
- detect UWP and add to `buildinfo.txt`.
  Consider it enabled if `CPPFLAGS` contains `-DWINSTORECOMPAT`.
- disable telnet with UWP.
- enable Unicode with UWP.
- do not use `wldap32` with UWP.
- do not enable `USE_WIN32_CRYPTO` with UWP.
- make sure to link to `ws2_32` in UWP builds.
  To fix `undefined reference to `in6addr_any'` when linking
  `tests/server` programs. More in the comment.

Closes #16020
2025-01-16 19:42:13 +01:00
Daniel Stenberg
fb881abd72
docs/EXPERIMENTAL.md: add a mention of HTTPSRR as experimental
Closes #16017
2025-01-16 19:41:42 +01:00
Viktor Szakats
5902e18844
cmake: move mingw UWP workaround from GHA to CMakeLists.txt
CMake (as of 3.31.2) doesn't fully recognize mingw-w64 with
`CMAKE_SYSTEM_NAME=WindowsStore`.
The manual logic works around it.

Also move existing DJGPP workaround to the same block.

Closes #16019
2025-01-16 16:44:53 +01:00
Viktor Szakats
f07612cd9a
tidy-up: extend CURL_O_BINARY to lib and tests
Move `CURL_O_BINARY` definition from src to lib and use it from lib and
tests code.

Closes #16009
2025-01-16 12:36:07 +01:00
Daniel Stenberg
c5bb4e77e4
RELEASE-NOTES: synced 2025-01-16 09:27:49 +01:00
sftcd
ca1594e707
tool_getparam: ECH param parsing refix
Regression.

Fixes #16006
Reported-by: Milon Renatus
Closes #16010
2025-01-16 09:17:01 +01:00
Stefan Eissing
a6eac83481
cf-https-connect: look into httpsrr alpns when available
Improved the filter implementation to be flexible in which order h3 and
h2/h1 are attempted. When HTTPSRR is enabled, look at the ALPNs it found
and use the order given for connecting in default setups.

Closes #16012
2025-01-16 08:23:02 +01:00
Viktor Szakats
bbb91b22ee
GHA/non-native: lower job timeouts
New values have a 2-3x headroom.
2025-01-15 21:39:30 +01:00
Daniel Stenberg
bb93536270
doh: send HTTPS RR requests for all HTTP(S) transfers
When enabled in the build.

Update test2100: verify with HTTPS RR included

Adjust runtests and server/disabled.c to include "HTTPSRR" as a feature
in the test suite.

Also, decode the ALPN list in HTTPS records straight into IDs. There's
no point in storing everything in string format. Skip ALPNs we do not
support.

Closes #16007
2025-01-15 12:55:15 +01:00
Daniel Stenberg
5d70a5c5a4
doh: cleanups and extended HTTPS RR code
In preparation for using HTTPS outside of ECH, the parser now also
extracts the port number.

Plus other minor cleanups.

Closes #16007
2025-01-15 12:55:04 +01:00
Viktor Szakats
f739a6867b
INSTALL.md: tweak to the MSVC version line [ci skip]
Follow-up to 308437ac53 #15992
2025-01-15 02:33:54 +01:00
Viktor Szakats
55f3ba447f
CI: add/extend curl binary info, VS2010 32-bit, misc improvements
- fix `find` commands to not miss items.

- call `file` on the built files in `curl -V` steps.
  To give more feedback on what was built.

- add `curl info` step for cross-jobs that can't do a `curl -V`.
  It lists the files built and calls `file` on them.

- appveyor: make a VS2010 32-bit to match the VS2008 job it replaced.
  Follow-up to d34aeecb08 #15934

- GHA/windows: drop the word "old" from standalone mingw-w64 jobs to not
  conflate it with "old mingw" we no longer support (while also keeping
  it short).

Cherry-picked from #15975
Closes #16001
2025-01-14 17:46:49 +01:00
Daniel Stenberg
be82a3605a
easy: make curl_easy_perform() return error if connection still there
This typically happens if CURL_CONNECT_ONLY is used and a second
curl_easy_perform() is attempted.

A connection "taken over" with CURL_CONNECT_ONLY cannot be ended any
other way than a curl_easy_cleanup() on the easy handle that holds it.

Add test 696 to verify.

Closes #16003
2025-01-14 16:32:46 +01:00
Daniel Stenberg
2f8ecd5dbd
CURLOPT_CONNECT_ONLY.md: an easy handle with this option set cannot be reused
Closes #16002
2025-01-14 16:26:34 +01:00
Viktor Szakats
308437ac53
INSTALL.md: document VS2008 and mingw-w64
Ref: #15972
Closes #15992
2025-01-14 15:58:39 +01:00
Daniel Stenberg
b9c173ebad
sha256/hmac: use these with TLS builds now
Used by the SSL session cache code.

Bug: https://curl.se/mail/lib-2025-01/0041.html
Reported-by: Aleksander Mazur
Closes #15994
2025-01-14 12:13:59 +01:00
Viktor Szakats
5474d70c3e
tidy-up: drop parenthesis around return expression
Closes #15990
2025-01-14 12:11:42 +01:00
Stefan Eissing
06d4456a21
CI: run pytest in github CI colored
Add colors to pytest runs in github workflows and see how test clutch
copes with it!

Closes #15998
2025-01-14 11:34:56 +01:00
Stefan Eissing
fa5d5ac1c9
pytest: use httpd/apache2 directly, no apachectl
Since the script 'apachectl' from the httpd project is severly mutilated
on several distros, use the executable httpd/apache2 directly in pytest
runs.

Remove detection of apachectl form autoconf and cmake.

Closes #16000
2025-01-14 11:33:49 +01:00
Daniel Stenberg
862244636e
cmdline-opts/version.md: describe multissl, mention SSLS-EXPORT
Closes #15996
2025-01-14 11:08:24 +01:00
Jay Satiro
5ffc73c78e transfer: fix CURLOPT_CURLU override logic
- Change setopt and pretransfer to always reset URL related variables
  for a CURLU handle set CURLOPT_CURLU.

This change is to ensure we are in compliance with the doc which says
CURLU handles must be able to override a URL set via CURLOPT_URL and
that if the contents of the CURLU handle changes between transfers then
the updated contents must be used.

Prior to this change, although subsequent transfers appear to be
performed correctly in those cases, the work URL `data->state.url` was
not updated. CURLINFO_EFFECTIVE_URL returns data->state.url to the user
so it would return the URL from the initial transfer which was the wrong
URL. It's likely there are other cases as well.

Ref: https://curl.se/libcurl/c/CURLOPT_CURLU.html

Reported-by: Nicolás San Martín

Fixes https://github.com/curl/curl/issues/15984
Closes https://github.com/curl/curl/pull/15985
2025-01-14 04:36:13 -05:00
Jay Satiro
8ab468c8aa mprintf: terminate snprintf output on windows
- Null terminate the end of the snprintf output buffer on Windows.

Old versions of the Windows CRT (which are often found on later versions
of Windows) do not terminate the snprintf output buffer if the output
reaches the max size.

This is a follow-up to parent 7e32f656 which made the same change but
limited it to mingw, however it is a CRT version issue irrespective of
compiler.

Ref: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l?view=msvc-170#remarks

Closes https://github.com/curl/curl/pull/15997
2025-01-14 04:33:51 -05:00
Daniel Stenberg
7e32f65687
mprintf: fix integer handling in float precision
In the double output function when an extremely large width and
precision is set that reaches the libcurl maximum (325), the handling of
the precision part would do wrong which could lead to bad output.

Also: work-around for single-byte buffer snprintf overflow with mingw.

Extend test 557 to verify.

Coverity CID 1638751.

Closes #15988
2025-01-13 23:41:38 +01:00
Daniel Stenberg
97d278fd76
GHA: enable the SSL session cache in a few builds
Closes #15989
2025-01-13 23:40:23 +01:00
Daniel Stenberg
260b7d54a6
curl_easy_ssls_export/import.md: made for TLS protocols
Which then makes the generated man page also include details about the
specific backends that support this feature.

Follow-up to 515a21f350

Closes #15993
2025-01-13 23:39:31 +01:00
Daniel Stenberg
23742ce015
cmake: enable SSLS-EXPORT in the build
Follow-up to 515a21f350

Closes #15991
2025-01-13 19:58:29 +01:00
Daniel Stenberg
9e54db2707
lib/easy.c: bring back the vtls/vtls_scache.h include 2025-01-13 18:26:19 +01:00
Daniel Stenberg
02ba03938f
telnet: handle single-byte input option
Coverity CID 1638753 correctly identies this code misbehaved if the
passed in suboption is exactly one byte long by substracting two from
the unsigned size_t variable.

Closes #15987
2025-01-13 14:29:02 +01:00
Daniel Stenberg
81a25ba7a4
altsvc: return error on dot-only name
Because it is a trailing dot that otherwise leads to a zero length name.

Coverity CID 1638755.

Closes #15986
2025-01-13 14:27:44 +01:00
Daniel Stenberg
e67e2bda5a
RELEASE-NOTES: synced 2025-01-13 10:41:12 +01:00
Daniel Stenberg
cd43c92685
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
2025-01-13 10:32:03 +01:00
Daniel Stenberg
854e055a70
checksrc: use 'banfunc' proper in more places 2025-01-13 09:10:58 +01:00
Daniel Stenberg
eb652da1b2
examples: use return according to code style 2025-01-13 09:10:58 +01:00
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