Commit Graph

35946 Commits

Author SHA1 Message Date
Viktor Szakats
54da6f5a32
build: if no perl, fix to use the pre-built hugehelp, if present
- cmake: Before this patch a missing perl disabled the curl manual.
  After this patch, it automatically picks up a pre-built hugehelp,
  if present (= when building from a release tarball).
  Follow-up to 0035ff45c5 #16081

- autotools: Rework behavior when perl is missing. Before this patch
  it caused a hard error when docs/manual/ca-embed were enabled.
  Of these, docs were enabled by default. After this patch, doc
  generation is automatically skipped, with a warning. Manual generation
  falls back to using a pre-built hugehelp, or a stub if that's missing.
  CA-embed is automatically skipped, with a warning.
  Slight difference from cmake: When built with no perl and no pre-built
  hugehelp, the manual is enabled, but the content is empty; with cmake
  it's disabled proper.
  Follow-up to 137aecfbf1 #13514
  Follow-up to 541321507e #12857

Also:
- GHA/distcheck: verify if the pre-built hugehelp makes it into curl.
- GHA/distcheck: streamline disabling perl with autotools.
- GHA/distcheck: `--disable-docs` no longer required to build without perl.
  Passing it also implicitly disables the curl manual, which is
  undesired in these tests.
- cmake: drop redundant `HAVE_MANUAL_TOOLS` interim variable.
- cmake: move two `set()` lines close to their counterparts.

Follow-up to 25119fbaaa #18104

Closes #18118
2025-08-01 23:54:12 +02:00
Daniel Stenberg
18e00c8ed0
managen: reset text mode at end of table marker
It previously mostly ignored it which lead to bad format after a table
has ended with "##".

Closes #18139
2025-08-01 23:24:32 +02:00
Daniel Stenberg
2bad773b30
urlapi: allow more path characters "raw" when asked to URL encode
Setting the path component to contain the letters:

    ! $ & ' ( ) { } [ ] * + , ; = : @

now leaves them un-encoded when CURLU_URLENCODE is used.

Amended test 1560 to verify.

Reported-by: Jeroen Ooms
Fixes #17977
Closes #18024
2025-08-01 23:22:32 +02:00
Viktor Szakats
a33893dac7
examples: drop long cast for CURLALTSVC_*
Follow-up to d45b85d791 #18063
2025-08-01 18:54:27 +02:00
Viktor Szakats
80297e1dcb
CURLOPT: bump remaining macros to long
This patch bumps the size of these macros from `int` to `long`, while
keeping their actual values the same. It may cause incompatibilities in
user code, requiring the bump of holder variables and/or adding casts:

- CURLGSSAPI_DELEGATION_FLAG
- CURLGSSAPI_DELEGATION_NONE
- CURLGSSAPI_DELEGATION_POLICY_FLAG

- CURLMIMEOPT_FORMESCAPE

- CURLSSH_AUTH_AGENT
- CURLSSH_AUTH_ANY
- CURLSSH_AUTH_DEFAULT
- CURLSSH_AUTH_GSSAPI
- CURLSSH_AUTH_HOST
- CURLSSH_AUTH_KEYBOARD
- CURLSSH_AUTH_NONE
- CURLSSH_AUTH_PASSWORD
- CURLSSH_AUTH_PUBLICKEY

Also:
- keep existing cast within the documentation to make sure it applies
  to older curl versions as well.

Closes #18134
2025-08-01 18:49:23 +02:00
Viktor Szakats
b131db5410
CURLOPT: bump CURLPROTO_* macros to long
This patch bumps the size of these macros from `int` to `long`, while
keeping their actual values the same. It may cause incompatibilities in
user code, requiring the bump of holder variables and/or adding casts:

- CURLPROTO_HTTP
- CURLPROTO_HTTPS
- CURLPROTO_FTP
- CURLPROTO_FTPS
- CURLPROTO_SCP
- CURLPROTO_SFTP
- CURLPROTO_TELNET
- CURLPROTO_LDAP
- CURLPROTO_LDAPS
- CURLPROTO_DICT
- CURLPROTO_FILE
- CURLPROTO_TFTP
- CURLPROTO_IMAP
- CURLPROTO_IMAPS
- CURLPROTO_POP3
- CURLPROTO_POP3S
- CURLPROTO_SMTP
- CURLPROTO_SMTPS
- CURLPROTO_RTSP
- CURLPROTO_RTMP
- CURLPROTO_RTMPT
- CURLPROTO_RTMPE
- CURLPROTO_RTMPTE
- CURLPROTO_RTMPS
- CURLPROTO_RTMPTS
- CURLPROTO_GOPHER
- CURLPROTO_SMB
- CURLPROTO_SMBS
- CURLPROTO_MQTT
- CURLPROTO_GOPHERS
- CURLPROTO_ALL

