Commit graph

39481 commits

Author SHA1 Message Date
Alhuda Khan
2ba2fe3540
ldap: base64-encode LDIF values beginning with colon or less-than
A value whose first byte is ':' or '<' is not a SAFE-INIT-CHAR per RFC
2849 and must be base64-encoded, but ldap_value_needs_base64() and the
inline check in oldap_recv() only encoded on a control byte or
leading/trailing blank. Such a value was emitted verbatim, producing
LDIF that strict parsers reject.

Closes #22339
2026-08-21 00:16:12 +02:00
Jayanth Vennamreddy
3bc93643cb
docs: connection reuse behavior for socket callbacks
Document observed behavior around connections reuse and socket
callbacks. When CURLOPT_CLOSESOCKETFUNCTION is copied and when it is
invoked.

Closes #20521
2026-08-21 00:12:45 +02:00
Alb3e3
74b732f637
tool_msgs: make notef() respect --silent
Until 8.17.0 the --silent check lived in voutf(), so it covered every
message type that went through it. 56450ce26f moved that check out to
the callers so that errorf() could honour --show-error, and warnf() and
errorf() got the check back, but notef() did not. Since then "Note:"
messages have been printed even with --silent, as long as tracing was
on.

Reported-by: Jace Laquerre
Fixes #22623
Closes #22625
2026-08-20 22:55:04 +02:00
Stefan Eissing
aab0518d04 url: fix handling of empty user in ntml matching
Line should already have been removed in 7103a93, but neither
humans nor clankers caught it. tststs...

Prior to this change it appears all reuse of empty cred connection was
blocked for ntlm instead of the intended behavior of allowing
reuse in the limited circumstance when it is the same connection used by
the transfer before.

Closes https://github.com/curl/curl/pull/22629
2026-08-20 11:35:43 -04:00
Dan Fandrich
f31251b645 test_07_upload: skip tests if nghttpx lacks QUIC
If nghttpx is available but lacks QUIC support, disable the tests that
depend on that support.

Co-authored-by: Stefan Eissing
Fixes #22609
Closes #22624
2026-08-20 07:41:56 -07:00
Daniel Stenberg
9b29495863
http: custom Authorization: header overrides Negotiate
As documented and as it does for other methods.

Difficult to test since it needs a successful kerberos ticket.

Reported-by: sdgh179 on github
Fixes #22610
Closes #22622
2026-08-19 23:39:09 +02:00
Daniel Stenberg
fc6c67ce86
docs: clarify that cookies need domain set to match
Especially important if reading cookies from HTTP headers, which is a
style we discourage.

Reported-by: accl on hackerone
Closes #22621
2026-08-19 22:54:46 +02:00
Daniel Stenberg
695aa15743
urldata: remove the aptr struct
Move the two remaining fields into the state struct instead, within the
HTTP ifdef.

Also: make the AWS sigv4 code always rely on the http_host value. It
was previously conditionally trying to also work if it was not set, but
that logic was not creating an identical copy so it would fail.

Closes #22620
2026-08-19 07:49:55 +02:00
Viktor Szakats
79132a1daf
GHA: use --subset runtests option, run random subset in riscv64 job
Also:
- drop most hand-tuned `--min` options, in favor of defaults.
- enable tests on emulated riscv64.
  Suggested-by: Dan Fandrich
  Ref: https://github.com/curl/curl/pull/22590#issuecomment-5303238102
- drop building examples on emulated riscv64.

Adding around 3.5 minutes to the riscv64 job:
0.5 Perl install, 2 minutes to build tests, 1 minute to run 100 tests.

Follow-up to 66486691ee #22619
Follow-up to e669179681 #22616
Follow-up to 58cb1e2f1f #22618
Follow-up to d00000673d #22602

Closes #22617
2026-08-18 16:07:42 +02:00
Viktor Szakats
66486691ee
runtests: divide minimum required tests by subsets
When the minimum comes from `CURL_TEST_MIN`, to improve the default
behavior. It may still need manual adjustment in cases.

Follow-up to e669179681 #22616
Follow-up to 58cb1e2f1f #22618
Cherry-picked from #22617

Closes #22619
2026-08-18 15:45:16 +02:00
Daniel Stenberg
e669179681
runtests: introduce a subset option
To make it easier to run different subsets of the tests in separate
invokes.

