]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
7 hours agosetopt: refactor setopt_cptr into smaller helper functions master
Daniel Stenberg [Thu, 18 Jun 2026 16:21:52 +0000 (18:21 +0200)] 
setopt: refactor setopt_cptr into smaller helper functions

This takes down the longest function to sub 500 lines

Closes #22095

13 hours agoKNOWN_BUGS.md: drop outdated CMake issues
Viktor Szakats [Fri, 19 Jun 2026 13:12:15 +0000 (15:12 +0200)] 
KNOWN_BUGS.md: drop outdated CMake issues

- "cmake outputs: no version information available"
  Ref: #11158

  Seems to be about missing support for autotools `--enable-versioned-symbols`.
  This was implemented for CMake in:
  14d4712db7e34fda25a11fd5f23f0f57a6aea67f #17039
  7100c5bc9b8c9c49a44c47d64b42e98b4de2465b #14818
  7b1444979094a365c82c665cce0e2ebc6b69467b #14378

- "generated `.pc` file contains strange entries"
  Ref: #6167

  Fixed in:
  9f56bb608ecfbb8978c6cb72a04d9e8b23162d82 #14681

- "CMake build with MIT Kerberos does not work"
  Ref: #6904

  The FindGSS module responsible for MIT Kerberos detection has seen 50
  updates since this report. In the last years I made many local tests
  with it, and it's also extensively CI-tested since (including Windows
  for a 1-year period), with no known issues.

If you see problems remaining, let us know in a new issue.

Closes #22108

16 hours agoGHA: update dependency cloudflare/quiche to v0.29.2
renovate[bot] [Fri, 19 Jun 2026 12:45:46 +0000 (12:45 +0000)] 
GHA: update dependency cloudflare/quiche to v0.29.2

Closes #22106

16 hours agovquic: fix `-Wunused-parameter` with proxies disabled
Viktor Szakats [Fri, 19 Jun 2026 12:11:50 +0000 (14:11 +0200)] 
vquic: fix `-Wunused-parameter` with proxies disabled

Fixing:
```
lib/vquic/vquic.c:864:56: error: unused parameter 'conn' [-Werror,-Wunused-parameter]
  864 |                              const struct connectdata *conn,
      |                                                        ^
```

Closes #22104

16 hours agoruntests: drop orphaned, no-op `-k` option
Viktor Szakats [Fri, 19 Jun 2026 08:34:40 +0000 (10:34 +0200)] 
runtests: drop orphaned, no-op `-k` option

And the corresponding internal variable.

This option became the always-enabled default earlier, via #4035.

Reported-by: Zartaj Majeed
Ref: #22098
Follow-up to 6617db6a7ed322d28322896aa20bcabf3a479e7c #4035

Closes #22100

30 hours agoGHA: re-sync Linux CMake triplet with autotools builds
Viktor Szakats [Thu, 18 Jun 2026 23:06:39 +0000 (01:06 +0200)] 
GHA: re-sync Linux CMake triplet with autotools builds

Follow-up to 8f5e4f020e79ec1fd1e8540bdea3c1c20030405b #22097

30 hours agoGHA: fix Linux triplet passed to `CMAKE_C_COMPILER_TARGET`
Viktor Szakats [Thu, 18 Jun 2026 22:17:50 +0000 (00:17 +0200)] 
GHA: fix Linux triplet passed to `CMAKE_C_COMPILER_TARGET`

Before this patch it broke clang 20/21 cmake builds on ubuntu-26.04-arm
runner, failing at the beginning of the configure stage while probing
the compiler.

Seen in the 'CM openssl clang krb5 LTO' job:
```
: && /usr/bin/clang --target=aarch64-pc-linux-gnu   CMakeFiles/cmTC_3d9ae.dir/testCCompiler.c.o -o cmTC_3d9ae   && :
    /usr/bin/aarch64-linux-gnu-ld.bfd: cannot find crtbeginS.o: No such file or directory
    /usr/bin/aarch64-linux-gnu-ld.bfd: cannot find -lgcc: No such file or directory
    /usr/bin/aarch64-linux-gnu-ld.bfd: cannot find -lgcc_s: No such file or directory
```
Ref: https://github.com/curl/curl/actions/runs/27778098314/job/82195462687#step:38:66

Follow-up to 36bd8074758a0b3a784403eb3d2cc31d240de896 #15242
Follow-up to 232302f88a152a1d1722da9f69c383a766528918 #14382
Cherry-picked from #22092

Closes #22097

31 hours agoGHA: separate pytype from other checkers and pips
Viktor Szakats [Thu, 18 Jun 2026 21:48:23 +0000 (23:48 +0200)] 
GHA: separate pytype from other checkers and pips

pytype is discontinued, does not receive further updates, and it
requires older python, offered by Ubuntu 24.04 or older.

Move it to its own GHA job to allow bumping the rest of checkers to.
newer runner images. Also move it out from the shared `requirements.txt`
and install directly from its separate GHA job, to avoid installing it
unnecessarily from others. Since it does not receive update, it's fine
to move out from Dependabot's view.

Ref: https://pypi.org/project/pytype/
Cherry-picked from #22092

Closes #22096

31 hours agocookie: check __Secure- and __Host- case sensitively when read from file
alhudz [Thu, 18 Jun 2026 14:31:20 +0000 (20:01 +0530)] 
cookie: check __Secure- and __Host- case sensitively when read from file

The header path matches these prefixes case sensitively, as 5af0165562
made it for cookie spec reasons, but the Netscape cookie-file path still
used a case-insensitive match. Align the file path so a differently
cased name like __secure-x is treated as an ordinary cookie instead of
being put through the prefix integrity checks.

Extended test 2311 to cover it.

Closes #22085

34 hours agosmb: constify `strchr()` result variable
Viktor Szakats [Thu, 18 Jun 2026 18:04:51 +0000 (20:04 +0200)] 
smb: constify `strchr()` result variable

Fixing (as seen with gcc-15 on Ubuntu 26.04):
```
lib/smb.c: In function 'smb_connect':
lib/smb.c:491:9: error: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  491 |   slash = strchr(user, '/');
      |         ^
lib/smb.c:493:11: error: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  493 |     slash = strchr(user, '\\');
      |           ^
```
Ref: https://github.com/curl/curl/actions/runs/27778098314/job/82195462418?pr=22092

Follow-up to 4e5908306ad5febee88f7eae8ea3b0c41a6b7d84 #20428
Follow-up to 7dc60bdb90c710c2e36b2d05aa3686ff491a9bbe #20425
Follow-up to 0e2507a3c65376d6bda860ff20bd94ada9bbb9fd #20421

Cherry-picked from #22092

Closes #22094

36 hours agoGHA/http3-linux: bump to ubuntu-26.04
Viktor Szakats [Thu, 18 Jun 2026 15:57:51 +0000 (17:57 +0200)] 
GHA/http3-linux: bump to ubuntu-26.04