Also:
- keep existing cast within the documentation to make sure it applies
  to older curl versions as well.

Closes #18136
2025-08-01 18:49:23 +02:00
Viktor Szakats
ebbb8e3da7
CURLOPT: bump CURL_SSLVERSION_* macros to long
This patch bumps the size of these macros from `int` to `long`, while
keeping their actual values the same. It may cause incompatibilities in
user code, requiring the bump of holder variables and/or adding casts:

- CURL_SSLVERSION_DEFAULT
- CURL_SSLVERSION_SSLv2
- CURL_SSLVERSION_SSLv3
- CURL_SSLVERSION_TLSv1
- CURL_SSLVERSION_TLSv1_0
- CURL_SSLVERSION_TLSv1_1
- CURL_SSLVERSION_TLSv1_2
- CURL_SSLVERSION_TLSv1_3

- CURL_SSLVERSION_MAX_DEFAULT
- CURL_SSLVERSION_MAX_NONE
- CURL_SSLVERSION_MAX_TLSv1_0
- CURL_SSLVERSION_MAX_TLSv1_1
- CURL_SSLVERSION_MAX_TLSv1_2
- CURL_SSLVERSION_MAX_TLSv1_3

Also:
- keep existing cast within the documentation to make sure it applies
  to older curl versions as well.

Closes #18135
2025-08-01 18:49:23 +02:00
Viktor Szakats
ac0222d355
CURLOPT: bump CURLWS_NOAUTOPONG, CURLWS_RAW_MODE macros to long
This patch bumps the size of these macros from `int` to `long`, while
keeping their actual values the same. It may cause incompatibilities in
user code, requiring the bump of holder variables and/or adding casts:

- CURLWS_NOAUTOPONG
- CURLWS_RAW_MODE

Also:
- keep existing cast within the documentation to make sure it applies
  to older curl versions as well.

Closes #18137
2025-08-01 18:49:23 +02:00
Viktor Szakats
1d56c1401f
lib2700: use testnum
Follow-up to 02dd471bbf #17591
Follow-up to d3594be653 #17136

Closes #18138
2025-08-01 18:48:07 +02:00
Stefan Eissing
ec4c559104
openssl: check SSL_write() length on retries
When an SSL_write() blocks we need to retry it with the
same length as before or stupid OpenSSL freaks out. Remember
it, limit any longer sends and fail shorter ones.

Fixes #18121
Reported-by: adamse on github
Closes #18132
2025-08-01 17:54:05 +02:00
Daniel Stenberg
8df0a5ba32
release-notes: fix warning
Follow-up to 2ec54556d4

Closes #18133
2025-08-01 16:02:54 +02:00
Daniel Stenberg
32cab35a0c
RELEASE-NOTES: synced 2025-08-01 15:40:53 +02:00
Stefan Eissing
7f5ad2028d
pytest: test very long urls
test_02_36 tests h1/h2/h3 with urls longer than 1/16/32/64K.

Protocols behave the same until the size exceed 64k when h2 frame limits
bite and h3 exhibits a different http status.

Failed attempt to reproduce #18121
Closes #18129
2025-08-01 14:35:37 +02:00
Stefan Eissing
30daac9f2f
cli_hx_download: fix compiler warnings about format strings
Follow-up to ba9ddb9357

Closes #18127
2025-08-01 10:51:19 +02:00
Stefan Eissing
077fd6aac8
curl_easy_ssls_export: make the example more clear
As mentioned in #18031
Closes #18117
2025-08-01 10:49:56 +02:00
Stefan Eissing
ba9ddb9357
tls: CURLINFO_TLS_SSL_PTR testing
Add tests of CURLINFO_TLS_SSL_PTR and its returned value in test client
'hx-download'. Use obtained pointer to look up the negotiated TLS
version.

