`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#22577Closes#22588
- 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
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#12224Closes#22595
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
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.0Closes#22590
- 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
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/14541https://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-5291468024Closes#22580
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
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
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
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
In the totally unlikely event that next_easy_id would ever wrap, avoid
undefined behavior. It is a signed type.
Also: update the related comment in urldata.h that mentioned LONG_MAX
but is nowadays CURL_OFF_T_MAX
Closes#22569
Since this code needs to work (identically) on systems with 32 bit longs
anyway, this might just as well always use 32 bit to save space and make
the code work the same everywhere.
Closes#22564
Reorder logic when looking for matching connections. Check candidate
Negotiate/NTLM state first. Require same "input" parameters when
connection is already authenticated. Same for proxy.
Deny connection reuse for empty usernames for NTLM/Negotiate using
connections.
Reported-by: Martin Dukek
Closes#22528
- drop redundant casts for `CURL_UNCONST()` pointers (Windows).
- GHA/linux: delete redundant/dupe `-g` C flag in memory sanitizer job.
Spotted-by: Daniel Stenberg
- examples/http2-upload: drop local macro.
- examples/http2-upload: drop leading underscore from union name.
- examples/http2-upload: drop interim macro.
- tests/server/util: reapply patch lost in a rebase.
- sync `main()` declarations across the codebase.
Closes#22559
Keep only a single `start` time and calculate the rest in delta
microseconds since then. Separate timestamps and durations into separate
sub-structures for clarity.
remove progress.t_acceptdata
It was recorded in FTP accept but never used anywhere.
Closes#22547
The only usage of the thread queue and pool is for "DNS" which is a
static string. No point in strdup'ing it (twice). Future users are
*likely* to also used fixed strings, otherwise we revert this change
when dynamic names are introduced.
Reported-by: Max Dymond
Closes#22555
The dedotdotify() function that removes ./ and ../ sequences from paths
juggles memory and is slow. Now needs_dedotdot() is called first to
determine if the removal process is necessary and otherwise avoids doing
it. Avoids unnecessary memory operations.
Adjusted unit test 1395 accordingly because now a lot of input strings
return NULL for "no change necessary".
Suggested-by: Max Dymond
Closes#22557
`pccritic` is available on the latest macOS runner revision (not every
job runs get it yet), Cygwin, MSYS2/mingw-w64 (one job, others will
follow on the next msys2/setup-msys2 Action bump). It will be
automatically used on BSDs, once they start offering it. Missing from
Linux jobs.
Also:
- GHA/windows: convert `libcurl.pc` to Unix newlines to bump score
96 to 100 in mingw-w64 jobs.
CMake-specific fix pending in: #22556
- GHA: verify with minimum `pccritic` score 94 to 100 (depending on CI
job).
- build: fill `Maintainer:` `libcurl.pc` property when run curl CI.
Issues remaining:
macOS:
```
[info ] Cflags adds an include path already on the default search path (pkgconf strips it): -I/usr/local/include (cflags/PC031)
[info ] Libs adds a library path already on the default search path (pkgconf strips it): -L/usr/local/lib (libs/PC040)
[minor ] Libs.private contains an unexpected flag: /Applications/Xcode_26.6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.5.sdk/System/Library/Frameworks/GSS.framework (libs/PC041)
```
Windows:
```
[minor ] file uses CRLF line endings (style/PC061)
```
Ref: #22556
Follow-up to b9254da617#22548
Follow-up to 852f5d34da#22553
Follow-up to 4d9ba9fef4#22545
Follow-up to 6c7993d4d9#22536
Follow-up to 3f1c033afe#22519Closes#22543
To keep it tidy and to support properties in the template that only
appear in the generated `libcurl.pc` when filled.
E.g. `Required.private` may remain empty after #22548.
Also:
- GHA/windows: dump `libcurl.pc` to log in every job
- tidy up a pre-existing regex in the updated command.
2c22d3069a#22544
Ref: b9254da617#22548
Cherry-picked from #22543Closes#22553
Before this patch static-only libcurl builds stored the list of module
dependencies in both `Require` and `Require.private`. The new `pccritic`
tool flagged this as an issue. Having (or not) a duplicate in
`Require.private` does not change the output created by `pkgconf` and
`pkg-config`, as tested with both with and without `--static` option.
Thus, fix by deleting the private copy.
Fixing:
```
$ pccritic libcurl.pc
bld/libcurl.pc
score: 63/100 grade: D (0 critical, 0 major, 9 minor, 1 info)
[minor ] 'libssh2' appears in both Requires and Requires.private (requires/PC051)
[minor ] 'libidn2' appears in both Requires and Requires.private (requires/PC051)
[minor ] 'openssl' appears in both Requires and Requires.private (requires/PC051)
[...]
```
Ref: https://github.com/curl/curl/actions/runs/31495008715/job/93790403026#step:10:210 (macOS, CM clang OpenSSL torture)
Ref: https://github.com/curl/curl/actions/runs/31495008825/job/93790433646#step:9:216 (mingw, AM ucrt-x86_64 wolfssl c-ares U)
Follow-up to f057de5a1a#13911
Follow-up to 98e5904165#5373
Cherry-picked from #22543Closes#22548
curl already built like this in UWP mode; add a macro to allow building
regular Win32 targets too, meaning without the hidden GUI window, window
handler, and thus without support for shutting down `servers.exe`
gracefully. To test the server in CI as a plain console app and remove
one component/variable from the system, in an effort chasing flaky runs.
The graceful option was used by `taskkill` (without `-f`) in runtests,
and it has been disabled (in favor of always `-f` (forced) kill), in an
attempt to avoid taskkill hanging. Those resolved, but general CI
flakiness remained. We see `taskkill` invoked seldom per job, and in
most of these cases it doesn't find the PID requested. It means the
graceful option is not actually used since 2025-04, and rather rarely
before that. Also just today, the callback and main loop received a few
updates to avoid potentially unsafe calls and interaction with the ctrl
handler.
Not expecting anything breakthrough here. Also graceful shutdown
is a useful feature to cleanup properly and to be in sync with other
platforms.
Also: GHA/windows: enable in Windows CI jobs.
Ref: https://learn.microsoft.com/windows/console/registering-a-control-handler-function#listen-with-hidden-window-example
Follow-up to 7db9947fcf#22045
Follow-up to 9ea48811fe#22487
Follow-up to b11e0026f7#22495
Follow-up to 208b87744e#21039
Follow-up to f450f3801b#19897
Follow-up to 2701ac6a4d#19421
Follow-up to 4e203f65a1#17054Closes#22496