Before: https://github.com/curl/curl/actions/runs/27772068909
After: https://github.com/curl/curl/actions/runs/27772321661?pr=22089

Closes #22089

36 hours agoMANUAL.md: update `apt-key` example
Viktor Szakats [Thu, 18 Jun 2026 17:00:48 +0000 (19:00 +0200)] 
MANUAL.md: update `apt-key` example

To use `tee` instead, due to `apt-key` being deprecated, and missing
from recent distros.

Also lowercase `stdin` to match rest of the file.

Ref: https://documentation.ubuntu.com/release-notes/26.04/summary-for-lts-users/#package-management-apt-3

Follow-up to b13e9066b3dfd65ba8aadc336232ae7832ac687a #16127
Follow-up to 54130a6cad4e044a199f40e857c300a139818b9b #10170

Closes #22090

37 hours agoGHA: bump analyzer/sanitizer jobs to clang-22, and ubuntu-26.04
Viktor Szakats [Thu, 18 Jun 2026 15:04:58 +0000 (17:04 +0200)] 
GHA: bump analyzer/sanitizer jobs to clang-22, and ubuntu-26.04

On Linux, and Windows cross-builds.

clang-tidy jobs look significantly faster. Other jobs remain around the
same (this feels nice after seeing the significant slowdowns in
Windows-2025, FreeBSD 15.)

Before: https://github.com/curl/curl/actions/runs/27770630688
After: https://github.com/curl/curl/actions/runs/27770913426?pr=22086

gcc-analyzer also got faster:
Before: https://github.com/curl/curl/actions/runs/27758865007/job/82127670883
After: https://github.com/curl/curl/actions/runs/27768696084/job/82162385765

Also:
- work around actionlint 1.7.12 not yet being aware of ubuntu-26.04:
  ```
  windows.yml:770:14: label "ubuntu-26.04" is unknown. available labels are [...]
  ```
  Ref: https://github.com/curl/curl/actions/runs/27769065782/job/82163700294#step:6:13
  Ref: https://github.com/rhysd/actionlint/issues/682
  Ref: https://github.com/rhysd/actionlint/pull/683

Follow-up to 5a2af800dea30b8ca5e6fa064ce2b8f2b9f0eb44 #22084

Closes #22086

37 hours agocurl_multi_assign.md: clarify lifetime
Daniel Stenberg [Thu, 18 Jun 2026 15:34:02 +0000 (17:34 +0200)] 
curl_multi_assign.md: clarify lifetime

Closes #22088

38 hours agoopenssl: do not mix OpenSSL int result with `CURLcode` variable
Viktor Szakats [Thu, 18 Jun 2026 15:12:03 +0000 (17:12 +0200)] 
openssl: do not mix OpenSSL int result with `CURLcode` variable

Seen with clang-22:
```
lib/vtls/openssl.c:3538:14: error: implicit conversion from 'int' to enumeration type 'CURLcode' is invalid in C++ [-Werror,-Wimplicit-int-enum-cast]
 3538 |     result = SSL_ech_set1_server_names(octx->ssl,
      |            ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 3539 |                                        peer->origin->hostname, outername,
      |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 3540 |                                        0 /* do send outer */);
      |                                        ~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```
Ref: https://github.com/curl/curl/actions/runs/27769068896/job/82163712258#step:42:43

Cherry-picked from #22086

Closes #22087

38 hours agoCURLMOPT_SOCKETFUNCTION.md: this sends *all* file descriptors
Daniel Stenberg [Thu, 18 Jun 2026 12:43:08 +0000 (14:43 +0200)] 
CURLMOPT_SOCKETFUNCTION.md: this sends *all* file descriptors

Since libcurl has more than just the main tranfer sockets to worry
about.

Closes #22081

38 hours agoGHA/linux: bump analyzer job to gcc-16, and ubuntu-26.04
Viktor Szakats [Thu, 18 Jun 2026 14:27:52 +0000 (16:27 +0200)] 
GHA/linux: bump analyzer job to gcc-16, and ubuntu-26.04

To fix false positive gcc analyzer warning
`-Wanalyzer-deref-before-check`, seen with gcc-15 and lower.

Also bump its pair job.

Tests with #22082 applied:
gcc-13: https://github.com/curl/curl/actions/runs/27761999978/job/82138558662 (warning)
gcc-15: https://github.com/curl/curl/actions/runs/27767571050/job/82158465527 (warning)
gcc-16: https://github.com/curl/curl/actions/runs/27767332723/job/82157636394 (OK)

Ref: #22082
Fixes #22083

Closes #22084

41 hours agopingpong: reject nul byte in server response line
alhudz [Sat, 13 Jun 2026 08:04:51 +0000 (13:34 +0530)] 
pingpong: reject nul byte in server response line

Add test 2108 covering the rejection over FTP. Drop the now-vestigial
nul bytes from test 1282; they exercised the removed Kerberos FTP
security buffer check and now trip this rejection before the 633
login-denied path is reached.

Closes #21996

42 hours agodocs/VERIFY: expand with more things we do
Daniel Stenberg [Thu, 18 Jun 2026 10:34:13 +0000 (12:34 +0200)] 
docs/VERIFY: expand with more things we do

Closes #22080

44 hours agoGHA/linux: use default GCC compiler, drop `CC`/`CXX` envs
Viktor Szakats [Thu, 18 Jun 2026 08:44:03 +0000 (10:44 +0200)] 
GHA/linux: use default GCC compiler, drop `CC`/`CXX` envs

At the time of the original commit, the runner was ubuntu-22.04 with
a default GCC 11. It made sense to bump to 12 manually. Since 2025,
the default is ubuntu-24.04 with GCC 13, when this became a downgrade.

Drop manual envs and bump to GCC 13 with it. Other options available are
14, 15 and 16.

Refs:
https://packages.ubuntu.com/jammy/gcc (ubuntu-22.04)
https://packages.ubuntu.com/noble/gcc (ubuntu-24.04)

Follow-up to 6079ff314b059c48f560065cdbe6da8334961e2b #22075
Follow-up to a8174176b5425c5692b55b78e40aef3a2331155f #13841

Closes #22077

44 hours agoGHA/http3-linux: simplify setting `CC`/`CXX` envs
Viktor Szakats [Thu, 18 Jun 2026 01:06:30 +0000 (03:06 +0200)] 
GHA/http3-linux: simplify setting `CC`/`CXX` envs

Replace `GITHUB_ENV` method by defining these envs at workflow-level.

Follow-up to a8174176b5425c5692b55b78e40aef3a2331155f #13841

Closes #22075

44 hours agoGHA/linux: drop arm runner home attribute workaround (fixed upstream)
Viktor Szakats [Thu, 18 Jun 2026 08:18:29 +0000 (10:18 +0200)] 
GHA/linux: drop arm runner home attribute workaround (fixed upstream)