Update manpage of CURLINFO_TLS_SSL_PTR to also describe the behaviour of
wolfSSL similar to OpenSSL. Fix the wolfSSl implementation for TCP to
behave like that. Update the QUIC queries.

Fix rustls `get_internals()` to return the rustls_connection* and not
the address of the pointer.

Assisted-by: Viktor Szakats
Closes #18066
2025-08-01 09:37:36 +02:00
Stefan Eissing
af69c9d636
ip happy eyeballing: keep attempts running
When `CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS` expires, start the next ip
connect attempt, but keep all ongoing attempts alive.

Separate happy-eyeballs connection filter into own source files.

Closes #18105
2025-08-01 09:30:59 +02:00
Daniel Stenberg
4654493fed
curl: add --parallel-max-host to limit concurrent connections per host
Where 'host' is protocol + hostname + portnumber.

Closes #18052
2025-07-31 23:30:40 +02:00
Daniel Stenberg
e688fe18a9
spacecheck.pl: when detecting unicode, mention line number
Closes #18120
2025-07-31 23:29:17 +02:00
Viktor Szakats
902262b166
windows: document toolchain support for CERT_NAME_SEARCH_ALL_NAMES_FLAG
Follow-up to 5f99b45693 #18113
Follow-up to 3bfcfe82b9 #18085
2025-07-31 20:43:21 +02:00
Viktor Szakats
923db3515d
schannel: not supported with UWP, drop redundant code
Schannel is not supported by UWP. SSPI is also required by Schannel in
curl, and SSPI also isn't supported by UWP.

mingw-w64 is able to create such build regardless (my guess: due to API
parts not accurately marked as UWP-only), but the binary is unlikely
to work. With MSVC the failure happens at build-time.

Ref: https://learn.microsoft.com/windows/win32/api/sspi/nf-sspi-initsecurityinterfacea#requirements
Ref: https://learn.microsoft.com/windows/win32/secauthn/initializesecuritycontext--schannel#requirements

Drop all UWP-related logic, including two related feature checks, that
can now be permanently enabled.

Also:
- build: show fatal error for Schannel in UWP mode.
- build: do not allow enabling SSPI in UWP mode.
- drop undocumented option `DISABLE_SCHANNEL_CLIENT_CERT`. Added without
  mention in an unrelated commit. The PR text says to save size. On x64
  this is 0.3%, or 4KB out of 1.3MB. The tiny gain doesn't justify
  an extra build variant. Ref: 8beff43559
- move `MPROTO_SCHANNEL_CERT_SHARE_KEY` closer to its use.
- replace commented block with `#if 0`.

Reviewed-by: Jay Satiro
Follow-up to cd0ec4784c #17089
Closes #18116
2025-07-31 20:05:32 +02:00
Viktor Szakats
b5c245045e
windows: drop two interim, single-use macros
Follow-up to e77d867068

Closes #18114
2025-07-31 11:54:18 +02:00
Daniel Stenberg
d21e75a6ae
curl_mime_data_cb.md: mention what datasize is for
Closes #18115
2025-07-31 10:48:53 +02:00
Cole Leavitt
4108d11008
bufq: add integer overflow checks before chunk allocations
Closes #18112
2025-07-31 10:07:11 +02:00
Viktor Szakats
37913c01a5
libtests: update format strings to avoid casts, drop some macros
- bump format strings to show the full value, drop casts.
- drop redundant casts (enum -> `%d`).
- drop some single-use macros.
- replace `int` with `bool` in testtrace.

Closes #18106
2025-07-31 09:29:49 +02:00
Viktor Szakats
e5cf6223d7
CURLOPT: bump CURL_REDIR_* macros to long
This patch bumps the size of these macros from `int` to `long`, while
keeping their actual values the same. It may cause incompatibilities in
user code, requiring the bump of holder variables and/or adding casts:

- CURL_REDIR_GET_ALL
- CURL_REDIR_POST_301
- CURL_REDIR_POST_302
- CURL_REDIR_POST_303
- CURL_REDIR_POST_ALL

Also:
- keep existing cast within the documentation to make sure it applies
  to older curl versions as well.

Closes #18110
2025-07-31 09:29:49 +02:00
Viktor Szakats
5f99b45693
windows: document toolchain support for some macros (cont.)
Follow-up to 3bfcfe82b9 #18085

Closes #18113
2025-07-31 09:29:48 +02:00
Daniel Stenberg
4d025fd912
curl: make --retry-delay and --retry-max-time accept decimal seconds
Like other time options already do.