Closes #22616
2026-08-18 13:45:52 +02:00
Viktor Szakats
58cb1e2f1f
runtests: allow resetting CURL_TEST_MIN via --min=0
Set the default to `CURL_TEST_MIN` if set, first. Then process the
command-line options to override it. Previously, the env took over if
the command-line explicitly tried to set it to zero.

Ref: #22617

Follow-up to 3f1cd809ee #19942

Closes #22618
2026-08-18 13:20:46 +02:00
Daniel Stenberg
64ea25cfe6
KNOWN_BUGS: remove old entries and NTLM related
- The ancient Negotiate ones are just outdated
- NTLM is going away, no need to list the bugs anymore

Closes #22615
2026-08-18 12:22:44 +02:00
Viktor Szakats
b8b1dc0a0d
config-win32.h: drop UWP, c-ares, simplify more
UWP requires VS2015+. Project files have no support for c-ares.
Drop redundant guard, merge `#if` blocks.

Follow-up to 1db93bdb7c #22595

Closes #22613
2026-08-18 11:44:14 +02:00
Daniel Stenberg
b729003d83
TODO: remove "Support MQTTS"
implemented

Follow-up to 6c31df453b
2026-08-18 11:18:11 +02:00
Stefan Eissing
1d8f54823e
Happy Eyeballing v3: resolution delay of 25ms
After telemetry data from Mozilla reported the P99 DNS resolution
differences between A and AAAA responses to by 21ms, reduce curl's
resolution delay to 25ms.

What could possibly go wrong?

Closes #22612
2026-08-18 11:05:52 +02:00
Samuel Henrique
38c5ff6bfa
tests: fix Content-Length mismatch in test 2064
Closes #22611
2026-08-18 08:02:08 +02:00
Anton Karpov
05ddf5511a
headers: name the arguments the way the definitions name them
Eleven arguments are named one way in the header and another in the
definition. the compiler only checks types so nothing is broken, but the
header is what people read first, and then the name changes under them
in the source:

```
curl_dbg_malloc          size     ->  wantedsize
curl_dbg_calloc          n, size  ->  wanted_elements, wanted_size
curl_dbg_realloc         size     ->  wantedsize
curl_dbg_strdup          src      ->  source
r_freeaddrinfo           res      ->  cahead
my_get_line              fp, db   ->  input, buf
curl_slist_append_ccsid  l        ->  list
curl_version_info_ccsid  cid      ->  ccsid
curl_easy_setopt_ccsid   curl     ->  easy
```

Follow-up to df6014894b #20794

Closes #22550
2026-08-18 00:11:02 +02:00
Stefan Eissing
406edd036a
filter: change time reporting
Replace the QUERY filter methods for connect and appconnect time with a
new control CF_CTRL_REPORT_STATS that is triggered when a connect ends
(successful or not).

Filters in the connection can then report their statistics. Socket and
TLS filters do this only once. Subsequent CF_CTRL_REPORT_STATS will do
nothing.

This prevents timers to be reported twice in STARTTLS scenarios.

Fixes #22587 (again)
Closes #22596
2026-08-17 23:35:57 +02:00
Viktor Szakats
a01a24deaf
curlx_inet_pton: drop setting errno on error
Follow-up to bb406386d9 #22229

Closes #22607
2026-08-17 19:11:51 +02:00
Viktor Szakats
bb406386d9
curlx_inet_ntop: return CURLcode, drop setting errno
To simplify and to remove an exception where `errno` was reused to
return a socket error codes on Windows.

The error was used by one call site (`sockaddr2string()` in
`cf-socket.c`), but it was in practice always propagated as
`SOCKEAFNOSUPPORT` to callers.

Also:
- cf-socket: update 3 error messages to show `CURLcode` accordingly.
- if2ip: handle `curlx_inet_ntop()` error in `Curl_if2ip()`.
- dnsd: display `CURLcode` on two errors.

Follow-up to 39dec13ec0 #22170

Closes #22229
2026-08-17 18:41:31 +02:00
Daniel Stenberg
c2da5c7e66
RELEASE-NOTES: synced 2026-08-17 16:28:31 +02:00
Stefan Eissing
8e2eced234
multi: initialisation order
When creating a multi handle, global_init() may not have been
invoked that. There is a lazy check for this in easy_init()
that trigger global_init().

