Commit Graph

35972 Commits

Author SHA1 Message Date
Anthony Hu
2340a60070
wolfssl: rename ML-KEM hybrids to match IETF draft
Closes #18123
2025-08-05 08:58:19 +02:00
Daniel Stenberg
1f34125141
urldata: reduce two long struct fields to unsigned short
Closes #18173
2025-08-05 08:48:07 +02:00
Daniel Stenberg
df2b4ccc22
hostip: cache negative name resolves
Hold them for half the normal lifetime. Helps when told to transfer N
URLs in quick succession that all use the same non-resolving hostname.

Done by storing a DNS entry with a NULL pointer for 'addr'.

Previously an attempt was made in #12406 by Björn Stenberg that was
ultimately never merged.

Closes #18157
2025-08-05 08:05:31 +02:00
Viktor Szakats
06c12cc08b
build: disable TCP_NODELAY for emscripten
In WebAssembly, using `TCP_NODELAY` fails with:
```
* Could not set TCP_NODELAY: Protocol not available
```

Add a new feature macro in `curl_setup.h` telling whether `TCP_NODELAY`
is known to be supported at runtime, when defined at compile-time.

Keep `TCP_NODELAY` guards at their current positions to ensure the
necessary headers (e.g. `netinet/tcp.h` and `netinet/in.h`) define it.

Reported-by: Jeroen Ooms
Fixes #17974
Closes #18155
2025-08-05 00:34:24 +02:00
Daniel Stenberg
74ba04f5b2
RELEASE-NOTES: synced 2025-08-04 23:53:16 +02:00
Stefan Eissing
1ad2009ad6
multi: add new information extraction method
Adds `curl_off_t curl_multi_get_offt(CURLM *multi_handle, CURLMinfo_offt
info)` to the multi interface with enums:

* CURLMINFO_XFERS_CURRENT: current number of transfers
* CURLMINFO_XFERS_RUNNING: number of running transfers
* CURLMINFO_XFERS_PENDING: number of pending transfers
* CURLMINFO_XFERS_DONE: number of finished transfers to read
* CURLMINFO_XFERS_ADDED: total number of transfers added, ever

Add documentation for functions and info enums.

Add use in the curl command line tool to replace two static
variables counting the same "from the outside".

refs #17870
Closes #17992
2025-08-04 23:48:57 +02:00
Daniel Stenberg
fadc487567
writeout: add %time{}
Output the current UTC time using strftime format. %f is an extra curl
specific flag to output the microsecond fraction of the current second.

Verified by test 1981

Closes #18119
2025-08-04 23:45:48 +02:00
Stefan Eissing
5b80b4c012
lib: replace getsock() logic with pollsets
`getsock()` calls operated on a global limit that could
not be configure beyond 16 sockets. This is no longer adequate
with the new happy eyeballing strategy.

Instead, do the following:
- make `struct easy_pollset` dynamic. Starting with
  a minimal room for two sockets, the very common case,
  allow it to grow on demand.
- replace all protocol handler getsock() calls with pollsets
  and a CURLcode to return failures
- add CURLcode return for all connection filter `adjust_pollset()`
  callbacks, since they too can now fail.
- use appropriately in multi.c and multi_ev.c
- fix unit2600 to trigger pollset growth

Closes #18164
2025-08-04 23:43:13 +02:00
Petar Popovic
c85c2b7be7
tool_paramhlp: fix secs2ms()
- remove one zero from digs[5]
- remove size of size

Closes #18167
2025-08-04 23:26:32 +02:00
Viktor Szakats
ffafec8ffa
cmake: enable -Wall for MSVC 1944
MSVC=1944 is now tested in CI. It did not trigger new `-Wall` compiler
warnings, thus safe to enable `-Wall` for.

Closes #18165
2025-08-04 19:08:27 +02:00
Daniel Stenberg
13cbabf05f
curl: add --follow
Makes curl follow redirects an act on the response code and change a
custom method accordingly, contrary to --location.

Potential future command line to send QUERY and following a redirect
according to the status code:

    curl -d "request-body" -X QUERY --follow https://example.com

add test 794,796,797

Assisted-by: Daniel Böhmer <post@daniel-boehmer.de>

Closes #16543
2025-08-04 17:12:14 +02:00
Daniel Stenberg
29a6e15b27
setopt: split out cookielist() and cookiefile()
into their own sub functions

Closes #18162
2025-08-04 16:31:54 +02:00
Viktor Szakats
ff5140a25f
GHA/windows: give more time for Ubuntu installs
Recently sometimes the Ubuntu package repository is very slow to access.
Remove the time limit for the install step, and bump the total limit,
aligning with Linux jobs.

In most cases the `install packages` steps takes 15-25 seconds.
Sometimes this goes up to 30-45 minutes.