Reported-by: Alice Lee Poetics
Fixes #18109
Closes #18111
2025-07-31 08:55:58 +02:00
Viktor Szakats
3bfcfe82b9
windows: document toolchain support for some macros
The oldest MS SDK I checked is 6.0A (VS2008). Versions are approximate
beyond 7.1A. I only have two Win10 SDKs to verify:
10.0.16299.0 (VS2017-15.4) and 10.0.22621.0 (VS2022).

Ref: https://en.wikipedia.org/wiki/Microsoft_Windows_SDK
Ref: https://developer.microsoft.com/windows/downloads/sdk-archive/index-legacy (recent versions mostly)

Closes #18085
2025-07-31 00:43:57 +02:00
Viktor Szakats
08acef2aab
schannel: assume CERT_CHAIN_REVOCATION_CHECK_CHAIN
Always available in supported mingw-w64 and MSVC compilers, except
in UWP mode. For mingw32ce this macro is defined later in the code.

Also available in OpenWatcom 2.
ce6c37eb29/bld/w32api/include/winerror.mh

Closes #18108
2025-07-31 00:41:36 +02:00
Viktor Szakats
25119fbaaa
GHA/distcheck: add more tarball builds
- add AM out-of-tree no perl job.
- add AM in-tree no perl job.
- make CM out-of-tree job use no perl.
- add CM in-tree no perl job.
- run `curl -V` after builds.
- show the number of `--manual` lines.
- set `--enable-werror` in autotools jobs.

Ref: https://github.com/curl/curl/issues/18088#issuecomment-3135112176

Closes #18104
2025-07-31 00:41:36 +02:00
Daniel Stenberg
f028667131
test757: MIME parts reused as a child part, using data_cb
An attempt to reproduce #18070. That turned out to not be a bug, but the
test is still a good one.

Based on test695

Closes #18101
2025-07-30 23:16:33 +02:00
Daniel Stenberg
98bcb885fe
curl: make the URL indexes 64 bit
Otherwise we could misbehave already at 2 billion URLs and we can't have
that. A few of the counters are already correctly using the right type.

Closes #18096
2025-07-30 23:13:45 +02:00
Viktor Szakats
d413ed2d40
windows: drop CRYPT_E_* macro fallbacks, limit one to mingw32ce
They are defined by all mingw-w64 versions and all supported MSVC
versions (VS2008 and up).

Also by OpenWatcom 2:
ce6c37eb29/bld/w32api/include/winerror.mh

mingw32ce misses `CRYPT_E_NOT_IN_REVOCATION_DATABASE`.

Closes #18092
2025-07-30 15:28:28 +02:00
Viktor Szakats
1140c8bc04
tests: fix perl warnings in http2-server, http3-server
AM libressl heimdal:
```
Global symbol "$verbose" requires explicit package name (did you forget to declare "my $verbose"?) at tests/http2-server.pl line 52.
Global symbol "$certfile" requires explicit package name (did you forget to declare "my $certfile"?) at tests/http2-server.pl line 109.
Global symbol "$keyfile" requires explicit package name (did you forget to declare "my $keyfile"?) at tests/http2-server.pl line 110.
Execution of tests/http2-server.pl aborted due to compilation errors.
[...]
```
Ref: https://github.com/curl/curl/actions/runs/16622030370/job/47028537336?pr=18099#step:39:3148

Follow-up to 2ec54556d4 #17877

Closes #18100
2025-07-30 14:21:17 +02:00
Viktor Szakats
801800aca2
tests: fix prechecks to call the bundle libtest tool
Some tests make a hard-coded call to the libtest binary in the precheck
step. With bundle builds the binary changed name and calling convention.
Before this patch these tests failed the pre-check and did not run for
the 5 affected tests: 518, 537, 678, 1517, 1960

Fixing, e.g.:
```
test 1517 SKIPPED: precheck command error
```
https://github.com/curl/curl/actions/runs/16611990422/job/46996698437?pr=18039#step:13:4832

It also fixes builds with a custom `CURL_DIRSUFFIX` set.

Follow-up to 2c27a67daa #17590
Follow-up to 71cf0d1fca #14772