Create the admin handle for a multi first, before any further
operations, so easy_init() can trigger a global_init() when
necessary.

Closes #22606
2026-08-17 15:05:39 +02:00
Daniel Stenberg
5406d2627c
urldata: drop four strings from the aptr struct
- 'rtsp_transport'

  There is no need to keep this data around once the RTSP request has been
  issued.

- 'accept_encoding'

  Only needed when creating the RTSP request.

- 'uagent'

  The header is generated on demand from set.str[STRING_USERAGENT]

- 'ref'

  Not necessary to keep around

Closes #22603
2026-08-17 14:03:44 +02:00
Stefan Eissing
c437d28c76
urldata: cleanups
- sockindex: int -> int8_t
- move connectdata members around for fun and profit
- remove data->state.current_speed as unused
- remove data->state.trailers_bytes_sent as unsed
- remove data->state.trailers_buf as unsed

The sockindex type change spread a little.

Closes #22604
2026-08-17 14:03:14 +02:00
Stefan Eissing
722362d87b
scorecard: fix argument handling when count and parallel are both 1
Closes #22605
2026-08-17 14:02:08 +02:00
Viktor Szakats
0c22fcffe3
config-riscos.h: delete handcrafted RISC OS config header, in favor of autotools
According to the content of the latest downloadable builds available at
(from 2022): https://www.riscos.info/packages/src/Network/, these builds
used autotools, not the handcrafted header. Also the handcrafted header
did not see an update (that I could find) since
0866c1b52d (2002-04-08), other than
source-wide maintenance updates.

Closes #22598
2026-08-17 00:00:14 +02:00
Viktor Szakats
d00000673d
GHA/non-native: sync BSD tflags logic with other workflows
To make it easier to customize tests for individual matrix jobs.

Also:
- tested running riscv64 tests, but it takes too long (8.5-12 minutes,
  for ~1000 HTTP tests.)

Follow-up to bf594226d6 #22601

Closes #22602
2026-08-17 00:00:14 +02:00
Viktor Szakats
8eb978b9c2
GHA/non-native: drop leftover perl5 install from riscv64 job [ci skip]
Follow-up to bf594226d6 #22601
2026-08-16 12:41:04 +02:00
Viktor Szakats
4b42956cd1
build: drop detecting gettimeofday() on Windows
To remove a build difference between mingw-w64 and MSVC builds (where
mingw-w64 has it, while MSVC does not). Also to simplify and save the
cost of detection/verification in CI.

`gettimeofday()` was used in `curl_threads.c` in codepath practically
unreachable in Windows builds, and in `tool_writeout.c` that falls back
to `time()` for targets without it.

Ref: #22593

Closes #22594
2026-08-16 12:34:35 +02:00
Viktor Szakats
5b9946a106
curl_threads: always use native threads/mutex on Windows
Syncing with build systems, which already enforce this.

Closes #22593
2026-08-16 12:16:57 +02:00
Viktor Szakats
e090cf59ad
build: drop dirent.h and opendir() detections on Windows
`opendir()` was used previously with mingw-w64 for `file://` directory
listing support. This was replaced by a native Win32 solution on all
Windows platforms, leaving `opendir()` no longer used. Drop related
feature detections.

Follow-up to c7c42afab9 #22577

Closes #22588
2026-08-16 12:15:54 +02:00
Viktor Szakats
bf594226d6
GHA/non-native: BSD build improvements
- show binary sizes and file types in 'curl -V' step, like rest of
  workflows.
- make `build tests` step verbose.
- disable typecheck on emulated CPUs.
  It results in 3-4x speed-up for riscv64, and ~2x for ARM64 when
  building tests (in particular the libtests binary.)
  Ref: 9e6f1c5efb #19637
- enable building tests in an ARM64 job.
- move examples build test from ARM64 to riscv64 (to spread job times).

Closes #22601
2026-08-16 10:08:33 +02:00
Viktor Szakats
1db93bdb7c
config-win32.h: limit use to MSVC IDE Project builds
This is the only purpose it's maintained for.

Drop mingw-w64 and other logic falling outside of VS2010-2013 needs.