Issue had been fixed in the ubuntu-24.04-arm runner image upstream.

now:
```
$ ls -l /home  # on arm
drwxr-x---  11 runner runner 4096 Jun 18 08:19 runner

$ ls -l /home  # on intel
drwxr-x---  11 runner runner 4096 Jun 18 08:19 runner
```

Follow-up to 2b0d8dcc16c531d3154ab54347a3eaabf9bd2c7d #20231

Closes #22076

45 hours agomulti: xfers_really_alive
Stefan Eissing [Wed, 17 Jun 2026 12:20:02 +0000 (14:20 +0200)] 
multi: xfers_really_alive

Yes, we were counting the "live" transfers before, but were they
*really* alive?

When determining to add the wakeup socket to fdset/waitfds etc, we
should only do that when the multi handle is actually processing
transfers. Other wise, the application could wait on the wakeup socket
forever.

For this, we counted `multi->xfers_alive` (e.g. the "running" number
returned by `curl_multi_perform()`). This was almost correct.

The problem is that added easy handles are counted as "alive" right away
on the addition. But the processing has not started yet. They did not
trigger any DNS resolves or opened any sockets yet.

Add two fields in multi and easy handle:

* `multi->xfers_really_alive`: counts the "alive" transfers that have
  passed `MSTATE_INIT` (at least once)
* `data->state.really_alive`: to track if the transfer has been counted

Add test 2412 to check that adding transfers without perform will not
trigger the wakeup socket to be added.

Fixes #22050
Reported-by: Bryan Henderson
Closes #22066

47 hours agoRELEASE-PROCEDURE.md: update coming relese dates
Daniel Stenberg [Thu, 18 Jun 2026 06:31:39 +0000 (08:31 +0200)] 
RELEASE-PROCEDURE.md: update coming relese dates

Adjusted for the summer of bliss 2026

47 hours agocookie: reject control octets in file-loaded cookies
alhudz [Wed, 17 Jun 2026 14:45:11 +0000 (20:15 +0530)] 
cookie: reject control octets in file-loaded cookies

Verified by test 2311

Closes #22070

47 hours agourl: don't log bits.close state
Yedaya Katsman [Wed, 17 Jun 2026 19:46:14 +0000 (22:46 +0300)] 
url: don't log bits.close state

This doesn't seem useful to users, and there doesn't seem to be a
scenario where bits.close is set to 1 during this logging anyway.

Closes #22073

2 days agocmake/FindGSS: drop CMake <3.16 compatibility logic
Viktor Szakats [Wed, 17 Jun 2026 16:27:13 +0000 (18:27 +0200)] 
cmake/FindGSS: drop CMake <3.16 compatibility logic

Redundant since bumping minimum to 3.18.

Follow-up to 89043ba90689418a115e967633e261139b48ce23 #20407
Follow-up to 1f112242323848d0ebfc88ae97b139d18e7987f6 #18950

Closes #22072

2 days agocmake/FindGSS: drop "MIT Unknown" version value, related tidy ups
Viktor Szakats [Wed, 17 Jun 2026 15:38:32 +0000 (17:38 +0200)] 
cmake/FindGSS: drop "MIT Unknown" version value, related tidy ups

After this patch the `GSS_VERSION` value is left empty in all cases when
there is known version number (potentially on Windows).

Also:
- sync `GSS_FOUND` comment with other Find modules.
- sync `GSS_VERSION` comment with other Find modules, drop the promise
  of returning "unknown", which was not true and also not done by other
  Find modules.
- tidy up Windows-registry-based MIT `GSS_VERSION` detection, by
  guarding the whole block for `WIN32`.
- drop fallback version value `MIT Unknown` used for MIT.
- fix vertical alignment in comment block.

Changing CMake log output like so (in affected config):
```
-- Found GSS: MIT (found version "MIT Unknown")
```
->
```
-- Found GSS: MIT
```

Spotted by Copilot
Bug: https://github.com/curl/curl/pull/22052#discussion_r3429273238
Follow-up to 558814e16d84aa202c5ccc0c8108a9d728e77a58

Closes #22071

2 days agoGHA/macos: enable krb5 in an autotools job
Viktor Szakats [Wed, 17 Jun 2026 14:22:52 +0000 (16:22 +0200)] 
GHA/macos: enable krb5 in an autotools job

Cherry-picked from #22052

Closes #22069

2 days agocmake: simplify `LINK_ONLY` imported target extraction
Viktor Szakats [Wed, 17 Jun 2026 11:50:52 +0000 (13:50 +0200)] 
cmake: simplify `LINK_ONLY` imported target extraction

Suggested-by: Kai Pastor
Ref: https://github.com/curl/curl/pull/21654#discussion_r3425296606
Follow-up to 3c597ced16e1f3aa7bfe08609add0feaf5c8d90d #21654

Closes #22063

2 days agoGHA/linux: give more time for `apt-get install`
Viktor Szakats [Wed, 17 Jun 2026 12:56:45 +0000 (14:56 +0200)] 
GHA/linux: give more time for `apt-get install`

3 minutes (was: 2).

IIn the hope it fixes timeouts, assuming the Ubuntu mirrors are only
somewhat slower sometimes (and not completely stalled).

Closes #22068

2 days agoGHA: sync apt-get code between workflows/jobs
Viktor Szakats [Wed, 17 Jun 2026 12:53:17 +0000 (14:53 +0200)] 
GHA: sync apt-get code between workflows/jobs

- delete 3rd-party apt sources, where missing.
- do `apt-get update`, where missing.

Closes #22067

2 days agoGHA/linux: allow more time for `apt.repos.intel.com` install
Viktor Szakats [Wed, 17 Jun 2026 12:15:01 +0000 (14:15 +0200)] 
GHA/linux: allow more time for `apt.repos.intel.com` install

Whether the install is extreme slow and will fail anyway, or only slower
sometimes, and this fixes, we will see.

Example:
```
Need to get 1159 MB of archives.
After this operation, 4463 MB of additional disk space will be used.
Get:1 https://apt.repos.intel.com/oneapi all/main all intel-oneapi-common-licensing-2023.2.0 all 2023.2.0-49462 [30.4 kB]
Get:2 https://apt.repos.intel.com/oneapi all/main all intel-oneapi-common-licensing-2026.0 all 2026.0.0-235 [30.7 kB]
[...]
Get:21 https://apt.repos.intel.com/oneapi all/main amd64 intel-oneapi-dpcpp-debugger-2023.2.0 amd64 2023.2.0-49330 [201 MB]
Error: The action 'install Intel compilers' has timed out after 2 minutes.
```
Ref: https://github.com/curl/curl/actions/runs/27683923870/job/81877924590