Closes #18099
2025-07-30 14:21:17 +02:00
Viktor Szakats
e32a6dc510
schannel: drop fallbacks for 4 macros
They are defined by all mingw-w64 versions and all supported MSVC
versions (SDK 7.1A+).

Also by OpenWatcom 2:
ce6c37eb29/bld/w32api/include/wincrypt.mh

These aren't defined by mingw32ce. And likely defined by MS WinCE SDK,
but curl code doesn't use them in WinCE builds.

Closes #18093
2025-07-30 12:24:37 +02:00
Viktor Szakats
dfe3844c56
schannel: drop fallbacks for unused BCRYPT_* macros
In case they are used again in the future, the fallbacks are not
necessary for the supported mingw-w64 (v3+) and MSVC versions.

Follow-up to 6238888ca7 #15621

Closes #18091
2025-07-30 12:24:37 +02:00
Viktor Szakats
58906838c5
schannel: fix recent update for mingw32ce
Follow-up to 952c929bdf #18084
Closes #18097
2025-07-30 11:55:54 +02:00
Viktor Szakats
217ae24a94
build: fix mingw-w64 version guard for mingw32ce
Follow-up to a28f5f68b9 #18010
Closes #18095
2025-07-30 11:55:54 +02:00
Daniel Stenberg
8d00527e9e
schannel: use if(result) like the code style says
instead of comparing != CURLE_OK

Closes #18094
2025-07-30 11:26:04 +02:00
Stefan Eissing
83da4d9d3b
connectdata: remove primary+secondary ip_quadruple
Since the content varies during connection setup and while doing it
(eyeballing), remove these strcut from `connectdata` and replace use
with querying the connection filters. Those keep that information
already.

Change the info logging of established connections to also give the
local address and port.

Closes #17960
2025-07-30 10:56:19 +02:00
Dominik Tomecki
450c00f983
smtp: allow suffix behind a mail address for RFC 3461
Verified in test 3215

Closes #16643
2025-07-30 09:52:34 +02:00
Daniel Stenberg
3ccffad28d
RELEASE-NOTES: synced 2025-07-30 09:31:18 +02:00
Daniel Stenberg
4b1a5fe436
top-complexity: set cutoff level to 80
Closes #18080
2025-07-30 09:13:50 +02:00
Daniel Stenberg
d7918861d1
openssl: split cert_stuff into smaller sub functions
- rename it client_cert
- make it return CURLcode

Closes #18081
2025-07-30 09:12:10 +02:00
Daniel Stenberg
7ed349de4c
unit-tests: build the unitprotos.h from here
Make the bundle depend on the header in the lib dir and built it now if
not present.

Reported-by: Todd Gamblin
Fixes #18088
Closes #18089
2025-07-30 09:06:35 +02:00
Viktor Szakats
58e0ff809f
tidy-up: whitespace, indent, #if 0
Closes #18090
2025-07-30 03:46:21 +02:00
Viktor Szakats
daa5b044b8
cmake: defer building unitprotos.h till a test target needs it
Follow-up to c9bb9cd165 #17750
Ref: https://github.com/curl/curl/pull/17750#issuecomment-3133749477
Closes #18086
2025-07-30 02:38:14 +02:00
Viktor Szakats
00887aee8c
tests: merge clients into libtests, drop duplicate code
libtests and clients were built the same way after recent overhauls.
libtests are used by runtests, clients by pytests.

Merge clients into libtests, aligning their entry function signature,
dropping common utility functions, and simplifying the build.

Note: After this patch `CURLDEBUG` applies to cli tests, when enabled.

Also:
- lib552: drop local copy-paste debug callback in favor of testtrace.
- lib552: drop local copy-paste dump function in favor of testtrace.
- clients: use `long` for HTTP version, drop casts.
- clients: replace local dump function in favor of testrace clone.
- sync cli test entry function prototype with libtests'.
- h2_serverpush: replace local trace callback with testtrace.
- de-duplicate 3 websocket close, ping, ping, functions. Kept the pong
  iteration from `ws_pingpong`. Note: the pong clone in `lib2304` was
  returning an error when `curl_ws_recv()` returned non-zero and
  the payload matched the expected one anyway. After this patch, this
  case returns success, as it does in `ws_pingpong`.
  `lib2304` keeps passing, but I'm not sure if the previous behavior
  was intentional.
- display full value in websocket close, ping, pong, drop casts.

Closes #18079
2025-07-30 02:38:13 +02:00