mingw-w64/MSVC platform differences keep being maintained/documented as
part of the CMake pre-fill logic in `CMake/win32-cache.cmake`.

Follow-up to ba8752e556 #12224

Closes #22595
2026-08-16 10:08:33 +02:00
Viktor Szakats
0c72958a67
GHA/windows: bump stunnel to 5.80
Ref: https://www.stunnel.org/NEWS.html

Closes #22600
2026-08-15 23:14:00 +02:00
Stefan Eissing
787cbd2033
multi: shrink expire timer indices
The enum `exire_id` fits easily into a uint8_t. Use that type for
storing expire timeout list indices.

Closes #22591
2026-08-15 22:35:20 +02:00
Viktor Szakats
fa21937ab0
GHA/non-native: sync BSD test exclusion logic with rest of workflows
Stop auto-skipping tests on emulated CPUs, replace it with explicit
`skipall` tags instead. To make it easier to enable tests on emulated
CPUs and to align with rest of workflows.

Closes #22599
2026-08-15 22:24:17 +02:00
Viktor Szakats
26dadd9ea3
GHA/windows: log preinstalled MSYS2 packages
CI jobs rely on defaults, sometimes to reduce log noise (possibly
improve performance a bit) or simplify, sometimes by accident. List them
to help debug or optimize on changes.

Refs:
https://github.com/actions/runner-images/issues/14562#issuecomment-5301777198
636489312c
https://github.com/msys2/MSYS2-packages/pull/6491
https://github.com/msys2/MSYS2-packages/pull/6479

Follow-up to d854ab4673 #22580
Follow-up to c349bd668c #14097

Closes #22589
2026-08-15 15:45:01 +02:00
hunterinvariants
c7c42afab9
file: support directory listing on Windows
Closes #22577
2026-08-15 11:56:25 +02:00
Stefan Eissing
ebc0fbc0e8
connect: only set connect timer on first socket
Only collect connect/appconnect timer stats on the first socket.

Fixes #22587
Closes #22592
Reported-by: GLaDOS-418 on github
2026-08-15 11:55:38 +02:00
Viktor Szakats
91323de7f3
GHA/non-native: bump cross-build-actions, NetBSD 11.0, FreeBSD riscv64
New riscv64 job takes 4.5 minutes.

Also:
- use prefill on riscv64 to save 2 minutes configure time.
- disable manuals/perl on riscv64 to save ~1 minute (install, build).
- cmake: fix `HAVE_GETHOSTBYNAME_R_6` prefill for FreeBSD.

Ref: https://github.com/cross-platform-actions/action/releases/tag/v1.4.0

Closes #22590
2026-08-15 11:21:11 +02:00
Stefan Eissing
3d6d93a6be
multi: timeout improvements
- Move expire timeout code from multi into splay.c
- keep a "time_base" timestamp to calculate timediff_t for
  actual timeout values. Unfortunately this means our
  timeouts will go wrong after ~500,000 years of continuous
  operations...
- use timediff_t as key in splay instead of curltime
- use timediff_t in transfers expire times instead of curltime
- re-comment splay.c for better understanding how it works
- replace splay nodes double-linked "same" list with a single link,
  we almost never have duplicate keys
- keep transfer `mid` in splay nodes instead of the transfer pointer
- keep registered bit in splay node for tracking instead of separate
  bit in transfer
- adapt unit1309.c to changes in timediff_t and mid

Closes #22584
2026-08-14 22:39:41 +02:00
Viktor Szakats
d854ab4673
GHA/windows: install MSYS2 Perl manually on Windows 2025 runner
In GitHub runner image windows-2025-vs2026 v20260810.198.2, the default
Perl binary changed from MSYS2 to Strawberry. The reason is that the MSYS2
installation not longer has Perl preinstalled.

As seen in CMake configuration:
```diff
- -- Found Perl: C:/a/_temp/msys64/usr/bin/perl.exe (found version "5.42.2")
+ -- Found Perl: C:/Strawberry/perl/bin/perl.exe (found version "5.42.0")
```

curl's Perl scripts require an MSYS2 Perl. Fix by installing it manually
in this one job.

Symptom was `gencert.pl` no longer finding openssl.exe:
```
Missing or broken 'openssl' tool. openssl 1.0.2+ is required.
```
Then the script hanging while trying to trace it.