Follow-up to 50ff4f2927e3e319d39ba86bbcac3f57e5c89984 #21414

Closes #22065

2 days agoGHA/windows: do `apt-get update` in clang-tidy cross-build job again
Viktor Szakats [Wed, 17 Jun 2026 12:09:49 +0000 (14:09 +0200)] 
GHA/windows: do `apt-get update` in clang-tidy cross-build job again

Syncing with most similar uses in other workflows.

Fixing, e.g.:
```
E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/universe/l/
  llvm-toolchain-20/llvm-20-linker-tools_20.1.2-0ubuntu1%7e24.04.2_amd64.deb
  404  Not Found [IP: 172.66.152.176 443]
```
Ref: https://github.com/curl/curl/actions/runs/27682974841/job/81877061033?pr=22061

Follow-up to 1b8449674adb57ee0f60e761d654c69b20ee8fcf #14992

Closes #22064

2 days agoINTERNALS.md: document minimum nghttp3 and ngtcp2 versions
Viktor Szakats [Wed, 17 Jun 2026 10:42:12 +0000 (12:42 +0200)] 
INTERNALS.md: document minimum nghttp3 and ngtcp2 versions

Follow-up to 5eefdd71a394d135c0ffb56fb8ec117c87dbe4f0 #17027
Follow-up to 915f3981c93cba568806b16a5719ff444b62e365 #16320

Closes #22062

2 days agosrc: sync nghttp2 versions checks with current requirements
Viktor Szakats [Wed, 17 Jun 2026 10:35:20 +0000 (12:35 +0200)] 
src: sync nghttp2 versions checks with current requirements

Also:
- drop a redundant check.
- make the in-source error informative.

Follow-up to 2900c29218d2d24ab519853589da84caa850e8c7 #11473

Closes #22061

2 days agofirst.h reflow
Viktor Szakats [Wed, 17 Jun 2026 12:37:14 +0000 (14:37 +0200)] 
first.h reflow

2 days agohttp: for basic+digest auth, do not engage on empty user+passwd
Stefan Eissing [Wed, 17 Jun 2026 10:06:29 +0000 (12:06 +0200)] 
http: for basic+digest auth, do not engage on empty user+passwd

Since we have the quirky of empty credentials (the empty string for
username and password) for Negotiate reactivated, we need to check for
this when considering Basic and Digest auth.

Verify a redirect to blank user+password in test 2208

Closes #22060

2 days agodns-httpsrr-lookup: use origin, not peer
Stefan Eissing [Wed, 17 Jun 2026 09:50:35 +0000 (11:50 +0200)] 
dns-httpsrr-lookup: use origin, not peer

Origin is the correct peer for lookup of HTTPS-RR records.

Closes #22059

2 days agolibtest: unify on easy_setopt macro
Daniel Stenberg [Wed, 17 Jun 2026 09:02:19 +0000 (11:02 +0200)] 
libtest: unify on easy_setopt macro

- drop the old test_setopt() which did the same thing
- remove #if 0'ed macros from first.h

These macros now store results in 'result' more aggressively, but I
believe that is generally favorable.

Closes #22057

2 days agocreds: create with empty user+pass rc-8_21_0-3
Stefan Eissing [Tue, 16 Jun 2026 11:42:05 +0000 (13:42 +0200)] 
creds: create with empty user+pass

Allow creation of a `Curl_creds` instance with empty username and
password (not NULL username/password). There are authentication
schemes like <insert greek mythology'> that do not use the actual
values of username/password but trigger on the mere existance.

We have no test cases for this, so this is a shot in the dark
here.

Fixes #21943
Reported-by: Dan Fandrich
Closes #22044

3 days agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 16 Jun 2026 21:22:58 +0000 (23:22 +0200)] 
RELEASE-NOTES: synced

3 days agocf-dns: pass peer for result lookups
Stefan Eissing [Tue, 16 Jun 2026 10:07:08 +0000 (12:07 +0200)] 
cf-dns: pass peer for result lookups

The DNS filter knows the peer it resolves and the code parts that want
the results know the peer as well. Pass it to lookup methods to make
sure results match.

Background: when tunneling, the resolved peer is not always the one that
other filters are looking for. Especially when HTTPS-RR results are
accessed in TLS filters, those will differ.

This prevents a HTTPS-RR for a proxy to be used for the origin when ECH
is activated. To make ECH work through a tunnel, we need to start an
additional resolve. Something to be fixed after 8.21.

Closes #22042

3 days agoGHA: bump pip cryptography from 46.0.7 to 48.0.1
dependabot[bot] [Tue, 16 Jun 2026 19:48:28 +0000 (19:48 +0000)] 
GHA: bump pip cryptography from 46.0.7 to 48.0.1

Closes #22055

3 days agoconfigure: tidy up `OPT_APPLE_SECTRUST` initialization
Viktor Szakats [Tue, 16 Jun 2026 18:26:41 +0000 (20:26 +0200)] 
configure: tidy up `OPT_APPLE_SECTRUST` initialization

The OS detection variable is not initialized at the time of assigning
its value to `OPT_APPLE_SECTRUST`. Replace the current empty value with
`no`. This keeps existing, desired, behavior.

Closes #22054

3 days agoCI: improve labeler tag detection
Dan Fandrich [Tue, 16 Jun 2026 17:52:45 +0000 (10:52 -0700)] 
CI: improve labeler tag detection

3 days agocmake/FindGSS: prioritize MIT over GNU in pkg-config detection
Viktor Szakats [Tue, 16 Jun 2026 16:52:45 +0000 (18:52 +0200)] 
cmake/FindGSS: prioritize MIT over GNU in pkg-config detection

To match the non-pkg-config path, and also suspected user expectation.

This comes with a small incompatibility in return for more consistency.

Bug: https://github.com/curl/curl/pull/22052#discussion_r3422424979
Follow-up to 9e19a577eb93caae74c9793848efdf57480b04df #15176

Closes #22053

3 days agoperl: `open... || ` -> `open... or` (cont.)
Viktor Szakats [Tue, 16 Jun 2026 13:40:07 +0000 (15:40 +0200)] 
perl: `open... || ` -> `open... or` (cont.)

Also: unfold a few lines, fix a space, add a missing parentheses.

Follow-up to 678e63934cc4bd1941b20c5111d37a6e530d2a5d #22036

Closes #22047

3 days agoGHA: update google/boringssl to v0.20260616.0
renovate[bot] [Tue, 16 Jun 2026 13:14:06 +0000 (13:14 +0000)] 
GHA: update google/boringssl to v0.20260616.0

Closes #22046

3 days ago_URL.md: remove the zone-id mention
Daniel Stenberg [Tue, 16 Jun 2026 13:50:08 +0000 (15:50 +0200)] 
_URL.md: remove the zone-id mention

While correct, it felt random and misplaced there.

