Commit Graph

35793 Commits

Author SHA1 Message Date
Daniel Stenberg
034612cd51
tool_urlglob: polish, cleanups, improvements
- assert instead of printing "internal error" for unlikely events
- avoid allocating the main struct
- convert globerror() from macro to function
- renames to shorter and clearer names
- malloc + copy => memdup0
- change buffer handling to dynbuf
- realloc to handle more globs, but use less memory for few

Closes #18198
2025-08-06 08:47:53 +02:00
Stefan Eissing
6d5570c4dd
lib: replace conn [write]sockfd members by index
The `connectdata` members `sockfd` and `writesockfd` needed to by either
CURL_SOCKET_BAD or a copy of one of `conn->sock[2]`. When equal to one,
that index was used to send/recv/poll the proper socket or connection
filter chain.

Replace those with `send_idx` and `recv_idx` which are either -1, 0 or 1
to indicate which socket/filter to send/receive on.

Closes #18179
2025-08-06 08:47:12 +02:00
Daniel Stenberg
aec28f3ad3
splay: add another assert for detected usage problem
Closes #18199
2025-08-06 08:42:39 +02:00
renovate[bot]
a1e4e81431
GHA: update actions/download-artifact action to v5
Closes #18193
2025-08-06 08:41:44 +02:00
Qriist
ca2536a60f
BINDINGS.md: add LibQurl
Add LibQurl to the list of known binding libraries.

Closes #18195
2025-08-06 08:40:04 +02:00
Daniel Stenberg
e1a0e2b72c
config2setopts: avoid curlx_dyn_addf(..., "%s"
Closes #18194
2025-08-06 08:32:07 +02:00
Daniel Stenberg
bf5265ad11
dynbuf: assert on curlx_dyn_addf use with just "%s"
Because it is wasteful and should be done better.

Closes #18194
2025-08-06 08:32:07 +02:00
Viktor Szakats
7aa04d3395
GHA/curl-for-win: include CPU archs in job names
Closes #18191
2025-08-06 00:38:51 +02:00
Stefan Eissing
41fe621ae1
vtls: set seen http version on successful ALPN
When a HTTP version has been negotiated via ALPN, set the member
`conn->httpversion_seen` accordingly. This allows pending transfers to
reuse multiplexed http connections before the response to the first
transfer has arrived.

Fixes #18177
Reported-by: IoannisGS on github
Closes #18181
2025-08-05 16:01:39 +02:00
Daniel Stenberg
952117c032
tool_cb_hrd: remove global pointer from 'struct HdrCbData'
It is not necessary

Closes #18184
2025-08-05 15:47:56 +02:00
Daniel Stenberg
b3b7d65239
tool: replace three malloc + copy with memdup0
The function already existed for private use in var.c

Closes #18185
2025-08-05 15:46:51 +02:00
renovate[bot]
a7bacfe6e0
ci: update openssl/openssl to v3.5.2
Closes #18186
2025-08-05 14:51:21 +02:00
Daniel Stenberg
2978d33089
tool_cb_wrt: use dynbuf instead of "manual" malloc
When creating new file names for no-clobber

Closes #18182
2025-08-05 14:26:16 +02:00
Daniel Stenberg
fe4ade53b7
tool_cb_wrt: split out win_console() from tool_write_cb()
Closes #18180
2025-08-05 14:05:40 +02:00
Daniel Stenberg
b059f7deaf
setopt: add helper functions to setopt_long()
- Consistently keep options within ranges
- Reduce the maximum maxredirs value to fit a signed short
- Removed comments as the place to document the options is not here

Closes #18174
2025-08-05 13:47:47 +02:00
Viktor Szakats
b5d2e6e63f
GHA: pin jobs to windows-2022
To avoid being bumped to windows-2025 in September, and to stay with
the superior performance offered by windows-2022 runners.

Ref: #18140
Closes #18178
2025-08-05 13:42:35 +02:00
David Zhuang
60587049f7
vquic: use curl_getenv
getenv isn't defined on all platforms, which prevents vquic from
building. I specifically ran into this issue building on PlayStation.

Closes #18170
2025-08-05 13:12:00 +02:00
Roberto Hidalgo
4442e06b1f
openssl: output unescaped utf8 x509 issuer/subject DNs
Closes #18171
2025-08-05 13:08:40 +02:00
Daniel Stenberg
3689ef21bd
multi: change prefix for the network change bits to CURLMNWC_
Because "CURLM_" is used for curl multi error codes and it is convenient
to use the prefix to identify the number family.

Closes #18176
2025-08-05 13:05:59 +02:00
Daniel Stenberg
96ff6b98b4
curl_multi_get_offt: language fix
Closes #18175
2025-08-05 11:48:31 +02:00
Daniel Stenberg
b2e6dae695
curl_multi_get_offt: add separate man pages for the options
Follow-up to 1ad2009ad6

Closes #18168
2025-08-05 11:24:30 +02:00
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