Also:
- add distinct error message and list PATH elements if openssl is not
  found via `gencert.pl`.
- tried falling back to Git for Windows Perl, which caused the test step
  to either hang or run too slowly to fit the time slot.

Refs:
https://github.com/actions/runner-images/pull/14541
https://github.com/actions/runner-images/releases/tag/win25-vs2026%2F20260810.198

Bug: https://github.com/curl/curl/pull/22577#issuecomment-5286533641
Bug: https://github.com/curl/curl/pull/22577#issuecomment-5291468024

Closes #22580
2026-08-14 16:15:18 +02:00
Daniel Stenberg
fe703df949
lib: optimize struct layouts for reduced memory usage
struct SingleRequest tweaks

- 'upgr101' from enum upgrade101 => 'unsigned char', saves three bytes
- made some 'unsigned char' => uint8_t
- moved 'io_flags' to fill a hole on 64-bit arch

struct UserDefined tweaks

- Sort the fields by size. Larger to smaller. Helps avoding holes.
- httpsig_algorithm moved
- FTP uint8_t fields moved
- new_file_perms moved
- rtspreq moved
- sort fields on size

- urldata: drop 'struct Curl_data_priority'

  It only had a single struct member 'weight'. Use that directly instead
  to save indirections and struct alignments. Move field for size order.

- urldata: move the RTSP fields in the UrlState struct to be ordered by
  size

struct PureInfo tweaks

- make 'pxcode' a uint8_t
- move 'conn_protocol' to fill a hole
- sort 'struct PureInfo' fields by size

Closes #22585
2026-08-14 16:14:24 +02:00
Stefan Eissing
7103a93b05
connections: use admin handles only for maintenance
Maintenance tasks like connection upkeep, liveliness checks and cache
eviction must only run on an admin handle, not the application transfer
from the calling context.

Then application transfers will get only attached to the connections
they actually work on. This makes `data->state.recent_conn_id`
meaningful for checks if a subsequent address is finding the previous
connection again.

One thing led to another:
- add Curl_get_admin(data), to obtain an admin handle for
  an application handle, inheriting some properties for
  connection operation.
- rename `Curl_easy *data` parameter to `Curl_easy *admin`
  where only admin handles should be passed. Add DEBUGASSERTs
  in the called function.
- rename `Curl_conn_terminate()` to `Curl_conn_close()`
  because this makes connections enter the shutdown close
  where possible.
- rename `Curl_cshutdn_terminate()` to `Curl_conn_terminate()`
  since this definitely kills the connection and does not
  involve a `cshutdn` instance.
- add Curl_share_lock_share(), Curl_share_unlock_share()
  so it possible to operate on a share without the passed
  easy handle having the share set.
  This catches a case where a shared needed to be locked
  but was not before. Adjust test1554 results.

Fixes #22567
Reported-by: cybertron10 on github
Closes #22572
2026-08-14 14:01:21 +02:00
Stefan Eissing
6e9880366f
Revert "uint-bset: add slot0 member"
This reverts commit 743096a496.

Closes #22581
2026-08-14 13:41:03 +02:00
Daniel Stenberg
554efab7f6
multi: drop the assert from large expires
Triggers the fuzzers

Closes #22582
2026-08-14 13:39:42 +02:00
Daniel Stenberg
a3aaca10d9
multi: cap expire times to INT_MAX internally
When the time-out value is passed to the outside world it needs to fit
in a signed 32-bit variable (on Windows and 32-bit architectures)
anyway. Also, this is 3.5 weeks and we should not knowingly set timeouts
that long anyway.

The previous cap introduced in 3089e7eec8 was only partial.

Closes #22579
2026-08-14 10:39:47 +02:00
Daniel Stenberg
e825e55867
RELEASE-NOTES: synced 2026-08-14 10:36:39 +02:00
Thomas Chauchefoin
68b5e60138
dict: avoid busy-loop in sendf() when the socket is not writable
Curl_xfer_send() reports CURLE_AGAIN as a successful zero-byte send, so
the retry loop spun at 100% CPU and ignored the timeout when the peer
stopped draining. Wait for writability and check the remaining time
between retries.

Closes #22576
2026-08-14 10:12:30 +02:00