Closes #22048

3 days agourl: connection credentials origin
Stefan Eissing [Tue, 16 Jun 2026 08:12:24 +0000 (10:12 +0200)] 
url: connection credentials origin

When tying credentials to a connection (NTLM, Negotiate) also link the
origin the credentials are for. This prevents a connection reuse with
the same credentials, but intended for another origin.

The mis-reuse could happen for a forwarding proxy and NTLM (although, in
the mind of the person writing this, it is an insane setup).

Closes #22040

3 days agoservers: deduplicate `storerequest()` across two servers
Viktor Szakats [Tue, 16 Jun 2026 09:44:18 +0000 (11:44 +0200)] 
servers: deduplicate `storerequest()` across two servers

Closes #22041

3 days agotool_writeout: fix %time{} output for %s
Daniel Stenberg [Tue, 16 Jun 2026 06:58:36 +0000 (08:58 +0200)] 
tool_writeout: fix %time{} output for %s

Now testing both %s and %% in test 1981

Reported-by: wulin-nudt on github
Fixes #22038
Closes #22039

4 days agoperl: `|| die` -> `or die`
Viktor Szakats [Sun, 14 Jun 2026 23:26:04 +0000 (01:26 +0200)] 
perl: `|| die` -> `or die`

Usage was fifty-fifty between these syntaxes before this patch.

Closes #22036

4 days agosetopt: mark function argument as unused *properly*
Daniel Stenberg [Mon, 15 Jun 2026 20:58:19 +0000 (22:58 +0200)] 
setopt: mark function argument as unused *properly*

Closes #22035

4 days agoverify-release: don't unpack in git repo
Daniel Stenberg [Mon, 15 Jun 2026 15:11:53 +0000 (17:11 +0200)] 
verify-release: don't unpack in git repo

- Clarify that the tarball to verify should be put in the same dir you
  run the script.

- Verify that the curl version number in the file name matches the
  version number within the tarball. To reduce risk for mistakes.

- When verifying using git, do not unpack the tarball. It avoids the
  security risk with malicious tarball contents playing tricks on git.

- Only unpack the tarball for git-less verfication.

- Move the source tarball into _tarballs/ instead of overwriting it,
  which can be useful in case the verification fails

Closes #22032

4 days agocf-https-connect: do not engage on proxy origin
Stefan Eissing [Mon, 15 Jun 2026 15:13:00 +0000 (17:13 +0200)] 
cf-https-connect: do not engage on proxy origin

When talking to a forwarding proxy, do not start HTTPS Eyeballing.
We might support this in the future, but for now, the --httpx.x
arguments to do not apply to such a setup.

Add a test case for forward proxying without use of ALPN.

Closes #22033

4 days agocookie: use origin scheme for secure context check
Dave Walker [Mon, 15 Jun 2026 11:57:42 +0000 (12:57 +0100)] 
cookie: use origin scheme for secure context check

`Curl_secure_context()` checked `conn->scheme` to determine if Secure
cookies may be sent. Since 73daec6, `conn->scheme` is set to the proxy's
scheme when using an HTTPS forwarding proxy, causing the function to
return TRUE for HTTP origins. This leaked Secure cookies over the
plaintext connection between proxy and origin.

Use `data->state.origin->scheme` instead, which always reflects the
origin's scheme regardless of proxy configuration.

Not an approved vulnerability because the regression was introduced
after the last release and is not present in any released version.

Verified by test 3401

Follow-up to 73daec6620bf9983df89e8df3660bfa3b8fd501d
Reported-by: daviey on hackerone
URL: https://hackerone.com/reports/3803415
Closes #22024

4 days agotls: wolfssl: fixes for PQC key shares
Tobias Frauenschläger [Mon, 15 Jun 2026 14:51:18 +0000 (16:51 +0200)] 
tls: wolfssl: fixes for PQC key shares

This PR makes the wolfssl TLS backend work properly for PQC key
exchanges. The following issues are fixed:
* WOLFSSL_HAVE_KYBER is not present anymore in upstream wolfssl (for a
  long time actually), so it has no use and the ML-KEM functionality was
  never turned on properly.
* Key share group selection (via --curves) is now handled via the
  generic wolfSSL_CTX_set1_groups_list() method instead of the prior
  wolfSSL_CTX_set1_curves_list() and the additonal PQC handling. This
  removes a lot of PQC related special handling and the behavior now
  matches the OpenSSL backend.
* The default QUIC group setting has been removed. For QUIC, the key
  share as well as the list in the supported_groups extension is now
  handled all within wolfssl. This also supports --curves properly now.

Closes #22030

4 days agoservers: silence `-Wunused-result` with pragma
Viktor Szakats [Mon, 15 Jun 2026 19:27:51 +0000 (21:27 +0200)] 
servers: silence `-Wunused-result` with pragma

In some configurations the `write()` functions gets the
`warn_unused_result` attribute, that makes casting to `(void)`
ineffective to silence this warning. Seen with glibc, in 5 CI jobs.
The warning option appeared in GCC 4.5 and comes enabled by default.