Reported-by: nevakrien on github
Bug: https://github.com/curl/curl/discussions/14854#discussioncomment-13988574
Closes #18163
2025-08-04 16:28:01 +02:00
Daniel Stenberg
854b0e230c
hostip: do DNS cache pruning in milliseconds
Instead of using integer seconds. Also: if the cache contains over
30,000 entries after first pruning, it makes anoter round and removes
all entries that are older than half the age of the oldest entry until
it goes below 30,000.

Closes #18160
2025-08-04 16:20:50 +02:00
Viktor Szakats
be71475b13
GHA/windows: show disk space used in each job
Also:
- make the dl-minge 6.4.0 job shared. To save 761MB of disk space, and
  speed up examples build step by 50% (10 seconds).

Closes #18150
2025-08-04 14:55:10 +02:00
Viktor Szakats
985f39c0ce
runtests: add --ci option, show Env: only when non-empty
To reduce log noise in local test runs:
- move the `buildinfo.txt` dump and header info lines
  `OS:`, `Perl:`, `diff:` behind a `--ci` `runtests.pl` option.
- enable this option for the CI test targets.
- hide `Env:` header info line if empty.
- merge `Env:` output into a single `logmsg()` call.

Closes #18147
2025-08-04 14:55:10 +02:00
Viktor Szakats
37ac4498ee
unit2604: avoid UNCONST()
Closes #18143
2025-08-04 14:55:10 +02:00
Viktor Szakats
c2fed8c669
libtests: use FMT_SOCKET_T, drop more casts
Follow-up to 37913c01a5 #18106

Closes #18142
2025-08-04 14:55:10 +02:00
Viktor Szakats
1644a49ab8
configure: if no perl, disable unity and shell completion, related tidy ups
Also:
- GHA/linux, macos: test `install` with autotools too.
- GHA/linux, macos: enable fish and zsh completion in an autotools job.
- scripts: drop dynamic perl checks redundant after this patch.
- scripts: drop two interim variables.
- autotools: make `build-certs` target check perl first.
- autotools: replace `$(PERL)` with `@PERL@` to match the pattern used
  in most automake scripts. For consistency. This makes `PERL` be
  defined at configure-time, as opposed to make-time, for these cases
  now.

Closes #18141
2025-08-04 14:55:10 +02:00
Daniel Stenberg
c27a2db54f
curl-config: remove X prefix use
That shellcheck now annoyingly and uselessly complains about.

Closes #18158
2025-08-04 10:01:07 +02:00
Viktor Szakats
38672f2eaf
cmake: fix to restrict SystemConfiguration to macOS
Also fix indentation and tidy up to use `STREQUAL` when checking for
Darwin.

Reported-by: Waldemar Kornewald
Fixes #18149
Regression from 739ef9804d #13713
Closes #18153
2025-08-03 23:35:28 +02:00
Daniel Stenberg
40caca581f
splay: rename KEY_NOTUSED TO SPLAY_SUBNODE
- explains its purpose better
- make it global static const
- added an assert for a condition that should never happen (that we
  also catch run-time)

Closes #18152
2025-08-03 22:06:26 +02:00
Stefan Eissing
d07504aa8d
unit2600: add another case
Add a case with 1 ipv4 and 3 ipv6 and check that all are attempted with
the correct minimum duration before failures. To check that more ipv6
than ipv4 lead to the correct behaviour.

Closes #18144
2025-08-03 22:03:42 +02:00
Viktor Szakats
51bc836c42
cmake: re-add simple test target, and name it tests
Before this patch there was no (easy) way to run tests without various
verbose options, hindering readability of the output due its length.

Unfortunately CMake reserves `test` as a target name, which was
the reason for its removal earlier. Re-add it with the name `tests`,
to have the functionality without the name collision.

Also add a `tests` target as an alias to `test` for autotools.

Ref: https://cmake.org/cmake/help/v4.1/policy/CMP0037.html
Follow-up to cfea4f2f4d #6258
Closes #18145
2025-08-02 15:03:54 +02:00
Viktor Szakats
d01d2ec9f1
docs: add CURLOPT type change history, drop casts where present
Some CURLOPT constants defined in the curl public headers were initially
enums (= ints), or macros with bare numeric values. Recent curl releases
upgraded them to `long` constants, to make them pass correctly to
`curl_easy_setop()` by default, i.e. without requiring a `(long)` cast.

This patch drops such casts from the examples embedded in the docs. At
the same time it documents which curl release made them `long` types,
to keep them useful when working with previous libcurl versions.

Also:
- drop a `(long)` cast that was never necessary.
- CURLOPT_ALTSVC_CTRL.md: bump local copy of macros to long.
- test1119: make it ignore symbols ending with an underscore, to skip
  wildcard, e.g. `**CURLAUTH_***`.

Closes #18130
2025-08-02 00:05:33 +02:00
Viktor Szakats
d1da9543f8
CURLOPT: replace (long) cast with L suffix for CURLHSTS_* macros
In curl/curl.h and the man page. To match the rest of CURLOPT macros.

Cherry-picked from #18130
2025-08-01 23:58:17 +02:00
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