```
tests/server/util.c:329:5: error: ignoring return value of â€˜write’ declared with attribute â€˜warn_unused_result’ [-Werror=unused-result]
  329 |     write(STDERR_FILENO, msg, sizeof(msg) - 1);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/27548333990/job/81427544632

Refs:
https://github.com/curl/curl/pull/22023#issuecomment-4708455631
https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Warning-Options.html#index-Wunused-result
https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Common-Attributes.html#index-warn_005funused_005fresult
https://stackoverflow.com/questions/40576003/ignoring-warning-wunused-result

Follow-up to c8d8f081fd62c68c588f8963a8e441c730a23b5b #22023
Follow-up to e95f509c66abdd88ae02e3243cdc217f19c4a330 #16852

Closes #22034

4 days agoservers: fix off-by-3 OOB write for large `loghex()` inputs
Viktor Szakats [Mon, 15 Jun 2026 15:04:44 +0000 (17:04 +0200)] 
servers: fix off-by-3 OOB write for large `loghex()` inputs

Spotted by GitHub Code Quality

Closes #22031

4 days agowinldap: avoid NULL pointer deref on `ldap_get_dn()` fail
Viktor Szakats [Sun, 14 Jun 2026 10:12:53 +0000 (12:12 +0200)] 
winldap: avoid NULL pointer deref on `ldap_get_dn()` fail

In non-Unicode builds.

Assisted-by: Jay Satiro
Closes #22000

4 days agocurl_formdata: fix to pass long where missing, document `CURLFORM_NAMELENGTH`
Viktor Szakats [Mon, 15 Jun 2026 09:47:05 +0000 (11:47 +0200)] 
curl_formdata: fix to pass long where missing, document `CURLFORM_NAMELENGTH`

- lib650: pass `long` to `CURLFORM_NAMELENGTH` in test.
  Spotted by Copilot.
  https://github.com/curl/curl/pull/22011#discussion_r3412407235
  Follow-up to 3620e569b312476f1e63b298106f942079b5afe8

- lib650: drop an interim variable, and interim casts.
  Follow-up to 60776a0515c2a8f572902ad5bcc9f63eeaeafa84 #2747

- curl_formdata.md: document `CURLFORM_NAMELENGTH` on man page.

- curl_formdata.md: pass `long` to `CURLFORM_BUFFERLENGTH` on man page.

- formdata: pass `long` to `CURLFORM_CONTENTSLENGTH` in comment.

Closes #22017

4 days agoservers: accept `lstat()` failing due to the file missing
Viktor Szakats [Mon, 15 Jun 2026 09:18:14 +0000 (11:18 +0200)] 
servers: accept `lstat()` failing due to the file missing

In `bind_unix_socket()`, before retrying `bind()`.

Before this patch the code wanted to check if the to-be-deleted unix
socket path was indeed a socket, before deleting it and retrying to
bind. If `lstat()` failed for any reason, it skipped retry. Fix to retry
if `lstat()` failed because of the file missing.

Ref: https://pubs.opengroup.org/onlinepubs/9799919799/functions/lstat.html

Follow-up to 0882e3951d910b923f3463fa98604df9fcb13a0c #22026
Follow-up to 03bc93bd327e06e86af0b0c14a888f7482affedc #22021
Follow-up to e70f8ebd34edade24df442152f52b361abaf4309 #22020
Follow-up to 30e491e5c921aecca5a16083d8185840dc64eccd #7034
Follow-up to 99fb36797a3f0b64ad20fcb8b83026875640f8e0

Closes #22010

4 days agoratelimits: use minimal burst rate
Stefan Eissing [Mon, 15 Jun 2026 08:19:56 +0000 (10:19 +0200)] 
ratelimits: use minimal burst rate

Some protocols (and servers) prefer to batch IO and will not send data
unless the window is of sufficient size. Set the burst rate for our
rate limits to a minimum of 32KB to prevent stalling.

Reported-by: Tatsuhiro Tsujikawa
Closes #22016

4 days agocf-setup: own source file
Stefan Eissing [Mon, 15 Jun 2026 11:48:24 +0000 (13:48 +0200)] 
cf-setup: own source file

Move the setup filter into its own source file.

Move the main connect driving function, `Curl_conn_connect()`,
from cfilters.c to connect.c.

Closes #22022

4 days agolib668: do not assume null-terminator in test input data
Viktor Szakats [Mon, 15 Jun 2026 12:41:19 +0000 (14:41 +0200)] 
lib668: do not assume null-terminator in test input data

For correctness. Did not cause an issue, because the null-terminator is
present.

Also:
- change a size type to avoid casts.
- reuse input length value.

Spotted by GitHub Code Quality

Follow-up to 1e4cb333ef632bf081045bb7b36f0736bec52708 #4826

Closes #22027

4 days agoservers: accept `unlink()` failing due to the file missing
Viktor Szakats [Mon, 15 Jun 2026 13:08:09 +0000 (15:08 +0200)] 
servers: accept `unlink()` failing due to the file missing

In `bind_unix_socket()`, before retrying `bind()`.

This patch uses `ENOENT`. This was last time in source between
d25b0503795f1fbf557632ce870298f52f2a78c1 (2018) and
dffd996e3b54a0c9314b1c93c7f837a5b2b1fc3d (2023), and also earlier. Also
defined by supported Windows envs. Seems safe to use.

Reported-by CodeQL
Follow-up to 99fb36797a3f0b64ad20fcb8b83026875640f8e0
Cherry-picked from #22010

Closes #22028

4 days agoverify-release: verify more thoroughly with git
Daniel Stenberg [Mon, 15 Jun 2026 10:15:56 +0000 (12:15 +0200)] 
verify-release: verify more thoroughly with git

If the script is invoked in a git repository it verifies the tarball
better.

Closes #22018

4 days agocf-capsule: complete filter
Stefan Eissing [Mon, 15 Jun 2026 10:34:09 +0000 (12:34 +0200)] 
cf-capsule: complete filter

Make the capsule filter complete, implement:

- pollset handling
- flush handling and querying
- shutdown handling
- replace allocated send buffer with a bufq

Closes #22019

4 days agosrc/test: avoid (void)! constructs
Daniel Stenberg [Mon, 15 Jun 2026 11:52:52 +0000 (13:52 +0200)] 
src/test: avoid (void)! constructs

The reason to use them seems to be that just (void) before a function
call is not enough to silence compiler warnings when return codes are
ignored and -Werror=unused-result is used.

While (void)! apparently works to silence those warnings, it is just too
weird and surprising to readers to use.

It is rather a reason to reconsider the usefulness of the warning.

Closes #22023

4 days agochecksrc: detect and warn for (void)!
Daniel Stenberg [Mon, 15 Jun 2026 11:51:52 +0000 (13:51 +0200)] 
checksrc: detect and warn for (void)!

It's plain weird. Don't do it.

Closes #22023

4 days agoVULN-DISCLOSURE-POLICY: non-released code
Daniel Stenberg [Mon, 15 Jun 2026 12:03:20 +0000 (14:03 +0200)] 
VULN-DISCLOSURE-POLICY: non-released code

Closes #22025

4 days agoservers: mask to `S_IFMT` in unix socket path attribute check
Viktor Szakats [Mon, 15 Jun 2026 12:03:07 +0000 (14:03 +0200)] 
servers: mask to `S_IFMT` in unix socket path attribute check

Instead of `S_IFSOCK` before this patch. For correctness; it is probably
not an issue in most environments.

Spotted by Copilot
Bug: https://github.com/curl/curl/pull/22021#discussion_r3413049506
Follow-up to 99fb36797a3f0b64ad20fcb8b83026875640f8e0

Closes #22026

4 days agotransfer: adapt Curl_xfer_is_secure()
Stefan Eissing [Mon, 15 Jun 2026 07:10:28 +0000 (09:10 +0200)] 
transfer: adapt Curl_xfer_is_secure()

Now that `conn->origin` can be the proxy, we need to change how
Curl_xfer_is_secure() and some other places work.

Pointed out by Codex Security

Closes #22015

4 days agoservers: drop unix socket path attribute check on Windows
Viktor Szakats [Mon, 15 Jun 2026 11:11:30 +0000 (13:11 +0200)] 
servers: drop unix socket path attribute check on Windows

On Windows there is no `lstat()`, which was later substituted with
normal `stat()`, but on Windows `S_IFSOCK` is never defined, which meant
the output of stat was not actually used, reducing this to checking for
the presence of the file, and bailing out without retry if missing.

Follow-up to 30e491e5c921aecca5a16083d8185840dc64eccd #7034
Follow-up to 99fb36797a3f0b64ad20fcb8b83026875640f8e0

Cherry-picked from #22010

Closes #22021

4 days agoservers: fix error message if unix socket path is not a socket
Viktor Szakats [Mon, 15 Jun 2026 10:48:59 +0000 (12:48 +0200)] 
servers: fix error message if unix socket path is not a socket

Follow-up to 99fb36797a3f0b64ad20fcb8b83026875640f8e0
Cherry-picked from #22010

Closes #22020

4 days agolibtests: prefer `sizeof()` over `strlen()`, fix potential OOB read in 1591
Viktor Szakats [Sun, 14 Jun 2026 19:54:06 +0000 (21:54 +0200)] 
libtests: prefer `sizeof()` over `strlen()`, fix potential OOB read in 1591

- test1591: fix potential OOB read.
  Spotted by GitHub Code Quality
  Follow-up to f464535bfdd9a83140d8a13c3fe3d937239d1c2a #3350

Closes #22011

4 days agourlapi: refactor and simplify curl_url_set
Daniel Stenberg [Sun, 14 Jun 2026 20:56:14 +0000 (22:56 +0200)] 
urlapi: refactor and simplify curl_url_set

Create and make use of:

- url_encode_part()
- url_uppercasehex_part()
- url_append_query()
- url_sethost()

Closes #22012

5 days agotidy-up: prefer spelling 'flavor', where missing
Viktor Szakats [Mon, 15 Jun 2026 00:44:59 +0000 (02:44 +0200)] 
tidy-up: prefer spelling 'flavor', where missing

In comments and two internal build variables.

Closes #22014

5 days agocmake/FindGSS: fix comment, adjust custom flavor property name
Viktor Szakats [Mon, 15 Jun 2026 00:14:13 +0000 (02:14 +0200)] 
cmake/FindGSS: fix comment, adjust custom flavor property name

- fix property name in comment.
- rename `INTERFACE_CURL_GSS_FLAVOUR` ->
  `INTERFACE_CURL_GSS_FLAVOR` to match preferred usage.

Follow-up to 8aeefd0b353021053688e53fc3a4b0edef85dcc7 (subcommit)
Follow-up to 16f073ef49f94412000218c9f6ad04e3fd7e4d01 #16973

Closes #22013

5 days agotidy-up: miscellaneous
Viktor Szakats [Thu, 11 Jun 2026 22:33:40 +0000 (00:33 +0200)] 
tidy-up: miscellaneous

- `N byte` -> `N-byte` or `N bytes`.
- INTERNALS.md: language tweaks.
- schannel: language tweak in comment/error message.
- socks_gssapi, socks_sspi: simplify composing an error message.
  (at a cost of 8 extra constant string bytes.)
- m4/curl-compilers.m4: fix typo in link (in comment).
- contrithanks.sh: fix indent, drop stray `;` terminator.
- lib, src, tests: drop/fix a bunch of badwords.
- fix typos in comments.
- fix indent, stray spaces.

Some of these spotted by GitHub Code Quality and Copilot

Closes #22009

5 days agosocks_sspi: store socks5_gssapi_enctype
Daniel Stenberg [Sun, 14 Jun 2026 10:44:44 +0000 (12:44 +0200)] 
socks_sspi: store socks5_gssapi_enctype

Store the unwrapped protection level in `conn->socks5_gssapi_enctype` to
prevent the proxy from contuning unprotected. Matches the GSSAPI version
of the code.

Reported-by: Trail of Bits
Closes #22004

5 days agosmb: integer overflow proof a size check
Daniel Stenberg [Sun, 14 Jun 2026 10:19:49 +0000 (12:19 +0200)] 
smb: integer overflow proof a size check

By using size_t for the vars instead of shorts.

Pointed out by Zeropath

Closes #22001

5 days agoservers: drop single-use interim result variables
Viktor Szakats [Sun, 14 Jun 2026 11:51:24 +0000 (13:51 +0200)] 
servers: drop single-use interim result variables

Closes #22008

5 days agoservers: minor socket error handling fixes
Viktor Szakats [Sun, 14 Jun 2026 12:36:24 +0000 (14:36 +0200)] 
servers: minor socket error handling fixes

- sws: fix socket error code in `select()` failure message.
  Spotted by Copilot
  Bug: https://github.com/curl/curl/pull/21998#discussion_r3409469444
- sws: do not call `SOCKERRNO` twice on error.
- dnsd: do not call `SOCKERRNO` twice on error.
- dnsd: replace `goto` with `while()` to sync with rest of code.
- dnsd: `sendto()` fail message fixes:
  - replace `int` cast with `%zu` mask.
  - drop redundant newline.
  - show socket error string like rest of code.
  - report not-fully-sent error separately from socket errors.

Closes #22007

5 days agortspd: sync up sleep loop with sws
Viktor Szakats [Sun, 14 Jun 2026 12:29:13 +0000 (14:29 +0200)] 
rtspd: sync up sleep loop with sws

Check for `!got_exit_signal` as part of the `while()` expression,
instead of doing it after calling `curlx_wait_ms()`. To simplify and
improve consistency with rest of code.

Follow-up to 0653fa107f6fb03555d49da86a1fbfc659873f5b
Follow-up to 123c92c904b2f258ae69e211aa2663e80cb5429a

Closes #22006

5 days agotests/servers: do not interpret `unlink()` retval as `errno`
Viktor Szakats [Sun, 14 Jun 2026 10:44:57 +0000 (12:44 +0200)] 
tests/servers: do not interpret `unlink()` retval as `errno`

In `socksd` and `sws` error messages.

Also:
- show the messages only if `unlink()` failed.
- rename a return code variable and sync a message text for consistency.

Ref: https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlink.html

Spotted by Copilot in `socksd.c`
Bug: https://github.com/curl/curl/pull/21998#discussion_r3409395013
Follow-up to 80eb71a3f5146f2ab5c5f8d8655d6861b5472668 #8687

Closes #22005

5 days agoperl: switch from backticks to `qx()`
Viktor Szakats [Tue, 19 May 2026 15:41:07 +0000 (17:41 +0200)] 
perl: switch from backticks to `qx()`

To make it easier to find external command invocation in the source.

Also drop backticks from a comment.

To find external command invocations in Perl code use:
```sh
git grep -E "((exec|qx|open2|open3|system)\(|open\(.+-\|)" $(<perlfiles>)
```

Refs:
https://perldoc.perl.org/functions/qx
https://perldoc.perl.org/perlop#Simpler-Quote-Like-Operators

Closes #21994

5 days agokrb5_sspi: fix error message on `DecryptMessage()` fail
Viktor Szakats [Sun, 14 Jun 2026 10:18:46 +0000 (12:18 +0200)] 
krb5_sspi: fix error message on `DecryptMessage()` fail

Spotted by GitHub Code Quality

Closes #22003

5 days agotelnet: drop an `int` cast no longer necessary
Viktor Szakats [Sun, 14 Jun 2026 10:26:46 +0000 (12:26 +0200)] 
telnet: drop an `int` cast no longer necessary

Spotted-by GitHub Code Quality

Follow-up to c5637baa06046d317c383d420f6cbc9ddb3b0870
Follow-up to 83a5e390654fb1e77c7c5d7bd32ba147ff022cbd

Closes #22002

5 days agosocket: use name `sockerr` for socket error variables
Viktor Szakats [Fri, 12 Jun 2026 21:42:50 +0000 (23:42 +0200)] 
socket: use name `sockerr` for socket error variables

Also:
- add comment explaining a `sockerr = errno` (vs. `SOCKERRNO`)
  assigment.

Closes #21998

5 days agosocks_sspi: invalid response length is a fatal error
Daniel Stenberg [Sun, 14 Jun 2026 10:13:42 +0000 (12:13 +0200)] 
socks_sspi: invalid response length is a fatal error

Pointed out by Zeropath
Closes #21999

5 days agoldap: base64 encode binary LDIF values with WinLDAP
Saud Alshareef [Fri, 12 Jun 2026 02:02:04 +0000 (05:02 +0300)] 
ldap: base64 encode binary LDIF values with WinLDAP

The WinLDAP backend only base64 encoded LDAP values when the attribute
name ended in ;binary. This made attributes such as jpegPhoto get
written as raw bytes, producing malformed LDIF output.

Match the OpenLDAP backend by also base64 encoding values with leading
or trailing blanks or non-printable bytes.

Fixes #21926
Reported-by: oreadvanthink on github
Closes #21982

6 days agosspi: free libcurl allocated memory with curlx_free
Daniel Stenberg [Fri, 12 Jun 2026 12:37:55 +0000 (14:37 +0200)] 
sspi: free libcurl allocated memory with curlx_free

DecryptMessage() decrypts the buffer in place, overwriting the original
contents. It does not allocate any new buffer so the single original
buffer should be freed using the same memory "system" that allocated it.

Reported-by: Trail of Bits
Closes #21990

7 days agotelnet: drop redundant interim variables
Viktor Szakats [Fri, 12 Jun 2026 21:50:03 +0000 (23:50 +0200)] 
telnet: drop redundant interim variables

Also reduce scope of a declaration.

Closes #21995

7 days agolib: transfer origin and proxy handling
Stefan Eissing [Fri, 12 Jun 2026 10:02:08 +0000 (12:02 +0200)] 
lib: transfer origin and proxy handling

Add `data->state.origin` as the origin the transfer is sending the
current request to/gets the response from. Use it for request specific
properties like authentication, hsts and cookie handling, etc.

Unless talking to a forwarding HTTP proxy (e.g. not tunneling),
`data->state.origin` and `conn->origin` are the same.

With a forwarding HTTP proxy in play, `conn->origin` is set to
`conn->http_proxy.peer` and `conn->bits.origin_is_proxy` (a new bit) is
set.

Remove the connection bits, now replaced with:

* `conn->bits.socksproxy` -> `conn->socks_proy.peer`
* `conn->bits.httpproxy` -> `conn->http_proy.peer`
* `conn->bits.proxy` -> `(conn->socks_proy.peer || conn->http_proy.peer`)
* `conn->bits.tunnel_proxy` -> (`conn->http_proy.peer && !conn->bits.origin_is_proxy`)
* `(conn->bits.httpproxy && !conn->bits.tunnel_proxy)` -> `conn->bits.origin_is_proxy`

Rename `noproxy.[ch]` to `proxy.[ch]`. Move the connection proxy setup
code from `url.c` to `proxy.c`.

Remove `data->info.conn_remote_port` as no one uses it.

Add test_40_02b for a SOCKS connection to a forwarding HTTPS proxy.

Update internal documentation about peers and creds.

Closes #21967

7 days agobuild: enable `-Wlogical-op` picky warning for GCC 4.4+
Viktor Szakats [Sat, 6 Jun 2026 12:24:29 +0000 (14:24 +0200)] 
build: enable `-Wlogical-op` picky warning for GCC 4.4+

Follow-up to 879a1514c3cf41926fd565db9e9ae62ab9733554 #21992

Closes #21893

7 days agosocket: introduce `SOCK_EAGAIN()` and use it
Viktor Szakats [Sun, 7 Jun 2026 23:21:44 +0000 (01:21 +0200)] 
socket: introduce `SOCK_EAGAIN()` and use it

To contain the logic of checking for both `EWOULDBLOCK` and/or `EAGAIN`
depending on platform/availability. Also to avoid checking for both if
they mapp to the same value, and to avoid PP guards around use.

This also ensures `EAGAIN` is consistently not checked on Windows, where
headers defined it, but `SOCKERRNO` never returns it, because curl maps
it to `WSAGetLastError()`.

If they map to the same value, checking them both in an `if` expression
trips GCC warning `-Wlogical-op` (the same way it triggers duplicate
case value error in `switch`).

Also:
- replace two `switch()` statements with the new macro.
- tests/server/sws: make two outliers use the new macro that were only
  checking for `EWOULDBLOCK` before this patch, in `connect_to()`.
- move variables to the left-side of expressions, where missing.
- rustls: use a variant of this macro that uses raw `EWOULDBLOCK`.
  Tried tracing it back to the origins, but I couldn't figure out if
  this is working as expected on all supported Windows versions in
  Rust. It seems to be using `GetLastError()`, according to
  https://docs.rs/system_error/0.2.0/system_error/, which would be
  probably incorrect.

Notes:
- it's probably a good idea to assign `SOCKERRNO` to a variable before
  passing it to this macro.

Cherry-picked from #21893

Closes #21992

7 days agoAmigaOS: fix build fallouts, re-add to CI
Viktor Szakats [Fri, 12 Jun 2026 15:51:22 +0000 (17:51 +0200)] 
AmigaOS: fix build fallouts, re-add to CI

Fix build issues:
- src: adjust `toolx_ftruncate()`.
- libtests/cli_ftp_upload: make `struct timeval` initialization portable.
- libtests/lib1960: do unconst in local `inet_pton()` macro.
- tests/server/dnsd: make it stub instead of failing the build.
- tests/server: make them link AmiSSL for `SocketBase`.

Also:
- bump AmiSSL to the latest release.
- add download hash checks and toolchain cache.
- sync restored code with local updates made since last year.

It takes 30 seconds per job, 1 minute in total.

Thanks-to: Bebbo
Thanks-to: Darren Banfi
Ref: https://github.com/curl/curl/pull/21989#issuecomment-4691380623
Follow-up to 7a14898264e9aa48f7f84f631288d728cade5d57 #17486

Closes #21993