Compare commits

...

2402 commits

Author SHA1 Message Date
Viktor Szakats
2e5acc1b15
GHA/linux: rename mbedtls-prev env to align with Renovate
- rename version env to stay compatible with Renovate `matchStrings`.
- also switch to manual bumps.
  Bump rule was wrong, and deemed not worthy the complexity to fix.

Closes #21319
2026-04-14 18:54:23 +02:00
Viktor Szakats
7767b56862
GHA/http3-linux: bump OpenSSL 4 beta to final
Closes #21318
2026-04-14 18:54:23 +02:00
Daniel Stenberg
3a19987a87
urldata: move cookiehost to struct SingleRequest
To make it scoped for the single request appropriately.

Reported-by: Muhamad Arga Reksapati

Verify with libtest 2504: a custom Host *disabled* on reused handle

Closes #21312
2026-04-14 16:59:11 +02:00
Stefan Eissing
86f1e5b3f6
test dnsd: implement delayed responses
Add "Delay-A: ms", "Delay-AAAA: ms" and "Delay-HTTPS: ms" to the test
dnsd config and implement delayed response handling.

Add test_21_09 and test_21_10 to check that delayed responses connect
using the undelayed address family.

Closes #21299
2026-04-14 16:49:07 +02:00
Stefan Eissing
bcd94e2750
socks: use dns filter for resolving
Use a dns connection filter to resolve hostnames where their addresses
are locally resolved and forwarded to the SOCKS proxy.

This makes all improvements, like in #21295 for example, also apply
to socks connections. Curl_resolv() is now only called from a DNS
filter.

(ftp still calls Curl_resolv_blocking() in two places, one of which
 may be replaceable with a DNS filter as well to remove the block, tbd)

Closes #21297
2026-04-14 16:48:20 +02:00
Daniel Stenberg
0567e72168
tests: use %b64[] instead of "raw" base64
Closes #21313
2026-04-14 16:18:14 +02:00
Daniel Stenberg
188c2f166a
http: clear the proxy credentials as well on port or scheme change
Add tests 2009-2011 to verify switching between proxies with credentials
when the switch is driven by a redirect

Reported-by: Dwij Mehta

Closes #21304
2026-04-14 16:14:51 +02:00
Daniel Stenberg
9ceb3ff46a
urlapi: stop extracting hostname from file:// URLs on Windows
There is no reason we should treat this part different on Windows. Noe
anything except blank, localhost or 127.0.0.1 cause error there as well.

Also: fix query handling in urlencode_str

Closes #21296
2026-04-14 12:09:48 +02:00
Daniel Stenberg
0b4ebebb06
test1675: unit tests for URL API helper functions
- ipv4_normalize
- urlencode_str
- ipv6_parse
- parse_file

urlapi: make the string URL encoder normalize to uppercase
percent-encoding

Closes #21296
2026-04-14 12:09:38 +02:00
Daniel Stenberg
d7a991cc9b
lib1560: fix comment typo 2026-04-14 12:09:04 +02:00
Daniel Stenberg
99ead4e0f0
request: cleanup the auth headers on soft rest as well
To avoid the risk them lingering around.

Follow-up to 3512b673dd

Closes #21311
2026-04-14 11:24:21 +02:00
renovate[bot]
67795ff730
GHA: update dependency google/boringssl to v0.20260413.0
Closes #21310
2026-04-14 11:04:10 +02:00
Daniel Stenberg
def4d8986e
http: use header_has_value() instead of duplicate code
Closes #21302
2026-04-14 10:16:43 +02:00
dependabot[bot]
bcb02fe526
GHA: bump pytest from 9.0.2 to 9.0.3
CVE-2025-71176

Closes #21306
2026-04-14 02:27:15 +02:00
Viktor Szakats
7b787f5995
KNOWN_BUGS: Native CA roots incomplete on Windows with OpenSSL/fork
Reported-by: finkjsc on github
Reported-by: nitrogene on github
Ref: #12303
Closes #20897

Closes #21305
2026-04-14 02:20:16 +02:00
Viktor Szakats
df6014894b
clang-tidy: enable more checks, fix fallouts
- enable three checks:
  - bugprone-invalid-enum-default-initialization
  - bugprone-sizeof-expression
  - readability-inconsistent-declaration-parameter-name (strict)
- fix remaining discrepancies with arg names in prototypes
  and implementation, in strict mode.
- document reason for some checks tested but not enabled.

Closes #20794
2026-04-14 02:20:16 +02:00
Viktor Szakats
e0dd6eb4a4
tidy-up: miscellaneous
- examples: sync debug output printf masks.
- INSTALL-CMAKE.md: tidy up section for some options.
- curl_sha512_256: delete comment suggesting an optimization.
- vtls/keylog: scope a variable.
- vtls/openssl: make a source code URL a permalink.
- vtls/schannel: drop redundant parentheses.
- test1119.pl: robustify `$1` -> `$s`.
- sync arg names in comments to match the code.
- tidy up and minor fixes to comments.
- fix formatting/indenting/comment/newline/include nits.
- move `UNITTEST` protos next to definitions, sync their argument names.
- make variables static.
- add parentheses to Perl `open()` calls.
- drop unnecessary double quotes in Perl.
- clang-format.

Closes #21000
2026-04-14 01:08:32 +02:00
Daniel Stenberg
3512b673dd
lib: move request specific allocations to the request struct
To make it clearer that they are ephemeral.

Closes #21301
2026-04-13 23:23:34 +02:00
Daniel Stenberg
7a349b5eed
setopt: fix typos in comments
Closes #21303
2026-04-13 23:12:05 +02:00
Daniel Stenberg
9ded494f0e
test1560: add a few more URL API test variations
Closes #21294
2026-04-13 21:58:55 +02:00
Stefan Eissing
40d57c9f58
hostip: resolve user supplied ip addresses
When a user supplied an ip address in a URL as hostname, use that even
when address family restrictions like -4 or -6 are set.

Add test_10_15/16 to verify with a local proxy server.

Fixes #21146
Reported-by: Terrance Wong

How:
- cf-dns: on see the hostname is an ip(v6) address, add the respective
  A/AAAA to the dns query bits
- cf-dns/hostip: only hand out addrinfos for a family if that family
  is part of the DNS queries. That prevents for example ipv6 addresses
  to show up from dns cache entries
- change cf-ip-happy to no longer check for "ip_version" and instead
  use all addresses that cf-dns hands out

Closes #21295
2026-04-13 19:52:30 +02:00
Daniel Stenberg
ec445fc595
setopt: move CURLOPT_CURLU
To fix cast from 'char *' to 'CURLU *' (aka 'struct Curl_URL *')
increases required alignment from 1 to 8

Follow-up to 3407bee8c8

Closes #21298
2026-04-13 14:34:16 +02:00
Jay Satiro
70bb0db767 schannel: increase renegotiation timeout to 60 seconds
Prior to this change the timeout was 7 seconds but that is too short for
enhanced-security users that have to fill out an interactive prompt on
Schannel renegotiation (PIN, smart card, etc).

Reported-by: Tim Omta

Fixes https://github.com/curl/curl/issues/21270
Closes https://github.com/curl/curl/pull/21291
2026-04-13 02:12:16 -04:00
Daniel Stenberg
3b68c67be2
RELEASE-NOTES: synced 2026-04-13 08:08:19 +02:00
Stefan Eissing
afdd8f1290
http: fix auth_used and auth_avail
Fix http auth to set the `picked` auth when sending the corresponding
headers. Fix reporting Digest as avail.

Fixes #21274
Reported-by: sergio-nsk on github
Closes #21284
2026-04-11 17:33:03 +02:00
Stefan Eissing
a483128b01
pytest: test threaded resolver
Add `resolv-threaded` to curlinfo to detect use of the threaded resolver
correctly even with c-ares linked to https-rr.

Run test_21_05 exactly when threaded resolver is built.

Closes #21287
2026-04-11 17:31:56 +02:00
Daniel Stenberg
879209fc88
unit1398: add msnprintf tests with negative precision
Closes #21292
2026-04-11 17:22:22 +02:00
Daniel Stenberg
3e40ccb875
getinfo: repair CURLINFO_TLS_SESSION
This should return a SSL_CTX pointer but it was accidentally broken.

Verify with test 1587

Follow-up to 2db8ae480f

Spotted by Codex Security

Closes #21290
2026-04-11 16:56:22 +02:00
renovate[bot]
935e1f9963
GHA: update dependency ruff to v0.15.10
Closes #21282
2026-04-11 02:21:33 +02:00
Viktor Szakats
8a3991e050
configure: tidy up comments
- convert `#` comments to `dnl`, except copyright headers, and inline
  comments in `curl-complilers.m4`.
- drop empty comments.
- drop line-ending `dnl` markers. (except `zz40-xc-ovr.m4` where it's
  used to produce a comment in `configure`.)
- replace `dnl` line with C comment in `AC_CHECK_HEADERS()`.

Verified to produce the same `configure` script except empty lines,
`#` comments, and C comments, with autoreconf 2.72.

Cherry-picked from #21000

Closes #21246
2026-04-10 23:19:41 +02:00
Daniel McCarney
0a7e1982fe
tests/http: add abrupt server close test
Test that connecting to a server that immediately closes the connection
produces an error instead of hanging/timing out.
2026-04-10 15:58:39 +02:00
kpcyrd
ce05754c7c
rustls: handle EOF during initial handshake
Closes #21242
2026-04-10 15:58:31 +02:00
Stefan Eissing
a5542c23e7
pytest: adding support for dnsd test server
Add tests to test_21 with checks for 'overrride-dns' from curlinfo.

Closes #21289
2026-04-10 14:29:29 +02:00
Stefan Eissing
7c8f11e953
pytest: switch off h3 for pytest_07_22
Run test_07_22 only on http/1.1 and h2. For h3, we get unreliable tests
results in CI due to (probably) nghttpx not always reporting the RESET
from the backend and the test timing out.

Closes #21286
2026-04-10 12:39:51 +02:00
Viktor Szakats
6e40c3ed48
vquic: fix variable name in fallback code
Could not cause an issue in practice.

Closes #21281
2026-04-10 12:10:23 +02:00
Daniel Stenberg
e5087ac9fc
http: on 303, switch to GET
... unless it is a POST and the user explicitly asked to keep doing
POST.

Add test1983/1984: verify --follow with 303 and PUT + custom GET

Fixes #20715
Reported-by: Dan Arnfield
Closes #21280
2026-04-10 09:39:39 +02:00
Daniel Stenberg
bb3670f929
tool: simplify retrycheck()
- By making retry_sleep() a separate funtion that determines how long to
  wait until the next retry.

- switch the retry timer to uint32 to make it uniform across platforms

Closes #21279
2026-04-10 09:38:15 +02:00
renovate[bot]
008aa2b38f
GHA: update awslabs/aws-lc to v1.71.0
Closes #21283
2026-04-10 08:21:48 +02:00
Viktor Szakats
7d49f47fcb
RELEASE-NOTES: fix typos [ci skip] 2026-04-10 00:10:58 +02:00
Stefan Eissing
ef49d42a2c
cfilters: CF_TYPE_SETUP connection filter
Connection filters can now carry the flag CF_TYPE_SETUP, indicating that
they are only needed during connection setup, e.g. connect.

Once the connection is fully established, those filter are removed
again. This frees resources and also makes the filter (call) chains
shorter.

Closes #21269
2026-04-09 14:10:28 +02:00
Stefan Eissing
a28540787c
asyn-ares: connect async
Make separate queries for A and AAAA records. Hand out A/AAAA/HTTPS
information before all queries are complete.

Closes #21205
2026-04-09 09:32:12 +02:00
Stefan Eissing
d99df64405
h3: HTTPS-RR use in HTTP/3
When HTTPS-RR is needed for the HTTP/3 handshake, delay the connect
until it arrives. Relevant only for TLS backends that support ECH, for
now.

Closes #21253
2026-04-09 09:30:52 +02:00
dependabot[bot]
3bde26dac8
tests/http: bump cryptography from 46.0.6 to 46.0.7
Closes #21273
2026-04-09 02:13:34 +02:00
renovate[bot]
8a3de6c8ce
GHA: update dependency wolfSSL/wolfssl to v5.9.1
Closes #21272
2026-04-08 23:32:25 +02:00
Viktor Szakats
1737e47f59
build: skip detecting pipe2() for Apple targets
To avoid (mis-)detecting it via the internal Apple library
`/usr/lib/system/libsystem_sim_kernel.dylib` when targeting iPhone
Simulator (seen with iPhoneSimulator26.4.sdk).

Reported-by: Ian Spence
Fixes #21236

Closes #21271
2026-04-08 23:32:25 +02:00
Stefan Eissing
567803db79
dns: https-eyeballing async
Make cf-https-connect work async correctly:
- only start first baller when at least one A/AAAA address
  is available
- select first connect attempt after that with HTTPS-RR info
  there or not.
- select second connect attempt only when HTTPS-RR is resolved
  (may have resolved to "not known") and select possible ALPN
  from things known by then. May not select any second attempt
  when first already covers everything.

This means when the HTTPS-RR is known at/before the first address
is resolved, everything behaves as before. When the HTTPS-RR is
late, a first connection attempt will have been started. Any
ALPN preference from the HTTPS-RR that is not already ongoing will
then start the second attempt.

For HTTPS-RRs that recommend 2 or more ALPNs, the first will always
be attempted: either it is already ongong or it will be the ALPN
for the second attempt. The 2nd ALPN recommendation from HTTPS-RR
*may* be honored or not, depending on what is already selected.

The difference in behaviour between early/late HTTPS-RR resolve
cannot be helped - unless we do not perform any attempts before
it arrives. Trade offs.

Closes #21267
2026-04-08 23:15:39 +02:00
Dan Fandrich
17e8200733 tests: make whitespace between functions and classes consistent
Mostly, this means two blank lines between classes and functions and one
line between methods. Since these checks are currently in preview, they
are done in a separate ruff invocation to avoid turning ALL the preview
checks on at the same time.
2026-04-08 10:28:05 -07:00
Dan Fandrich
98e470b3a8 tests: alphabetize and group Python imports & add check
- De-duplicates, groups, and sorts imports based on the provided `isort` settings.
2026-04-08 10:28:05 -07:00
Dan Fandrich
4c1b6f5494 tests: enable more ruff checks
- Checks for missing explicit `return` statements at the end of functions
that can return non-`None` values.
- Checks for classes that inherit from `object`.
- Checks for useless expressions.
- Within an `except*` clause, raise exceptions with `raise ... from err`
or `raise ... from None` to distinguish them from errors in exception
handling
- Checks for variable assignments that immediately precede a `return` of the
assigned variable.
- Checks for `else` statements with a `return` statement in the preceding
`if` block.
- Checks for unnecessary parentheses on raised exceptions.

Closes: #21258
2026-04-08 10:28:05 -07:00
Daniel Stenberg
698eee1b95
vtls_scache: include cert_blob independently of verifypeer
The making of the TLS session cache key should use the cert blob
independently of verifypeer on/off.

Follow-up to fa0ccd9f1f

Spotted by Codex Security

Closes #21222
2026-04-08 15:18:45 +02:00
Daniel Stenberg
283db12e05
parsedate: bsearch the time zones
There are 69 entries, bsearch is faster than linear search for random
access.

This now also makes the matching case sensitive (zone names always in
uppercase). No docs said otherwise and all tests assumed uppercase.

Extended test 517

Closes #21266
2026-04-08 12:00:59 +02:00
Viktor Szakats
5d84aa41a0
RELEASE-NOTES: update the entry for mk-ca-bundle.pl [ci skip]
To dsecribe the feature remaiming after follow-up commits.

Follow-up to 351e4f956a #21116
2026-04-08 11:41:55 +02:00
Daniel Stenberg
c0e7f70218
RELEASE-NOTES: synced 2026-04-08 11:33:11 +02:00
Daniel Stenberg
59c8de7897
mbedtls: fix ECJPAKE matching
It did not require a full-length match, so empty or prefix tokens map to
ECJPAKE would silently add that cipher to the configured list.

Follow-up to fba9afebba

Reported by Codex Security

Closes #21264
2026-04-08 11:27:31 +02:00
Ted Lyngmo
135665036f
docs: use the correct CURLOPT_WRITEFUNCTION signature
In order to not encourage users to use incompatible function pointers,
change the callback function definitions to use `char *` instead of
`void *` for the first argument.

Triggered by https://stackoverflow.com/questions/79921871/curl-c-c-library-based-application-produces-erronious-response-for-http-post-r#comment141032037_79921871 :

"The code was mostly modified from
 [this example code](https://curl.se/libcurl/c/postinmemory.html),
 honestly I never knew this is wrong. Thanks for pointing it out."

Signed-off-by: Ted Lyngmo <ted@lyncon.se>
Closes #21265
2026-04-08 11:25:54 +02:00
Daniel Stenberg
80b2a5dd37
tool_getparam: reduce opt_string complexity
- move arguments taking unsigned numbers into opt_num

- move arugments taking seconds into opt_secs

Closes #21261
2026-04-08 08:03:16 +02:00
Viktor Szakats
4c9af8b6d1
configure: silence useless clang warnings in C89 builds
Syncing with CMake.

Follow-up to 43397b0283 #21015
Follow-up to 09c9afdd71 #20363

Closes #21263
2026-04-08 03:51:54 +02:00
Viktor Szakats
f82ed74ed6
GHA/linux: bump mbedTLS 3 to 3.6.5 (from 3.6.4), also verify hash
Also:
- fix incorrect version in cache id.
  Follow-up to 3a305831d1 #19077
- latest version 3.6.6 fails pytests. Seems similar to the v4.1.0
  regression.
  https://github.com/curl/curl/pull/21178
  https://github.com/Mbed-TLS/mbedtls/issues/10668

Closes #21262
2026-04-08 02:31:44 +02:00
Viktor Szakats
b2a767dbce
gtls: fail for large files in load_file()
Used for issuer certs. Limit the size at `CURL_MAX_INPUT_LENGTH`, 8MB.

Bug: https://github.com/curl/curl/pull/21256#discussion_r3045854654

Closes #21257
2026-04-07 20:04:44 +02:00
Viktor Szakats
d3dc5dbc87
clang-tidy: avoid assigments in if expressions
Also enable check in clang-tidy.

Cherry-picked from #20794

Closes #21256
2026-04-07 16:57:46 +02:00
Daniel Stenberg
3536730f33
parsedate: clarify time2epoch and add more variations to test 517
Polish the time2epoch function to become a little more readable.

Corrected the military time zones: they were going in the wrong
direction.

Add more curl_getdate() input varations to test 517

Closes #21251
2026-04-07 16:32:22 +02:00
Daniel Stenberg
09f9035045
clang-tidy: drop readability-math-missing-parentheses
It's mostly annoying and not helpful
2026-04-07 16:32:22 +02:00
Stefan Eissing
db9b6fa82e
cf-ip-happy: limit concurrent attempts
Introduce a limit on the concurrent connect attempts of 6:

- document this in CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS
- close the oldest attempt before opening a new one that would
  exceed the limit
- closing failed attempts early to avoid sockets use beyong their
  usefulness
- add tests for limits in unit2600

These changes are externally visible as file descriptors will be
reassigned where we previously kept the old one around and started a
new socket, allocating always a new descriptor.

Closes #21252
2026-04-07 16:26:25 +02:00
renovate[bot]
44c19a2cce
GHA: update openssl/openssl to v3.6.2
Closes #21254
2026-04-07 16:09:51 +02:00
Daniel Stenberg
b168fc79ff
libssh: split myssh_statemach_act into sub functions and rename
Follow-up to bd3b2a626a

- rename it to myssh_statemachine

- remove the use of ternary operators in the switch

- fix the error handling for if 'sshp' actually ever is NULL

Closes #21250
2026-04-07 15:59:04 +02:00
Daniel Stenberg
a20989b82c
libssh2: split ssh_statemachine into more sub functions
The pieces of the state machine that were not separate functions before, now
are.

Also removed the use of ternary operators in the function calls.

Follow-up to f0bf43e209

Closes #21249
2026-04-07 14:50:42 +02:00
Daniel Stenberg
74a169575d
protocol: disable connection reuse for SMB(S)
Connections should only be reused when using the same "share" (and
perhaps some additional conditions), but instead of fixing this flaw,
this change completely disables connection reuse for SMB. This protocol
is about to get dropped soon anyway.

Reported-by: Osama Hamad
Closes #21238
2026-04-07 13:23:01 +02:00
Viktor Szakats
a0d5d8fea3
curl_ntlm_core: use wolfCrypt DES API with wolfSSL
Replacing the last uses of the OpenSSL compatibility API, and dropping
the redefinition of external symbols.

Closes #21247
2026-04-07 11:58:30 +02:00
Viktor Szakats
f974a00aba
lib: replace PRI*32 printf masks with C89 ones
Also: fix indent.

Follow-up to 13c1a93414 #20215

Closes #21234
2026-04-07 11:58:30 +02:00
renovate[bot]
f1e3091923
Dockerfile: update debian:bookworm-slim Docker digest to 4724b8c
Closes #21248
2026-04-07 07:50:19 +02:00
Daniel Stenberg
be92f0a2e4
lib: reserve 'result' for CURLcode, even more
Closes #21245
2026-04-07 07:48:58 +02:00
Viktor Szakats
fc3261b284
cmake: pre-fill HAVE_PIPE2 for two more platforms
For DragonFlyBSD and SunOS.

Also opt-in `BSD`, which is covering those listed explicitly, when using
CMake 3.25+.

Follow-up to 131a2fd5aa #16987

Closes #21243
2026-04-07 00:33:48 +02:00
Daniel Stenberg
9f5d1a38d1
lib: reserve 'result' for CURLcode
For consistency, whereever we use a local variable named 'result' that
is a CURLcode type. Make other types use other names.

Closes #21244
2026-04-06 23:12:06 +02:00
Daniel Stenberg
4cb4f9d602
cfilters: fix Curl_pollset_poll() return code mixup
Curl_conn_cf_poll did not map adjust_pollset failures to poll-style
errors properly, so error codes were treated as ready events.

Found by Codex Security

Closes #21231
2026-04-06 22:09:03 +02:00
Viktor Szakats
ecd09257d8
GHA/curl-for-win: drop certdata dependency and GITHUB_TOKEN with it
`certdata` dependency requires accessing api.github.com for
a reproducible timestamp, which in turn requires a GitHub token to avoid
errors due to rate limiting. Avoid all this by omitting this dependency,
which isn't necessary for these build tests anyway.

The `zero` job already did not use `certdata`, but disable explicitly
anyway just in case.

Reported-by: James Fuller

Follow-up to 9514184977
Follow-up to 128c252975 #21105

Closes #21241
2026-04-06 18:49:13 +02:00
Viktor Szakats
596f685da5
GHA: autoreconf downloaded tarballs where missing
To avoid using pre-built `./configure` scripts.

Also: drop unrecognized nettle `./configure` option.

Closes #21240
2026-04-06 18:49:13 +02:00
Viktor Szakats
7b96563a05
spacecheck.pl: fix to check 3+ newlines in all files
Follow-up to e52e6dac8e #20269

Closes #21237
2026-04-06 04:05:58 +02:00
Viktor Szakats
e078485b36
cmake: drop redundant condition
Follow-up to 43397b0283 #21015
Cherry-picked from #21000
2026-04-06 02:52:08 +02:00
Viktor Szakats
6e9df9f111
Makefile.am: replace stray := with = [ci skip]
`=` is used everywhere else in `Makefile.am` files.

Cherry-picked from #21000
2026-04-06 02:52:08 +02:00
Viktor Szakats
5fdb35a3bc
curl_setup.h: drop stray/unused USE_OPENSSL_QUIC guard
Follow-up to 6aaac9dd38 #20226

Closes #21235
2026-04-05 22:03:50 +02:00
Viktor Szakats
af08d642ea
man: fix argument type for CURLSHOPT_[UN]SHARE options
Closes #21232
2026-04-05 18:03:41 +02:00
Daniel Stenberg
f3176e0be8
CURLOPT_SOCKS5_AUTH.md: an access property
Reported-by: Cutiapreta on hackerone
Closes #21230
2026-04-05 17:47:57 +02:00
Viktor Szakats
8b50c9d1cc
GHA/windows: enable more options in 32-bit jobs
c-ares, gnutls, libssh, openssl.

Closes #21227
2026-04-05 17:41:11 +02:00
Daniel Stenberg
f22f08a0df
docs: noproxy wants the punycoded hostname version
Reported-by: Mehtab Zafar

Closes #21228
2026-04-05 16:53:09 +02:00
Viktor Szakats
20756bcf9a
libssh: fix 64-bit printf mask for mingw-w64 <=6.0.0
Fixing (dl-mingw, CM 6.4.0-i686 (mingw-w64 5.0.0) schannel !unity):
```
lib/vssh/libssh.c: In function 'myssh_in_SFTP_QUOTE_STATVFS':
lib/vssh/libssh.c:573:31: error: ISO C does not support the 'I' printf flag [-Werror=format=]
     char *tmp = curl_maprintf("statvfs:\n"
                               ^~~~~~~~~~~~
lib/vssh/libssh.c:573:31: error: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'uint64_t {aka long long unsigned int}' [-Werror=format=]
lib/vssh/libssh.c:573:31: error: ISO C does not support the 'I' printf flag [-Werror=format=]
[...]
```
Ref: https://github.com/curl/curl/actions/runs/24002480364/job/70000685821

mingw-w64 <=6.0.0 define `PRIu64` like this:
```
./inttypes.h:#define PRIu64 "I64u"
```

Follow-up to 413a0fedd0 #12346
Cherry-picked from #21227

Closes #21229
2026-04-05 16:45:30 +02:00
Daniel Stenberg
7813d9a077
share: do bitshifts after the type is checked to be valid
Fixes #21224
Reported-by: bird on github
Closes #21226
2026-04-05 16:07:54 +02:00
Viktor Szakats
8968a68eba
libssh: fix -Wsign-compare in 32-bit builds by dropping a redundant check
Follow-up to 8c8eeba522 #21214 (wrong silencing)
Follow-up to c049c37acd #18989 (add redundant check)
Follow-up to c988ec9f41 #9328 (make check fail)
Follow-up to 44a02d2532 #9324 (add original check)

Closes #21225
2026-04-05 15:23:02 +02:00
Viktor Szakats
acda4eae5e
runtests: allow configuring SSH host/client key algorithm
via env `CURL_TEST_SSH_KEYALGO`, `rsa` (default), `ecdsa`, `ed25519`.

To ease debugging and testing and to make these code paths more
universal.

Closes #21223
2026-04-05 11:19:42 +02:00
Daniel Stenberg
2e5d219205
sendf: fix CR detection if no LF is in the chunk
When doing line ending conversions, and a chunk contains no '\n', the
function returned early without updating prev_cr to reflect the last
byte. It could then lead to CRLFs sequences not get converted when
occuring right on the boundary border.

Found by Codex Security

Closes #21221
2026-04-04 22:32:54 +02:00
Viktor Szakats
ec22ea2502
GHA/windows: restore libssh, fix to pass tests with 0.12.0
libssh 0.12.0 on Windows 64-bit Intel fails to connect to sshd (with SSH
state 30) when using the mlkem768x25519-sha256 KEX. (32-bit Intel, ARM64
and tested non-Windows platforms work fine.) Fix by disabling this KEX
for the libssh job.

I do not recommend libssh on Windows due to bugs an insecure behavior.

Also:
- fix libssh TFLAGS condition for mingw-w64.

Follow-up to e127f8ce84 #21204
Follow-up to fcf946e846 #21195

Closes #21199
2026-04-04 18:34:13 +02:00
Viktor Szakats
c98d0a2e9a
sshserver.pl: add option to disable KEX algorithms in sshd
Cherry-picked from #21199

Closes #21220
2026-04-04 17:16:36 +02:00
Daniel Stenberg
741ee57375
doh: remove superfluous doh_req check
It has already been checked previously in the function.

Spotted by CodeSonar

Closes #21216
2026-04-04 17:10:37 +02:00
Daniel Stenberg
b669a58f2e
CURLOPT_UPLOAD_FLAGS.md: expand
And list each supported flag in a nicer way

Closes #21218
2026-04-04 17:09:23 +02:00
Daniel Stenberg
6d6d81e393
url: set default upload flags to CURLULFLAG_SEEN
As documented. Not doing this was a regression.

Follow-up to 6758aa722d

Reported by Codex Security

Closes #21217
2026-04-04 17:07:22 +02:00
Viktor Szakats
3b8bb1a86a
GHA/windows: bump OpenSSH-Windows to v10, other improvements
- use it in a mingw-w64 job.
- add support for native ARM64 binaries.
- add ability to use built-in OpenSSH server in mingw-w64 jobs.

Cherry-picked from #21199

Closes #21219
2026-04-04 15:52:44 +02:00
Viktor Szakats
f419afd058
GHA/windows: switch 3 mingw-w64 jobs to ucrt64
mingw-w64 (using msvcrt) is in legacy status.

Ref: https://www.msys2.org/docs/environments/

Closes #21213
2026-04-04 15:44:22 +02:00
Viktor Szakats
8c8eeba522
libssh: fix -Wsign-compare in 32-bit builds
Seen with mingw-w64 i686 gcc 15.2.0 (mingw32):
```
D:/a/curl/curl/lib/vssh/libssh.c: In function 'myssh_in_SFTP_QUOTE_STAT':
D:/a/curl/curl/lib/vssh/libssh.c:1664:13: error: comparison of integer expressions
  of different signedness: 'time_t' {aka 'long int'} and 'unsigned int' [-Werror=sign-compare]
 1664 |     if(date > UINT_MAX)
      |             ^
cc1.exe: all warnings being treated as errors
```
Ref: https://github.com/curl/curl/actions/runs/23966805891/job/69908216152

Cherry-picked from #21199

Closes #21214
2026-04-04 13:55:16 +02:00
Daniel Stenberg
d2110e7fcf
docs: CURLOPT_LOGIN_OPTIONS is a login property
Test case 1982 verifies this

Closes #21215
2026-04-04 12:37:39 +02:00
Daniel Stenberg
e96cb8b1d8
buildconf: remove
Not used since 85868537d6 (Aug 2020)

Removed from the release tarballs since 91fcbc5d1a (Aug 2024)

Closes #21210
2026-04-04 11:35:24 +02:00
Daniel Stenberg
b1784ead8e
RELEASE-NOTES: synced 2026-04-03 22:33:41 +02:00
Daniel Stenberg
1bf663e32f
dnscache: fix locking for negative caching
Reported-by: Izan on hackerone
Closes #21209
2026-04-03 22:27:59 +02:00
Samuel Henrique
f4eddde9dc
test 766: flag as timing-dependent
We have noticed this test as failing when run in parallel in Fedora and
Amazon Linux:
https://src.fedoraproject.org/rpms/curl/c/389f1409549178f639afa49f478c544fdaa87be2?branch=rawhide

Debian did not have issues but given there are other FTP tests flagged
as timing-dependent, it makes sense to flag this one too if we notice
failures in other OSes.

Closes #21155
2026-04-03 17:07:36 +02:00
Stefan Eissing
78e281bf6a
tool: fix retries in parallel mode
Verify that curl's --retry behaviour works

- test 502 in serial, works
- test 502 in parallel, hangs forver, test skipped by default
- test 401, no retries done

Fixes #20669
Reported-by: BlackFuffey on github
Closes #21206
2026-04-03 17:06:16 +02:00
Dan Fandrich
c54a3319ad CI: Fix or remove obsolete files in labeler config
Add a few more paths, too.
2026-04-02 10:11:42 -07:00
Daniel Stenberg
e65ba1bd34
hsts: make the HSTS read callback handle name dupes
Now the logic for handling name duplicates and picking the longest
expiry and strictest subdomain is the same for the callback as for when
reading from file.

Also strip trailing dots from the hostname added by the callback.

A minor side-effect is that the hostname provided by the callback can
now enable subdomains by starting the name with a dot, but we discourage
using such hostnames in documentation.

Amended test 1915 to verify.

Closes #21201
2026-04-02 18:01:20 +02:00
Viktor Szakats
dc20c91e04
GHA/windows: switch back to the canonical Cygwin mirror
The spare one is at the time of this patch inaccessible.

Follow-up to fb5541c28b #20583

Closes #21207
2026-04-02 17:00:05 +02:00
Viktor Szakats
e127f8ce84
GHA/windows: drop building with libssh
Bumping `msys2/setup-msys2` from 2.30.0 to 2.31.0 also brought libssh
0.12.0 (after 0.11.3). libssh has been long known for loading OpenSSH
configuration from disk insecurely on Windows. 0.12.0 brings some fixes
to this (CVE-2025-14821), which in turn may be changing its behavior on
the default GH Windows runner to fail all curl SCP/SFTP tests.

Detecting what is the exact root cause, then defining exact runtime
conditions for it is difficult and fragile. Same for changing these
libssh defaults (if at all possible.)

But, since configuration loading remains insecure and broken on Windows
even after the mitigations made by 0.12.0 [0], this patch removes libssh
from the Windows CI job using it previously.

If someone figures out how to run in CI, it can be readded, though in
general, using libssh on Windows seems to be less than ideal.

[0] 0e4bd38a5b/libssh.sh (L11-L94)

Refs:
https://www.libssh.org/2026/02/10/libssh-0-12-0-and-0-11-4-security-releases/
91382507d5
#21199 (unsuccessful fix attempts)

Bug: https://github.com/curl/curl/pull/21195#issuecomment-4173085194
Follow-up to fcf946e846 #21195

Closes #21204
2026-04-02 16:40:26 +02:00
Stefan Eissing
99d5b90878
asyn-thrdd: item cleanup using resolv_id
Now that we support multiple async operations at the same transfer,
fix the thread queue cleanup to match not only the mid but also the
resolv_id.

Found by Codex Security

Closes #21202
2026-04-02 13:15:53 +02:00
Stefan Eissing
33e43985b8
url: improve connection reuse on negotiate
Check state of negotiate to allow proper connection reuse.

Closes #21203
2026-04-02 13:14:29 +02:00
Daniel Stenberg
b27e828b93
url: init req.no_body in DO so that it works for h2 push
req.no_body was only initialized in Curl_connect, while HTTP/2 server
push adds a duplicated handle via Curl_multi_add_perform and calls
Curl_init_do with conn==NULL, never invoking Curl_connect.

Verify it by amending test 1620

Found by Codex Security

Closes #21194
2026-04-02 10:50:23 +02:00
Daniel Stenberg
93e80c75b4
hsts: accept 10K entries in the list
Up from 1K.

Reduces the risk that someone could flush the list by tricking a user to
do many transfers to new hostnames.

Document the limit.

Follow-up to 03a792b186

Closes #21200
2026-04-02 10:22:35 +02:00
Daniel Stenberg
d888a53e14
libssh: path length precaution
Make sure the string is non-zero before indexing it -1. Right now, the
path is always non-zero length so this is more for (future) safety
reasons.

Closes #21193
2026-04-02 09:55:25 +02:00
Dan Fandrich
38b626e790 CI: Improve labeler tag detection
Add entries for relevant new files added in the last two years.
2026-04-01 17:44:04 -07:00
Viktor Szakats
0b06b944fe
spelling: fix typos
Closes #21198
2026-04-01 22:50:12 +02:00
dependabot[bot]
fcf946e846
GHA: bump actions and pips
- update `actions/cache` from 5.0.3 to 5.0.4
- update `actions/download-artifact` from 7.0.0 to 8.0.1
- update `actions/upload-artifact` from 6.0.0 to 7.0.0
- update `msys2/setup-msys2` from 2.30.0 to 2.31.0
- update pip `ruff` from 0.15.7 to 0.15.8

Closes #21195
Closes #21197
2026-04-01 22:50:11 +02:00
Viktor Szakats
0df6c01db3
tidy-up: rename Curl_safefree()/tool_safefree() to curlx_safefree()
To sync names for the same macro logic between lib and src, and to move
it to the curlx namespace, to match `curlx_free()` that it's calling.

Closes #21151
2026-04-01 19:53:53 +02:00
Stefan Eissing
2b3dfb4ad4
lib: make resolving HTTPS DNS records reliable:
- allow to specify when they are wanted on starting a resolve
- match dns cache entries accordingly. An entry which never
  tried to get HTTPS-RRs is no answer for a resolve that wants
  it.
- fix late arrivals of resolve answers to match the "async"
  records that started them - if it still exists.
- provide for multiple "async" resolves in a transfer at the
  same time. We may need to resolve an IP interface while the
  main connection resolve has not finished yet.
- allow lookup of HTTPS-RR information as soon as it is
  available, even if A/AAAA queries are still ongoing.

For this, the "async" infrastructure is changed:

- Defined bits for DNS queries `CURL_DNSQ_A`, `CURL_DNSQ_AAAA`
  and `CURL_DNSQ_HTTPS`. These replace `ip_version` which says
  nothing about HTTPS.
  Use them in dns cache entries for matching.
- enhance the `async->id` to be a unique `uint32_t` for
  resolves inside one multi. This is weak, as the id may
  wrap around. However it is combined with the `mid` of
  the easy handle, making collisions highly unlikely.
  `data->state.async` is only accessed in few places where
  the mid/async-id match is performed.
- vtls: for ECH supporting TLS backends (openssl, rustls, wolfssl),
  retrieve the HTTPS-RR information from the dns connection filter.
  Delay the connect if the HTTPS-RR is needed, but has not
  been resolved yet.

The implementation of all this is complete for the threaded
resolver. c-ares resolver and DoH do not take advantage of
all new async features yet. To be done in separate PRs.

Details:

c-ares: cleanup settings and initialisation. Any ares channel
is only being created on starting a resolve and propagating
operations in setopt.c to the channel are not helpful.

Changed threaded+ares pollset handling so that they do not
overwrite each others `ASYNC_NAME` timeouts.

Add trace name 'threads' for tracing thread queue and
pool used by threaded resolver.

Closes #21175
2026-04-01 15:36:31 +02:00
Daniel Stenberg
03a792b186
HSTS: cap the list at 1,000 entries
Avoid never-ending growth.

When adding more entries, it now deletes the first entry in the list,
which is the oldest added entry still held in memory. I decided to avoid
a Least Recently Used concept as I suspect with a list with this many
entries most entries have not been used, and we don't save the timestamp
of recent use anyway.

The net effect might (no matter what) be that the removed entry might
feel a bit "random" in the eyes of the user.

Verify with test 1674

Ref #21183
Closes #21190
2026-04-01 14:38:41 +02:00
Daniel Stenberg
4f3a0ef90d
test1275.pl: ignore indented sections in markdowns
They are special and should not be checked like this.

Closes #21191
2026-04-01 14:36:10 +02:00
Daniel Stenberg
0805ec043e
altsvc: cap the list at 5,000 entries
Avoid never-ending growth.

When adding more entries, it now deletes the first entry in the list,
which is the oldest added entry still held in memory. I decided to avoid
a Least Recently Used concept as I suspect with a list with this many
entries most entries have not been used, and we don't save the timestamp
of recent use anyway.

The net effect might (no matter what) be that the removed entry might
feel a bit "random" in the eyes of the user.

Verify with test 1669.

Reported-by: Geeknik Labs
Fixes #21183
Closes #21189
2026-04-01 12:05:47 +02:00
Daniel Stenberg
c1963e2d2c
altsvc: drop the prio field from the struct
The value is not used for anything, no point in keeping it in memory.

Closes #21188
2026-04-01 11:06:43 +02:00
Daniel Stenberg
11609c3d45
alt-svc: skip expired entries read from file
Extend test 1654 to verify

Closes #21187
2026-04-01 10:56:11 +02:00
Daniel Stenberg
4478a10f0d
hsts: skip expired HSTS entries read from file
Extend test 780 to verify

Closes #21186
2026-04-01 10:49:26 +02:00
Daniel Stenberg
8e8bdd3604
cookie: fix rejection when tabs in value
A previous refactor changed the TAB check so that the octet could be
accepted in the 'path', which would cause an invalid line in the saved
cookie file so not possible to read the cookie back. Not terrible
because the path cannot contain a raw tab anyway so it would never match
anyway.

Add test 1685 to verify

Reported-by: Izan on hackerone

Closes #21185
2026-04-01 10:45:05 +02:00
Alex Hamilton
46d107d0e7
docs/cmdline-opts: tidy up retry-connrefused
Closes #21182
2026-04-01 08:34:56 +02:00
Daniel Stenberg
1ec912d292
http: refactor http_on_response into sub functions
Reduces complexity.

Closes #21172
2026-03-31 23:53:45 +02:00
Viktor Szakats
a5838847c4
GHA: try workaround for slow Azure Ubuntu distro server (cont.)
- fail if all retries failed.
- run `dpkg --configure -a` after an aborted slow attempt.

```
Selecting previously unselected package libsys-hostname-long-perl.
Error: slow server, retry
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
[...]
```

Bug: https://github.com/curl/curl/pull/21107#issuecomment-4163506100
Follow-up to 5172ba5475 #21107

Closes #21181
2026-03-31 23:39:47 +02:00
Daniel Stenberg
6eab0a42e3
md5: fix large size handling
Follow-up to dd7fcd581f

Closes #21180
2026-03-31 17:53:03 +02:00
Daniel Stenberg
dd7fcd581f
lib: accept larger input to md5/hmac/sha256/sha512 functions
Avoid unchecked data conversions from size_t to unsigned int.

Reported-by: James Fuller
Closes #21174
2026-03-31 17:19:56 +02:00
Viktor Szakats
1570091f10
INSTALL.md: refer to as Cygwin
Replacing `cygwin`.

Closes #21179
2026-03-31 17:17:47 +02:00
Viktor Szakats
f14d9e6efc
cmake: enable pthreads for BoringSSL/AWS-LC
Depends on 6828df7d21 #21176

Closes #21168
2026-03-31 17:17:47 +02:00
Daniel Stenberg
c31fcf2dec
docs: SSH host verification is done at connect time
Connection reuse is done more "casually" once verified.

Closes #21173
2026-03-31 17:15:47 +02:00
John Haugabook
c1f7ffd572
INSTALL.md: update Cygwin instructions
Polish Cygwin section of install, adding suggestions for:

- `cmake`
- `ninja`
- `setup --build-depends`

Closes #20995
2026-03-31 16:49:57 +02:00
Viktor Szakats
6828df7d21
cmake: improve passing build options to try_compile()
Pass build options directly via `COMPILE_DEFINTIONS` and
`LINK_LIBRARIES`, instead of "tunneling" them through `CMAKE_FLAGS`.
The latter method breaks when passing `Threads::Threads` as library via
`CMAKE_REQUIRED_LIBRARIES`, while also being complex and fragile.

Example:
```
-- Performing Test HAVE_FSETXATTR_5
CMake Error at bld/CMakeFiles/CMakeTmp/CMakeLists.txt:27 (target_link_libraries):
  Target "cmTC_3386e" links to:

    Threads::Threads

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

CMake Error at CMake/Macros.cmake:51 (try_compile):
  Failed to generate test project build system.
Call Stack (most recent call first):
  CMakeLists.txt:1684 (curl_internal_test)
```
Ref: https://github.com/curl/curl/actions/runs/23792043930/job/69329796592?pr=21168#step:38:318

Note: a side-effect is no longer passing C compiler flags (e.g.
`CMAKE_REQUIRED_FLAGS`) to the _linker_. This should not be an issue,
though CMake is passing them during its built-in detections.

Ref: https://cmake.org/cmake/help/v3.18/command/try_compile.html

Closes #21176
2026-03-31 13:23:46 +02:00
Daniel Stenberg
3e677a9a26
RELEASE-NOTES: synced 2026-03-31 09:02:47 +02:00
Daniel Stenberg
9b36748938
http2: return error on OOM in push headers
Reported-by: M42kL33 on hackerone
Bug: https://hackerone.com/reports/3636044
Closes #21171
2026-03-31 08:59:07 +02:00
Daniel Stenberg
2f93a0e6bb
CURLOPT_SSL_CTX_FUNCTION.md: expand on effects connection reuse
Closes #21164
2026-03-31 07:50:56 +02:00
Daniel Stenberg
8e89646a3d
tool_operhlp: iterate through all slashes to find name
If there is no trailing file name for -O or --remote-name-all, continue
searching until there is no more to search. A URL ending with multiple
slashes would previously make it do wrong.

Add test 1639 and 1644 to verify.

Follow-up to e26eefd9ce

Reported-by: James Fuller

Closes #21165
2026-03-31 07:43:47 +02:00
Dan Fandrich
bae6237c45 docs: list more dependencies for running Python HTTP tests
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Viktor Szakats <commit@vsz.me>
Closes #21110
2026-03-30 21:54:39 -07:00
Viktor Szakats
b9690e9cd1
cmake: silence bad library Threads::Threads warning
Seen on macOS:
```
CMake Warning at CMakeLists.txt:2158 (message):
  Bad lib in library list: Threads::Threads
```

Follow-up to 2d546d239e #21163

Closes #21170
2026-03-31 05:33:45 +02:00
Viktor Szakats
e49190f9f3
cf-https-connect: silence -Wimplicit-int-enum-cast with HTTPS-RR + clang 21 (reapply)
Reapply: e09a7b83d6 #21057

Also:
- enable HTTPS-RR by default in curl-for-win to test it with clang 21.
  Ref: dc65c449f3

Follow-up to 335dc0e3c5 #21027

Closes #21167
2026-03-31 03:32:36 +02:00
renovate[bot]
9dc3c06aa7
GHA: update dependency google/boringssl to v0.20260327.0
Closes #21166
2026-03-31 00:51:04 +02:00
Viktor Szakats
2d546d239e
cmake: use Threads::Threads imported target for POSIX Threads
- use `Threads::Threads` imported target, replacing
  `CMAKE_THREAD_LIBS_INIT`. To use the modern form and to allow using
  `THREADS_PREFER_PTHREAD_FLAG` option.

- only add Threads library/options if POSIX Threads was detected (not
  any other threading backend FindThreads may detect, e.g. the HP one.)

- curl-config.in.cmake: detect and define `Threads::Threads`.

Refs:
https://cmake.org/cmake/help/v3.18/module/FindThreads.html
https://cmake.org/cmake/help/v4.3/module/FindThreads.html

Closes #21163
2026-03-31 00:51:04 +02:00
Viktor Szakats
ce6c441cf2
build: drop redundant HAVE_PTHREAD_H guard
Prior to this patch code used either `HAVE_PTHREAD_H`, or
`HAVE_THREADS_POSIX`, or both, to decide if POSIX Threads support is
present. In effect requiring both to be defined for a consistent build.

Drop detecting and guarding for `pthread.h`, and assume it present when
`HAVE_THREADS_POSIX` is set.

OS/400 had `HAVE_PTHREAD_H` set, but not `HAVE_THREADS_POSIX`, which
possibly left threading disabled in most sources.

Ref: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/pthread.h.html
Ref: 930f2e8227 #21144

Closes #21158
2026-03-30 18:57:07 +02:00
Daniel Stenberg
9f7295fb23
test445: fix error code, remove SMB use
The test should now expect error 7. SMB is now opt-in, so not used in as
many builds anymore.

Follow-up to a186ecf4bf

Closes #21160
2026-03-30 18:50:44 +02:00
Daniel Stenberg
7deed5bb55
wolfssl: fix build without TLS 1.3 support
Follow-up to: eac64c1879

Closes #21161
2026-03-30 18:50:02 +02:00
Stefan Eissing
8deaf04feb
fopen: for temp files, inherit permissions only for owner
When creating a temp file in order to later replace an original, copying
over the existing permissions can not be considered safe when the user
running libcurl is not the owner of the existing file.

Closes #21092
2026-03-30 18:39:12 +02:00
Daniel Stenberg
eac64c1879
wolfssl: refactor Curl_wssl_ctx_init into sub functions
Reduce complexity. It was at complexity 60, with is the current max
allowed. After this, the worst in wolfssl.c is at 29.

Closes #21128
2026-03-30 16:46:53 +02:00
MarkLee131
9fcc7e4c43
tool: fix two more allocator mismatches
memory allocated by libcurl (curl_maprintf) must be freed with
curl_free(), and memory allocated by the tool (curlx_strdup via
findfile) must be freed with curlx_free().

- tool_cfgable: ech_config is allocated with curl_maprintf, free it
  with curl_free() instead of tool_safefree()
- config2setopts: known hosts from findfile() is allocated with
  curlx_strdup, free it with curlx_free() instead of curl_free()

Follow-up to b71973c115

Closes #21150
2026-03-30 16:17:42 +02:00
Kaixuan Li
2c26cea5ec
socks: add assertion for hostname length in SOCKS5 connect
socks5_req0_init() rejects hostnames longer than 255 bytes, but the
later cast to unsigned char in socks5_req1_init() has no local
indication that it is safe. Add a DEBUGASSERT and comment to document
the invariant and guard against future refactoring.

Closes #21157
2026-03-30 16:13:24 +02:00
Greg Kroah-Hartman
fb6925c243
socks: reject zero-length GSSAPI/SSPI tokens from proxy
A "broken" SOCKS5 proxy can send an invalid length of the encryption
token, which could cause malloc(0) to be called, which is a "platform
can do what it wants" potential problem.

Resolve this by explicitly checking the length and rejecting the invalid
token before ever attempting to allocate any memory.

Closes #21159
2026-03-30 16:07:06 +02:00
Viktor Szakats
930f2e8227
build: drop duplicate pthread.h includes
Already included from `curl_setup.h`.

Closes #21144
2026-03-30 13:46:14 +02:00
Viktor Szakats
3c72928471
build: drop redundant USE_QUICHE guards
When used together with `USE_OPENSSL`. `USE_QUICHE` always implies
`USE_OPENSSL`.

Also: merge two (now identical) `#if` blocks in `openssl.c`.

Closes #21135
2026-03-30 13:46:14 +02:00
Viktor Szakats
9f66cdddf4
tool_dirhie: stop redefining system symbol mkdir
Replace with local macro `toolx_mkdir()`, and map that to
platform-specific implementations as necessary.

Closes #21133
2026-03-30 13:46:14 +02:00
Viktor Szakats
20b18a43f6
src: drop detecting and redefining system symbol ftruncate
Introduce `toolx_ftruncate()` macro and map it to existing replacements
for non-mingw-w64 Windows and DJGPP, or to `ftruncate` otherwise.

Follow-up to 6041b9b11b #21109

Closes #21130
2026-03-30 13:46:14 +02:00
Stefan Eissing
335dc0e3c5
cf-dns: connection filter for DNS queries
New connection filter `cf-dns` that manages DNS queries. If hands
out addresses and HTTPS-RR records to anyone interested. Used by
HTTPS and IP happy eyeballing.

Information may become available *before* the libcurl "dns entry"
is complete, e.g. all queries have been answered. The cf-ip-happy
filter uses this information to start connection attempts as soon
as the first address is available.

The multi MSTATE_RESOLVING was removed. A new connection always
goes to MSTATE_CONNECTING. The connectdata bit `dns_resolved`
indicates when DNS information is complete. This is used for
error reporting and starting the progress meter.

Removed dns entries `data->state.dns[i]`, as the `cf-dns` filter
now keeps the reference now.

Many minor tweaks for making this work and pass address information
around safely.

Closes #21027
2026-03-30 13:28:38 +02:00
Viktor Szakats
89741958e8
cmake: use AIX built-in variable (with CMake 4.0+)
Also keep the old method for compatibility with CMake <4.0.

Ref: https://cmake.org/cmake/help/v4.0/variable/AIX.html

Closes #21134
2026-03-30 13:05:17 +02:00
Viktor Szakats
3502c5159b
GHA/linux: drop slow server logic for non-Azure source [ci skip]
Ref: https://github.com/curl/curl/actions/runs/23740539514/job/69156214117
Follow-up to 5172ba5475 #21107
2026-03-30 13:02:24 +02:00
Viktor Szakats
9dfe69cb3c
GHA/windows: bump to stunnel 5.77 (from 5.76)
Ref: https://www.stunnel.org/mailman3/hyperkitty/list/stunnel-announce@lists.stunnel.org/thread/BLYG54UILDIADJC2HWVFWQ2MK2YC3HOM/

Closes #21154
2026-03-30 11:00:37 +02:00
Viktor Szakats
89dbe84fdf
curl_ngtcp2: extend and update callbacks for 1.22.0+
Fixing:
```
lib/vquic/curl_ngtcp2.c:880:1: error: missing field 'recv_stateless_reset2' initializer [-Wmissing-field-initializers]
  880 | };
      | ^
```

Also:
- GHA/http3-linux: bump to ngtcp2 v1.22.0.

Refs:
https://github.com/ngtcp2/ngtcp2/releases/tag/v1.22.0
b7bfe41db8
https://github.com/ngtcp2/ngtcp2/pull/2035

Closes #21152
2026-03-30 10:59:38 +02:00
Daniel Stenberg
78cf1566f1
docs: mention more zip bomb precautions
Closes #21143
2026-03-29 23:42:11 +02:00
Daniel Stenberg
d87d4022aa
tool_operate: actually apply the --parallel-max-host limit
It was wrongly previously only used in debug code for event based
transfer and not in the "normal" parallel transfer case.

Follow-up to 4654493fed

Closes #21147
2026-03-29 18:59:34 +02:00
Daniel Stenberg
8f3f470bae
tool_cb_rea: make waitfd() return void
Nothing cared about the return code. Simplified.

Closes #21127
2026-03-28 23:00:42 +01:00
Dexter Gerig
fde2e9a6b2
configure: remove superfluous experimental warning for HTTP/3
This warning was created at a time when all backends for HTTP/3 were
experimental. Since there are now non-experimental backends this warning
is incorrect in some cases and was already handled by backends that were
added to the experimental list.

Follow-up to 0535f6ec71

Closes #21139
2026-03-28 22:59:22 +01:00
Viktor Szakats
f0f0a7f7d6
boringssl: fix more coexist cases with Schannel/WinCrypt
By moving the coexist workaround from vtls/openssl.c to vtls/openssl.h.
This way it also applies to vtls.c (and possibly other sources including
`vtls/openssl.h`), which may need it in unity builds before BoringSSL
header `openssl/ssl.h` pulling in the conflicting symbols and causing
conflicts otherwise.

Seen with build config:
```
-DCURL_USE_SCHANNEL=ON -DCURL_USE_OPENSSL=ON
-DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=30
```

Fixing:
```
In file included from _cm-win-boringssl/lib/CMakeFiles/libcurl_object.dir/Unity/unity_5_c.c:7:
In file included from lib/vtls/vtls.c:54:
In file included from lib/vtls/openssl.h:33:
In file included from /path/to/boringssl/_x64-win-ucrt/usr/include/openssl/opensslv.h:18:
In file included from /path/to/boringssl/_x64-win-ucrt/usr/include/openssl/crypto.h:18:
/path/to/boringssl/_x64-win-ucrt/usr/include/openssl/base.h:293:29: error: expected ')'
  293 | typedef struct X509_name_st X509_NAME;
      |                             ^
/path/to/llvm-mingw/x86_64-w64-mingw32/include/wincrypt.h:1515:29: note: expanded from macro 'X509_NAME'
 1515 | #define X509_NAME ((LPCSTR) 7)
      |                             ^
[...]
```

Ref: 2a92c39a21 #20567

Closes #21136
2026-03-28 15:52:41 +01:00
Viktor Szakats
9b01f73ac2
keylog.h: replace literal number with macro in declaration
Also syncing with the defintion.

Closes #21141
2026-03-28 15:51:04 +01:00
Viktor Szakats
31ec67651a
keylog: drop unused/redundant includes and guards
Closes #21137
2026-03-28 12:20:03 +01:00
dependabot[bot]
bb0c8cf5af
GHA: bump pip-dependencies
- update `filelock` from 3.24.3 to 3.25.2
- update `ruff` from 0.15.2 to 0.15.7
- update `cryptography` from 46.0.5 to 46.0.6 (CVE-2026-34073)

Closes #21138
2026-03-28 03:43:26 +01:00
Viktor Szakats
f1bdbd25e3
mk-ca-bundle.pl: tidy up more leftovers
Follow-up to 351e4f956a #21116
Follow-up to ca92e20123 #20528

Closes #21131
2026-03-28 00:55:09 +01:00
Viktor Szakats
30462cd66f
GHA/http3-linux: fix openssl4 version in cache keys
Follow-up to 7523de760d #21118

Closes #21132
2026-03-28 00:49:46 +01:00
Daniel Stenberg
4f316230fd
tool_util: fix the ftruncate use for DJGPP
Follow-up to 6041b9b11b

Since we define ftruncate as a macro, we can't use the macro within
the function!

Closes #21125
2026-03-27 16:51:07 +01:00
Daniel Stenberg
d7d683c3ba
tool_cb_hdr: use the file descriptor instead of calling fileno() again
Follow-up to 6041b9b11b

Closes #21126
2026-03-27 16:50:28 +01:00
Daniel Stenberg
ff678be69a
libssh: propagate error back in SFTP function
The myssh_in_SFTP_READDIR_BOTTOM() function would not store the error
code correctly thus it could be ignored and missed when an error was
returned at that particular moment.

Follow-up to 3c26e6a896

Found by Codex Security

Closes #21122
2026-03-27 16:12:51 +01:00
Daniel Stenberg
86b39c2226
transfer: clear the URL pointer in OOM to avoid UAF
Since the pointer can be extracted with CURLINFO_EFFECTIVE_URL later it
must not linger pointing to freed memory.

Found by Codex Security

Closes #21123
2026-03-27 15:56:12 +01:00
Daniel Stenberg
28fbf4a87d
multi: fix connection retry for non-http
non-HTTP protocols no longer retry after connection reuse failures
because multi_follow() now requires a handler->follow callback that is
NULL for those protocols. Provide a fallback for plain retries.

Follow-up to 1213c31272

Spotted by Codex Security

Closes #21121
2026-03-27 15:54:22 +01:00
Stefan Eissing
2e8c922a89
http2: prevent secure schemes pushed over insecure connections
When assembling the URL of a pushed resource over a not-secured
connection, require the scheme to be known and not secure.

Reported-by: xkilua on hackerone

Closes #21113
2026-03-27 14:23:29 +01:00
Viktor Szakats
351e4f956a
mk-ca-bundle.pl: drop reproducible timestamp feature
Mozilla may push to its repo much later than the commit date, which can
be a source of confusion when using the reproducible timestamp (which is
determined by the commit date) by default. Example:

https://curl.se/ca/cacert-2026-03-19.pem vs.
https://github.com/mozilla-firefox/firefox/commits/1a84aee6387d2f9c9531c655edeea4a80aa0fcfa/security/nss/lib/ckfw/builtins/certdata.txt

This feature had no actual user (or a planned one) from within curl at
the moment, and not requested by curl users. curl-for-win does this on
its own, which is the more practical way there since everything (not
just the CA bundle) needs to be reproducible anyway. I surmise this may
be true for most if not all reproducible use-cases.

Another limitation was that it could bump into GitHub's rate limiting,
needing further updates.

Also: code had some unintented leftovers.

Reported-by: Daniel Stenberg
Bug: https://github.com/curl/curl/pull/20528#issuecomment-4140610008
Follow-up to ca92e20123 #20528

Closes #21116
2026-03-27 14:19:31 +01:00
Viktor Szakats
7523de760d
GHA/http3-linux: add OpenSSL 4 beta jobs, with ECH
Closes #21118
2026-03-27 12:23:12 +01:00
Viktor Szakats
c025082967
openssl: fix build with 4.0.0-beta1 no-deprecated
```
lib/vtls/openssl.c:4238:22: error: ‘SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED’ undeclared (first use in this function); did you mean ‘SSL_R_TLS_ALERT_CERTIFICATE_EXPIRED’?
 4238 |           (reason == SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED))) {
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                      SSL_R_TLS_ALERT_CERTIFICATE_EXPIRED
lib/vtls/openssl.c:4238:22: note: each undeclared identifier is reported only once for each function it appears in
```
Ref: https://github.com/curl/curl/actions/runs/23641366299/job/68863072427#step:24:189

Cherry-picked from #21118

Closes #21119
2026-03-27 12:05:51 +01:00
Viktor Szakats
68fefb9f59
GHA/http3-linux: add missing step conditions
To omit unused cache restores. Saving ~7 seconds in jobs not using them.

Closes #21120
2026-03-27 11:53:57 +01:00
Daniel Stenberg
10d5177984
request: reset resp_trailer in new requests
Otherwise the trailer state lingers on into subsequent requests.

Follow-up to 29610e5f3d

Spotted by Codex Security

Closes #21112
2026-03-27 09:51:34 +01:00
Daniel Stenberg
cfc86e4e04
RELEASE-NOTES: synced 2026-03-27 09:38:59 +01:00
Daniel Stenberg
248b92939a
cf-socket: avoid low risk integer overflow on ancient Solaris
Spotted by Codex Security

Closes #21111
2026-03-27 09:34:42 +01:00
Daniel Stenberg
860c57dffd
test1619: download into %LOGDIR
Otherwise it will end up in tests/ which is not wanted.

Follow-up to d63432d1f8

Reported-by: Stefan Eissing

Closes #21114
2026-03-27 09:33:54 +01:00
Daniel Stenberg
916faac3dc
runtests: check for Debug case sensitively
For both TrackMemory and Debug

Closes #21099
2026-03-27 08:10:39 +01:00
Daniel Stenberg
b71973c115
tool: fix memory mixups
memory allocated by libcurl must be freed with curl_free() and vice versa,
memory allocated by the tool itself must be freed with curlx_free().

- dynbuf: free libcurl data with curl_free()
- tool_operate: make sure we get URL using the right memory
- tool_operhlp: free libcurl memory with curl_free()
- tool_operate: free curl_maprintf() pointer with curl_free
- var: data from curlx_base64_decode needs curlx_free
- tool_operate: fix memory juggling in etag handling
- tool_cb_hdr: fix memory area mixups
- tool_operate: another mixup in etag management
- tool_cb_hdr: more memory mixup fixes
- tool_cfgable.c: document some details
- tool_help: show global-mem-debug in -V output

Closes #21099
2026-03-27 08:10:32 +01:00
Daniel Stenberg
46d0ade086
GHA: add a 'curl_global_init_mem debug' job
Closes #21099
2026-03-27 08:10:29 +01:00
Daniel Stenberg
59c11074cf
src: add curl_global_init_mem testing
Build with "configure --enable-init-mem-debug" to make the tool use
curl_global_init_mem() and a set of private memory funtion callbacks for
libcurl's memory management.

Using this setup, memory mixups in tool code is more likely to cause
crashes and thus get discovered while running tests.

This curl_global_init_mem debug mode can only be done when building
libcurl shared (not static) and without debugging enabled - since it
needs to use the custom memory funtion callbacks.

Closes #21099
2026-03-27 08:10:14 +01:00
Daniel Stenberg
6041b9b11b
src: use ftruncate() unconditionally
Systems without it need to provide a custom alternative just like we
have have for Windows. This adds an MSDOS version that fails if trying
to truncate a too large file.

Closes #21109
2026-03-27 08:05:48 +01:00
Daniel Stenberg
d63432d1f8
tool_cb_hdr: only truncate etags output when regular file
When sending the output to stdout it cannot truncate.

Add test1619 to verify --etag-save to stdout

Spotted by Codex Security

Closes #21103
2026-03-26 23:39:28 +01:00
Daniel Stenberg
e1fdbdd16f
hsts: when a dupe host adds subdomains, use that
Otherwise a weaker earlier entry is allowed to override a later more
restrictive one.

Add test 1638 to verify.

Closes #21108
2026-03-26 23:27:24 +01:00
Viktor Szakats
5172ba5475
GHA: try workaround for slow Azure Ubuntu distro server
It's been going on for almost a year, chances seem slim to have this
fixed upstream.

The observed issue is that on GitHub-supplied CI runner images,
sometimes, `apt-get install` using the stock distro server
`http://azure.archive.ubuntu.com/ubuntu` sees extreme slowness while
downloading data, then reaching the job timeout and aborting, making CI
red and necessitating a manual restart of the failed job(s).

In majority of cases the install step takes no longer than 8-40 seconds
(download + install), while in the failing case it takes 10-20+ minutes
just to download.

Earlier I slimmed down installs to avoid unnecessary packages, which
mitigated, but did not completely fix the issue.

Example:
https://github.com/curl/curl/actions/runs/23599596928/job/68725576899?pr=21105

Follow-up to 0455d8772a #18509

Closes #21107
2026-03-26 23:05:59 +01:00
Viktor Szakats
128c252975
GHA/curl-for-win: pass GH token to the containers
To avoid rate limits when accessing GH APIs during the build.

Aiming to avoid (while trying to retrieve a file timestamp):
```
++ [[ 2026-02-11-1a84aee6387d2f9c9531c655edeea4a80aa0fcfa =~ (.+)-([a-f0-9]{40,}) ]]
++ ver=2026-02-11
++ commit=1a84aee6387d2f9c9531c655edeea4a80aa0fcfa
++ set +x
curl: (22) The requested URL returned error: 403
curl: (22) The requested URL returned error: 403
curl: (22) The requested URL returned error: 403
curl: (22) The requested URL returned error: 403
[...]
```
Ref: https://github.com/curl/curl/actions/runs/23598912140/job/68723120977?pr=21104

Follow-up to:
a26898fe48
17f2fb3ead
6dd6e47e98
b461404b5a

Closes #21105
2026-03-26 16:08:37 +01:00
Viktor Szakats
20914e3753
perl: harden external command invocations
In `adddocsref.pl`, `checksrc-all.pl`, `singleuse.pl` and tests 307, 1013,
1022, 1275, 1707, 1708, 1710.

Closes #21097
2026-03-26 14:20:07 +01:00
Viktor Szakats
a56ab9dbc8
cmake: add CMake Config-based dependency detection for c-ares, wolfSSL
For wolfSSL it requires v5.2.1+, and with 5.9.0+ it's also supported when
wolfSSL was built with autotools.

Follow-up to 8fce3e17e6 #20814

Closes #21098
2026-03-26 11:20:03 +01:00
Daniel Stenberg
f660b77f74
DEPRECATE.md: fix copy-and-paste mistaken subtitles
Closes #21102
2026-03-26 11:06:25 +01:00
Daniel Stenberg
897f7143c5
docs/VERIFY.md: verify curl
Don't trust, verify!

Closes #21085
2026-03-26 07:57:25 +01:00
Daniel Stenberg
970f0a8cec
cleancmd.pl: remove markdown links before spellcheck
Closes #21085
2026-03-26 07:57:19 +01:00
Daniel Stenberg
0c14ed62c4
location/follow: mention netrc
Closes #21091
2026-03-26 07:56:42 +01:00
Viktor Szakats
bf6a34d8eb
md4, md5: switch to wolfCrypt API in wolfSSL builds
Replacing the OpenSSL-like compatibility interface, and syncing with other
hashes, when building with wolfSSL.

Also: stop stomping on OpenSSL public MD4 symbols. This makes the wolfSSL
coexist workaround unnecessary, while also syncing up with MD5 sources.

After this patch the only remaining reference to wolfSSL's OpenSSL
compatibility layer is in `lib/curl_ntlm_core.c`.

Closes #21093
2026-03-25 18:56:40 +01:00
Viktor Szakats
486334509f
curl_ntlm_core: drop redundant PP condition
`LIBWOLFSSL_VERSION_HEX` is always present in supported wolfSSL
versions.

Closes #21096
2026-03-25 18:56:40 +01:00
Viktor Szakats
afa71f1a22
spacecheck: verify filename lengths and characters
Maximum filename length 64, of which 48 maximum for the filename part.
Allowed characters: `A-Za-z0-9/._-`.

Also:
- rename a file to pass the check.
- init max constants outside the loop.
- minor fix to an error message.
  Follow-up to 62d77b12fc #21087

Closes #21095
2026-03-25 18:56:40 +01:00
Stefan Eissing
dc9a03e855
multi: multi_wait fixes after #20832
The refactoring in #20832 introduced some inconsistencies between
windows and posix handling, pointed out by reviews. Fix them:

- rename `wait_on_nop` back to `extrawait` as it was called before
- use multi_timeout() to shorten the user supplied timeout for
  both windows/posix in the same way
- remove the extra multi_timeout() check in the posix function
- Add the multi's wakeup socket for monitoring only when there
  are other sockets to poll on or when the caller wants the
  extra waiting time.

Closes #21072
2026-03-25 12:17:58 +01:00
Stefan Eissing
a186ecf4bf
proxy: chunked response, error code
Add test1715 to check proper handling of chunked transfer
encoding in CONNECT responses. Change proxy error code from
56 (RECV_ERROR) for everything to 7 (COULDNT_CONNECT) when
the server response could be read successfully, but establishing
the connection is not possible (http status code wrong).

Adapt several test expectations from 56 to 7.

Closes #21084
2026-03-25 12:16:21 +01:00
Stefan Eissing
39036c9021
async-thrdd: use thread queue for resolving
Use a thread queue and pool for asnyc threaded DNS resolves.
Add pytest test_21_* for verification.

Add `CURLMOPT_RESOLVE_THREADS_MAX` to allow applications to
resize the thread pool used.

Add `CURLMOPT_QUICK_EXIT` to allow applications to skip thread
joins when cleaning up a multi handle. Multi handles in
`curl_easy_perform()` inherit this from `CURLOPT_QUICK_EXIT`.

Add several debug environment variables for testing.

Closes #20936
2026-03-25 12:14:21 +01:00
Daniel Stenberg
507e7be573
url: do not reuse a non-tls starttls connection if new requires TLS
Reported-by: Arkadi Vainbrand

Closes #21082
2026-03-25 11:23:37 +01:00
Viktor Szakats
62d77b12fc
spacecheck: check long lines and repeat spaces, fix fallouts
Verify if lines are not longer than 192 characters. Also verify if lines
have less than 79 repeat spaces (and fix one fallout).

To improve readability by avoiding long lines and to prevent adding
overly long lines with text that may go unnoticed in an editor or diff
viewer.

In addition to pre-existing line length limits: 79 for C, 132 for CMake
sources.

Also:
- spacecheck: fix/harden allowlist regexes.
- spacecheck: tidy-up quotes and simplify escaping.
- spacecheck: allow folding strings with repeat spaces.
- GHA: fix a suppressed shellcheck warning.
- GHA/macos: simplify by dropping brew bundle.
- test1119.pl: precompile a regex.
- FAQ.md: delete very long link to a Windows 7/2008 support article
  that's lost it relevance.

Closes #21087
2026-03-25 11:02:08 +01:00
Viktor Szakats
ff3251a538
sha256, sha512_256: switch to wolfCrypt API
Replacing the OpenSSL-like compatibility interface, and syncing with
existing API use within lib/wolfssl.c for SHA-256.

Ref: https://www.wolfssl.com/documentation/manuals/wolfssl/group__SHA.html

Follow-up to 28f0932073 #21077
Follow-up to 988b352f91 #21078

Closes #21090
2026-03-25 11:02:08 +01:00
Viktor Szakats
988b352f91
sha256: support delegating to wolfSSL API
Offered by wolfSSL v3.11.0+ (2017-05-04).

Closes #21078
2026-03-24 19:29:21 +01:00
Viktor Szakats
28f0932073
curl_sha512_256: support delegating to wolfSSL API
Offered by wolfSSL v5.0.0+ (2021-11-01).

Closes #21077
2026-03-24 19:29:21 +01:00
Stefan Eissing
797bc316bf
ratelimit: reset on start
On any `Curl_rlimit_start()` the rate limit needs to reset its
values before calculating the effective step duration and adjust
the tokens/burst per step.

Add two fields to the struct to remember the original values.

Closes #21086
2026-03-24 16:25:53 +01:00
Viktor Szakats
372d721e92
wolfssl: document v5.0.0 (2021-11-01) as minimum required
The previously documented version was based on version checks made in
the source. In practice though, curl doesn't build with <5.0.0.

Also:
- bump main internal version check.
- drop superfluous internal version checks.

Closes #21080
2026-03-24 11:08:23 +01:00
Daniel Stenberg
18f88739ff
tool_setopt: return error on OOM correctly
When generating mime code for the --libcurl option.

Follow-up to acdb48272a

Spotted by Codex Security

Closes #21083
2026-03-24 10:48:03 +01:00
Patrick Monnerat
54f4937729
OS400: add new definitions to the ILE/RPG binding.
Also update supported protocols list in README.OS400.

Fixes #20672
Closes #21066
2026-03-24 09:27:48 +01:00
Daniel Stenberg
949b1ff34e
RELEASE-NOTES: synced 2026-03-24 09:09:30 +01:00
Daniel Stenberg
5023d2fe27
DEPRECATE: remove NTLM, SMB and local crypto implementations
Closes #21079
2026-03-24 08:52:54 +01:00
Daniel Stenberg
29dfc0238c
tool_getparam: use correct free function for libcurl memory
Memory returned from curl_easy_escape() should be fred with curl_free()
to avoid surprises.

Follow-up to f37840a46e

Spotted by Codex Security
Closes #21075
2026-03-24 08:49:20 +01:00
Daniel Stenberg
14712fa513
curl_version_info.md: clarify age details
The argument is not used.

Fixes #21052
Reported-by: Dan Fandrich
Closes #21059
2026-03-24 08:17:29 +01:00
Stefan Eissing
6f9f4b3cb7
lib: add thread pool and queue
- new source files for thread pool and queue
- test cases 3217 and 3218 for them
- internal documentation

Closes #20916
2026-03-23 23:03:58 +01:00
Daniel Stenberg
664db28d29
test2405: require wakeup
To get the correct file descriptor count

Reported-by: Marcel Raad
Fixes #21069
Closes #21074
2026-03-23 23:01:01 +01:00
Daniel Stenberg
3ef422e128
lib1560: verify more URLs
- control codes at various places in URL, even when URL encoding
  is requested

- verify zone id extraction more

Closes #21071
2026-03-23 14:35:02 +01:00
Daniel Stenberg
d3fa54a243
config2setopts: make --capath work in proxy disabled builds
Follow-up to 95e8515ca0

Spotted by Codex Security

Closes #21063
2026-03-23 14:33:59 +01:00
Daniel Stenberg
07d109b7c6
test1714: verify telnet download with --max-filesize
(disabled on Windows because of hangs)

Closes #21023
2026-03-23 14:32:46 +01:00
Viktor Szakats
806fd7a0e1
genserv.pl: make external calls safe
By passing command-line as separate arguments instead of using a single
string. This needs skipping the shell, so rework redirections to use
Perl `open3()`.

Also explored to use `-out` to avoid redirections, but it makes the
command-line incompatible with some OpenSSL implementations/versions
(e.g. on default macOS), and would still need a solution for
`2>/dev/null`.

Ref: https://perldoc.perl.org/IPC::Open3

Closes #20971
2026-03-23 12:39:38 +01:00
Daniel Stenberg
8f0e0f9dc7
urldata: make hstslist only present in HSTS builds
Closes #21068
2026-03-23 10:19:45 +01:00
Daniel Stenberg
e0327b2ebb
netrc: remove unused parsenetrc() macro for netrc-disabled
When netrc is disabled, this macro is unused (and wrong).

Closes #21067
2026-03-23 10:19:08 +01:00
Daniel Stenberg
e0be05cbab
urlapi: fix handling of "file:///"
When the path is exactly one byte, a single slash.

Extended test 1560 to verify.

Found by Codex Security

Closes #21070
2026-03-23 10:17:59 +01:00
Daniel Stenberg
0c475b5df7
urlapi: remove redundant condition in dedotdotify
Bonus: remove two variables, clear up some comments.

Poined out by CodeSonar

Closes #21065
2026-03-23 08:26:02 +01:00
Daniel Stenberg
9820e5dfac
tool_operate: fix memory-leak on failed uploads
Add test case 1673 to do repeated upload failures and verify there is no
leak. This proved a previous leak and now it verifies the fix.

Reported-by: James Fuller
Closes #21062
2026-03-22 23:58:02 +01:00
Viktor Szakats
e8c64a06c5
asyn-thrdd: fix clang-tidy unused value warning
with `-DCURL_DISABLE_SOCKETPAIR=ON`.

```
lib/asyn-thrdd.c:227:5: error: Value stored to 'do_abort' is never read [clang-analyzer-deadcode.DeadStores,-warnings-as-errors]
  227 |     do_abort = addr_ctx->do_abort;
      |     ^          ~~~~~~~~~~~~~~~~~~
```

Closes #21061
2026-03-22 19:15:56 +01:00
Viktor Szakats
757fd6aae9
gnutls: fix clang-tidy warning with !verbose
with
`-DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_USE_GNUTLS=ON -DCURL_CLANG_TIDY=ON`.

```
lib/vtls/gtls.c:268:7: error: Value stored to 'strerr' is never read [clang-analyzer-deadcode.DeadStores,-warnings-as-errors]
  268 |       strerr = gnutls_strerror(rc);
      |       ^        ~~~~~~~~~~~~~~~~~~~
```

Closes #21060
2026-03-22 19:15:56 +01:00
Daniel Stenberg
57a94fec47
multi.h: add CURLMNWC_CLEAR_ALL
The two bitmask constants for *CLEAR_DNS and *CLEAR_CONNS were
duplicates (both set to 1), so they cannot be distinguished and both
actions fire.

This shipped in public releases since 8.16.0 to and include 8.19.0.

This fix adds CURLMNWC_CLEAR_ALL to be the new 1, and it now implies all
bits. The DNS and CONNS defines get two new bits (2, 4).

Follow-up to 55c045c863

Found by Codex Security
Closes #20968
2026-03-22 18:06:32 +01:00
Daniel Stenberg
e9eddedf38
Revert "md5/md4: enable unaligned access fast path on powerpc64"
This reverts commit 21fc17b265.

That was not properly thought through. PowerPC can run in either endian
and the preprocessor does not know which.

Ref: #20985
Closes #21058
2026-03-22 18:04:08 +01:00
Viktor Szakats
fcec44df00
FAQ.md: point archive.org link to the original, no-JS, revision [ci skip]
To make it pass mdlinkcheck, open faster, w/o cookie banner, and not
need special URL format to make JS happy.

Ref: 1dc0ce9562
2026-03-22 13:33:34 +01:00
Daniel Stenberg
d3ae2e0565
RELEASE-NOTES: synced 2026-03-22 12:02:49 +01:00
Daniel Stenberg
6393103b99
lib: make SMB support opt-in
The SMB protocol has weak security and is rarely used these days.

Note that SMB also requires NTLM enabled.

Closes #20846
2026-03-22 11:55:39 +01:00
Viktor Szakats
06a83340b1
GHA/curl-for-win: enable c-ares with HTTPS-RR in an existing job
c-ares builds have been sped up within curl-for-win using, pre-fills. It
allows building it with acceptable performance, making it practical to
use it, alongside HTTPS-RR, in curl CI and possibly in curl-for-win. It
has been enabled in its dev branch for a while.

Ref: 61a7354120

Closes #21032
2026-03-22 00:26:25 +01:00
Viktor Szakats
e09a7b83d6
cf-https-connect: silence -Wimplicit-int-enum-cast with HTTPS-RR + clang 21
Fixing (seen in curl-for-win dev branch):
```
In file included from _a64-linux-gnu-bld/lib/CMakeFiles/libcurl_object.dir/Unity/unity_0_c.c:34:
lib/cf-https-connect.c:681:28: error: implicit conversion from 'unsigned char' to enumeration type 'enum alpnid' is invalid in C++ [-Werror,-Wimplicit-int-enum-cast]
  681 |         enum alpnid alpn = rr->alpns[i];
      |                     ~~~~   ^~~~~~~~~~~~e
```

Ref: #21032

Closes #21057
2026-03-21 23:45:55 +01:00
Daniel Stenberg
789282cb8d
lib: drop support for < c-ares 1.16.0
Closes #20911
2026-03-21 23:37:59 +01:00
Scott Boudreaux
21fc17b265
md5/md4: enable unaligned access fast path on powerpc64
PowerPC64 (both big-endian and little-endian) supports efficient
unaligned memory access, similar to x86. This extends the existing
fast path that avoids byte-by-byte loads in the MD5 and MD4 SET/GET
macros.

On POWER8 ppc64le, this eliminates 3 shifts + 3 ORs per 32-bit word
load, replacing them with a single lwz (or lwbrx on big-endian).

Co Authored By Claude Opus 4.6 (1M context)

Closes #20985
2026-03-21 23:35:58 +01:00
Daniel Stenberg
77ed315096
progress: count amount of data "delivered" to application
... and apply the CURLOPT_MAXFILESIZE limit (if set) on that as well.
This effectively protects the user against "zip bombs".

Test case 1618 verifies using a 14 byte brotli payload that otherwise
explodes to 102400 zero bytes.

Closes #20787
2026-03-21 23:21:55 +01:00
Daniel Stenberg
fa13f373b2
netrc: skip malformed macdef lines
When skipping macdef lines inside netrc files, ignore it completely and
do not tokenize or bail out on bad quotes.

Verify in test 1672

Follow-up to 3b43a05e00

Spotted by Codex Security
Closes #21049
2026-03-21 23:20:49 +01:00
Daniel Stenberg
6026d76fdf
test1668: unit test the FTP 213 time response parser
Should make it harder to introduce regressions.

Closes #21051
2026-03-21 23:10:32 +01:00
Daniel Stenberg
89d649c482
badwords-all: stop checking source code comments
The code runs under different rules than documentation and these checks
cause too much friction with too little gain.

Leave checking of the public include files since they are almost
documentation.

Closes #21048
2026-03-21 22:58:51 +01:00
Viktor Szakats
6c64d39dce
hostip: drop guard from Curl_resolver_error() definition
To sync with its declaration.

Fixing (seen when building trurl in curl-for-win):
```
ld.lld: error: undefined symbol: Curl_resolver_error
```
Ref: https://github.com/curl/curl-for-win/actions/runs/23388349475/job/68038915761#step:3:7469

Closes #21054
2026-03-21 22:42:38 +01:00
Viktor Szakats
3025c9778a
testcurl.pl: replace shell commands with Perl rmtree()
Ref: https://perldoc.perl.org/5.8.2/File::Path
Follow-up to e992aa6a54

Closes #21053
2026-03-21 22:42:38 +01:00
Harry Sintonen
e2186933c1
tool: add check for curlinfo->age when determining if ssh backend is libssh2
The code failed to check for the version, and could thus read memory
past the existing curl_version_info_data structure. This could lead to a
crash.

Closes #21050
2026-03-21 18:54:23 +01:00
Viktor Szakats
8fce3e17e6
cmake: add CMake Config-based dependency detection
After limiting `find_package()`/`find_dependency()` calls to curl local
Find modules via the `MODULES` keyword, it became possible to detect
dependencies via CMake Configs from within those local Find modules, by
calling `find_package()` again with the `CONFIG` keyword. This patch
implements this. Then maps detection results to the result variables and
curl-specific imported targets the rest of the build expects.

Also honor recently introduced `*_USE_STATIC_LIBS` (experimental) flags
to map to the static target when requested.

This adds CMake Configs as an alternative to the existing `pkg-config`
and `find_path()`/`find_library()` auto-detection methods.

Enabled by default for MSVC, outside vcpkg and when not cross-building.
To enable for other cases, or override the default, you can use
`-DCURL_USE_CMAKECONFIG=ON` or `OFF`.

When enabled, Config detection happens after `pkg-config` and before
`find_path()`/`find_library()`. Using CMake's built-in options, you may
also manually point to the absolute directory holding Config files:

`Libssh2_DIR`, `MbedTLS_DIR`, `NGHTTP2_DIR`, `NGHTTP3_DIR`,
`NGTCP2_DIR` v1.19.0+ (with non-fork OpenSSL only), `Zstd_DIR` v1.4.5+

E.g. `-DMbedTLS_DIR=/path/to/mbedtls/lib/cmake/MbedTLS`

These dependencies typically need to be built with CMake to support
this.

Tagged as experimental.

Refs:
#20013 #19156 #19117
https://github.com/curl/curl/pull/20784#issuecomment-3984318492

Depends-on: fad1ebaecc #20840
Follow-up to 91e06fde1b #20784
Follow-up to 26c39d8df1 #20015

Closes #20814
2026-03-21 18:52:31 +01:00
Daniel Stenberg
aef8fd00c8
GHA: add NTLM to lots of builds 2026-03-21 15:30:04 +01:00
Daniel Stenberg
cc0c83c5f8
build: make NTLM disabled by default
NTLM has weak security and does not work over HTTP/2 or HTTP/3.

Enable in cmake or configure to get support for it.

Closes #20698
2026-03-21 15:30:03 +01:00
Daniel Stenberg
c247725b92
DEPRECATE: remove last empty line 2026-03-21 15:18:33 +01:00
Daniel Stenberg
ceae02db04
rtmp: drop support
- librtmp has no test cases, makes no proper releases and has not had a
  single commit within the last year

- librtmp parses the URL itself and requires non-compliant URLs for this

- we have no RTMP tests

- RTMP was used by 2.2% of curl users (self-identified in the 2025
  survey)

Closes #20673
2026-03-21 14:56:06 +01:00
Daniel Stenberg
ff28f67970
DEPRECATE: fix minor release number typo 2026-03-21 14:49:36 +01:00
Stefan Eissing
5649b21297
curlx_now(), prevent zero timestamp
As code checks `curltime` values for zero and interprets this
as not-initialized or "forever" in several places, make sure
`curlx_now()` never returns a zero timestamp.

Closes #21034
2026-03-21 14:47:36 +01:00
Daniel Stenberg
7e0a9b309c
CURLOPT_HAPROXY_CLIENT_IP.md: mention assuption on data format
The user is assumed to pass in correct data. I think we should start
clarifying this in more places.

Closes #21042
2026-03-21 14:46:55 +01:00
Stefan Eissing
82009c4220
share: concurrency handling, easy updates
Replace the `volatile int dirty` with a reference counter
protected by a mutex when available.

Solve the problem of when to call application's lock function
by adding a volatile flag that indicates a share has been added
to easy handles in its lifetime. That flag ever goes from
FALSE to TRUE, so volatile might work (in the absence of a mutex).

(The problem is that the lock/unlock functions need 2-3
`curl_share_setopt()` invocations to become usable and there
is no way of telling if the third will ever happen. Calling
the lock function before the 3rd setopt may crash the
application.)

When removing a share from an easy handle (or replacing it with
another share), detach the easy connection on a share with a
connection pool.

When cleaning up a share, allow this even if it is still used in
easy handles. It will be destroyed when the reference count
drops to 0.

Closes #20870
2026-03-21 14:42:49 +01:00
Stefan Eissing
745344ea4e
hostip: fix !no_signal mixup in resolve refaactor
When extracting the resolve case using alarm timers, the check for "we
are not allowed to use signals" was refactored wrong.

Follow-up to 96d5b5c688

Closes #21047
2026-03-21 14:28:54 +01:00
renovate[bot]
d560002551
GHA: update dependency rustls/rustls-ffi to v0.15.1
Closes #21044
2026-03-21 13:32:52 +01:00
Viktor Szakats
a8bc4cbcfe
build: assume snprintf() in mprintf, drop feature check
- it was already required for `curl_*printf()` float/double support.
- some curl tests always fail without it.
- it was already assumed to be present to build test servers.
  Source code did not check for `HAVE_SNPRINTF` detection variable.
- it was already required to build examples.

Windows builds stopped using this detection and the function via earlier
commits.

Follow-up to 64f28b8f88 #20765
Follow-up to 935b1bd454 #9570 #9569

Closes #20763
2026-03-21 13:30:37 +01:00
Viktor Szakats
89043ba906
cmake: drop support for CMake 3.17 and older
Require CMake 3.18 (2020-07-15) or newer, up from 3.7 (2016-11-11)
prior to this patch.

This requirement also applies to the distributed `curl-config.cmake`.

To allow dropping compatibility code maintained for old versions, and to
use features which were unpractical in separate code paths. Also to make
testing, documentation and development easier, CI builds faster due to
CMake performance improvements over time. (e.g. integration tests on
macOS run 8x faster (10 minutes is now under 1.5m) in CI, 2.5x faster on
Windows.)

CMake offers pre-built binaries for major platforms. They work without
an install step, just by unpacking and pointing the cmake command to
them. Making upgrades easy in many cases:
https://cmake.org/download/
https://cmake.org/files/
https://github.com/Kitware/CMake/releases

CMake 3.18 brings these feature as generally available when building or
consuming curl/libcurl:

LTO support, improved performance, `pkg-config` and interface target
support, `OBJECT` target (for faster libcurl builds), modern invocation
with `-S`/`-B` options, better support for custom linker options,
FetchContent, `GnuTLS::GnuTLS` target, `--verbose` and `--install`
options, `CMAKE_GENERATOR` env, last but not least unity mode and Ninja
generator.

For maximum build speed, use:
`-DCMAKE_UNITY_BUILD=ON -DCURL_DROP_UNUSED=ON`

As for deprecations, C++11 is required to build CMake itself, which may
be a limit on some platforms. autotools continues to cover them.

Follow-up to 9bcdfb3809 #20408
Follow-up to a7c974e038 #19902
Follow-up to dfbe035c8b #10161
Discussion: https://github.com/curl/curl/discussions/18704

Closes #20407
2026-03-21 13:24:47 +01:00
Viktor Szakats
d5014a2b95
scripts: drop redundant double-quotes: "$var" -> $var (Perl)
Closes #21009
2026-03-21 13:21:06 +01:00
Viktor Szakats
f45bf74b5a
curl/curl.h: replace recursive macros with C++-friendly method to enforce 3 args
Certain uses may still trigger a C compiler warning
`-Wdisabled-macro-expansion` after this, e.g. when the call is wrapped
in the `CURL_IGNORE_DEPRECATION()` macro as seen in docs/examples.

Suggested-by: Kai Pastor
Ref: https://github.com/curl/curl/issues/20682#issuecomment-3949788664

Follow-up to ee9b000438 #20686
Follow-up to daa6b27b4d #20597

Closes #20709
2026-03-21 13:21:06 +01:00
Viktor Szakats
c3c2bf5941
libtest: drop duplicate include
Include moved to `unitcheck.h` earlier.

Follow-up to 96d5b5c688 #20864
Ref: 8a1f361716 #21024

Closes #21046
2026-03-21 13:14:46 +01:00
Viktor Szakats
e0038e1096
tool_operhlp: propagate low-level OOM in add_file_name_to_url()
Bug: https://github.com/curl/curl/pull/21011#discussion_r2961678069

Closes #21043
2026-03-21 13:14:46 +01:00
Viktor Szakats
8ffe0db8f8
lib: move all UNITTEST prototypes to C files (cont.)
Follow-up to 98d8e82c74 #21014

Closes #21040
2026-03-21 13:14:46 +01:00
Daniel Stenberg
f36a8ac5a2
dnscache.h: include curlx/timeval.h for struct curltime
Follow-up to 96d5b5c688

Closes #21045
2026-03-21 12:27:34 +01:00
Daniel Stenberg
322db3efc0
ftp: make the MDTM date parser stricter (again)
A previous refactor made the parser more lenient and this takes it back
to making sure only ascii digits are accepted.

Added test 1684 to verify

Follow-up to 304b5183fd

Pointed out by Codex Security

Closes #21041
2026-03-21 12:25:14 +01:00
Stefan Eissing
96d5b5c688
dnscache: own source file, improvements
- Rename `Curl_resolv_unlink()` to `Curl_dns_entry_unlink()`.
- Change `Curl_dnscache_get()` to return CURLcode result. Returns
  now `CURLE_COULDNT_RESOLVE_HOST` for "negative" cache entries.
- Add `Curl_dnscache_add_negative()` to put a "negative" entry
  into the cache.

Closes #20864
2026-03-21 12:04:36 +01:00
Stefan Eissing
b0f6e9a3d7
openssl channel_binding: lookup digest algorithm without NID
Use an alternate OpenSSL API to get the digest algorithm tied
to a certificate signature to compute the channel binding.

Fixes #20590
Reported-by: Rob Crittenden
Closes #20734
2026-03-21 12:00:17 +01:00
Stefan Eissing
9bc8b078eb
multi: improve wakeup and wait code
- Split WINSOCK and POSIX code in `multi_wait()` as the ifdef'ery
  was becoming unreadable
- define `ENABLE_WAKEUP` to mean the wakeup socketpair is enabled,
  no additional USE_WINSOCK check needed. Under WINSOCK
  `ENABLE_WAKEUP` is not defined, so it's availability is as before
  under the double defined() checks
- When the multi handle has "alive" transfers, the admin handle's
  pollset include the wakeup receive socket. This results in the
  admin handle running when someone uses `curl_multi_wakeup()`.
- Without any "alive" transfers, the wakeup socket is removed from
  the pollset. Otherwise, event based processing would never finish,
  eg. leave the event loop.
- The wakeup socket was never registered for event processing before,
  e.g. `curl_multi_wakeup()` never worked in that mode.
- Adjust test exepectations on socket callback invocations and
  number of sockets appearing in waitfds sets.

Closes #20832
2026-03-21 11:58:24 +01:00
Daniel Stenberg
447b32f13a
RELEASE-NOTES: synced
Bump curlver to 8.20.0 for pending release
2026-03-20 22:28:50 +01:00
Viktor Szakats
208b87744e
GHA/windows: disable taskkill in torture jobs
As an experiment.

Also:
- processhelp.pm: log when `taskkill` is force-skipped.

Ref: #21035

Follow-up to f450f3801b #19897
Follow-up to 2701ac6a4d #19421

Closes #21039
2026-03-20 19:53:11 +01:00
Stefan Eissing
708b3f8b4e
wolfssl: fix handling of abrupt connection close
A closed connection without TLS notify shutdowns, has been reported as a
correct EOF instead of an error. Fix the error handling in wolfSSL
backend receive handling.

Spotted by Codex Security

Closes #21002
2026-03-20 17:48:56 +01:00
Daniel Stenberg
1eb9096897
transfer: enable custom methods again on next transfer
`http_ignorecustom` is set on redirect handling but was not reset
between transfers, so once a redirect occurs in the new follow modes,
custom request methods were ignored for later transfers on the same
handle.

Follow-up to fb13923dd6

Detected by Codex Security

Closes #21037
2026-03-20 17:46:50 +01:00
Daniel Stenberg
f2ba8f0613
protcol.h: fix the CURLPROTO_MASK
It had an 'f' too few. Also provide CURLPROTO_WS* unconditionally
internally, so that code can depend on them in all builds.

Follow-up to cd5ca80f00

Spotted by Codex Security

Test case 3219 added to catch this next time.

Closes #21031
2026-03-20 17:24:01 +01:00
Viktor Szakats
07c10f09a5
tool_operhlp: fix add_file_name_to_url() result on OOM
Return `CURLE_OUT_OF_MEMORY` instead of `CURLE_URL_MALFORMAT` when
`curl_url()`, `curl_easy_escape()`, or `curl_maprintf()` calls failed.

Found by Codex Security

Also reuse deinit code from a success branch.

Closes #21011
2026-03-20 17:23:25 +01:00
Daniel Stenberg
b9e179e4e5
urldata: make speeder_c uint32
This counter is meant to virtually never wrap.

Follow-up to e3691612ea

Spotted by Codex Security

Closes #21036
2026-03-20 16:56:48 +01:00
Daniel Stenberg
73a5288344
unit1627.c: remove a newline 2026-03-20 16:55:19 +01:00
Daniel Stenberg
6d1d50d65d
protocol: use scheme names lowercase
When composing the <scheme>_proxy environment variable, we assume the
handler->scheme name is already lowercase.

This makes unit test 1627 verify that is the case.

Follow-up to c294f9cb56

Spotted by Codex Security

Closes #21033
2026-03-20 16:00:30 +01:00
Daniel Stenberg
0b182ae529
file: init fd to -1 to prevent close fd 0 on early failure
Spotted by Codex Security

Closes #21029
2026-03-20 15:00:21 +01:00
Viktor Szakats
2cdb2209da
getinfo: initialize PureInfo field used_proxy
Found by Codex Security

Follow-up to cc04c73677 #12719

Closes #21020
2026-03-20 13:47:32 +01:00
Daniel Stenberg
e3ed70ce72
url: use the socks type for socks proxy
Reported by Codex Security

Closes #21025
2026-03-20 13:17:22 +01:00
Daniel Stenberg
14782b36fe
x509asn1: fixed and adapted for ASN1tostr unit testing
- move defines to header file
- make bit2str require < 8 unused bits
- make bool strings stricter
- make UTime2str show + or - for custom time zones
- removed unused 'type' argument to ASN1tostr() function
- fix int2str for negative values. All values below 10000 are now shown
  in decimal properly, also possibly negative values.

Add unit test 1667 to verify ASN1tostr

Closes #21013
2026-03-20 13:03:40 +01:00
Daniel Stenberg
756725a32b
tool_operate: drop the scheme-guessing in the -G handling
Prior to this, -G would override the scheme set with --proto-default and
revert back to guessing the scheme based on the hostname.

Add test 2008 to verify the fix

Spotted by Codex Security

Closes #20992
2026-03-20 11:57:10 +01:00
Viktor Szakats
8a1f361716
build: limit unitprotos.h include to units target
To omit it from `tunits`.

Also: move the include to `unitcheck.h` to save a guard.

Ref: https://github.com/curl/curl/pull/21014#issuecomment-4093742896
Reported-by: Daniel Stenberg
Fixes #21021
Follow-up to 98d8e82c74 #21014

Closes #21024
2026-03-20 11:31:35 +01:00
Daniel Stenberg
2b3332e749
tests/unit/README: describe how to unit test static functions
UNITTEST explained

Closes #21018
2026-03-20 07:56:19 +01:00
Daniel Stenberg
98d8e82c74
lib: move all UNITTEST prototypes to C files
- make extract-unit-protos handle multi-line prototypes - but they need
  to be above the implementation

- Prototypes for static functions we use in unit tests should not be in
  header files. We generate lib/unitprotos.h for this purpose

- Removed some function wrappers written for unit tests and make them
  use UNITTEST function directly.

- Renamed time2str() in the tool to timebuf() since we have the same
  name in lib/ and in unit tests they can both be used non-static in a
  build.

This reverts commit f95fadd116.

Follow-up to #21010

Closes #21014
2026-03-20 07:47:57 +01:00
Viktor Szakats
7242cea7f6
GHA/macos: restore compatibility with Intel runners
By generalizing Homebrew prefix in shared code paths, where missing.
No strong reason, sometimes it's useful for tests.

Follow-up to e5316069f1 #18818

Closes #21019
2026-03-20 01:42:47 +01:00
Viktor Szakats
6b645f91f6
mk-lib1521.pl: fix 4 callback function types passed to setopt
Silencing these warnings (seen on Solaris 11 SPARC GCC 4.9.2 + OpenCSW):
```
lib1521.c: In function 'test_lib1521':
/include/curl/typecheck-gcc.h:93:13: warning: call to 'Wcurl_easy_setopt_err_conv_cb' declared with attribute warning: curl_easy_setopt expects a curl_conv_callback argument
curl_easy_setopt(curl, CURLOPT_CONV_FROM_NETWORK_FUNCTION,
curl_easy_setopt(curl, CURLOPT_CONV_TO_NETWORK_FUNCTION,
curl_easy_setopt(curl, CURLOPT_CONV_FROM_UTF8_FUNCTION,
/include/curl/typecheck-gcc.h:123:13: warning: call to 'Wcurl_easy_setopt_err_interleave_cb' declared with attribute warning: curl_easy_setopt expects a curl_interleave_callback argument
curl_easy_setopt(curl, CURLOPT_INTERLEAVEFUNCTION,
```
Ref: https://curl.se/dev/log.cgi?id=20260319160651-1785427#prob2

Follow-up to de0adda78c

Closes #21017
2026-03-20 01:42:47 +01:00
Viktor Szakats
585955cd9a
servers.pm: fix to check gopher6 server on its ipv6 port
Found by Codex Security

Closes #21016
2026-03-20 01:42:47 +01:00
Viktor Szakats
43397b0283
cmake: extend C89-specific warning suppressions to all llvm/clang
From Apple clang-only prior to this patch.

Silencing (seen after macos-15 runner accidentally switched to
llvm/clang by default):
```
/Users/runner/work/curl/curl/lib/curlx/warnless.h:64:1: error: '_Bool' is a C99 extension [-Werror,-Wc99-extensions]
   64 | bool curlx_sztouz(ssize_t sznum, size_t *puznum);
      | ^
/opt/homebrew/Cellar/llvm@18/18.1.8/lib/clang/18/include/stdbool.h:20:14: note: expanded from macro 'bool'
   20 | #define bool _Bool
      |              ^
[...]
```
Ref: https://github.com/curl/curl/actions/runs/23304345180/job/67774031335?pr=21014#step:11:39

Follow-up to 09c9afdd71 #20363
Ref: https://github.com/actions/runner-images/issues/13827

Closes #21015
2026-03-19 17:54:10 +01:00
Viktor Szakats
a9e341a469
optiontable: replace stdin with filename arg, harden open() call
Closes #21008
2026-03-19 15:06:43 +01:00
Viktor Szakats
f95fadd116
x509asn1: move declaration to header
Fixing clang-tidy warning:
```
tests/unit/unit1666.c:50:12: error: call to undeclared function 'encodeOID'; ISO C99 and later do not support implicit function declarations [clang-diagnostic-implicit-function-declaration]
   50 |   result = encodeOID(dbuf, oid, oid + spec->size);
      |            ^
```
Ref: https://github.com/curl/curl/actions/runs/23297585235/job/67749144361?pr=21008#step:46:736

Follow-up to 673e14cd33 #21003

Closes #21010
2026-03-19 15:04:12 +01:00
Viktor Szakats
51f813308e
scripts: harden / tidy up more Perl system() calls
Closes #21007
2026-03-19 14:26:56 +01:00
Viktor Szakats
31add10322
docs: enable more compiler warnings for C snippets, fix 3 finds
Also:
- sync gcc option order.
- unfold lines in C snippet.

Closes #21006
2026-03-19 14:21:53 +01:00
Daniel Stenberg
673e14cd33
x509asn1: improve encodeOID
- return error on zero length input
- return error on OOM or doing too large output
- fix full 32-bit number support
- fix the broken handling of the first and second numbers
- support up to 32-bit minus 80 for the second number
- a field with a leading 0x80 is now considered an error, since it only
  works as padding and is then no longer the shortest possible version

Add unit tests in 1666

Bonus: removed the last argument to OID2str() as it was always set TRUE.

Closes #21003
2026-03-19 13:55:34 +01:00
Viktor Szakats
ce51fb493c
include: drop 'will' from public headers
Closes #21005
2026-03-19 12:02:10 +01:00
Viktor Szakats
387efe3d28
extract-unit-protos: retain internal paths for includes
Follow-up to 3058ed3df8 #20623

Closes #21004
2026-03-19 12:02:10 +01:00
Jason Stangroome
ae864e824e
examples: fix typo in comment
noticed while reviewing https://github.com/curl/curl/pull/20793

Ref: https://github.com/curl/curl/pull/20793/changes#r2957089487

Closes #21001
2026-03-19 12:02:10 +01:00
renovate[bot]
e9c3dacc5e
GHA: update dependency wolfSSL/wolfssl to v5.9.0
Closes #20998
2026-03-19 12:02:10 +01:00
Viktor Szakats
3bc6ae5500
mod_curltest: fix allocation size
It wasn't causing an issue with current usage.

Found by Codex Security

Follow-up to 35cfb081d2 #16541

Closes #20994
2026-03-19 12:02:10 +01:00
Viktor Szakats
6c0772fd7f
openssl: fix memory leaks in ECH code (OpenSSL 3)
Also drop an unnecessary cast.

Found by Codex Security

Follow-up to a362962b72 #11922

Closes #20993
2026-03-19 12:02:10 +01:00
Viktor Szakats
fc222ec11f
tool_operate: fix condition for loading curl-ca-bundle.crt (Windows)
It was incorrecly loaded with env `CURL_CA_BUNDLE` unset +
`SSL_CERT_DIR` set + `SSL_CERT_FILE` unset.

Found by Codex Security

Follow-up to 29bce9857a #11325 #11531

Closes #20989
2026-03-19 12:02:10 +01:00
Viktor Szakats
2bb3643bc1
sws: fix potential OOB write
Found by Codex Security

Follow-up to 0aaebf62ec

Closes #20988
2026-03-19 12:02:10 +01:00
Viktor Szakats
1c7a270e26
sshserver.pl: harden more system() calls
Ref: https://perldoc.perl.org/functions/system

Closes #20997
2026-03-19 11:27:03 +01:00
Viktor Szakats
1509b0ce6a
sshserver.pl: pass command-line to system() safely
Found by Codex Security

Follow-up to 89f306ae40 #16781

Closes #20996
2026-03-19 11:27:03 +01:00
Viktor Szakats
86c25c06c9
x509asn1: fix to return error in an error case from encodeOID()
Found by Codex Security

Follow-up to d8b0318ad6 #3582

Closes #20991
2026-03-19 11:17:17 +01:00
Viktor Szakats
59405ffb7d
build: enable -Wimplicit-int-enum-cast compiler warning, fix issues
Offered by clang 21+.

Closes #20990
2026-03-19 11:17:17 +01:00
Viktor Szakats
d86fd143a1
synctime: fix off-by-one read and write to a read-only buffer (Windows)
Also making the `--synctime` option work.

Off-by-one found by Codex Security

Assisted-by: Jay Satiro

Closes #20987
2026-03-19 11:17:17 +01:00
Viktor Szakats
e345dfb958
asyn-ares: drop orphaned variable references
In rare, conditional `#if` branches.

Found by Codex Security

Follow-up to ac7e2c3dc6 #17450
Follow-up to 7bf576064c #17167

Closes #20999
2026-03-19 02:24:06 +01:00
renovate[bot]
ad9836dfa4
GHA: update dependency nghttp2/nghttp2 to v1.68.1
Closes #20982
2026-03-18 15:06:44 +01:00
Viktor Szakats
d986b89c88
rand: use BCryptGenRandom() in UWP builds
Also:
- fix build configuration to correctly set Win10 target in the mingw-w64
  CI build, to enable the `BCryptGenRandom()` prototype in v6+ SDK
  headers.

Ref: https://learn.microsoft.com/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom

Issue raised by Codex Security

Closes #20983
2026-03-18 14:47:39 +01:00
Stefan Eissing
41aaac61e2
lib: always use Curl_1st_fatal instead of Curl_1st_err
Curl_1st_err() does not return the second error if the first result is
CURLE_AGAIN. This may cause errors to not become noticeable when they
should be.

Replace all use of Curl_1st_err() with Curl_1st_fatal(), which handles
CURLE_AGAIN as a not-a-real-error case.

Closes #20980
2026-03-18 13:38:51 +01:00
Viktor Szakats
77c5470147
scripts: drop unused CI scripts
Replaced by Test Clutch:
https://testclutch.curl.se/static/reports/feature-matrix.html

Closes #20981
2026-03-18 13:07:13 +01:00
Viktor Szakats
454db7aeee
badwords: prefer 'null-terminated'
Aligning with existing text.

Closes #20979
2026-03-18 11:40:13 +01:00
Viktor Szakats
a3699e8b9e
examples/websocket: fix to sleep more on Windows
Found by Codex Security

Follow-up to d4b8589055 #13771

Closes #20978
2026-03-18 11:37:15 +01:00
Viktor Szakats
c5daffe5f3
delta: avoid potential zero division
Found by Codex Security

Closes #20977
2026-03-18 11:37:15 +01:00
Viktor Szakats
578ee6b79b
gcc: guard #pragma diagnostic in core code for <4.6, disable picky warnings
Extend `#pragma diagnostic push`/`pop` guards to the whole codebase
(from tests and examples only) to disable it for GCC <4.6. Rename guard
to `CURL_HAVE_DIAG` and make it include llvm/clang to be interchangeable
with `__GNUC__ || __clang__` in this context.

The above means no longer disabling certain warnings locally, so pair
this with disabling all picky warnings for GCC <4.6.

Also:
- drop global workarounds for misbehaving GCC <4.6 compiler warnings.
  Not needed with picky warnings disabled.

Reported-by: fds242 on github
Reported-by: Sergey Fedorov
Thanks-to: Orgad Shaneh
Follow-up to f07a98ae11 #20366
Fixes #20892
Fixes #20924
Closes #20902
Closes #20907
2026-03-18 11:33:37 +01:00
Ercan Ermis
c3f04e76ae
ftp: reject PWD responses containing control characters
A malicious or compromised FTP server could include control characters
(e.g. bare \r, or bytes 0x01-0x1f/0x7f) inside the quoted directory path
of its 257 PWD response. That string is stored verbatim as
ftpc->entrypath and later sent unescaped in a CWD command on connection
reuse via Curl_pp_sendf(), which performs no sanitization before
appending \r\n.

Reject the entire path if any control character is encountered during
extraction so that tainted data never reaches a subsequent FTP command.

Add test case 3217 and 3218 to verify. Adjusted test 1152 accordingly.

Closes #20949
2026-03-18 11:24:41 +01:00
Viktor Szakats
650b33a3db
badwords: pass config as filename arg
Instead of stdin.

To simplify the command-line, and allow using a safe and portable
`system()` call from `badwords-all`.

Ref: https://perldoc.perl.org/functions/system

Closes #20970
2026-03-18 11:22:23 +01:00
Daniel Stenberg
3f06e27502
urlapi: make dedotdotify handle leading dots correctly
Paths starting with one or two leading dots but without a following
slash were not handled correctly.

Follow-up to c31dd6631f

Extended test 1395 accordingly with a set of new test string.

Reported by Codex Security

Closes #20974
2026-03-18 11:14:20 +01:00
Daniel Stenberg
acb4fcb2ef
tool_msgs: avoid null pointer deref for early errors
When errorf()/warnf() is used early on, before the global pointer is
setup, curl would previosly deref the null pointer.

Follow-up to 3b40128b0f

Found by Codex Security

Closes #20967
2026-03-18 10:40:19 +01:00
Daniel Stenberg
a43ea5943b
http2: clear the h2 session at delete
When calling nghttp2 to delete session, clear the pointer to avoid risk
of UAF.

Pointed out by Codex Security

Closes #20975
2026-03-18 10:34:48 +01:00
Daniel Stenberg
02e04eaee7
asyn-ares: fix HTTPS-lookup when not on port 443
Follow-up to 8d0bfe74fb

Spotted by Codex Security

Closes #20966
2026-03-18 10:25:52 +01:00
Daniel Stenberg
b11f43a4db
top-complexity: prevent filename-based shell injection risk
As we run this script in CI, this should reduce the risk of mischief

Found by Codex Security

Closes #20969
2026-03-18 10:24:53 +01:00
Daniel Stenberg
80b6cd92af
tool_formparse: propagate my_get_line errors when reading headers
The read_field_headers() function would return "ok" even if the
underlying file read returned error, thus would the parent not become
aware of the problem.

Follow-up to f847d2ed02

Found by Codex Security

Closes #20963
2026-03-17 23:41:23 +01:00
Daniel Stenberg
0d7677ac72
generate.bat: remove extra % from VC11 and VC12 runs
The extra % translates to nothing, so this did not break anything they
are just superfluous.

Follow-up to 57d349fe0e

Assisted-by: Viktor Szakats

Found by Codex Security
2026-03-17 23:39:33 +01:00
Viktor Szakats
650546fbe0
cmake: document functions used from Windows system DLLs
Closes #20965
2026-03-17 22:17:36 +01:00
Daniel Stenberg
cc5604182a
RELEASE-NOTES: synced 2026-03-17 17:05:15 +01:00
Daniel Stenberg
a327a5bded
netrc: refactor into smaller sub functions
Fixes #20950 - test 685 is extended for this
Closes #20932
2026-03-17 16:51:38 +01:00
Daniel Stenberg
a46816b4cb
imap: reset the UIDVALIDITY state between transfers
uidvalidity_set and mb_uidvalidity_set flags were never reset, leaving a
risk for stale UIDVALIDITY state across transfers and mailbox switches.

Follow-up to fb6a4802d7

Spotted by Codex Security

Closes #20962
2026-03-17 16:31:53 +01:00
Daniel Stenberg
ae09e5bf0d
curl_get_line: error out on read errors
Missing ferror handling in Curl_get_line causes infinite loops on I/O
errors, leading to denial-of-service hangs for config/cache file loads.

Follow-up to 769ccb4d42

Pointed out by Codex Security

Closes #20958
2026-03-17 16:14:08 +01:00
Stefan Eissing
adda11330b
transfer: enhance secure check
Introduce `Curl_xfer_is_secure(data)` that returns TRUE for transfers
that happen(ed) over a end-to-end secured connection, e.g. SSL.

Add test1586 to verify behaviour for http: transfers via a https: proxy.

Reported-by: lg_oled77c5pua on hackerone

Closes #20951
2026-03-17 15:56:02 +01:00
Daniel Stenberg
f4c0590b1c
tool_ipfs: accept IPFS gateway URL without set port number
Follow-up to: 56129718b8

Test 1851 added to verify

Pointed out by Codex Security

Closes #20957
2026-03-17 15:51:43 +01:00
Stefan Eissing
f1a5343f5e
urldata: remove trailers_state
It's not used anywhere. Remove `data->state.trailers_state` completely.

Closes #20960
2026-03-17 15:32:04 +01:00
Stefan Eissing
aeee5dd616
connection bits: move 'connect_only' here
Move the bit `connection_only` from `connectdata` to `ConnectBits`.
Since we keep all other bits there, seems the correct place.

Closes #20959
2026-03-17 15:01:29 +01:00
Daniel Stenberg
1098e1044e
tool_urlglob: fix memory-leak on glob range overflow
Follow-up to 5f273fdddf

Pointed out by Codex Security

Closes #20956
2026-03-17 14:55:11 +01:00
Stefan Eissing
91b422d356
pytest: add additional quiche check for flaky test_05_01
As long as stream resets are not visible in the API reliably,
exclude test_05_01, same as test_05_02 already.

Closes #20952
2026-03-17 14:53:15 +01:00
Daniel Stenberg
90b9f51458
tool_operate: fix minor memory-leak on early error
When .curlrc is parsed successfully but the tool exits early before
parse_args() executes; the allocated path was not freed.

Spotted by Codex Security

Closes #20954
2026-03-17 14:52:12 +01:00
renovate[bot]
b881bc0021
Dockerfile: update debian:bookworm-slim Docker digest to f065376
Closes #20946
2026-03-17 14:48:38 +01:00
Daniel Stenberg
e894699c1e
strerr: correct the strerror_s() return code condition
In curlx_strerror on Windows, the condition checks `!strerror_s(...)`
(true on success) and therefore always evaluates the fallback block.
Even when strerror_s successfully produced a valid errno message.

Follow-up to 1eca08a541

Pointed out by Codex Security
Closes #20955
2026-03-17 14:45:01 +01:00
Viktor Szakats
38107d3354
configure: fix --with-ngtcp2=<path> option for crypto libs
ngtcp2 1.14.0 added module dependencies to `ngtcp2_crypto_*.pc` files.
This broke certain build cases in curl, because configure was is
querying pkg-config modules by setting `PKG_CONFIG_LIBDIR` to the
directory specified via `--with-*=` options, including `--with-ngtcp2=`.
Setting `PKG_CONFIG_LIBDIR` tells pkg-config (and pkgconf) to ignore
system locations. This caused that `ngtcp2_crypto_gnutls.pc` could no
longer find its indirect dependencies, if those were present at system
locations (where they typically are). Another fallout was BoringSSL,
because it does not provide `openssl.pc` on its own, and successful
detection relied on finding a non-BoringSSL copy, typically at a system
location (also fixed in ngtcp2 main branch).

Fix `ngtcp2_crypto_*` detections to not touch `PKG_CONFIG_LIBDIR` and
instead prepend `<path>` set via `--with-ngtcp2=` to `PKG_CONFIG_PATH`.
This ensures to pick up any dependent modules from system locations.

Note the side-effect is that potentially undesired modules may be
detected this way from system locations, i.e. it makes this particular
detection less "hermetic" than the rest used in curl configure.

(Configurations using a bare `--with-ngtcp2` with no path were not
affected, and served as a workaround before this patch. It remains a
valid way of configuration after.)

Both `pkgconf` and `pkg-config` use this logic to calculate their search
directory list:
```pseudo
search = {}
if PKG_CONFIG_PATH is set
  search += PKG_CONFIG_PATH
endif
if PKG_CONFIG_LIBDIR is set (even if empty)
  search += PKG_CONFIG_LIBDIR
else
  search += built-in-pkg-config-dirs
endif
```

Refs:
https://github.com/curl/curl/pull/18028/commits (earlier attempt. Failed due to using `PKG_CONFIG_DIR` instead of the correct `PKG_CONFIG_PATH`)
https://github.com/curl/curl/pull/18028/commits/c0874ce8242d42a1ae1d570d6b70b8360da56482
https://man.archlinux.org/man/pkgconf.1.en
https://manpages.debian.org/unstable/pkgconf/pkgconf.1.en.html
https://manpages.debian.org/unstable/pkg-config/pkg-config.1.en.html
10e27fd63c

Bug: https://github.com/curl/curl/pull/18022#issuecomment-3120587041
Bug: https://github.com/ngtcp2/ngtcp2/pull/1689#issuecomment-3120593664
Follow-up to 04d90b5deb #20931
Follow-up to 3c64ffaff4 #18415 #18188
Follow-up to 99500660af #18028 #18022

Closes #20920
2026-03-17 14:37:53 +01:00
Viktor Szakats
3e74a3e062
openssl: drop obsolete SSLv2 logic
Closes #20945
2026-03-17 14:36:54 +01:00
Flavio Amieiro
fa5d2cc97e
curl_ctype.h: fix spelling in a couple of locally used macros
The `ISLOWHEXALHA` and `ISUPHEXALHA` macros were introduced in commit
f65f750 and seem to be only referenced locally by the `ISXDIGIT` macro.

Judging by the `ISALPHA` macro defined in the same file, it seems like
the intention was to spell them as `IS.*HEXALPHA`.

I noticed this while reading through the code and decided to open a PR,
even if it is only a tiny change, just because I was already looking at
it and it might be useful. If there is any reason not to merge this,
please do close the PR.

Closes #20810
2026-03-17 14:34:48 +01:00
Stefan Eissing
2e2d021d97
ftp: do not strdup DATA hostname
Since `newhost` is already allocated, we do not need to strdup()
it. Just assign and NULL the reference.

Closes #20953
2026-03-17 13:42:25 +01:00
Viktor Szakats
32500f12c4
HTTP3.md: minor improvements
- document building curl with CMake.

- mention all supported forks in the OpenSSL section. Delete dedicated
  quictls section.

- add TLS-backend pkgconfig dir to `PKG_CONFIG_PATH` for correctness.
  OpenSSL-based ones often work without this, by finding system
  `openssl.pc`. For GnuTLS and wolfSSL this has a lesser chance. Best to
  point to them explicitly. (configure may technically be able to do
  this automatically, but it isn't implemented.)

- use `--with-ngtcp2=<path>` again, where possible.
  GnuTLS is the exception, pending fix in #20910.
  Same for BoringSSL, but not documented in `HTTP3.md`.

- replace `<somewhereN>` with `/path/to/depname` for clarity.

- move `LDFLAGS` after `./configure` for curl, to match dep builds.

- move `--with-ngtcp2` next to the TLS-backend option.

Follow-up to 1e3c2bec7e #20926
Follow-up to 3c64ffaff4 #18415 #18188
Cherry-picked from #20920

Closes #20947
2026-03-17 12:28:58 +01:00
Daniel Stenberg
b98981e16b
url: don't assume all transfers have hostnames
Follow-up from 412cd2577a

Add test 1659 to verify --connect-to when doing file:// transfers.

Reported-by: James Fuller
Closes #20948
2026-03-17 10:26:35 +01:00
Viktor Szakats
1e3c2bec7e
GHA/http3-linux: add CI reproducer for --with-ngtcp2=<path> regression
Configure LibreSSL autotools job with `--with-ngtcp=<path>` instead of
adding ngtcp2 to `PKG_CONFIG_PATH`. To test this way of configuration in
CI and test for the regression reported in #20889.

Turns out this way of configuration isn't affected by the detection
issue in this particular case.

It also works for other backends except for these two, subject to
separate fixes:
- BoringSSL fix: https://github.com/ngtcp2/ngtcp2/pull/2070
- GnuTLS fix and BoringSSL workaround: #20920

Follow-up to 666db80196 #20891
Follow-up to 8db0e286b3 #18189
Follow-up to 99500660af #18028 #18022

Closes #20926
2026-03-17 02:47:05 +01:00
Viktor Szakats
e05cfd6454
build: drop openssl module dependency for BoringSSL from libcurl.pc
BoringSSL does not provide pc files, as of v0.20260211.0 (and its latest
main branch.) It also did not provide them in the past.

Its sibling fork, AWS-LC does provide them since v1.18.0 (2023-12-04):
7e6aef83ec
https://github.com/aws/aws-lc/pull/1310

Introduce internal variable `OPENSSL_IS_AWSLC` to make this possible.

Bug: https://github.com/curl/curl/pull/20926#issuecomment-4063674714
Ref: https://github.com/ngtcp2/ngtcp2/pull/1689#issuecomment-4063725461

Closes #20938
2026-03-17 00:42:41 +01:00
Daniel Stenberg
3e8df37885
digest: pass in the user name quoted (as well)
For cases where the user puts a double quote or backspace in the user
name.

Adjusted test 907 to verify

Reported-by: am-perip on hackerone

Closes #20940
2026-03-16 22:43:14 +01:00
Viktor Szakats
8423cc8e3b
configure: prefer dependency-specific variables over $withval
Tidy up, for robustness and consistency.

Ref: #20943
Cherry-picked from #20920

Closes #20944
2026-03-16 19:43:52 +01:00
Viktor Szakats
3ba48ee9ef
curl-wolfssl.m4: fix to use the correct value for pkg-config directory
Before this patch the `$withval` variable may have contained `yes` or
other unrelated values, instead of the wolfSSL directory configured via
`--with-wolfssl=`.

Fixing:
```
checking for wolfssl options with pkg-config... found
configure: pkg-config --exists wolfssl trace:
---- begin
PKG_CONFIG_PATH: |/home/runner/wolfssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig|
PKG_CONFIG_LIBDIR: |yes/lib/pkgconfig|         <=============== 'yes' used as base directory
trying path: /home/runner/wolfssl/build/lib/pkgconfig for wolfssl
---- end
```
Ref: https://github.com/curl/curl/actions/runs/23146424326/job/67235762794?pr=20920#step:18:245

Cherry-picked from #20920

Closes #20943
2026-03-16 19:43:52 +01:00
Viktor Szakats
b317506cac
configure: also trace two important pkg-config envs
`PKG_CONFIG_LIBDIR` and `PKG_CONFIG_PATH`.

To help debugging dependency issues. Example:
```
configure: pkg-config --exists openssl trace:
---- begin
PKG_CONFIG_LIBDIR: '/home/runner/libressl/build/lib/pkgconfig'
PKG_CONFIG_PATH: '/home/runner/libressl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig'
trying path: /home/runner/libressl/build/lib/pkgconfig for openssl
trying path: /home/runner/libressl/build/lib/pkgconfig for libssl
trying path: /home/runner/libressl/build/lib/pkgconfig for libcrypto
---- end
```

Cherry-picked from #20920
Follow-up to 04d90b5deb #20931

Closes #20942
2026-03-16 18:33:32 +01:00
Viktor Szakats
ec3f198ef0
GHA/http3-linux: prefer contains() over == in job name filters
To allow extending names without breaking logic.

Cherry-picked from #20920

Closes #20941
2026-03-16 18:12:00 +01:00
Daniel Stenberg
29cb750fc2
tool_cb_wrt: fix no-clobber error handling
When saving a file with --no-clobber, make sure the existing file name
remains set when creating the name fails. In a retry scenario, it comes
back and uses that variable again.

Add test 3036 to verify.

Reported-by: James Fuller
Closes #20939
2026-03-16 15:31:44 +01:00
Viktor Szakats
3525ed9b2f
ECH.md: replace double-backticks with single ones
Also fix a indent/space nits.

Closes #20937
2026-03-16 14:24:25 +01:00
Viktor Szakats
0793c98027
cmake: rework binutils ld hack to not read LOCATION property
Instead hook up the upstream target name as-is to the local wrapper
target.

To:
- make the hack work regardless of how the upstream target was created.
- make it work the same way in `curl-config.cmake`.
  Before this patch it had no guard for `IMPORTED` targets even though
  `find_dependencies()` is not guaranteed to create the target expected
  if it already existed and was potentially created differently.

Depends-on: #20840
Follow-up to 4f1646ef8a #20486 #20419

Closes #20839
2026-03-16 13:32:39 +01:00
Viktor Szakats
9d104f566f
ldap: drop duplicate ldap_set_option() on Windows
Already set after `ldap_sslinit()`/`ldap_init()` and before
`ldap_ssl`-specific initialization.

Follow-up to 39d1976b7f #19830
Follow-up to b41e65a8e3
Follow-up to b91421b107

Closes #20930
2026-03-16 13:18:45 +01:00
Viktor Szakats
030d6aeaf3
build: include curlx headers directly in src and tests
To include what's actually used.

Also:
- drop unused includes.
- scope includes where possible.
- drop `curlx/curlx.h` umbrella header.
- config2setopts: include `netinet/in.h` for Cygwin/MSYS2.
  Previously included by chance via an unused curlx include.

Closes #20776
2026-03-16 12:05:39 +01:00
Viktor Szakats
ca92e20123
mk-ca-bundle.pl: make generated timestamps deterministic
With default invocation, make generated file timestamps deterministic
by looking up (via the GitHub API) the last commit that modified
`certdata.txt`, along with  its commit timestamp.

Also:
- show the URL used to download `certdata.txt` from.
- make `ca-bundle.crt` timestamp match `certdata.txt`'s.

Closes #20528
2026-03-16 11:59:59 +01:00
Viktor Szakats
fad1ebaecc
cmake: resolve imported targets recursively when generating libcurl.pc
To allow simplifying the binutils ld hack, by chaining the original
imported target to curl's local duplicate target. Also to allow linking
to dependencies' native imported targets via their CMake Configs, which
will always be hooked up to a `CURL::` interface, and may also be
chained upstream.

Fixing (seen on Linux with simplified binutils hack via #20839):
```
 Requires:
 Requires.private: libzstd openssl zlib
 Libs: -L${libdir} -lcurl
-Libs.private:  -lcrypto -lssl -lz -lzstd
+Libs.private:  -lOpenSSL::Crypto -lZLIB::ZLIB -lcrypto -lssl -lz -lzstd
 Cflags: -I${includedir}
 Cflags.private: -DCURL_STATICLIB
Error: Process completed with exit code
```
Ref: https://github.com/curl/curl/actions/runs/22768301699/job/66041980258?pr=20839

Note this makes it possible to run into an infinite loop because CMake
allows cyclic dependencies. It isn't added by curl's CMake script nor by
any dependencies as defined by default, but may happen in theory with
custom-created targets. In such case CMake automatically stops with
an error at 1000 iterations. I find it overkill to add custom protection
for it.

Cherry-picked from #20814
Cherry-picked from #20839

Closes #20840
2026-03-16 11:57:56 +01:00
Viktor Szakats
e76968e20d
curl_get_line: fix potential infinite loop when filename is a directory
Fix potential inifinite loop reading file content with `Curl_get_line()`
when a filename passed via these options are pointing to a directory
entry (on non-Windows):

- `--alt-svc` / `CURLOPT_ALTSVC`
- `-b` / `--cookie` / `CURLOPT_COOKIEFILE`
- `--hsts` / `CURLOPT_HSTS`
- `--netrc-file` / `CURLOPT_NETRC_FILE`

Fix by checking for this condition and silently skipping such filename
without attempting to read content. Add test 1713 to verify.

Mention in cookie documentation as an accepted case, also show a verbose
message when a directory is detected. Extend test 46 to verify if such
failure lets the logic continue to the next cookie file.

Reported-and-based-on-patch-by: Richard Tollerton
Fixes #20823
Closes #20826 (originally-based-on)
Follow-up to 769ccb4d42 #19140

Closes #20873
2026-03-16 11:54:43 +01:00
Viktor Szakats
6d87eb2878
cmake: add CURL_GCC_ANALYZER option, enable in CI, fix/silence
Enable in one existing Linux, macOS and Windows job.

Cost:
- Linux: +1.3 minutes.
- macOS: +1.5 minutes.
- Windows: +2.5 minutes.

Fix or silence issues found:
- conncache: silence NULL deref warning.
  ```
  lib/conncache.c:564:18: warning: dereference of NULL '*data.multi' [CWE-476] [-Wanalyzer-null-dereference]
  ```
  Ref: ede6a8e087 #19378
- http2: check pointer for NULL.
  ```
  lib/http2.c:388:7: error: dereference of NULL ‘data’ [CWE-476] [-Wanalyzer-null-dereference]
  ```
- http2: silence potential NULL deref in `cf_h2_recv`.
  ```
  lib/http2.c: In function 'cf_h2_recv':
  lib/curl_trc.h:62:15: warning: dereference of NULL 'data' [CWE-476] [-Wanalyzer-null-dereference]
  ```
- openldap: silence deref before NULL check.
  Seen in GHA/Linux.
  ```
  lib/openldap.c: In function ‘oldap_state_mechs_resp’:
  lib/curl_trc.h:140:7: warning: check of ‘data’ for NULL after already dereferencing it [-Wanalyzer-deref-before-check]
  ```
- sendf: silence NULL deref false positive in `Curl_creader_set_fread`.
  It looks impossible to happen.
  ```
  lib/sendf.c:1133:7: warning: dereference of NULL 'r' [CWE-476] [-Wanalyzer-null-dereference]
  ```
- ws: silence deref before NULL check.
  ```
  lib/ws.c: In function 'ws_send_raw_blocking':
  lib/curl_trc.h:205:7: warning: check of 'data' for NULL after already dereferencing it [-Wanalyzer-deref-before-check]
  ```
- var: fix potential NULL deref
  ```
  src/var.c:216:29: warning: dereference of NULL 'envp' [CWE-476] [-Wanalyzer-null-dereference]
  ```
- cli_hx_upload.c: fix NULL check after dereference.
  ```
  tests/libtest/cli_hx_upload.c:170:7: warning: check of '*t.method' for NULL after already dereferencing it [-Wanalyzer-deref-before-check]
  ```
- unit1607, unit1609: fix theoretical NULL ptr dereference.
  ```
  tests/unit/unit1607.c:211:12: warning: dereference of NULL 'addr' [CWE-476] [-Wanalyzer-null-dereference]
  tests/unit/unit1609.c:193:12: warning: dereference of NULL 'addr' [CWE-476] [-Wanalyzer-null-dereference]
  ```
- globally disable checks triggering false positives only:
  ```
  docs/examples/externalsocket.c:135:8: warning: 'connect' on possibly invalid file descriptor 'sockfd' [-Wanalyzer-fd-use-without-check]
  lib/bufq.c:465:16: warning: infinite loop [CWE-835] [-Wanalyzer-infinite-loop] (gcc-15 Windows)
  lib/doh.c:1035:34: warning: stack-based buffer over-read [CWE-126] [-Wanalyzer-out-of-bounds] (gcc-15 macOS)
  lib/ftp.c:4022:20: warning: infinite loop [CWE-835] [-Wanalyzer-infinite-loop] (gcc-15 macOS)
  lib/http2.c:689:28: warning: buffer over-read [CWE-126] [-Wanalyzer-out-of-bounds] (gcc-15 macOS)
  lib/socketpair.c:195:5: warning: leak of file descriptor 'curl_dbg_socket(2, 1, 0, 192, "D:/a/curl/curl/lib/socketpair.c")' [CWE-775] [-Wanalyzer-fd-leak]
  src/tool_doswin.c:810:7: warning: leak of file descriptor '*tdata.socket_l' [CWE-775] [-Wanalyzer-fd-leak]
  src/tool_doswin.c:816:9: warning: leak of file descriptor '*tdata.socket_l' [CWE-775] [-Wanalyzer-fd-leak]
  src/tool_main.c:96:1: warning: leak of file descriptor 'fd[0]' [CWE-775] [-Wanalyzer-fd-leak]
  src/tool_main.c:96:1: warning: leak of file descriptor 'fd[1]' [CWE-775] [-Wanalyzer-fd-leak]
  src/tool_urlglob.c:48:17: warning: leak of 'malloc(8)' [CWE-401] [-Wanalyzer-malloc-leak]
  src/tool_writeout.c:870:3: warning: leak of FILE 'stream2' [CWE-775] [-Wanalyzer-file-leak]
  tests/libtest/lib518.c:90:1: warning: leak of FILE [CWE-775] [-Wanalyzer-file-leak]
  tests/libtest/lib537.c:87:1: warning: leak of FILE [CWE-775] [-Wanalyzer-file-leak]
  tests/server/tftpd.c:1147:10: warning: 'bind' on possibly invalid file descriptor 'sock' [-Wanalyzer-fd-use-without-check]
  tests/server/tftpd.c:1155:10: warning: 'bind' on possibly invalid file descriptor 'sock' [-Wanalyzer-fd-use-without-check]
  tests/server/tftpd.c:1259:10: warning: 'connect' on possibly invalid file descriptor '4294967295' [-Wanalyzer-fd-use-without-check]
  ```

Also:
- cmake: update clang-tidy typecheck comment.

Ref: https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html

Closes #20921
2026-03-16 11:49:34 +01:00
Viktor Szakats
04d90b5deb
configure: add option to trace pkg-config detection details
To aid debugging cases when dependency detection acts unexpectedly.
Sprung from spending days trying to figure out behavior of ngtcp2 crypto
modules and their dependencies.

You can enable by setting env `CURL_TRACE_PKG_CONFIG` to a non-empty
value. When enabled, details are logged for both successful and
unsuccessful detections. Logging of unsuccessful ones is automatically
enabled when `CURL_CI` env is set, which is the case for all CI jobs.

It works by asking for `--debug` output and grepping for lines that seem
useful for this purpose. Output is different for classic pkg-config and
pkgconf, and may depending on tool version. Also append `--print-errors`
output if any.

Examples (with pkgconf):

Fail, before:
```
checking for libngtcp2_crypto_boringssl options with pkg-config... no
configure: error: --with-ngtcp2 was specified but could not find ngtcp2_crypto_boringssl pkg-config file.
```

Fail, after:
```
checking for libngtcp2_crypto_boringssl options with pkg-config... no
configure: pkg-config --exists libngtcp2_crypto_boringssl trace:
---- begin
trying path: /home/runner/nghttp3/build/lib/pkgconfig for libngtcp2_crypto_boringssl
trying path: /home/runner/ngtcp2-boringssl/build/lib/pkgconfig for libngtcp2_crypto_boringssl
trying path: /home/runner/nghttp3/build/lib/pkgconfig for libngtcp2
trying path: /home/runner/ngtcp2-boringssl/build/lib/pkgconfig for libngtcp2
trying path: /home/runner/nghttp3/build/lib/pkgconfig for openssl
trying path: /home/runner/ngtcp2-boringssl/build/lib/pkgconfig for openssl
trying path: /home/runner/nghttp2/build/lib/pkgconfig for openssl
==== error:
Package openssl was not found in the pkg-config search path.
Perhaps you should add the directory containing `openssl.pc'
to the PKG_CONFIG_PATH environment variable
Package 'openssl', required by 'libngtcp2_crypto_boringssl', not found
---- end
configure: error: --with-ngtcp2 was specified but could not find ngtcp2_crypto_boringssl pkg-config file.
```

Success, after:
```
checking for libngtcp2_crypto_boringssl options with pkg-config... found
configure: pkg-config --exists libngtcp2_crypto_boringssl trace:
---- begin
trying path: /home/runner/awslc/build/lib/pkgconfig for libngtcp2_crypto_boringssl
trying path: /home/runner/nghttp3/build/lib/pkgconfig for libngtcp2_crypto_boringssl
trying path: /home/runner/nghttp2/build/lib/pkgconfig for libngtcp2_crypto_boringssl
trying path: /home/runner/ngtcp2/build/lib/pkgconfig for libngtcp2_crypto_boringssl
trying path: /home/runner/awslc/build/lib/pkgconfig for libngtcp2
trying path: /home/runner/nghttp3/build/lib/pkgconfig for libngtcp2
trying path: /home/runner/nghttp2/build/lib/pkgconfig for libngtcp2
trying path: /home/runner/ngtcp2/build/lib/pkgconfig for libngtcp2
trying path: /home/runner/awslc/build/lib/pkgconfig for openssl
trying path: /home/runner/awslc/build/lib/pkgconfig for libssl
trying path: /home/runner/awslc/build/lib/pkgconfig for libcrypto
---- end
```

More examples:
https://github.com/curl/curl/pull/20926#issuecomment-4064259935

If there is an externally enablable, built-in feature like this in
classic pkg-config or pkgconf, I could not find it.

Also:
- GHA/http3-linux: set `CURL_TRACE_PKG_CONFIG` to log detection details.
  H3 builds are prone to hard-to-debug dependency issues.

Ref: #20920
Follow-up to 3c64ffaff4 #18415 #18188
Follow-up to 99500660af #18028 #18022

Cherry-picked from #20926

Closes #20931
2026-03-16 11:31:01 +01:00
Viktor Szakats
6b0a885611
ldap: fix to initialize cleartext connection on Windows
Regression since curl 8.18.0.

Reported-by: Yoshiro Yoneya
Fixes #20927
Follow-up to 39d1976b7f #19830

Closes #20928
2026-03-16 11:30:45 +01:00
Daniel Stenberg
3334fca537
badwords-all: exit with correct code on errors
Problems remain undetected in CI otherwise

Closes #20934
2026-03-16 11:01:48 +01:00
Daniel Stenberg
b240c5292c
badwords: detect the the and with with
They seem to be the most common mistaken repeated words

Ref #20933

Closes #20934
2026-03-16 11:01:19 +01:00
Daniel Stenberg
0cd0e193d3
url: use URL for url even in comments
(Missed in CI due to a bug, see #20934)

Closes #20935
2026-03-16 10:51:02 +01:00
Martin Dürrmeier
594a9276bc
docs/lib: fix typos
Repated 'the the' and 'with with'

Closes #20933
2026-03-16 10:43:24 +01:00
Stefan Eissing
eb14705280
protocol source, all about protocols and uri schemes
Add protocol.h and protocol.c containing all about libcurl's
known URI schemes and their protocol handlers (so they exist).

Moves the scheme definitions from the various sources files into
protocol.c. Schemes are known and used, even of the protocol
handler is not build or just not implemented at all.

Closes #20906
2026-03-16 08:39:02 +01:00
Daniel Stenberg
32531f20f9
doh: fix memory-leak when doing a second DoH resolve
Reported-by: James Fuller
Closes #20929
2026-03-16 00:20:18 +01:00
Stefan Eissing
f50446f6da
lib: keepon improving
Improve the name, type and handling of `data->req.keepon`:

- Rename `keepon` to `io_flags`
- make `io_flags` and `uint8_t` and reposition in struct
- Rename `KEEP_*` defines to `REQ_IO_*`, move to request.h
- Replace all direct bit tests to `CURL_REQ_WANT_*` use
- Replace all direct bit manipulations with new macros

Closes #20905
2026-03-15 12:48:03 +01:00
Stefan Eissing
9325eb5fc4
urldata: import port types and conn destination format
Convert more `int port` to `uint16_t` port types. Reshuffle ports in
connectdata to save some bytes. Change `conn->destination` format to

- make it more readable and thus usable in tracing
- add the IPv6 scope_id only when not default (global)
  and make it resemble more the textual format for IPv6
  (e.g. suffix '%<scope_id>')

Closes #20918
2026-03-15 12:02:26 +01:00
crawfordxx
dfadec7ec3
os400sys: fix typo in comment (symetry -> symmetry)
Closes #20923
2026-03-15 12:00:08 +01:00
Stefan Eissing
412cd2577a
urldata: connection bit ipv6_ip is wrong
Eliminate `conn->bits.ipv6_ip`

The bit was only correct for the first transfer using a connection. Use
`data->state.up.hostname` instead in places that need the URL hostname
in its original form.

Fix parseurlandfillconn() to not modify `data->state.up.hostname` before
copying the connection's hostname, but modify the copy instead, leaving
the URL hostname intact.

Closes #20919
2026-03-14 23:17:40 +01:00
Daniel Stenberg
eb5af3a9c7
GHA: make typos ignore RELEASE-NOTES
The file is almost entirely made up by first-lines of previous git
commits, and we usually push it without a PR cycle, making it annoying
to trigger on typos later as they then show in independent PRs by other
people.

Closes #20917
2026-03-13 13:12:21 +01:00
Daniel Stenberg
a254b8ce3f
RELEASE-NOTES: fix typo 2026-03-13 10:25:27 +01:00
Daniel Stenberg
6870803187
badwords: only check comments and strings in source code
- when scanning source code, this now only checks source code comments
  and double-quote strings. No more finding bad words as part of code
- this allows the full scan to be done in a single invocation
- detects source code or markdown by file name extension
- moved the whitelist words config into the single `badwords.txt` file,
  no more having them separately (see top of file for syntax)
- all whitelisted words are checked case insensitively now
- removed support for whitelisting words on a specific line number. We
  did not use it and it is too fragile

Removing the actual code from getting scanned made the script take an
additional 0.5 seconds on my machine.

Scanning 1525 files now takes a little under 1.7 seconds for me.

Closes #20909
2026-03-13 08:54:35 +01:00
Daniel Stenberg
2b3438d486
tool_cfgable: free the SSL signature algorithms
Follow-up to a638828c88
Reported-by: James Fuller
Closes #20915
2026-03-12 23:45:38 +01:00
Daniel Stenberg
c2f36b6c4b
RELEASE-NOTES: synced 2026-03-12 23:32:25 +01:00
Daniel Stenberg
510efa0007
HTTP3.md: drop outdated mentions of OpenSSL-QUIC
And make it a little clearer that the quiche backend is what is still
experimental.

Follow-up to 6aaac9dd38

Closes #20914
2026-03-12 23:20:47 +01:00
Viktor Szakats
666db80196
configure: fix LibreSSL ngtcp2 1.15.0+ crypto lib selection logic
Regression since curl 8.18.0.

Reported-by: Michael Hendricks
Fixes #20889
Regression from 8db0e286b3 #18189

Closes #20891
2026-03-12 23:13:03 +01:00
Viktor Szakats
210d8eca5b
build: compiler warning silencing tidy-ups
- tool_getparam: revert an unnecessary/no-op C89 warning silencer.
  Follow-up to 09c9afdd71 #20363

- tool_writeout: add comment saying silencing is a no-op for llvm/clang.
  For `strftime()` it is a GCC-specific, as of llvm/clang v22.1.0.
  Follow-up to f07a98ae11 #20366

- unit1652: drop always-false `!defined(__clang__)` guard.
  Pointed-out-by: Orgad Shaneh
  Ref: #20902
  Follow-up to 7e814c8717 #16062

- unit1652: document that `-Wformat` is necessary for GCC v5 to v8.
  Follow-up to 71cf0d1fca #14772

Closes #20908
2026-03-12 19:02:43 +01:00
Daniel Stenberg
d20fa5cd39
test459: switch to mode="warn" for stderr check
In a -j192 build, this output used a three-digit number for the output,
thus wrapping differently and causing it to error.

Reported-by: Carlos Henrique Lima Melara

Closes #20910
2026-03-12 16:55:07 +01:00
Daniel Stenberg
143279faf4
test1627: Curl_get_scheme unit test
Closes #20904
2026-03-12 14:22:38 +01:00
Daniel Stenberg
9148862c26
test1626: Curl_copy_header_value unit test
Closes #20903
2026-03-12 13:59:59 +01:00
Viktor Szakats
7a4fa90048
openssl: trace count of found / imported Windows native CA roots
To help understanding what's happening on systems where native CA misses
to verify legitimate public websites.

Also:
- drop a superfluous, hanging, `else`.

Ref: #20897

Closes #20899
2026-03-12 10:49:21 +01:00
Daniel Stenberg
133b125b89
http: make Curl_compareheader handle multiple commas in header
For robustness
2026-03-12 10:30:18 +01:00
Daniel Stenberg
ed7bfcd17d
test1625: unit test for Curl_compareheader
Follow-up to 2938cb72e5

Closes #20901
2026-03-12 10:30:14 +01:00
Daniel Stenberg
c0f17dee36
hostip: remove two zero assigns after memset clear
As the struct is now always unconditionally memset with zeros, we
can remove two zero assigns.

Follow-up to 015f1c7de4

Pointed out by CodeSonar

Closes #20900
2026-03-12 08:47:02 +01:00
Daniel Stenberg
2938cb72e5
http: fix Curl_compareheader for multi value headers
Follow-up to 04289c62de. Regression shipped in 8.13.0.

- a logic error made it not loop and thus only match if the searched string
  was first

- it no longer matches a substring

Adjusted test 1 to use multiple values in the Connection: response
header. Adjusted test 1542 to have a "Connection: close-not" which
should not match.

Reported-by: Henrique Pereira

Closes #20894
2026-03-12 07:52:58 +01:00
Viktor Szakats
6ada2e3dce
autotools: limit checksrc target to ignore non-repo test sources
Syncing tests with lib and src behavior.

Also:
- fix OS400 checksrc to find the per-directory `.checksrc` file.

Closes #20898
2026-03-12 01:45:24 +01:00
Viktor Szakats
a0db67572e
build: hook up badwords check to lint targets
Also:
- autotools: make `badwords` target honor `@PERL@`.

Suggested-by: Stefan Eissing

Closes #20884
2026-03-12 01:25:42 +01:00
Viktor Szakats
56739855f3
examples: drop warning silencers no longer hit
Also:
- scope clang `-Wcast-function-type-strict` silencing, add missed `pop`.

Follow-up to d06b49d8b2 #18260

Closes #20896
2026-03-12 01:01:16 +01:00
Viktor Szakats
435eabeac8
badwords: rework exceptions, fix many of them
Also:
- support per-directory and per-upper-directory whitelist entries.
- convert badlist input grep tweak into the above format.
  (except for 'And' which had just a few hits.)
- fix many code exceptions, but do not enforce.
  (there also remain about 350 'will' uses in lib)
- fix badwords in example code, drop exceptions.
- badwords-all: convert to Perl.
  To make it usable from CMake.
- FAQ: reword to not use 'will'. Drop exception.

Closes #20886
2026-03-12 01:01:16 +01:00
Daniel Stenberg
11c14b5ca5
urlapi: verify the last letter of a scheme when set explictly
A logic error made the function not check the last character, which thus
could make it accept invalid schemes.

Added test 1965 to verify

Reported-by: Otis Cui Lei

Closes #20893
2026-03-11 23:48:53 +01:00
Stefan Eissing
5fc7d50cec
vtls: ECH definitions cleanup
- Move ECH related defines to vtls.h
- Prefix all defines with `CURLECH_`
- Move base64.h include from vtls.h to implementations

Closes #20887
2026-03-11 23:45:29 +01:00
Stefan Eissing
f14ce01369
pingpong: cleanup timeleft handling
- Move `RESP_TIMEOUT` from urldata.h to pingpong.h as
  `PINGPONG_TIMEOUT_MS`.
- Rename `Curl_pp_state_timeout()` to `Curl_pp_state_timeleft_ms()` as
  the function returns the time left, not the timout..
- Update implementation comments and variable names

Closes #20888
2026-03-11 23:30:05 +01:00
Stefan Eissing
da7bfb89a1
connection_check, simplified
The protocol handler method `connection_check` allowed to variable
operations to trigger with variable result bits. Only the `CONNCHECK_ISDEAD`
and `CONNRESULT_DEAD` were in use. Transform the function into
`connection_is_dead` without extra parameter and a bool result.

- Remove defines for `CONNCHECK_*` and `CONNRESULT_*`
- Rename protocol function in handler comments
- Change RTSP implementation (only protocol that uses this)

Closes #20890
2026-03-11 23:28:50 +01:00
Vladimír Marek
015f1c7de4
hostip: clear the sockaddr_in6 structure before use
On Solaris this was causing intermittent issues when the private
structure member __sin6_src_id had unexpectedly some value. connect(2)
would then fail with EADDRNOTAVAIL.

Closes #20885
2026-03-11 11:33:13 +01:00
Daniel Stenberg
53a3b2114a
libssh2: fix error handling on quote errors
Previously it lacked the actual return. libssh.c uses the same function
name.

Verified by test 2007.

Reported-by: m777m0 on hackerone

Follow-up to 578706adde

Closes #20883
2026-03-11 09:44:21 +01:00
Daniel Stenberg
a221e2fbff
RELEASE-NOTES: synced
Bumped curlver as well
2026-03-11 08:49:39 +01:00
Daniel Stenberg
1a4d392046
docs: minor wording tweaks
found when improving the badwords whitelisting logic
2026-03-11 08:46:01 +01:00
Daniel Stenberg
2e52a57107
badwords: combine the whitelisting into a single regex
Also: make the whitelist matches case insensitve

Takes the script execution time down from 3.6 seconds to 1.1 on my
machine.

Closes #20880
2026-03-11 08:45:54 +01:00
Daniel Stenberg
8c908d2d0a
RELEASE-NOTES: synced
curl 8.19.0
2026-03-11 07:46:12 +01:00
Daniel Stenberg
7a73be1f95
VERSIONS: add 8.19.0 2026-03-11 07:46:12 +01:00
Daniel Stenberg
3fd0d776d1
THANKS: add contributors from 8.19.0 release 2026-03-11 07:46:12 +01:00
Viktor Szakats
18e8c9f455
FAQ.md: point codeproject.com URL to archive.org copy
The original server closed down, linked page last seen on 2026-02-16.

Refs:
https://github.com/curl/curl/actions/runs/22051494128
https://web.archive.org/web/20250818150617/www.codeproject.com/info/Changes.aspx

Closes #20882
2026-03-11 01:48:21 +01:00
Felipe Mesquita
f25124338c
badwords: avoid 'simply'
It's mostly a filler word. I've read through each use of it in the code
base and did minor rephrasings when "simply" carried some meaning. The
overwhelming majority of cases, removing it improved the text
significantly. Inspired by #20793.

Closes #20822
2026-03-10 19:34:06 +01:00
Viktor Szakats
4021c6e673
badwords: fix showing alternative for case-insensitive hits
Fixing:
```
Use of uninitialized value $alt{"Simply"} in printf at scripts/badwords line 109, <F> line 34.
 maybe use "" instead?
```

Closes #20879
2026-03-10 18:38:29 +01:00
Viktor Szakats
15932f2ac5
GHA: drop installing impacket for curl built without SMB support
Ref: #20846

Closes #20868
2026-03-10 17:45:27 +01:00
Viktor Szakats
3b43b9080d
badwords: dedupe invocation into a runnable script
Also:
- GHA/checksrc: merge two badwords CI jobs into a single one.
- re-add the more common bitness entries.

Closes #20874
2026-03-10 17:44:15 +01:00
Viktor Szakats
d4a06862cb
spacecheck: find double newlines in tests/data/test*
Closes #20872
2026-03-10 17:44:15 +01:00
Daniel Stenberg
ed7bf43a08
BUG-BOUNTY.md: minor rephrase to say there is no bug bounty
also add a brief mention to VULN-DISCLOSURE-POLICY.md

Closes #20878
2026-03-10 17:34:08 +01:00
renovate[bot]
a4f90969ff
GHA: update awslabs/aws-lc to v1.69.0
Closes #20876
2026-03-10 16:08:44 +01:00
Stefan Eissing
c1cea52f12
badwords: twice as fast
...on my macOS machine, this version uses half the time when
scanning the source.

Closes #20877
2026-03-10 16:07:15 +01:00
Daniel Stenberg
8ec0e1e109
docs: fixup wording nits
Mostly sentences starting with bad words
2026-03-09 22:47:07 +01:00
Daniel Stenberg
713287188e
badwords: move into ./scripts, speed up
- 'badwords' is now a target in Makefile.am

- change badwords.txt to specify plain "words" instead of regexes so the
  script can build single regexes when scanning, which makes the script
  perform much faster (~6 times faster)

Closes #20869
2026-03-09 22:47:07 +01:00
Daniel Stenberg
248dd9e55f
x509asn1: make encodeOID stop on too long input
Plus a minor fixup.

Reported-by: John Rodriguez

Closes #20871
2026-03-09 22:06:45 +01:00
Viktor Szakats
df5c6b6f54
docs: handle error in curl_global_init* examples
Also:
- call cleanup in `curl_global_init_mem()` example.

Closes #20866
2026-03-09 13:01:22 +01:00
Viktor Szakats
f6840572c4
THANKS-filter: update with a new entry
Closes #20861
2026-03-09 11:35:19 +01:00
Viktor Szakats
716dc8ce6c
rand: drop scan-build silencer
scan-build has been dropped in favor of clang-tidy and this false
positive no longer triggers with it.

Follow-up to ce4db9c2ef #20751
Follow-up to 02f207a76b

Closes #20860
2026-03-09 11:35:19 +01:00
Viktor Szakats
05189f5549
rand: drop impossible preprocessor branches (wincrypt)
After targeting Vista as minimum, the non-bcrypt fallback code was
impossible to reach, because on UWP wincrypt is never available.

After this patch it's more obvious that no-SSL UWP builds only support
weak random source.

Follow-up to b17ef873ae #18009

Closes #20859
2026-03-09 11:35:19 +01:00
Viktor Szakats
4cad71d1bf
configure: drop always true if check (Windows)
Follow-up to c1bc090d65 #12495

Closes #20858
2026-03-09 11:35:19 +01:00
Viktor Szakats
d709599338
GHA/windows: pass preprocessor flags via CPPFLAGS
To avoid potential warning with autotools when using `CFLAGS`. Existing
jobs are not affected.

Also:
- drop a redundant `export`.
- ensure not to overwrite per-job options with UWP ones.

Closes #20857
2026-03-09 11:35:19 +01:00
Viktor Szakats
6a09f2ef1d
config-win32.h: merge two #if branches
Closes #20856
2026-03-09 11:35:19 +01:00
Viktor Szakats
6a6826469d
windows: determine RtlVerifyVersionInfo address on global init
Instead of the first internal call to `curlx_verify_windows_version()`.

To avoid the chance of a race, potentially resulting in initializing
this address twice. AFAICT it could not cause an issue before this
patch.

Reported by Codex Security

Follow-up to b17ef873ae #18009

Closes #20853
2026-03-09 11:35:19 +01:00
Viktor Szakats
ccba492024
tidy-up: miscellaneous
Closes #20851
2026-03-09 11:35:19 +01:00
huanghuihui0904
cbb5544c45
digest: fix memory leak in auth_create_digest_http_message()
Signed-off-by: huanghuihui0904 <625173@qq.com>

Closes #20862
2026-03-09 09:24:01 +01:00
Daniel Stenberg
4a15bc13f4
RELEASE-NOTES: synced 2026-03-08 23:08:05 +01:00
Daniel Stenberg
1f8cfa049d
test1850: verify the SMB request path use for two transfers 2026-03-08 22:43:03 +01:00
Stefan Eissing
e090be9f73
smb: free the path in the request struct properly
Closes #20854
2026-03-08 22:43:03 +01:00
Viktor Szakats
22b0cbe65f
tests/server: drop unused curlx/version_win32.c
Previously used via `curlx/timeval.c`, but no longer after bumping
minimum target to Vista.

Follow-up to b17ef873ae #18009

Closes #20855
2026-03-08 18:17:11 +01:00
Viktor Szakats
64d4f5c4b6
system_win32: replace manual init code with curlx_now_init() call
The code actual init code remains identical after this patch. To make it
clearer where this initialization is called from, and to dedupe code.

Follow-up to b17ef873ae #18009

Closes #20852
2026-03-08 18:17:11 +01:00
dbalsom
9a674ee6f7
docs: replace instances of the vague qualifier 'quite'
in documentation and comments

Closes #20841
2026-03-07 23:52:50 +01:00
Daniel Stenberg
13f48dfb52
docs: avoid starting sentences with However,
An unnecessary filling word

Closes #20834
2026-03-07 23:49:11 +01:00
Daniel Stenberg
6b552e60a9
quiche: use PRIu64 for outputting the stream id
The 'id' struct field in 'struct h3_stream_ctx' is a uint64_t type so
should be output with PRIu64 - and it makes sense to be consistent.

Note that the field with the same name in the ngtcp2 version of this
struct is a *signed* 64-bit variable.

Reported by Codex Security

Closes #20849
2026-03-07 23:47:56 +01:00
Daniel Stenberg
f180818976
DEPRECATE.md: SMB and NTLM become build-time opt-in
Closes #20847
2026-03-07 14:56:08 +01:00
Daniel Stenberg
2f8fe96d6d
tests/FILEFORMAT.md: the <server> section is NOT mandatory
It can be left out if no servers are necessary.

Closes #20845
2026-03-07 14:21:46 +01:00
Daniel Stenberg
b351fd1b9a
test1849: reuse a proxy with different credentials
Closes #20842
2026-03-07 13:59:30 +01:00
Daniel Stenberg
08d6497005
cf-socket: ignore SOCK_CLOEXEC etc for socktype equality checks
As the SOCK_CLOEXEC and SOCK_NONBLOCK get ORed to the socktype, this
introduces the cf_socktype() function to use when checking for the
specific socket type: DGRAM or STREAM. The function filters off the
non-type related bits to enable the comparison.

Follow-up to 05367694ec

Closes #20808
2026-03-07 13:36:00 +01:00
Daniel Stenberg
e3d7401a32
http: only send bearer if auth is allowed
Verify with test 2006

Closes #20843
2026-03-07 11:00:16 +01:00
Daniel Stenberg
1495489c41
docs: drop basically
Another filler word

Closes #20835
2026-03-07 10:58:36 +01:00
Andrei Rybak
86ea3abd41
FAQ: syntax improvements
During conversion of `docs/FAQ` into Markdown, 'man ld' has incorrectly
kept one of its quotes when it was surrounded by backticks for inline
code formatting.  A space on the left of it was lost as well.

Fix the formatting in the new `docs/FAQ.md`.

Closes #20812
2026-03-06 23:01:47 +01:00
Stefan Eissing
704e7a85f3
mqtt: fix EOF handling
In mqtt_recv_atleast(), recognize an EOF as error.

Fixes #20815
Reported-by: Max Dymond
Closes #20830
2026-03-06 22:53:54 +01:00
Stefan Eissing
5f13a7645e
proxy-auth: additional tests
Also eliminate the special handling for socks proxy match.

Closes #20837
2026-03-06 22:52:39 +01:00
Daniel Stenberg
e47b6e657a
socketpair: clear 'err' when retrying due to EINTR
If the first write was interrupted by a signal and a subsequent write
succeeds, the function would still erroneously return EINTR.

Found by Codex Security
Closes #20809
2026-03-06 22:50:29 +01:00
Daniel Stenberg
e49efce12f
synctime: fix use of uninitialized buffer on non-Windows
Follow-up to: b714c674f3

Spotted by Codex Security
Closes #20806
2026-03-06 22:49:03 +01:00
Daniel Stenberg
27c3e0839a
content_encoding: return 'identity' if none other exists
This fixes a regression and accidental changed behavior shipped in
8.18.0 (via 6b9c75e219).

When the setopt is set to "" and curl is built without support for a
single compression algorithm, it used to use "identity" but recently did
not.

Spotted by Codex Security
Closes #20805
2026-03-06 22:48:16 +01:00
Daniel Stenberg
d7e4473806
tool_doswin: avoid memory-leak with CURL_FN_SANITIZE_*
This is debug-only code

Follow-up to 20900e4a1e

Found by Codex Security

Closes #20804
2026-03-06 22:47:30 +01:00
Daniel Stenberg
933c34e873
tool_operate: reset the URL --url-query between --next
Pointed out by Codex Security

Verify in test 1624
Closes #20802
2026-03-06 22:46:37 +01:00
Stefan Eissing
3c007d6351
openssl+ech: workaround for insecure handshakes
OpenSSL 4.0.0-dev supports ECH with one flaw. If peer verification
is not enabled, it will report SSL_ECH_STATUS_BAD_NAME on the ECH
status.

Provide a workaround in libcurl that checks the inner name used in
ECH was the peer's hostname, both verify peer and host are disabled
and then accept the BAD_NAME without failing the connect.

Fixes #20655
Reported-by: Dexter Gerig
Closes #20821
2026-03-06 22:42:40 +01:00
Stefan Eissing
b803dc9f20
async-ares: blocking resolve timeout handling, better
Perform the actual timeout calculation in the blocking resolv
loop each time in the same way, keeping the logic simpler.

The previous version calculated the timeout once, and then
reduced it by the elapsed time spent in polling/processing.
This is unnecessarily complicated.

Closes #20819
2026-03-06 22:41:56 +01:00
Stefan Eissing
bfb79de206
urldata: byebye conn->hostname_resolve
The strdup() of the hostname to resolve is unnecessary as the sync
resolve code does not keep the string and the async code makes copies
already.

Remove the member from `connectdata`.

Closes #20833
2026-03-06 22:40:29 +01:00
Viktor Szakats
9a3afc1083
cmake: fix LOCATION property access condition (debug)
To match other parts of curl's CMake script and the CMake source.

Ref: https://gitlab.kitware.com/cmake/cmake/-/blob/v3.18.0/Source/cmTargetPropertyComputer.h?ref_type=tags#L68-101

Follow-up to c6cfb2a2f3 #20828

Closes #20838
2026-03-06 15:35:27 +01:00
Viktor Szakats
009facd232
cmake: improve clang-tidy test command-line reproduction
- also query `INTERFACE_COMPILE_DEFINITIONS` and
  `INTERFACE_COMPILE_OPTIONS`.
  To further sync clang-tidy manual command-lines with the C compiler
  command-lines generated by CMake. In practice this adds `-I` options
  (via `INTERFACE_COMPILE_OPTIONS`) to the end of the command-line for
  dependency header directories. It does not change the outcome of
  clang-tidy runs.

- limit querying `COMPILE_DEFINITIONS` and `COMPILE_OPTIONS` to the top
  target, the test itself. To not include options such as
  `-DCURL_HIDDEN_SYMBOLS` and `-fvisibility=hidden` (when set) via
  the libcurl shared lib.
  To sync with the actual C compiler command-line.

- drop redundant `unset()`.

- rename local function to be more specific.

Follow-up to d9386a2f8e #20759

Closes #20829
2026-03-06 04:56:33 +01:00
Viktor Szakats
c6cfb2a2f3
cmake: fix LOCATION property read errors in target debug function
Exclude reading certain props for certain target types to avoid these errors:
```
CMake Error at CMake/Utilities.cmake:71 (get_property):
  The LOCATION property may not be read from target "...".  Use the target
  name directly with add_custom_command, or use the generator expression
  $<TARGET_FILE>, as appropriate.
```
(and the same in line 78.)

Follow-up to 855acb3bb0 #17701

Closes #20828
2026-03-06 04:04:09 +01:00
Viktor Szakats
37f5e3960f
spelling: bump codespell to 2.4.2, fix fallouts
Closes #20825
Closes #20827
2026-03-06 00:30:32 +01:00
Viktor Szakats
3a2fdeb5af
unit3205: drop NOLINT
In favor or a small code change the silences the clang-tidy warning.

Follow-up to b1f853a384 #20731

Closes #20820
2026-03-05 13:50:56 +01:00
Viktor Szakats
0742fd5c80
cmake: mark two internal options as advanced
To omit them from CMake GUI option listings.

Follow-up to c37e06c642 #17962
Follow-up to 6ab1fa423b #16278

Closes #20818
2026-03-05 04:00:08 +01:00
Max Dymond
70ec11358c socks: ensure DNS is freed in failure cases.
In several error cases in socks.c the DNS struct is not freed, which
leads to memory leaks.

Found by: OSS-Fuzz: 447858136

Closes #20813
2026-03-04 17:33:06 +00:00
Viktor Szakats
38ee35353c
examples: improve OpenSSL certificate examples
- add/fix/synchronize error messages and comments.
- consistently return error from the callback on failure.
- fix potential leaks on OpenSSL API failures.
- fix to not pass the nul-terminator to BIO read.
- scope a variable.
- sync code/formatting between the two examples.

Closes #20807
2026-03-04 12:37:31 +01:00
Daniel Stenberg
7079f1d39c
usercertinmem: use the correct cert BIO
PEM_read_bio_PrivateKey() is called with the wrong BIO, so the private
key is not loaded.

Follow-up to 8494012196

Pointed out by Codex Security
Closes #20800
2026-03-03 23:16:08 +01:00
Daniel Stenberg
ad58e07b54
curl.h: remove CURLPROTO_MQTTS from the public header
- the value collided with the internal one used for WebSocket
- we add all new ones as internal bits
- bump to 64-bit internal type
- introduce new define for setting all protocols (CURLPROTO_64ALL)

Reported by Codex Security

Closes #20798
2026-03-03 23:14:34 +01:00
Daniel Stenberg
3d4a701233
config2setopts: restore proper ignoring of CAINFO BLOB option errors
A regression from refactors

Spotted by Codex Security

Closes #20799
2026-03-03 22:54:23 +01:00
Daniel Stenberg
7577ed7e86
schannel: fix UAF in client cert store thumbprint handling
Follow-up to 10bb489b22

Found by Codex Security
Closes #20801
2026-03-03 22:14:26 +01:00
Daniel Stenberg
d9c2c64337
openssl: adapt to OpenSSL master adding const to more APIs
Closes #20797
2026-03-03 17:42:34 +01:00
Viktor Szakats
91e06fde1b
cmake: fix building with CMAKE_FIND_PACKAGE_PREFER_CONFIG=ON
This CMake global custom option tells it to find dependencies as cmake
Configs first, and only then look for `Find*` modules. This may result
in `find_package()` succeeding, but without actually creating `CURL::*`
imported targets the curl build scripts are expecting.

For dependencies with curl-specific, local, `Find*` modules, we always
want to use them, via the module detection method, and never a
Config-based detection. Ensure this by passing the `MODULE` option to
`find_package()` and `find_dependency()` to make them use `Find*`
modules unconditionally, making them work as expected with the
`CMAKE_FIND_PACKAGE_PREFER_CONFIG=ON` option set.

curl uses local Find modules for all dependencies except OpenSSL and
ZLIB. The latter two keep using either CMake's built-in Find modules or
Config method as before this patch.

Also:

- apply the same change to `curl-config.cmake`. To fix consuming curl
  with this option set.
  Authored-by: Valerie Snyder
  Ref: #20764
  Follow-up to 16f073ef49 #16973

- GHA/distcheck: add a job testing both building and consuming curl with
  this option set. (takes 15 seconds)
  Use custom NGHTTP2 configuration for an extra twist (not required
  to trigger this issue.)
  Follow-up to fcde8d7e37 #20773

Reported-by: Valerie Snyder
Fixes #20729

Closes #20784
2026-03-03 16:33:21 +01:00
Daniel Stenberg
3d708e239b
urlapi: use U_CURLU_URLDECODE when toggling it off unsigned
In this use case 'unsigned value &= ~DEFINE;

As otherwise the right side is treated as signed, which annoyingly
triggers UBSan. The U_* defines are local versions of the public define,
only typecast to unsigned.

Reported-by: xmoezzz on github
Fixes #20753
Closes #20769
2026-03-03 16:02:50 +01:00
Daniel Stenberg
cc85cdf3c5
docs: avoid using the word 'magic'
It's never actually magic.

Closes #20796
2026-03-03 15:32:13 +01:00
Daniel Stenberg
b4dba346cd
stop using the word 'just'
Everywhere. In documentation and code comments.

It is almost never a good word and almost always a filler that should be
avoided.

Closes #20793
2026-03-03 15:30:22 +01:00
renovate[bot]
4b583b7585
Dockerfile: update debian:bookworm-slim digest to 74d56e3
Closes #20714
2026-03-03 01:36:55 +01:00
Viktor Szakats
86a2a6b547
cmake: stop disabling C4774 after replacing snprintf(), update comment (MSVC)
- update comment for `-wd4710` option.
  Ref: https://ci.appveyor.com/project/curlorg/curl/builds/53627545
- stop suppressing C4774. Not triggered by the replacement call
  `vsnprintf()`, as also confirmed by local tests.
  Follow-up to 192b9214a7
  Ref: https://devblogs.microsoft.com/cppblog/format-specifiers-checking/
  Ref: https://learn.microsoft.com/cpp/error-messages/compiler-warnings/compiler-warnings-c4600-through-c4799

Follow-up to 64f28b8f88 #20765

Closes #20792
2026-03-03 00:46:41 +01:00
Daniel Díaz
3aa63896ae
mbedtls: guard TLS 1.3 + session tickets usage inside ifdef
If TLS 1.3 is not supported, the call to
`mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets()` fails
during compilation:
```
curl-8.18.0/lib/vtls/mbedtls.c: In function 'mbed_connect_step1':
curl-8.18.0/lib/vtls/mbedtls.c:809:3: error: implicit declaration of function 'mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets' [-Werror=implicit-function-declaration]
   mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets(&backend->config,
   ^
curl-8.18.0/lib/vtls/mbedtls.c:809:3: warning: nested extern declaration of 'mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets' [-Wnested-externs]
```

Protect this call inside the `#ifdef` block by making sure that support
for TLS 1.3 is defined.

Closes #20789
2026-03-03 00:28:35 +01:00
Viktor Szakats
d557c06b52
build: drop unused snprintf() feature check on Windows
Follow-up to 64f28b8f88 #20765

Closes #20790
2026-03-02 22:40:29 +01:00
Viktor Szakats
30ec220a68
mprintf: silence clang-tidy readability-suspicious-call-argument
Follow-up to 64f28b8f88 #20765

Closes #20791
2026-03-02 22:21:21 +01:00
Viktor Szakats
64f28b8f88
curlx: add local snprintf() helper that always nul-terminates (Windows)
Make the helper use `vsnprintf()` internally on all supported Windows
toolchains (dropping `_snprintf()` and `snprintf()`), ensure to
nul-terminate. Omit the return value to avoid complexity.

Use the helper from `mprintf.c` / `out_double()`, from tests/server code
and the tests/server-specific build of `curlx_inet_ntop()`,
`curlx_strerror()` functions. In the single call (in tests) where the
returned length was used previously, determine it with `strlen()`.

Refs:
https://github.com/libssh2/libssh2/blob/libssh2-1.11.1/src/misc.c#L57-L79
https://learn.microsoft.com/cpp/c-runtime-library/reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l
https://learn.microsoft.com/cpp/c-runtime-library/reference/vsnprintf-vsnprintf-vsnprintf-l-vsnwprintf-vsnwprintf-l

Assisted-by: Jay Satiro
Follow-up to fa8bd1cc09 #20761
Follow-up to 8ab468c8aa #15997

Closes #20765
2026-03-02 21:30:36 +01:00
Viktor Szakats
b83ade783d
multi: fix unreachable code compiler warning
```
lib/multi.c:305:5: error: code will never be executed [clang-diagnostic-unreachable-code]
  305 |     goto error;
      |     ^~~~~~~~~~
```

Cherry-picked from #20774

Closes #20788
2026-03-02 16:01:21 +01:00
Viktor Szakats
a5c6a4067a
clang-tidy: fix readability-suspicious-call-argument
Also:
- curlx/strerr: avoid a false positive by dropping an interim variable.
- enable this check.

Ref: #20627 (initial attempt)

Closes #20777
2026-03-02 15:28:25 +01:00
Viktor Szakats
fcde8d7e37
cmake: minor improvements to integration test framework
- add support for separate provider / consumer cmake options in
  `find_package` tests. To help test more integration scenarios.
  Refs: #20784 #20729 #20764

- dump generated curl config files in `find_package` tests.
  (cmake CONFIG source, `libcurl.pc`, `curl-config`.

- test.sh: use `sha256sum` (was: `openssl`).

Closes #20773
2026-03-02 14:50:33 +01:00
Viktor Szakats
7a77884a66
clang-tidy: enable clang-analyzer-* checks explicitly, fix fallout
v22.1.0 disabled them by default.

Fix fallout:
- http: check NULL to silence false positives in `HD_VAL()`.

Ref: https://releases.llvm.org/22.1.0/tools/clang/tools/extra/docs/ReleaseNotes.html#improvements-to-clang-tidy

Follow-up to da6fbb12a6 #20779
Follow-up to ce4db9c2ef #20751

Closes #20778
2026-03-02 14:01:09 +01:00
Viktor Szakats
da6fbb12a6
http1: fix potential NULL dereference in Curl_h1_req_parse_read()
Reported by clang-tidy v22 with `clang-analyzer-*` explicitly enabled:

```
lib/http1.c:89:31: error: Subtraction of a non-null pointer
 (from variable 'line_end') and a null pointer (via field 'line')
 results in undefined behavior [clang-analyzer-core.NullPointerArithm]
   89 |   parser->line_len = line_end - parser->line + 1;
      |                               ^
```
Ref: https://github.com/curl/curl/actions/runs/22534731241/job/65279952830?pr=20778#step:11:85

Ref: #20778

Closes #20779
2026-03-02 13:45:14 +01:00
Daniel Stenberg
7fe5b933d8
TODO: drop the alt-svc fallback
Let's return to this subject if someone actually needs this for their
specific use case.

See #17152
Closes #20786
2026-03-02 09:18:07 +01:00
Daniel Stenberg
d680789069
test1637: verify --fail and --retry with 502 response code
It should exit with 22 after the second retry.

Ref: #20771
Cloes #20780
2026-03-01 22:43:21 +01:00
Daniel Stenberg
99bd5ed97b
HISTORY: mention that Rafael passed away much too early
Closes #20781
2026-03-01 22:42:13 +01:00
dependabot[bot]
4427e6152a
GHA: bump actions and pip dependencies
- update action `actions/cache` from 5.0.1 to 5.0.3
- update action `github/codeql-action` from 4.31.9 to 4.32.4
- update pip `filelock` from 3.20.3 to 3.24.3
- update pip `ruff` from 0.14.14 to 0.15.2

Closes #20782
Closes #20783
2026-03-01 19:06:39 +01:00
Viktor Szakats
1b35c9e1e3
cmake: rename testbins target to tt, restore internal option
To make it easy to type. The internal option is used in CI.

Follow-up to aae361242f #20708

Closes #20768
2026-03-01 00:24:47 +01:00
Viktor Szakats
7a80082471
GHA/windows: bump clang-tidy job to clang v20 (from v18)
Adds 50 seconds to the 5m long build step. Also more prerequisites to
install, with no apparent effect on step time.

Follow-up to 9b52d516bb #20732

Closes #20775
2026-03-01 00:24:47 +01:00
Viktor Szakats
35bbb2e830
clang-tidy: fix issues found with build-fuzzing
- curl_sha512_256: add missing, drop redundant, parentheses.
- doh: drop redundant returns.
- url: add missing parentheses.
- vtls: fix unused const variables.
- tests/unit: fix missing header with clang-tidy and !threaded-resolver.
  Follow-up to 57ff2d6c91 #20106

Closes #20774
2026-03-01 00:04:18 +01:00
Viktor Szakats
bcc8144b89
clang-tidy: silence more minor issues found by v22
Also one found manually in lib/curl_sha512_256.c.

Follow-up to 7a08c5d820 #20762

Closes #20770
2026-02-28 13:16:54 +01:00
Florian Imdahl
006f561f6e
docs: some nitpicks
- replaced double spaces with single space where applicable
- replaced "favourite" with "favorite"
- added language identifiers to code blocks in markdown files
- added extra line after code blocks and after headings in markdown
  files

Cloes #20748
2026-02-27 23:05:37 +01:00
Daniel Stenberg
aea5552a64
INSTALL.md: fix typo
Reported-by: Nathan-M-code on github
Fixes #20766
Closes #20767
2026-02-27 22:52:03 +01:00
Viktor Szakats
92f66f0234
appveyor: minor improvements [ci skip]
- make per-job cmake options override default ones (as in GHA)
- also upload `.lib` artifacts (in commented code)

Cherry-picked from #20750
2026-02-27 16:04:21 +01:00
Viktor Szakats
7a08c5d820
ldap: silence clang-tidy v22 warning
Closes #20762
2026-02-27 15:57:48 +01:00
Viktor Szakats
fa8bd1cc09
mprintf: use _snprintf() when compiled with VS2013 and older
To support floats and doubles when using these old compilers.

Before this patch, these tests most likely failed with them:
```
FAIL 557: 'curl_mprintf() testing' printf, unittest
FAIL 566: 'HTTP GET with CURLINFO_CONTENT_LENGTH_DOWNLOAD and 0 bytes transfer' HTTP, HTTP GET
FAIL 599: 'HTTP GET with progress callback and redirects changing content sizes' HTTP, HTTP POST, chunked Transfer-Encoding
FAIL 1148: 'progress-bar' HTTP, progressbar
```

Also:
- mention `_snprintf()` in the `_CRT_SECURE_NO_WARNINGS` comment.

Follow-up to 7de35515d9 #20218

Closes #20761
2026-02-27 15:57:48 +01:00
Viktor Szakats
00b215b894
cmake: convert curl_add_clang_tidy_test_target() macro to function
I thought a macro is necessary to have `get_directory_property()` and
`CMAKE_CURRENT_SOURCE_DIR` work on the correct directory, but it turns
out they do work the same when used in a function.

Closes #20760
2026-02-27 14:09:22 +01:00
Viktor Szakats
9d727e4e55
cmake: replace list(FIND) with if(var IN_LIST list)
Available since CMake v3.3.

Ref: https://cmake.org/cmake/help/latest/command/if.html#in-list

Closes #20758
2026-02-27 14:08:59 +01:00
Viktor Szakats
ce4db9c2ef
GHA/linux: replace scan-build with clang-tidy
`scan-build` is a (Perl) wrapper around clang's built-in `--analyze`
option. Which look similar or identical to clang-tidy checkers under
the `clang-analyzer-*` namespace:
https://clang.llvm.org/docs/ClangStaticAnalyzer.html

Unless somebody has other information, it appears redundant to run
scan-build in parallel with clang-tidy in CI, now that the latter is
working reliably and with good performance for all curl components.

Another scan-build issue is the lack of a markup to suppress false
positives. It ignores `NOLINT`, yet finds the same false positives as
clang-tidy. This happens with scan-build v20+. v18 is silent, but it's
a blocker to upgrade to a newer version.

scan-build may still be a useful when combined with autotools, where
clang-tidy support is incomplete, slow (no parallelism), and uses
a distinct make target, which does not build binaries in the same pass.
But, scan-build also lacks extra checkers that are now enabled for
clang-tidy.

The clang-tidy job is also 30-40s faster than the one it replaced.

Also:
- drop scan-build job configured the same way as a clang-tidy one.
  CI time saved: 6m30s
- bump to clang-20 (from 18) in the replacement job.
- build tests in the replacement job.
  To verify a cmake command-line reconstruction issue only hit in this
  job in CI.
  CI time cost: 1m40s
- replacement job caught a minor, new, issue.
  Ref: b2076d3c2f #20752
- drop unused scan-build logic.

Bug: https://github.com/curl/curl/pull/20732#issuecomment-3963873838
Ref: https://github.com/curl/curl/pull/20732#issuecomment-3967479228

Closes #20751
2026-02-27 14:08:59 +01:00
Viktor Szakats
d9386a2f8e
cmake: fix system include directory position for clang-tidy in tests
To avoid a system include masking a custom directory, and e.g. picking
up system OpenSSL headers from `/usr/include` on Linux, instead of the
correct ones from a custom header directory, move system include
directories to the back of the header path list. Also to match what
CMake seems to be doing for the C compiler command-lines it generates.

CMake seems to use `-I`, while for these invocations we stick with
`-isystem` just in case.

This area remains fragile and likely not the final issue.

Fixing (seen in GHA/linux H3 c-ares):
```
Error while processing bld/tests/libtest/lib1521.c.
/usr/include/openssl/macros.h:147:4: error: "OPENSSL_API_COMPAT expresses an impossible API compatibility level" [clang-diagnostic-error]
Found compiler error(s).
  147 | #  error "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
      |    ^
FAILED: [code=1] tests/libtest/CMakeFiles/libtests-clang-tidy
```
Ref: https://github.com/curl/curl/actions/runs/22468472670/job/65079885471?pr=20751

Bug: https://github.com/curl/curl/pull/20751#issuecomment-3970180687
Cherry-picked from #20751

Closes #20759
2026-02-27 13:40:30 +01:00
Daniel Stenberg
a67ee591e0
RELEASE-NOTES: synced 2026-02-27 09:37:29 +01:00
Daniel Stenberg
61bcd1105a
cfilter: move a debug-only check into ifdef DEBUGBUILD
Pointed out by CodeSonar

Closes #20756
2026-02-27 08:21:15 +01:00
Daniel Stenberg
b48d02179a
ftp: remove two redundant assignments
Follow-up to 29bca12978

Pointed out by CodeSonar

Closes #20755
2026-02-27 08:10:11 +01:00
Viktor Szakats
b2076d3c2f
vquic: fix unused variable warning reported by clang-tidy
Silencing (seen in new GHA/Linux H3 v20 job):
```
lib/vquic/vquic.c:398:37: error: variable 'calls' set but not used [clang-diagnostic-unused-but-set-variable]
  398 |   size_t total_nread = 0, pkts = 0, calls = 0;
      |                                     ^
```

Cherry-picked from #20751

Closes #20752
2026-02-27 02:40:31 +01:00
Viktor Szakats
f76a54f890
clang-tidy: add missing and delete redundant parentheses
Reported by clang-tidy v22.1.0.

Ref: https://releases.llvm.org/22.1.0/tools/clang/tools/extra/docs/ReleaseNotes.html

Closes #20749
2026-02-27 01:03:41 +01:00
Daniel Stenberg
8d28ac612b
mailmap: Hamza Bensliman 2026-02-26 20:07:23 +01:00
Viktor Szakats
fb58b23256
cmake: fix confusing error when a dependency is undetected in curl-config.cmake
Fixing:
```
CMake Error at /path/to/CURL/CURLConfig.cmake:190 (get_target_property):
  get_target_property() called with non-existent target "CURL::libssh2".
```
and replacing it with the clearer message:
```
CMake Error at /path/to/CURL/CURLTargets.cmake:61 (set_target_properties):
  The link interface of target "CURL::libcurl_static" contains:

    CURL::libssh2

  but the target was not found.  Possible reasons include:
[...]
```

Reported-by: Val S.
Ref: #20729
Follow-up to 16f073ef49 #16973

Closes #20737
2026-02-26 19:44:28 +01:00
Viktor Szakats
c111275366
GHA/linux: delete unused autotools clang-tidy logic
Follow-up to 26eddf002f #20725

Closes #20747
2026-02-26 19:44:28 +01:00
Viktor Szakats
b3f1f69261
GHA/macos: bump runner to macos-26 in clang-tidy jobs
Tiny difference in practice:
Apple clang 17.0.0.17000013 -> 17.0.0.17000603

To use the most recent tools for static analyses.

Closes #20745
2026-02-26 19:24:32 +01:00
Viktor Szakats
ad72af4743
GHA/linux: enable clang-tidy for docs/examples
Also:
- imap-append: silence false positive (seen on Linux only).
  Follow-up to b1f853a384 #20731
  Follow-up to 725c5609ae #20723

Closes #20743
2026-02-26 19:24:32 +01:00
Viktor Szakats
9871f46069
GHA/macos: drop unused install_step values [ci skip] 2026-02-26 19:12:14 +01:00
hamza
05d991a8c5
rtsp: fix assertion failure on zero-length RTP payload
Fixes #20735
Reported-by: David Korczynski
Closes #20744
2026-02-26 18:35:10 +01:00
renovate[bot]
e86642909f
GHA: update ngtcp2/ngtcp2 to v1.21.0
Closes #20738
2026-02-26 17:15:22 +01:00
Daniel Stenberg
6789eb0ff9
multi: avoid a theoretical 32-bit wrap
If Curl_uint32_tbl_count() at some future point actually can return
UINT_MAX, this fixes the math to not wrap.

Closes #20742
2026-02-26 17:14:50 +01:00
Viktor Szakats
9b52d516bb
GHA/linux: bump sanitizer jobs to clang v20 (from v18)
To use the newest version offered by the runner's Ubuntu 24.04.

Ref: https://packages.ubuntu.com/search?suite=noble-updates&keywords=clang

Closes #20732
2026-02-26 17:13:16 +01:00
Viktor Szakats
dc4aef7352
GHA/macos: update comment about macOS targets vs. features
Closes #20741
2026-02-26 16:07:00 +01:00
Viktor Szakats
4a43eba3b1
cmake: silence potential unused var warnings in C++ test snippet
Follow-up to 6ad50dc285 #20687

Closes #20736
2026-02-26 13:39:43 +01:00
Daniel Stenberg
3cf86508fd
VULN-DISCLOSURE-POLICY.md: use hackerone
- bug_report.yml: use hackerone

Closes #20683
2026-02-26 07:57:19 +01:00
Viktor Szakats
26eddf002f
GHA/linux: switch clang-tidy job to cmake for 2x speed, bump to v20, enable for tests
Checking lib and src under 3m15s versus 7m15s.

Downside: autotools clang-tidy support is no longer CI-tested.

The reason for the slowness is invoking a single clang-tidy command with
all source files, and clang-tidy checking them in a single thread,
sequentially. clang-tidy offers a `run-clang-tidy` Python script for
parallel  processing, which may help with this. However at this point
it's more practical to use cmake, which also supports verifying the
whole codebase, not only lib and src.

Also:
- bump clang-tidy to the latest available, v20 (from v18).
- enable running clang-tidy on tests. Takes under 2 minutes.

Also tried `_CURL_TESTS_CONCAT=ON`, it brings down the build tests step
from 1m47s to 54s, saving 1 minute. Skipped using it for now.

Closes #20725
2026-02-26 05:08:30 +01:00
Viktor Szakats
137e87ca72
clang-tidy: enable scanning headers
By setting `HeaderFilterRegex: '.*'`.

Closes #20720
2026-02-26 05:08:30 +01:00
Viktor Szakats
b1f853a384
unit3205: suppress two clang-tidy false positives
Silencing:
```
tests/unit/unit3205.c:565:32: error: the result from calling 'memcpy' is not null-terminated [bugprone-not-null-terminated-result]
  565 |         expect = (const char *)memcpy(alt, "DHE-", 4);
      |                                ^~~~~~            ~~~
      |                                strcpy
tests/unit/unit3205.c:569:32: error: the result from calling 'memcpy' is not null-terminated [bugprone-not-null-terminated-result]
  569 |         expect = (const char *)memcpy(alt + 4, "DHE-", 4) - 4;
      |                                ^~~~~~                ~~~
      |                                strcpy
```
Ref: https://github.com/curl/curl/actions/runs/22425366818/job/64932197466?pr=20725

Cherry-picked from #20725

Closes #20731
2026-02-26 04:19:18 +01:00
Viktor Szakats
d38bf7949d
tests/server: fix to clear the complete srvr_sockaddr_union_t variable
Reported by clang-tidy (seen on Linux with v18, v19, v20, not on macOS):
```
tests/server/dnsd.c:552:14: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/dnsd.c:556:14: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/rtspd.c:1183:14: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/rtspd.c:1187:14: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/sws.c:2235:14: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/sws.c:2239:14: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/tftpd.c:1188:14: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/tftpd.c:1192:14: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/util.c:860:21: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/util.c:864:21: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
```
Ref: https://github.com/curl/curl/actions/runs/22424827575/job/64930560425?pr=20725

Cherry-picked from #20725

Closes #20730
2026-02-26 04:19:18 +01:00
Viktor Szakats
d110504e84
build: add missing GENERATEDCERTS files
Also alpha sort lists, while here.

Follow-up to 2cf19c245e #17493

Closes #20728
2026-02-26 03:09:16 +01:00
Viktor Szakats
2239879b74
cmake: minor fixes to test targets after prev
- run tests-clang-tidy when building testbins.
- drop redundant build-certs dependency for test targets.
  Already present via testdeps.

Follow-up to aae361242f #20708

Closes #20727
2026-02-26 02:44:39 +01:00
Viktor Szakats
b56e103d4d
build: do not include wolfSSL header in curl_setup.h
To fix building tests/server with cmake and both wolfSSL and OpenSSL
enabled (MultiSSL).

tests/server do not have libcurl dependency header paths setup because
it does not use libcurl. The code however includes `curl_setup.h`, which
tried including `wolfssl/version.h` before this patch to verify if the
wolfSSL coexist feature is available. Without a header path, it failed:
```
In file included from bld/tests/server/servers.c:3:
In file included from tests/server/first.h:40:
lib/curl_setup.h:737:12: fatal error: 'wolfssl/version.h' file not found
  737 | #  include <wolfssl/version.h>
      |            ^~~~~~~~~~~~~~~~~~~
1 error generated.
```
Ref: https://github.com/curl/curl/actions/runs/22410066319/job/64880787424#step:46:76

Fix by moving the include and version check to `vtls/wolfssl.c`.

Also: add an early version check to cmake.

Follow-up to 16f073ef49 #16973
Cherry-picked from #20720

Closes #20726
2026-02-26 01:36:16 +01:00
Viktor Szakats
aae361242f
cmake: replace internal option with a new testbins target
To allow building test binaries without test certs, replacing
`_CURL_SKIP_BUILD_CERTS` internal option with a build target that is
similar to `testdeps`, but without building the test certificates.

To make building test binaries a little bit faster, with less noisy
output, and without having to reconfigure the build.

Closes #20708
2026-02-25 22:57:02 +01:00
Viktor Szakats
3137f725cd
cmake: fix passing system header directories to clang-tidy for tests
Pass system directories with `-isystem` to avoid clang-tidy parsing
3rd-party and system headers with `HeaderFilterRegex: '.*' enabled.

Also:
- drop rule exception no longer necessary.
- sync normal vs. system header path order with compiler invocation.
- tidy up `set()` syntax.
- clear a temporary variable.

Bug: https://github.com/curl/curl/pull/20670#issuecomment-3940840176
Follow-up to e088e10454 #17705
Cherry-picked from: #20720

Closes #20724
2026-02-25 22:29:26 +01:00
Viktor Szakats
725c5609ae
clang-tidy: avoid/silence bugprone-not-null-terminated-result
Prefer `sizeof()` over `strlen()`, static const variables over macros.
Add a couple of `NOLINT`s to silence false positives.

Also sync similar code patterns between libtests.

Cherry-picked from #20720

Closes #20723
2026-02-25 22:11:05 +01:00
Viktor Szakats
39542f0993
cmake: add native clang-tidy support for tests, with concatenated sources
Tests are build in "unity"-style, by including sources into an umbrella
C files (similar to how CMake unity works). This does not play well with
clang-tidy, which seems to unconditionally ignore C sources included
like this. To fix it, curl's CMake implements a manual clang-tidy
support for tests, which  compiles sources one-by-one, while also making
sure sources compile cleanly standalone (e.g. all sources need to
include `first.h`). The manual clang-tidy implementation is fragile, and
performance, in particular when targeting Windows, is abysmal.

This patch introduces an alternate solution, enabled by the
`_CURL_TESTS_CONCAT=ON` option. In this mode, umbrella sources include
the actual sources instead of `#including` them. Allowing to use CMake's
built-in clang-tidy support to compile them, with clang-tidy actually
checking the sources. Making the manual clang-tidy support unnecessary.
In the Windows CI job it results in a 4x performance improvement (4m ->
1m), making it practical to run clang-tidy on tests on Windows, in CI.

The main downside is that clang-tidy doesn't understand the `#line`
directive. Meaning issues found show the wrong filename and line number
next to them. It's not impossible to locate errors this way, but also
not convenient.

Minor/potential downside is that the concatenated source needs to be
reassembled each time an original source is updated. This may result in
more copying on the disk when used in local development. The largest
source is 1.4MB, so probably not a show-stopper on most machines.

Another is the complexity of maintaining two methods in parallel, which
may be necessary till clang-tidy understands `#line`:
https://github.com/llvm/llvm-project/issues/62405

This solution may in theory also enable adding clang-tidy support for
tests in autotools, though I haven't tried.

Targeted for curl CI for now, and used in a GHA/windows job. 100%
experimental, not recommended outside these.

Closes #20667
2026-02-25 17:28:35 +01:00
Viktor Szakats
3b9d8412c0
clang-tidy: add more missing parentheses in macro values
Reported when running `HeaderFilterRegex: '.*'` in CI.

Also replace an underscored symbol with a regular one in macro
definition.

Cherry-picked from #20720

Closes #20721
2026-02-25 15:43:23 +01:00
Viktor Szakats
65f9426170
clang-tidy: enable more checks
Refs:
https://clang.llvm.org/extra/clang-tidy/checks/list.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/assert-side-effect.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/chained-comparison.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/dynamic-static-initializers.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/macro-repeated-side-effects.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/misplaced-operator-in-strlen-in-alloc.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/misplaced-pointer-arithmetic-in-alloc.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/not-null-terminated-result.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/posix-return.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-enum-usage.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-memset-usage.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-missing-comma.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-semicolon.html
https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-declaration.html
https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-function-ptr-dereference.html
https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-parentheses.html

Closes #20622
2026-02-25 15:26:07 +01:00
Viktor Szakats
af78b199b2
tidy-up: miscellaneous
- vms/curlmsg_vms.h: delete unused/commented code.
- vtls/schannel_verify: sort includes.
- typecheck-gcc.h: fix indent and alignment.
- lib/config-win32.h: drop idle `#undef`.
- spacecheck: check for stray empty lines before after curly braces.
- make literals more readable: 1048576 -> 1024 * 1024
- scope variables.
- use ISO date in a comment.
- drop redundant parentheses.
- drop empty comments.
- unfold lines.
- duplicate/stray spaces in comments.
- fix indent, whitespace, minor typos.

Closes #20690
2026-02-25 14:44:56 +01:00
Viktor Szakats
ac46392f44
clang-tidy: enable bugprone-signed-char-misuse, fix fallouts
Examples:
```
lib/vtls/openssl.c:2585:18: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
 2585 |       msg_type = *(const char *)buf;
lib/vtls/openssl.c:2593:18: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
 2593 |       msg_type = *(const char *)buf;
tests/server/mqttd.c:514:10: warning: comparison between 'signed char' and 'unsigned char' [bugprone-signed-char-misuse]
  514 |       if(passwd_flag == (char)(conn_flags & passwd_flag)) {
tests/server/tftpd.c:362:13: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
  362 |         c = test->rptr[0];
tests/server/tftpd.c:454:9: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
  454 |     c = *p++;                     /* pick up a character */
src/tool_urlglob.c:272:46: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
  272 |     pat->c.ascii.letter = pat->c.ascii.min = min_c;
src/tool_urlglob.c:273:24: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
  273 |     pat->c.ascii.max = max_c;
tests/libtest/cli_h2_pausing.c:164:23: warning: suspicious usage of 'sizeof()' on an expression of pointer type [bugprone-sizeof-expression]
  164 |   memset(&resolve, 0, sizeof(resolve));
tests/libtest/cli_upload_pausing.c:158:23: warning: suspicious usage of 'sizeof()' on an expression of pointer type [bugprone-sizeof-expression]
  158 |   memset(&resolve, 0, sizeof(resolve));
tests/libtest/first.c:86:15: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
   86 |     coptopt = arg[optpos];
```

Also:
- tests/server/mqttd: drop a redundant and a wrongly signed cast.

Ref: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/signed-char-misuse.html

Closes #20654
2026-02-25 14:44:56 +01:00
Daniel Stenberg
86772a76c7
RELEASE-NOTES: synced 2026-02-25 14:19:40 +01:00
Viktor Szakats
92eddc1fae
build: map Apple clang 26.4+ to llvm/clang 21.1
Ref: https://en.wikipedia.org/wiki/Xcode#Xcode_26.0_(since_version_number_change)_2

Closes #20717
2026-02-25 13:16:07 +01:00
Viktor Szakats
baf32a5cf4
build: enable -Wjump-misses-init for clang 21+
Refs:
543f112e14
43c05d9738

Follow-up to db4d617c1c #16252

Closes #20716
2026-02-25 12:28:58 +01:00
Hamza Bensliman
a4ce687af2
docs: add reproducible example for generating man page
Fixes #20699
Reported-by: sammydono on github
Closes #20703
2026-02-24 23:58:37 +01:00
Viktor Szakats
3e198f7586
build: fix building rare combinations
- http/2 + !headers
- gnutls + !verbose
- ssls-export + !verbose

Closes #20712
2026-02-24 20:49:06 +01:00
Viktor Szakats
102d4c8ba9
tidy-up: macro parentheses
Add missing and drop redundant parentheses.

Also: fix whitespace.

Ref: #20690

Closes #20710
2026-02-24 16:30:05 +01:00
Viktor Szakats
be2499f7dd
managen: silence Perl warnings
Closes #20707
2026-02-24 16:30:05 +01:00
Daniel Stenberg
c513b1d520
DEPRECATE.md: TLS SRP support gets removed in August 2026
Closes #20697
2026-02-24 16:02:34 +01:00
Daniel Stenberg
704a0a3fa9
config-riscos.h: drop all undefs
They are superfluous

Closes #20711
2026-02-24 15:54:45 +01:00
Daniel Stenberg
6ef6fb84ac
top-complexity: lower the max allowed complexity to 60
Closes #20706
2026-02-24 14:42:23 +01:00
Viktor Szakats
ba685ad5e5
openssl: fix potential NULL dereference when loading certs (Windows)
This could happen if the first cert to be loaded missed EKU (Enhanced
Key Usage) data, when using native CA on Windows.

Fix by skipping certs without Enhanced Key Usage data.

Detected by clang-tidy:
```
lib/vtls/openssl.c:2922:15: warning: Access to field 'cUsageIdentifier'
 results in a dereference of a null pointer (loaded from variable
 'enhkey_usage') [clang-analyzer-core.NullDereference]
 2922 |           if(!enhkey_usage->cUsageIdentifier) {
      |               ^
```

Refs:
https://learn.microsoft.com/windows/win32/secgloss/e-gly
https://learn.microsoft.com/windows/win32/api/wincrypt/nf-wincrypt-certgetenhancedkeyusage
https://gitlab.winehq.org/wine/wine/-/blob/wine-11.2/dlls/crypt32/cert.c?ref_type=tags#L3061-3164

Assisted-by: Stefan Eissing

Closes #20634
2026-02-24 12:34:19 +01:00
Daniel Stenberg
7981594df5
mbedtls: split mbed_connect_step1 into sub functions
Increase readability. Reduce complexity.

Closes #20689
2026-02-24 11:19:20 +01:00
Daniel Stenberg
956e1ae84f
setopt: refuse blobs with zero length
A blob must have a length or it will not be accepted. By enforcing the
check here, TLS backend code can rely on the fact that the length is
always non-zero from this point.

Reported-by: aisle-research-bot
URL: https://github.com/curl/curl/pull/20689#pullrequestreview-3846390367
Closes #20705
2026-02-24 11:18:12 +01:00
Diogo Correia
9d94b1a066
docs: use dot instead of comma at end of sentences
Some sentences incorrectly ended with a command instead of a dot.

Closes #20700
2026-02-24 08:15:39 +01:00
Viktor Szakats
67298a80b3
INSTALL-CMAKE.md: document the curl build target
Can be useful to together with `testdeps` to build all binaries.

Closes #20694
2026-02-24 01:11:17 +01:00
Viktor Szakats
453470fab1
spacecheck: double spaces in folded strings, fix fallouts
Closes #20695
2026-02-24 00:48:12 +01:00
Viktor Szakats
65262be0ab
clang-tidy: enable readability-math-missing-parentheses, adjust code
No functional changes.

Also:
- md4, md5: drop redundant parentheses from macro values.

Closes #20691
2026-02-23 18:57:40 +01:00
Daniel Stenberg
29bca12978
ftp: split ftp_state_use_port into sub functions
For readability and reduced complexity.

Fixed a bug when FTPPORT specifies an IPv6-address only, without brackets.

Closes #20685
2026-02-23 17:22:26 +01:00
Viktor Szakats
f1cee1f18a
clang-tidy: add arg names to prototypes where missing (cont.)
Detected by `readability-named-parameter` with `HeaderFilterRegex: '.*'`,
or `CURL_CLANG_TIDYFLAGS='--header-filter=.*'`. Seen on Windows.

Follow-up to e8415ad3c7 #20657
Follow-up to c878160e9c #20624

Closes #20693
2026-02-23 17:03:01 +01:00
Daniel Stenberg
e9786038d6
setopt: make setopt_copypostfields a separate function
Closes #20688
2026-02-23 16:45:37 +01:00
Viktor Szakats
3058ed3df8
lib: use lib source directory as base include path
Backtrack on previous change that aimed to solve the wrong `share.h`
being included. It turns out it did not fix this issue. At the same time
it introduced relative header filenames and the need to include the same
headers differently depending on the source files' location, reducing
readability and editability.

Replace this method by re-adding curl's lib source directory to the
header path and addressing headers by the their full, relative name to
that base directory. Aligning with this method already used in src and
tests.

With these advantages:
- makes includes easier to read, recognize, grep, sort, write, and copy
  between sources,
- syncs the way these headers are included across curl components,
- avoids the ambiguity between system `schannel.h`, `rustls.h` vs.
  local headers using the same names in `lib/vtls`,
- silences clang-tidy `readability-duplicate-include` checker, which
  detects the above issue,
  Ref: https://clang.llvm.org/extra/clang-tidy/checks/readability/duplicate-include.html
- possibly silences TIOBE coding standard warnings:
  `6.10.2.a: Don't use relative paths in #include statements.`
- long shot: it works well with concatenated test sources, for
  clang-tidy-friendly custom unity builds. Ref: #20667

Slight downside: it's not enforced.

If there happens to be a collision between a local `lib/*.h` header and
a system one, the solution is to rename (possibly with its `.c`
counterpart) into the `curl_` namespace. This is also the method used by
curl in the past.

Also:
- curlx/inet_pton: reduce scope of an include.
- toolx/tool_time: apply this to an include, and update VS project
  files accordingly. Also dropping unnecessary lib/curlx header path.
- clang-tidy: enable `readability-duplicate-include`.

Follow-up to 3887069c66 #19676
Follow-up to 625f2c1644 #16991 #16949

Closes #20623
2026-02-23 16:00:42 +01:00
Viktor Szakats
6ad50dc285
cmake: add C++ integration test
Also:
- include code to verify a C++-specific public header regression
  reported in 8.19.0-rc2.
- curl/curl.h: mention C++ global namespace in comment.
- GHA/dist: add CI job for C++. Runtime: 15 seconds.

Follow-up to ee9b000438 #20686
Ref: #20682

Closes #20687
2026-02-23 14:43:37 +01:00
Viktor Szakats
ee9b000438
curl/curl.h: revert to recursive macros to keep supporting C++ use-case
To avoid breaking 3rd-party code reusing these symbols as C++ methods,
e.g. in CMake sources:
```
cmake/src/v4.0.0-b30653ae0c.clean/Source/cmCurl.cxx:119:24: error: expected unqualified-id
  119 |     ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile.c_str());
      |                        ^
```

Also expand comment to highlight the case.

Reported-by: Kai Pastor
Bug: daa6b27b4d (r177869049)
Reported-by: Marcel Raad
Bug: https://curl.se/mail/lib-2026-02/0020.html
Fixes #20682
Follow-up to daa6b27b4d #20597

Closes #20686
2026-02-23 13:56:59 +01:00
Viktor Szakats
d6d8a1a15a
cmake: always build curlu and curltool test libs in unity mode
To speed up building/running tests by default (e.g. via `testdeps` or
`tests` targets.)

It reduces build commands to 21 (from 239) for a test build.

In CI, it affects build test step times as below:
- GHA/linux: aws-lc
  12s https://github.com/curl/curl/actions/runs/22279958343/job/64448913413 ->
  6s https://github.com/curl/curl/actions/runs/22282767915/job/64455970302
- GHA/linux: Fil-C
  39s https://github.com/curl/curl/actions/runs/22279958343/job/64448913430 ->
  37s https://github.com/curl/curl/actions/runs/22282767915/job/64455970352
- GHA/non-native: FreeBSD Intel
  22s https://github.com/curl/curl/actions/runs/22279958335/job/64448913514 ->
  15s https://github.com/curl/curl/actions/runs/22282767899/job/64455969960
- GHA/windows: dl-mingw 6.4.0
  23s https://github.com/curl/curl/actions/runs/22279958334/job/64448917225 ->
  9s https://github.com/curl/curl/actions/runs/22282767922/job/64455975006

Follow-up to fff9905bcf #20670

Closes #20677
2026-02-23 13:56:59 +01:00
Daniel Stenberg
3877db7bcf
openssl: fix compiler warning with OpenSSL master
vtls/openssl.c:469:15: error: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]

X509_get_X509_PUBKEY() now returns a const pointer - but only on OpenSSL
3, we must keep the non-const version for all forks.

Closes #20681
2026-02-23 10:23:57 +01:00
Viktor Szakats
e8415ad3c7
clang-tidy: add arg names to prototypes where missing
Detected by `readability-named-parameter` with `HeaderFilterRegex: '.*'`,
or `CURL_CLANG_TIDYFLAGS='--header-filter=.*'`.

Follow-up to c878160e9c #20624

Closes #20657
2026-02-23 01:00:47 +01:00
Daniel Stenberg
57a1cc5587
URL-SYNTAX.md: fix port number mistakes for IMAP and LDAP
Reported-by: Augment code
URL: https://github.com/curl/curl/pull/20673#pullrequestreview-3838139961
Closes #20679
2026-02-23 00:01:18 +01:00
Viktor Szakats
29758a6143
tests/server: silence clang-tidy warning
It looks like a case that can never happen in practice.

Seen on mingw-w64 with experimental concatenated (vs. #included) test
sources:
```
tests/server/util.c:662:16: error: Null pointer passed as 1st
 argument to string length function [clang-analyzer-unix.cstring.NullArg]
  662 |   size_t len = strlen(unix_socket);
      |                ^
```
Ref: https://github.com/curl/curl/actions/runs/22267482855/job/64416261156#step:10:273

Closes #20668
2026-02-22 22:32:13 +01:00
Viktor Szakats
c387c9fd0c
GHA/non-native: enable FreeBSD on arm again
Upstream package install is working again.

Follow-up to 41a6eeadf6 #20267

Closes #20678
2026-02-22 20:43:05 +01:00
Viktor Szakats
fff9905bcf
cmake: force-disable unity for clang-tidied build targets only
Instead of globally disabling unity for all targets when clang-tidy is
enabled.

After this patch `CMAKE_UNITY_BUILD=ON` is honored for:
- static libcurl when building both static and shared separately.
- libcurlu and libcurltool internal libraries when building the test
  target.

While keeping unity disabled for the libcurl build pass running
clang-tidy, and the curl tool, also running clang-tidy.

To make clang-tidy-enabled builds finish faster when unity mode is
enabled, yet performs the same clang-tidy checks as before this patch.

Effect on:
- GHA/macos: core build: same, buils tests 5-12 seconds faster,
  with steps going down from 259 to 25.

  52s: https://github.com/curl/curl/actions/runs/22279958340/job/64448913325 ->
  47s: https://github.com/curl/curl/actions/runs/22279873606/job/64448710743

- GHA/windows (not enabled): it'd save about 1 minute, bringing total
  time barely below 10m, still one of the slowest jobs overall.
  (#20667 is trying a way for 4x speed-up (with a drawback)).

  5m21s: https://github.com/curl/curl/actions/runs/22222907068/job/64284556852 ->
  4m26s: https://github.com/curl/curl/actions/runs/22281033369/job/64451601548

Closes #20670
2026-02-22 19:16:31 +01:00
Daniel Stenberg
0824bae8b0
config2setopts: split into smaller functions
Reduces complexity from 63 to 45

Closes #20676
2026-02-22 16:28:54 +01:00
Daniel Stenberg
84112673a0
socks_sspi: split Curl_SOCKS5_gssapi_negotiate into sub functions
Create and use socks5_sspi_setup(), socks5_sspi_loop() and
socks5_sspi_encryption(). Reduces complexity.

Closes #20581
2026-02-22 16:17:49 +01:00
Viktor Szakats
898ec9f2fb
cmake: limit clang-tidy to the shared libcurl if static is also built
On platforms that require building static and shared libcurl separately,
after this change clang-tidy is only run on one of them, to reduce build
time by avoiding the double-work. From a clang-tidy standpoint, static
and shared libs are identical.

Except `dllmain.c` on Windows, which is only present in shared. To keep
running it through clang-tidy, prefer the shared library for clang-tidy.

Closes #20675
2026-02-22 16:05:10 +01:00
Daniel Stenberg
8e3a2a64d1
tool: improve config error messaging
- make sure that errors for specific options in config files identify
  the file, line number and shows the error about the correct option

- improve some error message wording

- add warning for leading single quote of arguments in config files
  (verified in test 1712)

- adjust test error outputs accordingly

test1712 introduces mode=warn

Use the mode="warn" attribute if the output curl warning output, as it
then makes the check without newlines and the prefix to better handle
that the lines may wrap at different points depending on the lengths of
the lines and terminal width.

Fixes #20598
Closes #20666
2026-02-22 14:56:07 +01:00
Viktor Szakats
912aa7c867
cmake: omit curl.rc from curltool lib
It's unnecessary for static libs, and saves one build step when building
tests on Windows.

Closes #20671
2026-02-22 13:51:02 +01:00
Viktor Szakats
e009beab89
clang-tidy: add missing parentheses to debug macro arguments
Follow-up to 139307865a #20647

Closes #20674
2026-02-22 13:51:02 +01:00
Viktor Szakats
25512ab34e
build: adjust minimum version for some clang picky warnings
Enable 3 warnings earlier with autotools, update comments for the rest.

Ref: https://godbolt.org/

Closes #20665
2026-02-22 00:58:04 +01:00
Viktor Szakats
139307865a
clang-tidy: check bugprone-macro-parentheses, fix fallouts
Also:
- lib/parsedate: avoid relying on side-effect of missing parentheses.
- lib/http: drop redundant parentheses.
- fix cases in headers missed by clang-tidy.

Ref: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/macro-parentheses.html

Closes #20647
2026-02-22 00:58:04 +01:00
Daniel Stenberg
9ce9afa312
silent.md: also mention it shuts off warning messages
Closes #20664
2026-02-22 00:13:29 +01:00
Daniel Stenberg
f1a39f221d
url: fix copy and paste url_match_auth_nego mistake
Follow-up to 34fa034
Reported-by: dahmono on github
Closes #20662
2026-02-21 18:37:31 +01:00
Viktor Szakats
a0244c536e
inet_pton: scope an include
Closes #20661
2026-02-21 15:06:58 +01:00
Viktor Szakats
b35e58b24c
openssl: fix potential OOB read in debug/verbose logging
Reported-by: aisle-research-bot
Bug: https://github.com/curl/curl/pull/20654#discussion_r2834860711

Closes #20656
2026-02-21 15:06:58 +01:00
Viktor Szakats
020f48d00c
clang-tidy: drop some redundant conditions reported by misc-redundant-expression
Not enforced due to false positives, and because in cases a redundant
expression (e.g. encapsulated in a macro) may be preferred.

Ref: https://clang.llvm.org/extra/clang-tidy/checks/misc/redundant-expression.html

Closes #20644
2026-02-21 15:06:58 +01:00
Stefan Eissing
078b3031ea
easy: reset pausing when resetting request
When the easy handle's request is reset, this needs to also reset
any pausing/ratelimit state.

Reported-by: Natris on github
Fixes #20641
Closes #20643
2026-02-21 14:56:06 +01:00
Christian Schmitz
d19c9e4e63
request.h: rename parameter 'buf' to 'req' in Curl_req_send
Someone renamed the parameter, so we need to rename the documentation.

Closes #20660
2026-02-21 14:55:05 +01:00
Viktor Szakats
c81309479a
clang-tidy: link to main documentation page [ci skip] 2026-02-21 00:08:59 +01:00
Daniel Stenberg
7bcf877198
RELEASE-NOTES: synced 2026-02-20 23:06:43 +01:00
Viktor Szakats
2862cafb49
unit1654: fix clang-tidy bugprone-redundant-branch-condition
```
tests/unit/unit1654.c:41:5: warning: redundant condition 'result' [bugprone-redundant-branch-condition]
   41 |     fail_if(result, "Curl_altsvc_load");
      |     ^
tests/libtest/unitcheck.h:29:5: note: expanded from macro 'fail_if'
   29 |     if(expr) {                                                         \
      |     ^
```

Ref: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/redundant-branch-condition.html

Closes #20648
2026-02-20 17:33:35 +01:00
Viktor Szakats
977ac0c06c
clang-tidy: check misc-header-include-cycle, fix in internal headers
Also opt-out `curl/curl.h` because it includes `curl/mprintf.h`, which
in turn includes `curl/curl.h` for `CURL_EXTERN`. Not changeable in
public headers to remain compatible. (Somehow only triggered for
examples.)

Ref: https://clang.llvm.org/extra/clang-tidy/checks/misc/header-include-cycle.html

Closes #20645
2026-02-20 17:33:02 +01:00
Viktor Szakats
947775a613
libtests: drop two redundant memset()s
Reported by clang-tidy `bugprone-sizeof-expression`.

Silencing:
```
tests/libtest/cli_h2_pausing.c:164:23: warning: suspicious usage of 'sizeof()' on an expression of pointer type [bugprone-sizeof-expression]
  164 |   memset(&resolve, 0, sizeof(resolve));
      |                       ^
tests/libtest/cli_upload_pausing.c:158:23: warning: suspicious usage of 'sizeof()' on an expression of pointer type [bugprone-sizeof-expression]
  158 |   memset(&resolve, 0, sizeof(resolve));
      |                       ^
```

Ref: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/sizeof-expression.html

Closes #20649
2026-02-20 17:15:49 +01:00
Viktor Szakats
eabd452d27
tests: avoid assignment in if conditions in first.h
Found by clang-tidy `bugprone-assignment-in-if-condition`.

Ref: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/assignment-in-if-condition.html

Closes #20646
2026-02-20 17:09:20 +01:00
Viktor Szakats
4b4637a445
build: disable typecheck via the command-line instead of curl_config.h
To make it apply to examples. This in turn makes analyzers run quicker
and with fewer false positives.

It's a special disable option, having its effect via `curl/curl.h`.

Bug: https://github.com/curl/curl/pull/20649#issuecomment-3934885021
Follow-up to 9e6f1c5efb #19637

Closes #20650
2026-02-20 16:32:37 +01:00
Viktor Szakats
1eb79cf54b
cmake: include curl/curl.h as system header in integration tests
Follow-up to fb70812437 #16126

Closes #20651
2026-02-20 16:32:37 +01:00
Viktor Szakats
dd82205bb2
memdebug: include backtrace.h as system header
Closes #20642
2026-02-20 16:32:37 +01:00
Daniel Lublin
d4234d9f46
docs: clarify --ipv4 and --ipv6
Try to make the wording more clear. It is the addresses in the resolver
result that are affected, not anything regarding *how* resolving is
done.

Closes #20585
2026-02-20 12:50:10 +01:00
Anna Liberty
3699976b79
docs: reword explanation of --variable option
Simplify the language expaining the --variable option, reducing
repetition. Also fix some minor grammar issues and makes language for
examples more consistent.

Closes #20636
2026-02-20 12:08:52 +01:00
Viktor Szakats
aa1854a8ff
tests/server/sockfilt: check for NULL tv to silence clang-tidy
A NULL dereference cannot happen with existing use of this code.

linux-mingw, CM clang-tidy:
```
/home/runner/work/curl/curl/tests/server/sockfilt.c:720:24: error: Access
 to field 'tv_sec' results in a dereference of a null pointer (loaded from
 variable 'tv') [clang-analyzer-core.NullDereference,-warnings-as-errors]
  720 |             tv->tv_sec = 0;
      |             ~~         ^
```
Ref: https://github.com/curl/curl/actions/runs/22191200093/job/64179197235?pr=20631#step:10:283

Cherry-picked from #20631

Closes #20639
2026-02-20 12:08:52 +01:00
Viktor Szakats
4042e7d9d8
clang-tidy: work around clang-tidy <=20 false positive (Windows)
clang-tidy <= v20 (as seen between 18.1.3 and 20.1.2) report
`readability-uppercase-literal-suffix` originating from mingw-w64 system
header `_mingw_mac.h` via `define __MSABI_LONG(x) x ## l`

Triggered by `SOCKENOMEM` (e.g. in tests/server/sockfilt.c):
```
warning: integer literal has suffix 'l', which is not uppercase [readability-uppercase-literal-suffix]
```

Work around by replacing Windows macro `WSA_NOT_ENOUGH_MEMORY`
with its literal value.

Bug: https://github.com/curl/curl/pull/20631#issuecomment-3930619868
Follow-up to c07c3cac74 #20629
Cherry-picked from #20631

Closes #20638
2026-02-20 12:08:52 +01:00
Viktor Szakats
c927b18d6b
INSTALL-CMAKE.md: document more settings requiring absolute paths
Cherry-picked from #20631

Closes #20637
2026-02-20 12:08:52 +01:00
Viktor Szakats
6dc5f2948c
cmake: improve clang-tidy invocation for tests in cross-builds
By passing to clang-tidy the C compiler with `--target` and sysroot
options, if any.

Fixing (GHA/windows, linux-mingw, CM clang-tidy):
```
lib/curl_setup.h:841:10: error: 'io.h' file not found [clang-diagnostic-error]
  841 | #include <io.h>
      |          ^~~~~~
Found compiler error(s).
FAILED: [code=1] tests/server/CMakeFiles/servers-clang-tidy bld/tests/server/CMakeFiles/servers-clang-tidy
cd tests/server && /usr/bin/clang-tidy --config-file=.clang-tidy.yml
--warnings-as-errors=* --checks=-clang-diagnostic-unused-function first.c getpart.c util.c dnsd.c [...]
-- <-D-options> <-I-options> <cflags>
```

For reference, this is CMake's built-in clang-tidy invocation:
```
/usr/local/bin/cmake -E __run_co_compile --tidy="/usr/bin/clang-tidy;--config-file=.clang-tidy.yml;
--warnings-as-errors=*;--extra-arg-before=--driver-mode=gcc" --source=lib/curl_fopen.c
-- /usr/bin/clang --target=x86_64-w64-mingw32 <-D-options> <-I-options> <cflags>
```

Also:
- bump cmakelint `--max-statements`. Needs 59 after this patch.
- use undocumented CMake variables:
  - `CMAKE_C_COMPILE_OPTIONS_TARGET` for `--target=`
  - `CMAKE_C_COMPILE_OPTIONS_SYSROOT` for `--sysroot=`

Cherry-picked from #20631

Closes #20640
2026-02-20 12:08:52 +01:00
Viktor Szakats
1858126cca
cmake: sync clang-tidy arg order in tests with C compiler
Pass macro definitions first. For uniformity, no functional difference.

To match:
```
CMAKE_C_COMPILE_OBJECT = '<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> [...]'
```

Closes #20635
2026-02-19 19:08:31 +01:00
Viktor Szakats
b5a6d617d1
clang-tidy: sort list [ci skip]
Follow-up to b7ecd14725 #20632
2026-02-19 16:34:01 +01:00
Viktor Szakats
b7ecd14725
clang-tidy: replace comma-separated string with list in config
Bump required clang-tidy version to v17.0.0 for this.

Ref: https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/index.html
Follow-up to 4497dbd9ac #20605

Closes #20632
2026-02-19 16:27:08 +01:00
Viktor Szakats
8712fac111
clang-tidy: drop redundant casts
Found via `readability-redundant-casting`. Prone to false positives, not
enabled.

Ref: https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-casting.html

Closes #20630
2026-02-19 15:27:17 +01:00
Viktor Szakats
c07c3cac74
clang-tidy: enable and fix readability-uppercase-literal-suffix
Ref: https://clang.llvm.org/extra/clang-tidy/checks/readability/uppercase-literal-suffix.html

Closes #20629
2026-02-19 15:27:17 +01:00
Viktor Szakats
3cdc167425
clang-tidy: check readability-redundant-preprocessor, fix fallouts
Also:
- cipher_suite: merge `USE_MBEDTLS` `#if` blocks.

Ref: https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-preprocessor.html

Closes #20628
2026-02-19 15:27:17 +01:00
Viktor Szakats
bd60df527c
clang-tidy: check readability-redundant-control-flow
Also fix fallouts.

Ref: https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-control-flow.html

Closes #20625
2026-02-19 12:44:52 +01:00
Viktor Szakats
c878160e9c
clang-tidy: sync argument names in prototype and definition
Discovered with clang-tidy checker
`readability-inconsistent-declaration-parameter-name`.

Also:
- do not enforce the above because of inconsistencies still present
  between public API prototypes and definitions. (Also betwen man page
  protos, and man page examples, and other parts of the code, e.g.
  `easy` vs `curl` vs `d` vs `handle`) Perhaps subject for a future
  effort:
  https://github.com/curl/curl/actions/runs/22166472728/job/64094691653
- enable and fix `readability-named-parameter` where missing.

Refs:
https://clang.llvm.org/extra/clang-tidy/checks/readability/inconsistent-declaration-parameter-name.html
https://clang.llvm.org/extra/clang-tidy/checks/readability/named-parameter.html

Closes #20624
2026-02-19 12:44:37 +01:00
Viktor Szakats
7c01bb23bc
rtspd: fix to check realloc() result
Also enable `bugprone-suspicious-realloc-usage` clang-tidy option
to verify.

Fixing:
```
tests/server/rtspd.c:328:37: error: 'req->rtp_buffer' may be set to null if 'realloc' fails,
 which may result in a leak of the original buffer
 [bugprone-suspicious-realloc-usage,-warnings-as-errors]
  328 |                   req->rtp_buffer = realloc(req->rtp_buffer,
      |                   ~~~~~~~~~~~~~~~   ^       ~~~~~~~~~~~~~~~
```

Ref: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-realloc-usage.html

Closes #20621
2026-02-19 12:38:49 +01:00
Viktor Szakats
7e203c15e6
cmake/FindMbedTLS: add workaround for missing static MSVC mbedcrypto.lib 4.0.0
Seen with mbedTLS 4.0.0. mbedTLS 4.0.0 renamed `mbedcrypto` lib to
`tfpsacrypto`, while also keeping a copy under the old name to aid
transition. However, this compatibility logic is broken for MSVC static
builds, and the old name missing.

Work around by looking for the new name in the raw detection codepath.

Note that using `pkg-config`-based detection also works as a workaround.

Reported-by: tawmoto on github
Fixes #20616
Ref: https://github.com/Mbed-TLS/mbedtls/blob/v4.0.0/library/CMakeLists.txt#L275-L282
Ref: https://github.com/Mbed-TLS/mbedtls/issues/10605

Closes #20617
2026-02-19 12:38:49 +01:00
Viktor Szakats
4497dbd9ac
clang-tidy: fixes and improvements
Fix bigger and smaller kinks in how clang-tidy is configured and used.
Sync behavior more between autotools and cmake, lib/src and tests. Bump
clang-tidy minimum version and prepare logic to allow using clang-tidy
to a fuller extent.

- move clang-tidy settings from builds to a new `.clang-tidy.yml`.
  To make it easy to see and edit checks at one place. Also to allow
  using the `--checks=` option internally to silence tests-specific
  checks. (clang-tidy does not support multiple `--check=` options via
  the command-line.)
  Use explicit `--config-file=` option to point to the configuration.
- .clang-tidy.yml: link to documentation.
- suppress `clang-diagnostic-nullability-extension` due to a false
  positive in libtests with `CURL_WERROR=ON` and `PICKY_COMPILER=OFF`.
- .clang-tidy.yml: enable `portability-*`, `misc-const-correctness`.
- drop `--quiet` clang-tidy option by default to make its working a bit
  more transparent. The extra output is minimial.
- consistently use double-dashes in clang-tidy command-line options.
  Supported by clang-tidy 9.0.0+ (2019-09-19). Before this patch single
  and double were used arbitrarily.
- src/tool_parsecfg: silence false positive `clang-analyzer-unix.Stream`.
  Seen with clang 18 + clang-tidy 19 and 20 (only with autotools.)
- INTERNALS: require clang-tidy 14.0.0+. For the `--config-file` option.
- INTERNALS: recommend clang-tidy 19.1.0+, to avoid bogus
  `clang-analyzer-valist.Uninitialized` warnings. (bug details below)

autotools:

- allow configuring the clang-tidy tool via `CLANG_TIDY` env.
  Also to use in GHA to point to a suffixed clang-tody tool.
- fix to pass CFLAGS to lib, src sources.
  (keep omitting them when using a non-clang compiler.)
- fix to pass `--warnings-as-errors=*` in quotes to avoid globbing.

cmake:

- fix to not pass an empty `-I` to clang-tidy.
- fix to pass CFLAGS (picky warnings) to clang-tidy for test sources.
  (keep omitting them when using a non-clang compiler.)
- fix to disable `clang-diagnostic-unused-function` for test sources.
  (tests have static entry points, which trigger this check when
  checking them as individidual sources.)
- fix forwarding `CURL_CLANG_TIDYFLAGS` to clang-tidy.
- force disable picky warnings when running clang-tidy with a non-clang
  compiler. To not pass these flags when checking lib and src.

CI:

- GHA/linux: avoid clang-tidy bug by upgrading to v19, and drop the
  workaround.
- GHA/linux: switch to clang from gcc in the clang-tidy job. Using gcc
  doesn't allow passing CFLAGS to clang-tidy, making it less effective.
  (My guess this was one factor contributing to this job often missing
  to find certain issues compared to GHA/macos.)

I recomment using clang-tidy with a clang compiler, preferably the same
version or one that's compatible. Other cases are best effort, and may
fail if a C flag is passed to clang-tidy that it does not understand.
Picky warnings are mostly omitted when using a non-clang compiler,
reducing its usefulness.

Details and reproducer for the v18 (and earlier) clang-tidy bug,
previously affecting the GHA/linux job:

clang-tidy <=18 emits false warnings way when passing multiple C sources
at once (as done with autotools):

```sh
cat > src1.c <<EOF
#include <string.h>
static void dummy(void *p) { memcmp(p, p, 0); }
EOF

cat > src2.c <<EOF
#include <stdarg.h>
void vafunc(int option, ...)
{
  va_list param;
  va_start(param, option);
  if(option)
    (void)va_arg(param, int);
  va_end(param);
}
EOF

/opt/homebrew/opt/llvm@18/bin/clang-tidy --checks=clang-analyzer-valist.Uninitialized src1.c src2.c

# src2.c:7:11: warning: va_arg() is called on an uninitialized va_list [clang-analyzer-valist.Uninitialized]
```

Follow-up to e86542038d #17047

Closes #20605
2026-02-19 00:02:11 +01:00
Viktor Szakats
5fa5cb3825
build: fix -Wunused-macros warnings, and related tidy-ups
- fix internal macro `AN_APPLE_OS` reused between sources without
  resetting it. It may potentially have left the system sha256
  function unused.
- fix to define `WOLFSSL_OPTIONS_IGNORE_SYS` so that it always applies
  to wolfSSL headers, also during feature detection.
- md4, md5, sha256: simplify fallback logic.
- delete 20+ unused macros.
- scope or move macros to avoid `-Wunused-macros` warnings.
- examples: delete unused code.

The warning detects macros defined but not used within the same C
source. It does not warn for macros defined in headers. It also works
with unity builds, but to a lesser extent.

Closes #20593
2026-02-19 00:00:48 +01:00
Viktor Szakats
633ec719d5
curl_ntlm_core: merge two #if blocks
Cherry-picked from #20593

Closes #20620
2026-02-18 22:04:45 +01:00
Viktor Szakats
dc08922a61
openssl: disable local keylog feature if built-in upstream
Reported-by: Paul Howarth
Fixes #20611

Closes #20614
2026-02-18 12:04:23 +01:00
Stefan Eissing
f1c9d5e484
easy: reset errorbuf on eyeballing success
Any failf() that fill the errorbuf need to be forgotten once happy
eyeballing finds a succssful winner. Because the errorbuf, once set, is
not overwritten with future error information.

Adds test_05_05 to verify.

Reported-by: Tim Friedrich Brüggemann
Fixes #20608

Closes #20613
2026-02-18 12:04:23 +01:00
Dan Fandrich
36c2c7626f libcurl-security.md: Fix typos and add a point about URLs 2026-02-17 12:38:26 -08:00
Viktor Szakats
970e59a82f
GHA/windows: mark 3023/3024 flaky
Same as the other two tests, but for Schannel.

Follow-up to dead29362a #20602
Follow-up to 3ae234b2a3 #20462

Closes #20609
2026-02-16 21:13:43 +01:00
Viktor Szakats
8fb87f5a4a
lib: delete unused local includes
Filtered from `clang-tidy` `misc-include-cleaner` hits.

Also:
- pingping: scope includes.
- doh: say the reason for an include.

Closes #20607
2026-02-16 21:13:43 +01:00
Viktor Szakats
daa6b27b4d
include: avoid recursive macros
To fix potential `-Wdisabled-macro-expansion` warnings when using these
macros within other macros. Fixing for example:
```
lib/doh.c:328:3: error: disabled expansion of recursive macro [clang-diagnostic-disabled-macro-expansion,-warnings-as-errors]
  328 |   ERROR_CHECK_SETOPT(CURLOPT_URL, url);
      |   ^
lib/doh.c:271:14: note: expanded from macro 'ERROR_CHECK_SETOPT'
  271 |     result = curl_easy_setopt((CURL *)doh, x, y);       \
      |              ^
include/curl/curl.h:3332:44: note: expanded from macro 'curl_easy_setopt'
 3332 | #define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)
      |                                            ^
[...]
```

Also update comments on why curl continues to disable
`-Wdisabled-macro-expansion` and `-Wused-but-marked-unused` warnings.

Follow-up to 92f215fea1 #18477

Closes #20597
2026-02-15 22:54:32 +01:00
Viktor Szakats
1eec8b8d03
mprintf: rename internal enum to avoid collision with AmigaOS symbol
Also:
- drop AmigaOS workaround.

Closes #20584
2026-02-15 22:54:31 +01:00
Viktor Szakats
dead29362a
GHA/windows: mark test 3000 flaky too
Similar to test 3001 marked flaky earlier.

Example:
https://github.com/curl/curl/actions/runs/22035738719/job/63668228484?pr=20597#step:14:4099

Follow-up to 3ae234b2a3 #20462

Closes #20602
2026-02-15 22:54:31 +01:00
Viktor Szakats
a55f160b13
src: simplify declaring curl_ca_embed
Also to avoid `-Wunused-macros` warnings.

Follow-up to 8a3740bc8e #14059
Cherry-picked from #20593

Closes #20601
2026-02-15 12:48:46 +01:00
Viktor Szakats
298f73f95b
cmake: enable binutils ld workaround for all toolchains at build-time (revert)
The change was valid, but caused an annoying warning with perfectly
working non-binutils ld linkers:
```
ld: warning: ignoring duplicate libraries: 'my/path/usr/local/lib/libcrypto.a'
```
(seen with Apple clang, when using static `libcrypto.a`)

It means that for the binutil ld hack to work at consumption-time, curl
must be built with the same picky binutils (gcc) toolchain.

Reverts 795433b923 #20434

Closes #20594
2026-02-15 12:48:46 +01:00
Viktor Szakats
9e1e5ea67c
curl_setup.h: update/expand OPENSSL_SUPPRESS_DEPRECATED comment
Document functions/features requiring it.

Follow-up to cab040248d #10543
Cherry-picked from #20593

Closes #20600
2026-02-15 12:48:46 +01:00
Viktor Szakats
8494012196
examples/usercertinmem: use modern OpenSSL API, drop mentions of RSA
Replacing API calls deprecated by OpenSSL 3, and also missing
from OpenSSL 3 no-deprecated builds, fixing builds with the latter:
`PEM_read_bio_RSAPrivateKey()`, `RSA_free()`,
`SSL_CTX_use_RSAPrivateKey()`

Also: rename callback to match its `cacertinmem.c` sibling.

Fixes #20595
Closes #20596
2026-02-14 14:07:55 +01:00
Viktor Szakats
d445f2d930
lib: skip compiling code with features disabled
In non-SSL, non-SSH, non-H3, non-AppleSecTrust builds.

Also:
- drop unused internal macro `SSL_SYSTEM_VERIFIER`.

Closes #20587
2026-02-13 15:48:23 +01:00
Viktor Szakats
0649eb0825
GHA/windows: bump cygwin/cygwin-install-action to v6.1
Previous tag v6 changed upstream and points to a different commit. This
made zizmor unhappy. Previous commit is now tagged v6.0 in case we need
it.

Closes #20591
2026-02-13 15:41:04 +01:00
Viktor Szakats
cf9e445e03
cmake: normalize uppercase hex winver (for display)
For display and consistency with other regexp. It did not cause harm.

Follow-up to 2100d9fde2 #12044

Closes #20586
2026-02-13 11:56:13 +01:00
Viktor Szakats
20ae14a322
cmake: warn for invalid CURL_TARGET_WINDOWS_VERSION values
Also:
- INSTALL-CMAKE.md: add an example for `CURL_TARGET_WINDOWS_VERSION`.

Reported-by: nono303 on github
Ref: #20575
Closes #20582
2026-02-13 00:24:49 +01:00
Viktor Szakats
fb5541c28b
GHA/windows: replace Cygwin distro server
`mirrors.kernel.org` is down.

Also:
- link to `mirrors.kernel.org` status page.
- link to list of mirrors.

Ref: https://archlinux.org/mirrors/kernel.org/

Closes #20583
2026-02-13 00:22:57 +01:00
Daniel Stenberg
207ab758f5
ws/tftp: include header file even when protocol disabled
As the scheme details are still needed. clang 21 warned for this in HTTP-only
builds.

Reported-by: Marcel Raad
URL: https://curl.se/mail/lib-2026-02/0008.html
Closes #20568
2026-02-12 22:47:53 +01:00
Daniel Stenberg
36dc50b7e3
smb: include arpa/inet.h for NonStop
Reported-by: Randall S. Becker
URL: https://curl.se/mail/lib-2026-02/0010.html
Closes #20579
2026-02-12 22:46:56 +01:00
Daniel Stenberg
10bb489b22
schannel: refactor: reduce variable scopes, fix comment, fix indent
Refactor and simplify the Schannel code, primarily by reducing
duplicated buffer-management and credential-setup logic.

- split client certificate selection into get_client_cert() and SSPI
  credential acquisition into acquire_sspi_handle()
- introduce a struct sbuffer for encrypted/decrypted buffering
- Add ensure_encoding_size() and ensure_decoding_size() helpers to
  centralize buffer growth/realloc decisions
- Tighten variable scopes and tidy indentation/logging in the handshake
  and receive/decrypt loops.
- Update comments and adjusts some receive error-condition handling to
  better preserve buffered-data behavior.

Closes #20569
2026-02-12 22:34:58 +01:00
Daniel Stenberg
df6f3ae60a
multi: split multi_runsingle into sub functions
To reduce complexity.

- is_finished() checks if the individual transfer is done

- handle_completed() is the logic that runs for a completed
  transfer

Closes #20573
2026-02-12 22:34:23 +01:00
Viktor Szakats
3ce596a956
msvc: VS2026: unlock picky warning in cmake, test in CI
Upgrade a GHA/windows job to VS2026 (from VS2022), using a runner image
released a week ago. It also comes with the same Windows SDK as VS2022:
v10.0.26100.0.

The runner image uses Windows 2025 unfortunately, which makes the job
run significantly slower than before this patch:
- configure: 49s -> 1m10s
- build: 3s -> 5s
- install test prereqs: 23s -> 27s
- run tests: 3m18s -> 4m11s
- build examples: 15s -> 25s

It's a shame.

Also:
- cmake: enable picky warnings for VS2026 internal version 19.50.
  Build is clean with existing options.
- GHA/windows: make the built-in OpenSSH intall path recognize
  the windows-2025-vs2026 image as windows-2025.
- windows-2025-vs2026 is able to load the cached stunnel made on
  the windows-2022 runner.
- disk use of the build is almost identical to VS2022.

Before: https://github.com/curl/curl/actions/runs/21955482367/job/63418133880
After: https://github.com/curl/curl/actions/runs/21957589847/job/63426546943

Ref: 71f0157880/images/windows/Windows2025-VS2026-Readme.md
Ref: #20575

Closes #20577
2026-02-12 19:04:51 +01:00
renovate[bot]
aece530e26
GHA: update google/boringssl to v0.20260211.0
Closes #20566
2026-02-12 17:38:35 +01:00
Viktor Szakats
5edd79aa93
cmake: add CURL_PATCHSTAMP configuration variable, test in CI
Also:
- INSTALL-CMAKE.md: alpha sort.

Closes #20576
2026-02-12 17:29:22 +01:00
Viktor Szakats
516a0cd382
cmake: add BORINGSSL_VERSION configuration variable, test in CI
To simplify setting BoringSSL version, using:
`-DBORINGSSL_VERSION=0.20260211.0`
or
`-DBORINGSSL_VERSION=${boringssl_version}`

Previously it could be set via C flags, using complicated shell quotes:
`-DCMAKE_C_FLAGS="-DCURL_BORINGSSL_VERSION=\\\"${boringssl_version}\\\""`
(the C flags method remains, also for autotools)

It'd be nice if BoringSSL published its version not just via
`MODULE.bazel` in its source tree, but from its public headers, to make
these workarounds unnecessary.

Also:
- GHA/http3-linux: test both options.

Closes #20571
2026-02-12 16:29:49 +01:00
Viktor Szakats
61df5f466c
tidy-up: miscellaneous
- curl_ntlm_core, smtp, schannel: fix comments.
- curl_setup.h: fix to undef before define.
- tool_doswin, server/sockfilt: reduce variables scopes.
- tool_doswin: drop an interim variable.
- windows: replace `SOCKET_ERROR` with `0` to align with rest of code.
- libssh2: rename variable to align with rest of code.
- gtls, unit1398: use `#if 0`.
- curl_trc.h, curlx/inet_ntop.h: add missing parentheses in macro
  expressions.
- ldap.c: set empty macro to `do {} while(0)`.
- examples/crawler: rename a non-CURLcode `result` variable.
- CURLINFO_TLS_SESSION: drop stray colon.
- add `const` to casts where missing.
- drop unnecessary parentheses.
- fix indent.
- quote style.
- comment style.
- whitespace, newlines, fold/unfold.

Closes #20554
2026-02-12 14:52:16 +01:00
Viktor Szakats
2a92c39a21
windows: tidy up wincrypt.h / BoringSSL/AWS-LC coexist workaround
- openssl: move and expand explanatory comment.

- openssl: drop duplicate workaround.

- schannel: drop workaround. Unnecessary, because OpenSSL headers are
  not included in or after schannel code.

- schannel: drop explicit `wincrypt.h` include. It's indirectly
  included by system `<schannel.h>`.

- ldap: drop explicit `wincrypt.h` include.
  It isn't used there, and also not required for the workaround.
  `winldap.h` keeps including it indirectly.

Tested with BoringSSL and AWS-LC (MultiSSL with Schannel), also LDAP
enabled, and H3, unity and non-unity, and all tested cases build fine.

In lib in general, the point is to have the `#undef`s between the first
`wincrypt.h` include [1] and the first OpenSSL include [2], within a
single compilation unit. For non-unity builds the only such source is
`openssl.c`. For unity ones, depending on batch size, in theory we
should `#undef` after each `wincrypt.h` include. In practice this is
overkill and most cases are covered by `#undef`-fing _first_ in
`vtls/openssl.c`, and `#undef` in `ldap.c`. It's not impossible that we
need to add more undefs after further `wincrypt.h` includes to cover so
far undiscovered build cases [3]. Though I could not find more with the
current sources and source order.

It's also an option to include OpenSSL first, then `wincrypt.h`, as
done in libtests, but for lib and `vtls/openssl.c` it's more practical
to do the opposite.

[1] can be indirect, e.g. via `iphlpapi.h`, `schannel.h`, `winldap.h`.

[2] in
- BoringSSL/AWS-LC: any include (due to `openssl/base.h`).
  Original fix removed by BoringSSL in year
  [2014](ded93581f1 (diff-878093ea6426091505b4c49c59b78924f42859af0eb4ce39b8089bda9577e013)).
- OpenSSL: `openssl/ssl.h`, `openssl/x509v3.h`, and some more affected,
  and including `openssl/ossl_typ.h` does the `#undef` automatically.
  Since [3.1.0+](fbb9a1f997)
  each inclusion does the `#undef`, in 3.0.x (and earlier) only
  the first inclusion did. Initially fixed in
  [0.9.6d](1955b87423)
- LibreSSL [2.3.0+](0fa826d34f):
  not affected, though to suppress another warning 3.8.2+ and
  a [define](e7fe6caab2)
  is necessary.

[3] `lib/Makefile.inc` defines the order of unity sources.

For libtests, the case is simpler: There is always one compilation unit,
with a fixed order, and at the moment `cli_hx_download.c` is including
OpenSSL first, then wincrypt, and in this order they don't bother each
other. Also, at the moment `lib758.c` is the only other OpenSSL header
user, but it's compiled after `cli_hx_download.c` so the include is
skipped there. We may need to revisit this if either header gets
included before it.

All this said it'd be nice if BoringSSL/AWS-LC restored the built-in
workaround to behave like LibreSSL and OpenSSL and not require local
workarounds like these.

Ref: https://github.com/curl/curl/pull/20556#issuecomment-3888425644

Follow-up to 4c46c829f5 #9110
Follow-up to fbe07c6829 #5669 #5857

Closes #20567
2026-02-12 14:31:39 +01:00
Daniel Stenberg
208b2e8975
RELEASE-NOTES: synced 2026-02-12 09:25:50 +01:00
Viktor Szakats
85a895c59f
cli_hx_download: add Schannel support
Fixes:
```
$ wine libtests.exe cli_hx_download https://curl.se/
[...]
Assertion failed: t->checked_ssl, file .../curl/tests/libtest/cli_hx_download.c, line 563
```

into:
```
[t-0] info Schannel TLS version 0x00000800
```

Refs:
https://learn.microsoft.com/windows/win32/secauthn/querycontextattributes--general
https://learn.microsoft.com/windows/win32/api/schannel/ns-schannel-secpkgcontext_connectioninfo

Ref: c220674ac4 #20564
Follow-up to ba9ddb9357 #18066

Closes #20556
2026-02-11 18:00:55 +01:00
Viktor Szakats
325d0e0a68
cmake: fix CURL_DROP_UNUSED accidental left always-enabled
Follow-up to 66ad54e46b #20357

Closes #20565
2026-02-11 17:01:04 +01:00
Viktor Szakats
c220674ac4
windows: tidy up includes, macros, document dependencies
- define `SECURITY_WIN32` globally in `curl_setup.h`.
  To make sure it applies to all includes.

- document which Windows headers require `SECURITY_WIN32`.

- stop suppressing MSVC warning:
  `C4201 is: nonstandard extension used : nameless struct/union`
  The warning is no longer seen in supported build envs with the current
  codebase.
  Follow-up to 8beff43559 #8419

- document why `SCHANNEL_USE_BLACKLISTS` is needed.

- just define `SCHANNEL_USE_BLACKLISTS`, drop the unnecessary value `1`.

- stop defining unused `SCH_CRED_MAX_SUPPORTED*` fallback macros.
  Follow-up to 8beff43559 #8419

- document why `subauth.h` is included (where missing).

- move and de-dupe `subauth.h` include into `curl_setup.h`, limit to
  Schannel builds.

- stop include `schnlsp.h`. It is a 1-to-1 compatibility wrapper for
  `schannel.h`.

- curl_sspi.h: clarify comment about `SP_NAME_` macros.
  They are local macros, their SDK names are different and curl does not
  use them.

- curl_sspi.h: drop superfluous includes `security.h` and `rpc.h`.

Cherry-picked from #20556

Closes #20564
2026-02-11 16:15:11 +01:00
Viktor Szakats
982ab7b53f
build: check MSG_NOSIGNAL directly, drop detection and interim macro
Drop detecting it at configure time, along with the interim macro
`HAVE_MSG_NOSIGNAL`. There is no longer a reason for this workaround,
and allows to save the work at configure time and simplify.

Also say in a comment that `sys/socket.h` is defining this macro.

Follow-up to 77b3bc239d

Closes #20559
2026-02-11 14:51:08 +01:00
Viktor Szakats
c05cd2a10e
curl_setup.h: merge back single-use internal header curl_setup_once.h
Originally split in 2006, but the issues cited are no longer present in
current code. As of now both `curl_setup.h` and `curl_setup_once.h` are
included once per compiler invocation, without recursion. The latter is
a sub-header of the former with no clear distinction in their contents.

Merge them to avoid having to decide where to put new global PP logic.
Also to make it easier to overview what gets defined/included globally
and in what order. (Perhaps even allowing some tidying up here.)

Follow-up to 77b3bc239d

Closes #20555
2026-02-11 14:26:30 +01:00
Daniel Stenberg
6d2e9926d7
docs/libcurl: unify WARNING use
Consistently use bold and colon.

Closes #20561
2026-02-11 09:43:14 +01:00
Daniel Stenberg
434e5312f4
tool_operate: split post_per_transfer into sub functions
To make it easier to read and manage. Reduce complexity.

Closes #20560
2026-02-11 09:41:48 +01:00
renovate[bot]
69f67f5e1a
GHA/linux: update pizlonator/fil-c to v0.678
Closes #20558
2026-02-11 06:12:04 +01:00
Viktor Szakats
e269e3daf1
pytest: bump pip cryptography to 46.0.5
For CVE-2026-26007 (curl not affected)
2026-02-11 06:10:21 +01:00
renovate[bot]
64ea225589
GHA: update awslabs/aws-lc to v1.67.0
Closes #20553
2026-02-10 07:54:12 +01:00
Daniel Stenberg
ee3a4dff1a
http_aws_sigv4: fix query normalization of %2b
Reported-by: Nuno Goncalves
Fixes #20543
Closes #20550
2026-02-10 07:52:18 +01:00
Viktor Szakats
5c250e2421
gss: exclude verbose error logic from non-verbose builds
Closes #20551
2026-02-10 02:34:33 +01:00
Jay Satiro
b844c1a075 vtls: use ALPN http/1.0 & http/1.1 for HTTP/1.0 requests
- For compatibility reasons send both ALPN ids http/1.0 and http/1.1 for
  HTTP/1.0 requests.

Prior to this change for compatibility reasons curl would send ALPN
http/1.1 for HTTP/1.0 requests, since some servers do not recognize
ALPN http/1.0. However some servers may recognize only ALPN http/1.0 for
HTTP/1.0 requests. Therefore curl now sends both.

Reported-by: programmerlexi@users.noreply.github.com

Fixes https://github.com/curl/curl/issues/20487
Closes https://github.com/curl/curl/pull/20533
2026-02-09 12:15:35 -05:00
Daniel Stenberg
0291f751cb
RELEASE-NOTES: synced 2026-02-09 16:28:57 +01:00
Daniel Stenberg
22010e4185
test1980: verify sigv4 normalization query with + and spaces
Ref: #20543
Closes #20548
2026-02-09 13:41:42 +01:00
Daniel Stenberg
15a8a777b8
VULN-DISCLOSURE-POLICY.md: mention GitHub quirks
Closes #20541
2026-02-09 12:42:36 +01:00
Daniel Stenberg
950c7bb174
digest: escape double quotes and backslashes in realm and nonce
change test 907 to use quote in realm to verify

Fixes #20482
Reported-by: cooldadpresident on github
Closes #20545
2026-02-09 08:50:32 +01:00
Daniel Stenberg
afe9fdd1eb
tests: convert base64 data to %b64[]
To make it easier to read, understand and edit tests - and grep them.

Closes #20547
2026-02-09 08:42:49 +01:00
Viktor Szakats
cdfc8dc7ad
build: tidy up and simplify setmode() detection and use
- move macro to `curl_setup.h` (from curlx), and rename.
  It's required by src, test servers, libtests. Also used by unit/tunit,
  (which is fixable but this patch doesn't touch it.)
- special-case it for Windows/Cygwin/MS-DOS.
- build: drop `setmode()`/`_setmode()` detection.
  This also avoids detecting the different `setmode()` on BSDs,
  and a lot of complexity and overhead.
- use `CURL_O_BINARY`.

Follow-up to 250d613763 #15787
Follow-up to 5e70566094 #15169

Closes #20539
2026-02-08 15:47:47 +01:00
Viktor Szakats
2c0019b085
curl_setup.h: drop extra header guard for internal include
The included local header starts with this same guard. The original
commit added it for fixing VMS builds along with many other changes, but
without mention of this specific one in the commit message.

`curl_setup.h` is included once, which includes `curl_setup_once.h`
once, even if the latter wouldn't have it's own guard.

Ref: 25f351424b

Closes #20544
2026-02-08 15:47:47 +01:00
Viktor Szakats
bb56f325a4
curl_get_line: drop single-use macro
Follow-up to 769ccb4d42 #19140

Closes #20542
2026-02-08 15:47:47 +01:00
Daniel Stenberg
aa0be708b9
url.c: restore mistaken comment change
Follow-up to d7a9f1ab15

Closes #20540
2026-02-07 23:26:57 +01:00
Daniel Stenberg
510fdad64d
sws: prevent "connection monitor" to say disconnect twice 2026-02-07 22:16:53 +01:00
Daniel Stenberg
34fa034d9a
url: fix reuse of connections using HTTP Negotiate
Assume Negotiate means connection-based

Reported-by: Zhicheng Chen
Closes #20534
2026-02-07 22:16:53 +01:00
Viktor Szakats
2d8284e4e8
src/Makefile.inc: update CURLX_HFILES
Closes #20537
2026-02-07 19:40:45 +01:00
Viktor Szakats
02c37d269c
docs: compare result against literal CURLE_OK (where missing)
Also scope to result variables.

Closes #20536
2026-02-07 19:40:45 +01:00
Viktor Szakats
85de995208
tidy-up: move literals to right-side of if expressions (where missing)
Closes #20535
2026-02-07 16:41:51 +01:00
Viktor Szakats
c6ac2de5b3
tool_cb_prg: drop duplicate preprocessor logic
In favor of the copy in `curl_setup.h`.

Closes #20531
2026-02-05 23:46:49 +01:00
Viktor Szakats
0495425c69
lib518, 537: drop #error on unlikely/impossible build condition
`FD_SETSIZE` is used in core code and expected to be present.

Closes #20530
2026-02-05 23:46:49 +01:00
Daniel Stenberg
97cf032809
README: add MQTTS
Follow-up to 6c31df453b

Closes #20532
2026-02-05 22:55:01 +01:00
Juan Belon
12a1be509e
curl_setup_once: allow CURL_DEBUGASSERT for customization
Closes #19744
2026-02-05 17:40:46 +01:00
renovate[bot]
3417cb1562
Dockerfile: update debian:bookworm-slim Docker digest to 98f4b71
Closes #20501
2026-02-05 17:36:44 +01:00
Spenser Black
e674e84654
docs: fix grammar nitpicks
Closes #20518
2026-02-05 17:26:02 +01:00
Stefan Eissing
d7a9f1ab15
url.c: code/comment cleanup around conn creation
Several comments were outdated and parameters to create_conn() and
ConnectionExists() were not needed. Give functions better names and
consistently use terms `needle` and `conn`.

No functional change.

Closes #20464
2026-02-05 17:21:53 +01:00
jhauga
161be30854
curl: add -I and -i to -h important
Closes #20483
2026-02-05 17:20:29 +01:00
renovate[bot]
7fc12ecae8
GHA: update google/boringssl to v0.20260204.0
Closes #20519
2026-02-05 17:18:55 +01:00
Viktor Szakats
14144a4064
mk-ca-bundle.pl: drop support for obsolete/insecure fingerprint algos
MD5 and SHA1 fingerprints can no longer be included in the output when
using the `-t` option.

Closes #20527
2026-02-05 15:22:01 +01:00
Viktor Szakats
4b3af7fb67
lib: disable websockets early if no http
To prevent inconsistent `CURL_DISABLE_WEBSOCKETS` states between source
files.

Follow-up to 8edc0338f3 #20351

Closes #20526
2026-02-05 13:12:10 +01:00
Viktor Szakats
f659b82c2a
build: make HTTP_ONLY build options also disable websockets
Closes #20525
2026-02-05 13:12:10 +01:00
Viktor Szakats
4fb5c916fd
cmake: use list(APPEND ...) where missing
Cherry-picked from #20407

Closes #20522
2026-02-05 13:12:10 +01:00
Viktor Szakats
fa9318cabf
GHA/linux-old: use tilde where possible and consistent
Cherry-picked from #20407

Closes #20524
2026-02-05 13:12:10 +01:00
Viktor Szakats
86d8e2b94d
GHA/non-native: pin DJGPP toolchain to hash
This package is automatically bumped, but needs manual intervention
anyway, to update gcc version number in the filename.

Follow-up to 4ad0a022e1 #20517

Closes #20523
2026-02-05 13:12:10 +01:00
Viktor Szakats
4ad0a022e1
CI: log downloaded file hashes, pin manually bumped ones
To ensure downloaded binaries are the expected ones. Also to document
SHA-256 hashes of all binary packages and source tarballs.

Closes #20517
2026-02-05 03:20:46 +01:00
Viktor Szakats
462244447e
build: use native file open flags in Windows-specific code
To comply with official documentation. Also to make code compile with
`NO_OLDNAMES` (mingw-w64) or `_CRT_DECLARE_NONSTDC_NAMES=0` (MSVC) set.

Ref: #15652

Closes #20516
2026-02-04 15:59:35 +01:00
Daniel Stenberg
94349aa932
mqtt: verify Remaining Length for CONNACK and PUBACK
Verified in test 1132

Closes #20513
2026-02-04 15:43:13 +01:00
Daniel Stenberg
0ccaf6c835
VULN-DISCLOSURE-POLICY.md: push reports to the web form
Closes #20515
2026-02-04 12:45:51 +01:00
Viktor Szakats
0bfd2645ca
GHA/windows: set lookup-only in build-cache jobs
To save a few seconds by not actually restoring the cache, just checking
if there is cache hit.

Follow-up to fb44e44d92 #20456

Closes #20512
2026-02-04 03:07:29 +01:00
Viktor Szakats
443a539fcf
build: move curl stat struct type to the curlx namespace
To match surrounding curlx symbols and functions.

Follow-up to a84b041281 #20496

Closes #20508
2026-02-04 02:07:16 +01:00
Daniel Stenberg
fdca2e0fd3
imap: add a check for Curl_meta_get()
It should not return NULL, but if it does we need to bail out. Like we
do elsewhere.a

Found by CodeSonar.
Closes #20510
2026-02-03 23:24:06 +01:00
Stefan Eissing
2d4efbb9b3 multi: update timer unconditionally in multi_remove_handle
When removing an easy handle from a multi, there was an optimization
to update the timer only when the removed handle had any timers.

With the introduction of the "dirty" bitset, easy handles can now cause
a timeout of 0 to be set without having anything in their timer list.
Removing such a handle needs to update the timer now always, so that
it may get cleared when there is nothing more to wait for.

The previous "not clearing a 0 timer" should not have any effect on
application's logic. Without clearing, the timer will fire and then
adjust itself to the proper value. But it would cause one more timer
fire than necessary.

Reported-by: Jan Macku

Fixes https://github.com/curl/curl/issues/20498
Closes https://github.com/curl/curl/pull/20502
2026-02-03 16:24:39 -05:00
Viktor Szakats
0590753a3c
build: require POSIX strdup()
Stop detecting this function and drop the local fallback.

Let us know if this update is causing an issue.

Notes:
- on Windows `_strdup()` is required instead.
- `strdup()/_strdup()` were required before this patch to build one of
  the examples: `block_ip`.
- `strdup()/_strdup()` were required in 8.18.0 and earlier to build
  tests.

Closes #20505
2026-02-03 17:50:18 +01:00
Viktor Szakats
710d5a28fb
fopen.h: simplify curl memory macro mappings
Closes #20506
2026-02-03 15:13:37 +01:00
Viktor Szakats
5bdbad87c5
curlx: drop unused curlx_saferealloc()
Unused since 67ae101666 #19949

Closes #20504
2026-02-03 15:13:37 +01:00
Viktor Szakats
31a4f415af
build: tidy up and dedupe strdup functions
- de-dupe lib/src strdup/memdup functions into curlx.
- introduce `CURLX_STRDUP_LOW()` for mapping `strdup()`, and to do it at
  one place within the code, in `curl_setup.h`.
- tests/server: use `curlx_strdup()`. (Also to fix building without
  a system `strdup()`.)
- curlx/curlx.h: shorten and tidy up.
- adjust Windows build path to not need `HAVE_STRDUP`.
- build: stop detecting `HAVE_STRDUP` on Windows.

Closes #20497
2026-02-03 14:02:30 +01:00
Viktor Szakats
e39650c984
curl_setup.h: simplify curl memory macro mappings
Full argument listing is redundant for `curl`-prefixed internal macros.

Closes #20499
2026-02-03 10:54:42 +01:00
Viktor Szakats
d442be2ce3
typos: silence false positives found in C code
Closes #20500
2026-02-03 00:59:41 +01:00
Daniel Stenberg
76c4c8d411
RELEASE-NOTES: synced 2026-02-02 23:44:30 +01:00
Stefan Eissing
ffdbc04c7b
hostip.c: fix leak of addrinfo
When creating a dns entry, the addrinfo is passed into the entry on
success and needed deallocation by the caller on failure.

Change the signature to have Curl_dnscache_mk_entry() *always* take
ownership of the addrinfo, even on failure. Change parameter to address
of pointer so that call always clears it.

This makes the handling of failures to Curl_dnscache_mk_entry() simpler.

Fixes #20465
Closes #20468
2026-02-02 23:29:45 +01:00
Viktor Szakats
a84b041281
build: tidy up curl-specific fstat calls and stat struct type
To avoid redefining the `fstat` system symbol, and to clarify
`struct_stat` is a curl symbol.

- introduce `curlx_fstat()` macro and use it.
- rename `struct_stat` to `curl_struct_stat`.

Also:
- tests: replace direct `curlx_win32_stat()` call with `curlx_stat()`.
- checksrc: disallow direct `_fstati64` and `fstat()` calls, except in
  examples.

Closes #20496
2026-02-02 18:57:13 +01:00
Viktor Szakats
9630593650
build: use more const
Mostly with `char *` types.

Also:
- mime, x509asn1, tool_operate, lib3207: drop redundant casts.
- examples/smooth-gtk-thread: add missing variable declaration.
- reduce variable scopes.
- tests/server: move `data_to_hex()` to its only user: `sws`.

Closes #20489
2026-02-02 12:32:49 +01:00
Viktor Szakats
66bb641331
ftp: drop single-caller local verbose function
Closes #20495
2026-02-02 12:28:13 +01:00
Viktor Szakats
4728efe082
ftp: replace a curlx_free() with curlx_dyn_free()
On an error path.

Follow-up to f4beef524a #12638

Closes #20494
2026-02-02 12:28:13 +01:00
Viktor Szakats
9d04582d8c
test1604: avoid dynamic allocations
Closes #20493
2026-02-02 12:28:13 +01:00
Viktor Szakats
d8e3376c18
test1304: drop CURL_UNCONST()
Closes #20492
2026-02-02 12:28:13 +01:00
Viktor Szakats
4f1646ef8a
cmake: skip binutils ld hack if zlib/openssl target is not IMPORTED
The binutils ld hack requires reading the targets' `LOCATION` property.
This property exists in `IMPORTED` targets. `ZLIB::ZLIB` and
`OpenSSL::Crypto` are normally `IMPORTED` targets defined by CMake's
built-in Find modules. However, in some cases (e.g. in "superbuilds"),
they may be regular targets, defined manually, without a `LOCATION`
property. To avoid a CMake warning in such case, verify if the target is
`IMPORTED` before reading this property.

This also mean that in such case the binutils/ld/gcc hack is not
enabled, and libcurl may fail linking in static mode.

https://cmake.org/cmake/help/v4.2/prop_tgt/IMPORTED.html
https://cmake.org/cmake/help/v4.2/prop_tgt/LOCATION.html

Reported-by: Tomáš Malý
Fixes #20419
Follow-up to 3e841630ec #20427
Follow-up to 16f073ef49 #16973

Closes #20486
2026-02-02 12:28:12 +01:00
Viktor Szakats
96fa42c7c0
build: tidy up local lseek() mappings
- stop redefining system symbol `lseek`, by introducing `curl_lseek()`.
- handle AmigaOS quirk within the macro mapping.
- add missing parenthesis to `LSEEK_ERROR` values.
- tool_util: use curl `lseek` macros in `tool_ftruncate64()`.
- move `LSEEK_ERROR` to right-hand side of if expressions.
- checksrc: disallow direct uses of `_lseeki64`, `llseek`, `lseek`.

Closes #20488
2026-02-01 17:29:39 +01:00
dependabot[bot]
47734f3244
GHA: bump GHA and pip dependencies
- update `actions/checkout` from 6.0.1 to 6.0.2
- update `ruff` from 0.14.11 to 0.14.14
- update `cryptography` from 46.0.3 to 46.0.4
- update `psutil` from 7.2.1 to 7.2.2
- update `websockets` from 15.0.1 to 16.0

Closes #20490
Closes #20491
2026-02-01 16:40:37 +01:00
Viktor Szakats
3003c32cb2
tidy-up: miscellaneous
- INSTALL-CMAKE.md: add missing periods, text fixes.
- md4, md5: sync variables names.
- curl_trc: sync an argument type.
- docs/examples: sync debug/trace function copies, constify, tidy-ups.
- replace commented code with `#if 0`.
- drop redundant parenthesis (macro values, `return`, around single
  variables, function calls).
- fix indentation, apply clang-format in places.

Closes #20481
2026-02-01 00:54:23 +01:00
Jay Satiro
ca5efd02b6 CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md: fix available protocols
Bug: https://curl.se/mail/lib-2026-01/0033.html
Reported-by: Tenant HellTower (Negar)
2026-01-31 14:37:29 -05:00
Viktor Szakats
9c3fcb8a32
vtls: dedupe common on-session-reuse logic
Closes #20475
2026-01-30 13:27:03 +01:00
Viktor Szakats
97a294688f
ssh: dedupe state change function
Closes #20473
2026-01-30 13:27:03 +01:00
Viktor Szakats
1acf0c45f4
cmake: improve setting up runtests in Windows cross-builds
Closes #20479
2026-01-30 00:34:25 +01:00
Viktor Szakats
b619952b82
GHA/windows: fix typo in test number [ci skip]
Follow-up to 3ae234b2a3 #20462
2026-01-30 00:24:21 +01:00
Viktor Szakats
154dff6acc
tests/server/sockfilt: avoid possible endless loop on Windows
Seen to happen when run under WINE v10.0 on macOS.
```
$ CURL_TEST_EXE_EXT_SRV=.exe CURL_TEST_EXE_EXT_TOOL=.exe \
CURL_TEST_EXE_RUNNER=wine TFLAGS='951 -t' ninja tests
[...]
16:02:18.607002 [select_ws_wait_thread] PeekNamedPipe error: (0x00000032) - Request not supported.
[...endless repeat...]
```

Closes #20478
2026-01-29 23:25:36 +01:00
Viktor Szakats
373e89a021
tests/server: tidy-up error messages (Windows)
- show error description on `PeekNamedPipe()` error.
- show `GetLastError()` instead of socket error on non-socket failures
  in the window handler.
- include full hex `GetLastError()` numbers in error messages, syncing
  with Schannel code.
- drop internal `win32_perror()` function, in favor of direct
  `curlx_*strerror()` calls.

Closes #20477
2026-01-29 22:53:23 +01:00
Viktor Szakats
4d0c3b690e
tool_help.h: drop redundant U suffix from literals
Also:
- update the generator script accordingly.
- convert lowercase `u` suffix to uppercase to match rest of code.

Closes #20476
2026-01-29 22:53:22 +01:00
Viktor Szakats
c2d7bfa992
http2: dedupe nghttp2 verbose frame print function
Closes #20472
2026-01-29 19:22:00 +01:00
Viktor Szakats
0f5006f50d
md4, md5: replace custom types with uint32_t
Closes #20469
2026-01-29 15:01:16 +01:00
Viktor Szakats
ea044c5e65
setup-os400.h: drop no longer used custom type u_int32_t
Unused since bb55293313.

Closes #20470
2026-01-29 14:58:03 +01:00
Viktor Szakats
f95c79a988
send: drop CURL_UNCONST() from buffer argument on most platforms
Keep it on platforms requiring a non-const buffer. These are AmigaOS and
OS400.

Also:
- replace `SEND_QUAL_ARG2` with boolean macro `SEND_NONCONST_ARG2`.

Closes #20463
2026-01-29 03:42:09 +01:00
Viktor Szakats
d60f1006b0
GHA/macos: merge an autotools job into a cmake one, drop an iOS job
Merging the two macOS jobs saves 4-5 minutes. The dropped iOS Ninja job
saves 0.5-1 minute. (Keep the two slow iOS jobs to maintain variation.)

Number of Apple jobs is 32 after this patch.

Also:
- skip building tests and example in iOS autotools to save 30-40s.

Closes #20467
2026-01-29 03:10:21 +01:00
Dan Fandrich
3509a41494 docs: document the need for a 64-bit type and stdint.h
These are requirements above and above C89.

Ref: #20406

Closes #20384
2026-01-28 08:45:56 -08:00
Viktor Szakats
3ae234b2a3
GHA/windows: mark test 3001 flaky in native Windows jobs
It has been happening for a long time.

Example:
```
test 3001...[HTTPS localhost, last subject alt name matches, CN does not match]

 3001: protocol FAILED!
 There was no content at all in the file log/7/server.input.
 Server glitch? Total curl failure? Returned: 56
== Contents of files in the log/7/ directory after test 3001
=== Start of file commands.log
 ../src/curl.exe -q --output log/7/curl3001.out  --include --trace-ascii log/7/trace3001 --trace-time -4 --cacert ./certs/test-ca.crt https://localhost:64259/3001 > log/7/stdout3001 2> log/7/stderr3001
=== End of file commands.log
=== Start of file http_server.log
 13:57:47.951283 Running HTTP IPv4 version on port 64256
=== End of file http_server.log
=== Start of file https_stunnel.log
 2026.01.28 13:57:48 LOG5[ui]: stunnel 5.76 on x64-pc-mingw32-gnu platform
 2026.01.28 13:57:48 LOG5[ui]: Compiled/running with OpenSSL 3.5.4 30 Sep 2025
 [...]
 2026.01.28 13:57:49 LOG5[0]: Service [curltest] accepted connection from 127.0.0.1:64281
 2026.01.28 13:57:51 LOG3[0]: s_connect: connect 127.0.0.1:64256: Connection refused (WSAECONNREFUSED) (10061)
 2026.01.28 13:57:51 LOG3[0]: No more addresses to connect
 2026.01.28 13:57:51 LOG5[0]: Connection reset: 0 byte(s) sent to TLS, 0 byte(s) sent to socket
=== End of file https_stunnel.log
=== Start of file server.cmd
 Testnum 3001
=== End of file server.cmd
=== Start of file stderr3001
 curl: (56) Recv failure: Connection was reset
=== End of file stderr3001
[...]
RUN: Unknown server on our https port: 64259 (56)
```

Ref: https://github.com/curl/curl/actions/runs/21440845836/job/61743268798?pr=20461

Closes #20462
2026-01-28 15:47:36 +01:00
Viktor Szakats
41880875ad
tests/server: drop stray casts from swrite/sread arguments
Closes #20461
2026-01-28 15:09:52 +01:00
Viktor Szakats
2e5cc08d25
tests/server: replace 4 remaining send() calls with swrite()
They were masked by `()`, which was also not necessary anymore.

Follow-up to 483f4291fb #20459
Follow-up to a585cc35e5 #20097
Follow-up to bf7375ecc5 #18503

Closes #20460
2026-01-28 15:09:51 +01:00
Viktor Szakats
483f4291fb
build: replace send/recv with swrite/sread where missing
Also:
- checksrc: ban `send` and `recv`, as documented in `CODE_STYLE.md`.

Follow-up to 9a2663322c #17572
Ref: a585cc35e5 #20097
Ref: #20441

Closes #20459
2026-01-28 14:39:22 +01:00
Viktor Szakats
feb52be197
build: assume stdint.h
curl requires `stdint.h` from C99, and no longer builds without it since
v8.18.0 (after dropping VS2008 support). Assume it's available, drop
feature checks.

Also:
- drop duplicate `stdint.h` includes.
- introduce internal `HAVE_UINTPTR_T`, enabled by default.
- OS400: disable `HAVE_UINTPTR_T`.
- build: keep cmake pre-fill and `cmp-config.pl` exception because cmake
  and autotools both detect `stdint.h` implicitly.

Co-authored-by: Dan Fandrich
Ref: #20405
Ref: #20384
Follow-up to 2e1a045d89 #17931

Closes #20406
2026-01-28 12:05:20 +01:00
Stefan Eissing
f062b4b903
pytest: remove 03_02
The test for restarting the server during ongoing transfers does not
work reliably for HTTP/3. This seems due to the nature of UDP/QUIC where
the client may learn about a closed connection at any time, not only
when starting a new request.

Remove the test.

Closes #20458
2026-01-28 11:39:02 +01:00
Christian Schmitz
e788d9d2c7
imap: fix custom listing
Add test 1847 and 1848.

Fixes #20356
Closes #20360
2026-01-28 11:37:26 +01:00
Stefan Eissing
cf4164fa8d
vquic: handle SOCKEMSGSIZE correctly
Report UDP packets with SOCKEMSGSIZE as being "sent" to progress
the send buffer properly on PMTUD probes.

Reported-by: Daniil Gentili
Fixes #20440
Closes #20448
2026-01-28 11:23:10 +01:00
Itay Bookstein
05367694ec
cf-socket: use SOCK_CLOEXEC in socket_open when available
To close the possible race between socket() and fcntl(), we use
SOCK_CLOEXEC instead of fcntl() when it is available.

Closes #20442
2026-01-28 09:41:48 +01:00
Stefan Eissing
0f042efcb1
h2+h3: align stream close handling
For HTTP/2, add error code description to close failures.

For HTTP/3, add special handling like in HTTP/2 when streams
have been rejected or an error comes during the response body
and we are not interested in the body.

Closes #20207
2026-01-28 09:39:30 +01:00
renovate[bot]
3b1c2a1510
GHA: update openssl/openssl to v3.6.1
Closes #20449
2026-01-28 08:08:07 +01:00
Viktor Szakats
2f7d37f54a
windows: USE_WINSOCK to guard winsock2 code (where missing)
Replacing `_WIN32`.

Also:
- tool_doswin: guard possibly non-portable socket code with
  `USE_WINSOCK`. The socket is cast to `HANDLE` and passed to
  win32 API `SetStdHandle(STD_INPUT_HANDLE, ...)`.
- lib/setup-win32.h: move `#undef`s before their `#define` pair.

Closes #20455
2026-01-28 03:27:20 +01:00
Viktor Szakats
a4e2232c43
tool_doswin: avoid Windowsisms in socket code (cont.)
For general readability. Also to match the rest of the source code.

- bump `send()` result type from `int` to `ssize_t`.
- fix an `int` to be `curl_socklen_t`.
- `.S_un.S_addr` -> `.s_addr`.
- `SD_RECEIVE` -> `SHUT_RD`.
- `SD_SEND` -> `SHUT_WR`.

Follow-up to a81ab3e6db #20452
Follow-up to 9a2663322c #17572

Closes #20457
2026-01-28 03:26:45 +01:00
Viktor Szakats
fb44e44d92
GHA/windows: fix shell, fix GHA fail to share cache between arm and intel Windows
A cache entry created by windows-2022 is not picked up by
windows-11-arm. Also a cache created by windows-11-arm is not picked up
by windows-2022. Possibly related to this filed in 2025 June:
https://github.com/actions/cache/issues/1622. Also tried
`enableCrossOsArchive` to no avail. Unclear if these two runners count
as distinct operating systems, I'd guess not. Cache entries are
identical on the web UI. Via GH API they show up with the same cache key
bot different "version" (hash) and different sizes, possibly due to the
zstd vs. gzip bug above.

Fixing (identical error text on either runner):
```
Error: Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: Windows-stunnel-5.76-amd64
```

Also fix a silly typo in the shell value.

Follow-up to 0f54ca6150 #20454
Closes #20456
2026-01-28 02:33:57 +01:00
Daniel Stenberg
1b50dcc2ab
tls: remove checks for DEFAULT
Since 9d8998c994, the setopt code changes input DEFAULT to an
actual more specific TLS version (1.2) for the backends to use and check
for.

This means that the default value (0L) cannot and should not actually be
used when the TLS backends run. This change adds asserts to verify that
and removes code that accepts the DEFAULT value as a valid version with
the TLS version functions' logic.

Applications can still set a specific lower version if they want (1, 1.0
or 1.1).

Closes #20453
2026-01-27 23:42:09 +01:00
Stefan Eissing
ae99d750dd
TODO: remove item about signals
With SIGPIPE handling now automatic on most platforms, remove the
TODO item again.

Closes #20447
2026-01-27 23:36:31 +01:00
Viktor Szakats
0f54ca6150
GHA/windows: cache stunnel
To avoid hammering `stunnel.org`.

Follow-up to 7c3a4a4b4c #20410

Closes #20454
2026-01-27 19:58:48 +01:00
Viktor Szakats
a81ab3e6db
tool_doswin: avoid Windowsisms in socket code
For general readability. Also to match the rest of the source code.

- `SOCKADDR` -> `struct sockaddr`
- `SOCKADDR_IN` -> `struct sockaddr_in`
- `== SOCKET_ERROR` -> `== -1` or silent `!= 0`

Follow-up to 9a2663322c #17572

Closes #20452
2026-01-27 19:58:48 +01:00
Viktor Szakats
67ad0b0d79
cmake: initialize internal CURL_INCLUDES variable
Closes #20451
2026-01-27 15:24:29 +01:00
Viktor Szakats
f824b4d004
INSTALL-CMAKE.md: document new static options as experimental
Follow-up to 26c39d8df1 #20015

Closes #20450
2026-01-27 15:24:28 +01:00
Viktor Szakats
a42fdc1f60
cmake/FindGSS: add backtick missing from comment
Follow-up to 16f073ef49 #16973
2026-01-27 15:08:33 +01:00
Stefan Eissing
065b149df0
OpenSSL: check reuse of sessions for verify status
OpenSSL records its peer verification status inside its SSL_SESSION
objects. When a session is later reused, the SSL connection inherits
this verify status.

Session keys prevent reuse of sessions between connections that verify
the peer and those who do not. However, when Apple SecTrust is used
to verify a connection, this does not update the Sessions verify
status (and there is no setter). On session reuse, OpenSSL fails
the verification and Apple SecTrust cannot verify either since the
certificate peer chain is not available.

Fix this by checking the verification status on session reuse and
remove the session again if the peer needs to be verified, but the
session is not.

Reported-by: Christian Schmitza
Fixes #20435
Closes #20446
2026-01-27 14:03:47 +01:00
Billy O'Neal
af508e3641
curl_multi_perform.md: resolve inconsistency
... between curl_multi_perform and curl_multi_wait/poll documentation

The `curl_multi_perform` documentation uses integer contextual
conversion to `bool` to test the resulting `CURLMcode`, while other
functions like `curl_multi_wait` and `curl_multi_poll` test against
`CURLM_OK`. (I was initially confused by this as it looked like some
docs call curl_multi_wait/poll on error, while some called only on
success. But that was my misread, not a docs problem.)

Also fixed the example to print which function call failed; previously
an error reported by `curl_multi_perform` was printed as a failure of
`curl_multi_wait`.

Closes #20444
2026-01-27 09:07:18 +01:00
Dan Fandrich
08b31b1c8b docs: add LibreELEC to DISTROS.md 2026-01-26 12:12:05 -08:00
Viktor Szakats
33f606cd51
checksrc-all.pl: skip non-repository files
To avoid noise due to local C files when using automatic local checksrc
checks (e.g. via CMake `-DCURL_LINT=ON` option, or `curl-lint` target).

Also replace single-quote with double-quote in external git command, for
portability.

Follow-up to 88ff396549 #17882
Follow-up to e785e898a6 #17376

Closes #20439
2026-01-26 16:07:58 +01:00
Arnav-Purushotam-CUBoulder
9b20a672b8
include: mask computed auth/proto bitmasks to 32 bits
GCC 15.2 warns when assigning computed "all" bitmask macros to 32-bit
flag types because negated masks expand to the full width of unsigned
long/long on 64-bit platforms.

Mask these macros to a 32-bit domain so they do not set high bits and
avoid -Woverflow/-Wconversion warnings in callers.

Reported-by: Patrick Monnerat
Fixes #20242
Closes #20416
2026-01-26 13:48:05 +01:00
Viktor Szakats
2f8c9812b1
tool: rename curl handle and result variable in --libcurl-generated code
To match documentation, examples and curl source code:
- `hnd` -> `curl`
- `ret` -> `result`

Closes #20437
2026-01-26 13:21:46 +01:00
Daniel Stenberg
fa6a46473e
tool_cb_hdr: with -J, use the redirect name as a backup
The -J / --remote-header-name logic now records the file name part used
in the redirects so that it can use the last one as a name if no
Content-Disposition header arrives.

Add tests to verify:

1641: -J with a redirect and extract the CD contents in the second
response

1642: -J with a redirect but no Content-Disposition, use the name from
the Location: header

1643: -J with two redirects, using the last file name and also use
queries and fragments to verify them stripped off

Closes #20430
2026-01-26 12:53:03 +01:00
Daniel Stenberg
146de2460a
RELEASE-NOTES: synced 2026-01-26 12:47:02 +01:00
Daniel Stenberg
04c060b004
RELEASE-PROCEDURE.md: update future release dates 2026-01-26 12:28:25 +01:00
Viktor Szakats
63d75de95d
GHA: sync up configure option order across builds
Closes #20423
2026-01-26 12:08:47 +01:00
Daniel Stenberg
ca7ef4b817
BUG-BOUNTY.md: we stop the bug-bounty end of Jan 2026
Remove mentions of the bounty and hackerone.

Closes #20312
2026-01-26 08:26:28 +01:00
Viktor Szakats
2da1bbca96
tests: rename more CURLcode variables to result
For consistency.

Also:
- one remaining in `src/tool_writeout.c`.
- replace casting an `int` to `CURLcode`.
- lib758: rename `CURLMcode` `result` to `mresult`.
- move literals to the right side of if expressions.

Follow-up to d0dc6e2ec0 #20426
Follow-up to 56f600ec23

Closes #20432
2026-01-26 05:46:48 +01:00
Viktor Szakats
26c39d8df1
cmke: add *_USE_STATIC_LIBS options for 9 dependencies
Via options:

- `BROTLI_USE_STATIC_LIBS`
- `CARES_USE_STATIC_LIBS`
- `LIBSSH_USE_STATIC_LIBS`
- `LIBSSH2_USE_STATIC_LIBS`
- `MBEDTLS_USE_STATIC_LIBS`
- `NGHTTP2_USE_STATIC_LIBS`
- `NGHTTP3_USE_STATIC_LIBS`
- `NGTCP2_USE_STATIC_LIBS`
- `ZSTD_USE_STATIC_LIBS`

When enabled, make a "best effort" finding static libs first and set
the "build static" macro (on Windows) as required by the dependency.

When doing `pkg-config`-based detections, make curl select the static
configuration, which shall set the "build static" macro also.

These options resemble CMake's `OPENSSL_USE_STATIC_LIBS` and
`ZLIB_USE_STATIC_LIBS` (the latter does not support `pkg-config` as of
CMake v4.2.2).

Shared/static library selection based on loose filename conventions is
fragile and prone to break if the non-static-suffixed library is found
and happens to be a shared library, or, if the linker decides to pick up
a shared copy (e.g. `.a.dll`) that shadows the static one. It may help
to provide either static or shared, but not both, on the disk, and match
that with this setting.

Experimental.

Ref: #20013
Closes #20015
2026-01-26 05:21:24 +01:00
Viktor Szakats
3aa4fbf2d4
cmake: add CURL_BUILD_EVERYTHING option
To build all targets in a single go, meaning curl and libcurl as normal,
and tests and examples in addition. To build-test everything without
running multiple cmake commands.

Enable with:
- `-DCURL_BUILD_EVERYTHING=ON`
  Special values: `QUICK` to build examples quickly for build test,
  `NOEXAMPLES` to not build examples.

A well-equipped build takes 2.8s of configure time, and 1.7s to build
everything (shared, unity, ninja, prefill), 1.4s with `QUICK`. Without
this option it takes <1s to build curl/libcurl.

Also: streamline `CURL_LINT` internal logic.

Closes #20429
2026-01-26 02:08:02 +01:00
Viktor Szakats
795433b923
cmake: enable binutils ld workaround for all toolchains at build-time
To make it available for GCC if used when consuming libcurl.

Also add comment to `curl-config.cmake` explaining why these odd targets
are defined there.

Bug: https://github.com/curl/curl/pull/20382#discussion_r2716660108
Follow-up to 3e841630ec #20427
Follow-up to ef3101d181 #20382
Follow-up to 16f073ef49 #16973

Closes #20434
2026-01-25 22:37:56 +01:00
Viktor Szakats
3e841630ec
cmake: fix logic for openssl/zlib binutils ld workaround
While working #16973, the binutils ld lib order workaround logic
regressed so that it modified the wrong target, writing into the system
`ZLIB::ZLIB` and `OpenSSL::Crypto` ones a `INTERFACE_LINK_LIBRARIES`
property, instead of creating CURL-namespaced targets. Oddly enough,
this also fixed the binutils ld lib ordering issue. It seems this
property makes CMake insert each referenced library in two more
positions (not at the very end though), which allows ld to resolve all
symbols in the cases tested in CI.

Fix by creating the indented namespaced targets, and also creating
these in `curl-config.cmake` to be available when consuming libcurl.

Note that the logic continues doing `get_target_property()` on the two
system targets above. If these targets are defined manually and miss
the `LOCATION` propery, or are defined as aliases, this command may
fail. curl expects these targets be created by CMake's `FindZLIB` and
`FindOpenSSL` built-in Find modules (or ones compatible). Ref: #20419

The binutils ld issue is reproduced by these CI jobs:
 - Linux gcc glibc (amd64, arm64)
- Windows gcc zlib-classic (x64)

Currently using this curl-for-win revision:
7d12669daf
Examples:
https://github.com/curl/curl/actions/runs/21332437230/job/61399234023?pr=20427
https://github.com/curl/curl/actions/runs/21332437230/job/61399234033?pr=20427

Comparison of lib orders, as passed by CMake to the linker:

without workaround (possibly breaking binutils `ld`):
```diff
 -framework [...]
 libssl.dylib
 libcrypto.dylib
 libz.tbd
 -lssh2 -lidn2
 libldap.tbd
 liblber.tbd
 -lbrotlidec -lbrotlicommon -lzstd -lnghttp2 -lpsl -lrtmp
 -lz
 -lssl
 -lcrypto
```

before this patch:
```diff
 -framework [...]
 libssl.dylib
 libcrypto.dylib
 libz.tbd
+libcrypto.dylib <== inserted via `INTERFACE_LINK_LIBRARIES`
+libz.tbd        <== inserted via `INTERFACE_LINK_LIBRARIES`
 -lssh2 -lidn2
 libldap.tbd
 liblber.tbd
+libcrypto.dylib <== inserted via `INTERFACE_LINK_LIBRARIES`
+ibz.tbd         <== inserted via `INTERFACE_LINK_LIBRARIES`
 -lbrotlidec -lbrotlicommon -lzstd -lnghttp2 -lpsl -lrtmp
 -lz
 -lssl
 -lcrypto
```

after this patch:
```diff
 -framework [...]
 libssl.dylib
 libcrypto.dylib
 libz.tbd
 -lssh2 -lidn2
 libldap.tbd
 liblber.tbd
 -lbrotlidec -lbrotlicommon -lzstd -lnghttp2 -lpsl -lrtmp
 -lz
 -lssl
 -lcrypto
+libcrypto.dylib <== inserted via `CURL::OpenSSL_Crypto`
+libz.tbd        <== inserted via `CURL::ZLIB`
```

Bug: https://github.com/curl/curl/pull/20382#discussion_r2716660108
Reverts: 615c43eae8
Follow-up to 16f073ef49 #16973

Closes #20427
2026-01-25 20:49:04 +01:00
Viktor Szakats
4516023152
GHA: switch 3 more small jobs to ubuntu-slim
Follow-up to 30c49db6f7 #20431

Closes #20433
2026-01-25 19:29:24 +01:00
Viktor Szakats
30c49db6f7
GHA: use ubuntu-slim image in 3 jobs
For small jobs using no parallelism, and which still use x64 for faster
`apt install`. x64 1-core (vs. 4), 5GB RAM (vs. 16), no Linuxbrew,
no arm64.

Refs:
https://docs.github.com/en/actions/reference/runners/github-hosted-runners
https://github.blog/changelog/2026-01-22-1-vcpu-linux-runner-now-generally-available-in-github-actions/
285cf722f0/images/ubuntu-slim/ubuntu-slim-Readme.md

Closes #20431
2026-01-25 18:54:12 +01:00
Daniel Stenberg
d0dc6e2ec0
tool: return code variable consistency
- ParameterError variables are named 'err'
- CURLcode variables are named 'result'

For naming consistency across functions

Closes #20426
2026-01-25 15:58:56 +01:00
Viktor Szakats
4e5908306a
build: constify memchr()/strchr()/etc result variables (cont.)
Assisted-by: Rudi Heitbaum
Fixes #20420
Follow-up to 7dc60bdb90 #20425
Follow-up to 0e2507a3c6 #20421

Closes #20428
2026-01-25 14:20:37 +01:00
Viktor Szakats
6974bd7cc8
curlx: dedupe basename copies into curlx_basename()
Also stop redefining system `basename()` symbol. Call `curlx_basename()`
instead, and map that to `basename()` if available.

Closes #20424
2026-01-25 12:21:54 +01:00
Viktor Szakats
0e2507a3c6
build: constify memchr()/strchr()/etc result variables
And a few variables around.

There remain cases where the accepted pointer is const, yet the returned
pointer is written to.

Partly addressing (glibc 2.43):
```
* For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
  strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return
  pointers into their input arrays now have definitions as macros that
  return a pointer to a const-qualified type when the input argument is
  a pointer to a const-qualified type.
```
Ref: https://lists.gnu.org/archive/html/info-gnu/2026-01/msg00005.html

Reported-by: Rudi Heitbaum
Ref: #20420

Closes #20421
2026-01-25 12:21:54 +01:00
Daniel Stenberg
7dc60bdb90
noproxy: simplify, don't mix const non-const in strchr()
Ref: #20420
Closes #20425
2026-01-25 11:02:24 +01:00
Viktor Szakats
6f7ce1e45f
GHA: set --enable-option-checking=fatal where missing
Closes #20422
2026-01-25 04:54:16 +01:00
Dan Fandrich
c585282a1c docs: Update CodeSonar link 2026-01-24 13:24:37 -08:00
Viktor Szakats
64728418ff
GHA/codeql: improve perf on Windows, enable CURL_WERROR=ON, and more
- set `CURL_DROP_UNUSED=ON` for Windows (MSVC) to make the analysis step
  faster: 1m30s -> 1m15s

- enable `CURL_WERROR=ON` in all builds, to catch potential build issues
  in addition to running CodeQL. To make these builds useful as regular
  build tests too.

- add links to CodeQL Actions documentation.

- delete test data C files after checkout in an attempt to remove them
  from CodeQL code coverage stats.

Closes #20418
2026-01-24 13:10:26 +01:00
Viktor Szakats
3150ac7000
build: fix unused variables/values/code in non-verbose builds
Seen in GHA/codeql builds.

One of them also affected wolfSSL < 3.9.10 builds.

61093e2a81 #20353
Cherry-picked from #20404
Closes #20417
2026-01-24 02:12:54 +01:00
Michał Antoniak
55ea2b424d setopt: fix checking range for CURLOPT_MAXCONNECTS
- Use upper limit INT_MAX instead of UINT_MAX.

UINT_MAX doesn't work as the max value for the variable since it is
passed as a long and becomes -1 on platforms that have same sized
int and long, like Windows.

Closes https://github.com/curl/curl/pull/20414
2026-01-23 16:30:09 -05:00
Viktor Szakats
7c3a4a4b4c
GHA/windows: install stunnel manually, enable for Cygwin
Replace Chocolatey install with direct download and unpack. To reduce
CI dependencies (Chocolatey, NuGet), improve install performance
(10s -> 1s) and hopefully reliability. Last but not least to enable it
for the Cygwin CI job.

Caveats:
- Need to bump stunnel versions manually (2-3 times a year).
  Renovate could likely do it, but I failed to understand its
  documentation and miss tooling/interface to make tests.
- FIPS not enabled. (can be done if necessary)
- Possibly losing checksum verification (not sure if Chocolatey did it
  automatically for this package.)

Also:
- Increase minimum tests by 100 for the Cygwin job.

Ref: #16819 (earlier attempt)
Ref: https://www.stunnel.org/archive/
Ref: https://www.githubstatus.com/incidents/cqb5hcy0gx18
Follow-up to d176f58a20 #20413
Follow-up to 19b1e44660 #20409

Closes #20410
2026-01-23 17:38:06 +01:00
Viktor Szakats
d176f58a20
runtests: pass config filename to stunnel in native format (Windows)
Fixing (Seen when enabling stunnel for Cygwin in CI):
```
=== Start of file https_stunnel.log
 [ ] Initializing inetd mode configuration
 [ ] Running on Windows 6.2
[...]
 [.] Reading configuration from file /cygdrive/d/a/curl/curl/bld/tests/log/6/server/https_stunnel.conf
 [!] Cannot open configuration file
```
Ref: https://github.com/curl/curl/actions/runs/21289677523/job/61279662459?pr=20410

Cherry-picked from #20410
Closes #20413
2026-01-23 16:51:47 +01:00
Viktor Szakats
bd1cd21caa
renovate: merge two custom regex rules, escape dots
There are no longer envs ending with `_VER` in Circle CI config.

Follow-up to 17a669426f #17537

Closes #20412
2026-01-23 15:58:16 +01:00
Daniel Stenberg
c04ce3af0e
verbose.md: explain the { and } prefixes
The prefixes are now made as subtitles

Reported-by: Thibault de Villèle
Fixes #20386
Closes #20396
2026-01-23 14:34:44 +01:00
Viktor Szakats
55fc4e0dbb
cmake: sync two unix pre-fill comments with win32 [ci skip]
Cherry-picked from #20406
2026-01-23 13:16:19 +01:00
Viktor Szakats
19b1e44660
GHA/windows: fail CI early on stunnel install failure
Before this patch CI silently ignored stunnel install failures. This
pushed the failure to the test run step due to not meeting the minimum
number of tests.

Make the root cause obvious by failing early in this case.

Reported-by: Stefan Eissing
Follow-up to 3f1cd809ee #19942
Ref: https://github.com/curl/curl/actions/runs/21245626382/job/61134101176?pr=20397
Ref: #16819

Closes #20409
2026-01-23 12:44:43 +01:00
Viktor Szakats
9bcdfb3809
GHA/distcheck: bump old cmake, switch to arm64 for performance
Bump CMake version in CMake integration tests for better performance
(8x on macOS, 2-3x on Windows) and native arm64 binaries.

- bump old CMake in integration tests to v3.19.8 (was: v3.11.4)
- switch to native arm64 CMake binaries on macOS.
- switch Linux CMake integration job to arm64.

Speed gains:
- Linux: 2m -> 1m30s
- macOS: 9-10m -> 1m15s
- Windows: 6-7m -> 2m43s

Before:
https://github.com/curl/curl/actions/runs/21255697172
https://github.com/curl/curl/actions/runs/21255020621

After:
https://github.com/curl/curl/actions/runs/21272021446

With this, CI is:
- no longer testing deprecated CMake versions.
  Follow-up to a7c974e038 #19902
- not testing the next (from 2026 April) minimum 3.18, but going for
  3.19 instead. For arm64 binaries on both macOS and Linux. There is
  no 3.18-specific CMake code in curl.

Cherry-picked from #20407
Closes #20408
2026-01-23 12:39:43 +01:00
Viktor Szakats
86190dccb3
GHA: migrate 3 linter jobs to arm64
Also to make them finish as fast or overall faster.

checkdocs/proselint:
before: https://github.com/curl/curl/actions/runs/21255607528/job/61169136666 22s
after: https://github.com/curl/curl/actions/runs/21266680535/job/61207470652?pr=20403 19s

checksrc/spellcheck, linters, REUSE:
before: https://github.com/curl/curl/actions/runs/21255607522/job/61169137076 3m11s
after: https://github.com/curl/curl/actions/runs/21266680282/job/61207475282?pr=20403 2m27s
typos: 13s -> 28s
pytype: 2m24s -> 1m24s

checksrc/misc checks:
before: https://github.com/curl/curl/actions/runs/21255607522/job/61169137176 2m29s
after: https://github.com/curl/curl/actions/runs/21266680282/job/61207475248?pr=20403 2m5s
shellcheck: seems larger and slower on arm64. 33 -> 45MB, 1s -> 3s
badwords: 2m1s -> 1m35s

Closes #20403
2026-01-22 23:44:47 +01:00
Viktor Szakats
b81341e8f5
tidy-up: Markdown, clang-format nits
- drop leading indent from Markdown.
- switch to Markdown section markers where missing.
- move `&&` and `||` to the end of the line (C, Perl).
- openssl: add parenthesis to an if sub-expression.
- misc clang-format nits.
- unfold Markdown links.
- SSL-PROBLEMS.md: drop stray half code-fence.

Closes #20402
2026-01-22 23:44:47 +01:00
Viktor Szakats
9e9adfddbf
GHA/linux: rename intel to intelc to avoid mixup with <pkg>-intel
To avoid unnecessarily installing Intel C for any `<pkg>-intel` locally
built dependency.

Follow-up to ab8ccaed24 #20392
Follow-up to d9fe60d457 #20248

Closes #20400
2026-01-22 18:42:46 +01:00
Viktor Szakats
ab8ccaed24
GHA/linux: move mbedTLS and wolfSSL valgrind jobs to arm64
For significantly better performance.

AM wolfssl-opensslextra valgrind 1:  6m53s -> 4m15s
AM wolfssl-opensslextra valgrind 2:  6m47s -> 4m25s
CM mbedtls gss valgrind 1:           8m33s -> 4m31s
CM mbedtls gss valgrind 2:           8m39s -> 4m34s
('after' times corrected for 'install prereq' differences)

before: https://github.com/curl/curl/actions/runs/21255607562
after: https://github.com/curl/curl/actions/runs/21257368016

Also tried rustls, but that'd require linux arm64 release binaries at:
https://github.com/rustls/rustls-ffi/releases

Closes #20392
2026-01-22 18:27:51 +01:00
Stefan Eissing
2a6ae3684e
socketpair: set SO_NOSIGPIPE where possible
Set SO_NOSIGPIPE on socketpair/inet-simulated socketpair
implementations. eventfd and pipe() do not need/want it.

Closes #20397
2026-01-22 17:18:16 +01:00
Kai Pastor
ef3101d181
cmake: always define CURL::win32_winsock on Windows in curl-config.cmake
The CMake config can be consumed by project which enable only language
`CXX`. `CMAKE_C_COMPILER_ID` isn't defined in this case, and the target
definition would be missing. But the check for compiler id isn't really
needed: The target is namespaced and valid, regardless of actual
compiler.

Noticed in https://github.com/microsoft/vcpkg/issues/49518, building cpr.

Follow-up to 16f073ef49 #16973

Closes #20382
2026-01-22 17:10:48 +01:00
Viktor Szakats
66ad54e46b
cmake: add CURL_DROP_UNUSED option to reduce binary sizes
To enable known linker options dropping unused, dead, code and data from
the executables built.

Useful to reduce binary sizes for curl, libcurl shared lib and apps
linking static libcurl. It's effective on both "unity" and non-unity
builds. Aligning "unity" build sizes with default, non-unity ones.

Supported platforms: Apple, MSVC, llvm/clang and GCC on all tested
platforms: Linux, BSDs, Windows, MSYS2/Cygwin, Android, MS-DOS.

Notes:
- Static libraries grow 20-30% with non-Apple toolchains.
  This effect is controlled by separate, optional compiler flags on
  non-Apple. This patch enables them automatically for public binaries
  (libcurl and curl tool), and leaves them off for internal/test ones.
- MSVC enables this option by default for 'Release' configurations.
  The curl build option has no effect on it.
- Observed effect on VS2010 is negligible. VS2012+ is recommended.
- Works with LTO, Fil-C.
- No observed/conclusive effect on build speed.
- On Windows with clang/gcc (mingw-w64/MSYS2/Cygwin) it also enables
  `-fno-asynchronous-unwind-tables` as a workaround to make
  the toolchain options actually work.
  Ref: https://sourceware.org/bugzilla/show_bug.cgi?id=11539
  Thanks-to: Andarwinux

Also:
- GHA: enable in Linux and MinGW jobs to test it. Size changes:

  - linux aws-lc H3:
    curl: 2000000 -> 1937152, libcurl.a: 2065724 -> 2716532 bytes
  - macos clang HTTP-only:
    curl: 1364376 -> 128799 bytes, libcurl.a: unchanged
  - macos llvm MultiSSL:
    curl: 410056 -> 405720, libcurl.dylib: 1350336 -> 1348480 bytes
  - mingw schannel c-ares U:
    curl: 1588736 -> 1507328, libcurl-d.a: 3322040 -> 3884746 bytes
    bld: 34 -> 35MB

- GHA: enable in MSVC and Apple jobs to reduce disk footprint, with no
  obvious downside. Size changes:

  - AppVeyor CI VS2019:
    curl: 2339840 -> 1295872, libcurl-d.dll: 3155968 -> 1900544 bytes
    bld: 161 -> 97MB
  - AppVeyor CI VS2022 clang-cl:
    curl: 2933248 -> 2332160, libcurl-d.lib: 4762688 -> 5511330 bytes
    bld: 133 -> 121MB
  - AppVeyor CI VS2022 HTTP-only:
    curl: 3514368 -> 2177024, libcurl-d.lib: 2538420 -> 3151740 bytes
    bld: 137 -> 83MB
  - GHA intel:
    curl: 2629120 -> 2023424, libcurl-d.lib: 4366652 -> 5350670 bytes
    bld: 86 -> 69MB
  - GHA arm64:
    curl: 2832896 -> 2063872, libcurl-d.lib: 4690616 -> 5597250 bytes
    bld: 82 -> 66MB

Refs:
https://maskray.me/blog/2021-02-28-linker-garbage-collection
https://web.archive.org/web/20110811230637/msdn.microsoft.com/en-us/library/bxwfs976.aspx (VS2010)
https://learn.microsoft.com/cpp/build/reference/opt-optimizations
https://learn.microsoft.com/cpp/build/reference/gy-enable-function-level-linking

Closes #20357
2026-01-22 17:08:20 +01:00
Jacek Migacz
aacbe4d9bf
tool: enable header separation for HTTPS proxies
When using a proxy, --header specified headers were leaking into CONNECT
requests. This could break corporate proxies that reject custom
User-Agent headers in CONNECT.

Enable CURLHEADER_SEPARATE only for HTTPS through proxy or when
--proxytunnel is used, ensuring:

- --header affects only HTTP requests (not CONNECT)
- --proxy-header affects only CONNECT requests
- --user-agent affects both consistently

Fixes the redirect + proxy + custom UA issue while maintaining
compatibility with HTTP proxy scenarios.

Closes #20398
2026-01-22 16:51:34 +01:00
Daniel Stenberg
d89bc6b219
asyn-ares: abort with OOM error when Curl_dnscache_mk_entry fails
Closes #20385
2026-01-21 23:32:18 +01:00
Viktor Szakats
dfef594213
build: opt-in MSVC to C99-style verbose logging logic
MSVC does not advertise itself as C99 via `__STDC_VERSION__`, but
supports variadic macros in all curl-supported versions. Fix by
explicitly enabling C99 verbose string logic for MSVC.

With verbose logging enabled (default), this makes logging perform
better, on par with clang/gcc (and other C99) builds. (With the cost
of extra binary size.) With verbose logging disabled, it excludes all
verbose logging related strings and code from the binary. Before this
patch, MSVC used the C89 fallback code in both configs, which used
a fixed function call, with the called function deciding to actually
log or not, while also retaining the verbose log string in both configs.

Size comparison (bytes), schannel, static, debug, VS2022, local build:
curl-before-verbose.exe    4,024,832
curl-before-noverbose.exe  4,013,056
curl-after-verbose.exe     4,117,504
curl-after-noverbose.exe   3,928,064

In CI with non-verbose:
Before:
```
3274240 bytes: ./_bld/lib/Debug/libcurl-d.dll
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/53408629/job/htj7ps88q83ew9ww#L224

After:
```
3155968 bytes: ./_bld/lib/Debug/libcurl-d.dll
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/53408771/job/tp9epgjpef098vsr#L224

Idea-by: Arnav Purushotam
Ref: #20367
Ref: #20341
Follow-up to 61093e2a81 #20353

Closes #20387
2026-01-21 21:01:46 +01:00
Viktor Szakats
41198e09b6
appveyor: simplify job configuration
Replace interim knobs with cmake options.

Also:
- use CMake env `CMAKE_GENERATOR` to select the generator.
  (with workaround to make it work with CMake <3.15.)
- deduct some configuration from the job name.
- drop unused test runner logic.
- drop obsolete `BUILD_OPT` use.
- tidy-up job names and sync them with GHA ones.
- add newline between job configurations for readability.

Closes #20390
2026-01-21 19:34:12 +01:00
Viktor Szakats
f24be5b36e
dynhds: drop duplicate includes
Already included via `dynhds.h`.

Closes #20389
2026-01-21 18:10:08 +01:00
Viktor Szakats
9996cab546
GHA: strip Windows/MS-DOS/Android binaries to see their real size
Unstripped size hides effective binary sizes due to the added debug
information. E.g. `--gc-sections` may inflate unstripped binaries, while
their unstripped size decreases. To see if binary size optimization
options work, it's more useful to observe unstripped size.

Ref: #20357
Follow-up to 4cf43508e8 #20355

Closes #20359
2026-01-21 16:05:17 +01:00
Viktor Szakats
59e3b693f7
windows: test non-verbose builds, fix fallouts
- schannel: fix mixed-up declaration. (originally fenced infof for
  verbose, then changed to failf with the fence kept, then fence
  removed and variable marked as verbose, when in fact it's not, but
  not tested and caught in CI.
- fix two other fallouts.
- GHA/windows: disable verbose strings in a mingw job.
- appveyor: disable verbose strings in an MSVC job.
- appveyor: add way to pass any CMake option per-job.

Cherry-picked from #20387
Follow-up to 61093e2a81 #20353

Closes #20388
2026-01-21 15:25:40 +01:00
Viktor Szakats
61093e2a81
build: fully omit verbose strings and code when disabled
When the compiler supports C99.

- map logging functions to macro stubs when verbose logging is disabled
  and the compiler is C99. Make sure these stubs silence unused variable
  warnings for non-variadic arguments.
  Before this patch they mapped to function stubs, the same codepath
  used for C89 compiler in this configuration.

- introduce new macros to tell the compiler which code to include
  when verbose code is active, or inactive:

  - `CURLVERBOSE`: defined when verbose code is active.
    To enclose blocks of code only used for verbose logging.

  - `VERBOSE(statement);`:
    compile statement when verbose code is active.
    To mark code lines only used for verbose logging.

  - `NOVERBOSE(statement);`:
    compile statement when verbose code is inactive.
    To suppress warnings for arguments passed to logging functions via
    printf masks, e.g. `NOVERBOSE((void)ipaddress);`, yet keeping
    the warning in verbose builds.

  Note these macros are not the same as `CURL_DISABLE_VERBOSE_STRINGS`.
  Verbose code is always active in C89 mode (without variadic macro
  support).

- drop existing uses of `CURL_DISABLE_VERBOSE_STRINGS` where redundant,
  or replace with the above macros. Ending up reducing the number of
  `#ifdef`s, and also the number of lines.

Assisted-by: Daniel Stenberg
Assisted-by: Jay Satiro
Reported-by: Dan Fandrich
Fixes #20341
Refs: #12105 #12167

Closes #20353
2026-01-21 13:18:35 +01:00
Daniel Stenberg
e286589c71
multi: probe for IPv6 functionality in multi_init()
In some legacy systems IPv6 might dynamically work/not work and thus
curl needs to check/probe to see if it should indeed be used.

This change moves the probe that checks for working IPv6 to the multi
handle setup function instead of delaying it to when the first name
resolve is performed. This avoids a later tricky error path if the
socket cannot be created due to OOM.

Closes #20383
2026-01-21 09:38:31 +01:00
dEajL3kA
4890074e68 winapi: use FormatMessageA instead of FormatMessageW
Use FormatMessageA() to get the error message as multibyte-character
string (local codepage) directly, instead of using FormatMessageW()
and then convert the string from Unicode (UTF-16) to multi-byte (local
codepage) manually.

Prior to this change we used FormatMessageW + conversion because some
Windows CE did not have FormatMessageA. Since curl no longer supports
Windows CE, FormatMessageA can be used.

Closes https://github.com/curl/curl/pull/20261
2026-01-21 02:49:29 -05:00
Viktor Szakats
066ed13ca4
hostip: omit forward declaration of verbose logging function
Closes #20381
2026-01-21 04:09:11 +01:00
Viktor Szakats
246e95fe90
urldata.h: delete orphan forward declaration
Closes #20380
2026-01-21 04:09:10 +01:00
Viktor Szakats
e50aa46fb2
build: update to not need _CRT_NONSTDC_NO_DEPRECATE with MSVC
Use non-deprecated CRT function variants on Windows.

- introduce `curlx_fdopen()`, `curlx_close()` and use them. Map them to
  non-deprecated, underscored, CRT functions on Windows.

- replace `close()` uses with either `sclose()` (for sockets) or
  `curlx_close()` (for files).

- map `fileno`, `unlink`, `isatty` to their non-deprecated, underscored,
  versions on Windows.

- tool_dirhie: map `mkdir` to `_mkdir` on Windows.

- easy: use `_strdup()` on Windows, regardless of how `HAVE_STRDUP` is
  set.

- cmake: assume `HAVE_STRDUP` on Windows. To allow dropping a detection
  hack using `_CRT_NONSTDC_NO_DEPRECATE` with MSVC. Windows always has
  `_strdup()` which the code uses, but also needs `HAVE_STRDUP` defined
  to disable curl's own `strdup()` implementation.

- curl_setup.h: drop `_CRT_NONSTDC_NO_DEPRECATE` as no longer necessary.

Closes #20212
2026-01-20 23:19:54 +01:00
Viktor Szakats
dbc4603b09
CI: do not codespell RELEASE-NOTES
It contains names.

Reported-by: Daniel Stenberg
Fixes #20376
Revert 3e3d526c4c
Follow-up to 5f5e000278
Follow-up to 85cfc15601
Follow-up to 977595772c
Follow-up to 0260e8465a #17905

Closes #20378
2026-01-20 22:46:37 +01:00
Viktor Szakats
3e3d526c4c
codespell: ignore false positive found in RELEASE-NOTES 2026-01-20 17:56:45 +01:00
Daniel Stenberg
f8769845c8
config2setopts: acknowledge OOM error from CURLOPT_MIMEPOST
It should make curl exit. Found with "strict torture".

Closes #20375
2026-01-20 16:44:39 +01:00
Stefan Eissing
8ce16e7bf2
timeout handling: auto-detect effective timeout
When checking a transfer for being expired via `Curl_timeleft_ms()`,
eleminate the `bool connecting` parameter and have the function check
the `mstate` of the transfer instead.

Advantages:
* eleminate the caller needing awareness if the transfer is
  connecting or in a later state
* fix pingpong timeout handling to check the correct timeout
  during "proto_connect" phases
* avoid using "connecting" timeouts during establishing a secondary
  connection (e.g. FTP) since this would use the timestamp from
  the original, primary connect and thus be wrong

Reported-by: Wyuer on github
Fixes #20347
Closes #20354
2026-01-20 16:43:45 +01:00
renovate[bot]
3d354f55b7
GHA: update ngtcp2/ngtcp2 to v1.20.0
Closes #20372
2026-01-20 16:40:34 +01:00
renovate[bot]
677374d58b
GHA: update ngtcp2/nghttp3 to v1.15.0
Closes #20371
2026-01-20 16:39:45 +01:00
Stefan Eissing
3dd7f5890f
socket: check result of SO_NOSIGPIPE
New define USE_SO_NOSIGPIPE in curl_setup.h, for now set whenever
SO_NOSIGPIPE is defined. Maybe overridden in the future on systems where
this does not work.

With USE_SO_NOSIGPIPE defined, set SO_NOSIGPIPE on all sockets created
by libcurl and fail the creation when setsockopt() fails.

Closes #20370
2026-01-20 16:38:49 +01:00
Daniel Stenberg
0bef137fbd
RELEASE-NOTES: synced 2026-01-20 16:01:16 +01:00
Daniel Stenberg
3c957ad1fe
lib: use ISBLANK and ISNEWLINE more
Closes #20373
2026-01-20 15:36:52 +01:00
Viktor Szakats
09c9afdd71
cmake: silence silly Apple clang warnings in C89 mode, test in CI
- `stdbool.h` is also included via system headers. Disabling it from curl
  does not fix it. Silencing lots of these:
  ```
  curl/lib/curlx/warnless.h:64:1: warning: '_Bool' is a C99 extension [-Wc99-extensions]
   64 | bool curlx_sztouz(ssize_t sznum, size_t *puznum);
      | ^
  /Library/Developer/CommandLineTools/usr/lib/clang/17/include/stdbool.h:24:14: note: expanded from macro 'bool'
   24 | #define bool _Bool
      |              ^
  ```

- silence `-Wcomma` warnings.
  in favor of the global silencing approach, since a couple of more of
  these were hit (in vquic, tool1622, unit1309, unit1636), and it seems
  silly to update them all.
  Revert e8189c4420 #20362

Also:
- cmake: include C standard in 'platform flags' log line.
- GHA/macos: switch a job to C89 to verify.
- GHA/linux: show 'C89' in job names.

Ref: https://cmake.org/cmake/help/v3.7/variable/CMAKE_C_STANDARD.html

Closes #20363
2026-01-20 13:05:01 +01:00
Viktor Szakats
f07a98ae11
build: drop global suppression of -Wformat-nonliteral, fix fallouts
Extend two existing local suppressions to GCC, and add another
GCC-specific one as a replacement.

Before this patch suppressing this warning was odd with clang, because
after this option, `-Wformat=2` is used, which re-enables it.

Also:
- mprintf: minimize scope of a warning suppression.
- tests/server: suppress this warning for a system `vsnprintf()` call
  where it could trigger in C89 builds or with
  `CFLAGS=-DCURL_NO_FMT_CHECKS` set. Seen with Apple clang 17:
  ```
  curl/tests/server/util.c:114:37: warning: format string is not a string literal [-Wformat-nonliteral]
    114 |   vsnprintf(buffer, sizeof(buffer), msg, ap);
        |                                     ^~~
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:124:69: note: expanded from macro 'vsnprintf'
    124 | #define vsnprintf(str, len, ...) __vsnprintf_chk_func (str, len, 0, __VA_ARGS__)
        |                                                                     ^~~~~~~~~~~
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:81:65: note: expanded from macro '__vsnprintf_chk_func'
     81 |         __builtin___vsnprintf_chk (str, len, flag, __darwin_obsz(str), format, ap)
        |                                                                        ^~~~~~
  ```

Ref: #20363

Closes #20366
2026-01-20 12:38:02 +01:00
Viktor Szakats
c1ef1876ac
rtsp: fix missing variable declaration
```
lib/rtsp.c:1073:26: error: no previous extern declaration for non-static variable 'Curl_scheme_rtsp' [-Werror,-Wmissing-variable-declarations]
 1073 | const struct Curl_scheme Curl_scheme_rtsp = {
      |                          ^
lib/rtsp.c:1073:7: note: declare 'static' if the variable is not intended to be used outside of this translation unit
 1073 | const struct Curl_scheme Curl_scheme_rtsp = {
      |       ^
```
Ref: https://github.com/curl/trurl/actions/runs/21157411659/job/60844860592?pr=425#step:3:3036

Follow-up to 8edc0338f3 #20351

Closes #20365
2026-01-20 12:38:02 +01:00
Viktor Szakats
814b54d83e
tidy-up: miscellaneous
- whitespace, indent, comments, clang-format.
- openssl: move feature guards within function blocks.
- tunit: drop redundant blocks.

Closes #20361
2026-01-20 12:37:56 +01:00
Daniel Stenberg
2c6f13093e
libcurl docs: reduce 'since ...' in descriptions
Reduce mentions of libcurl versions like "since 7.xx ..." in option
descriptions to reduce clutter and make the texts easier to read. Keep
them in, or move them to, the HISTORY or DEPRECATED sections

The last version 7 release (7.88.1) shipped on Februrary 20, 2023.

Closes #20369
2026-01-20 11:22:27 +01:00
Frank Buss
d7bbc78360
tls: add new SSLSUPP flags for several options
So that curl_easy_setopt() correctly returns error for those not
supported by the backend.

Closes #20364
2026-01-20 10:34:08 +01:00
Maksim Ściepanienka
a87f346189
config2setopts: fix for --disable-aws build configuration
Closes #20368
2026-01-20 07:49:48 +01:00
Viktor Szakats
1c377717e7
GHA/curl-for-win: add CPU to Linux minimal job name 2026-01-20 03:38:18 +01:00
Viktor Szakats
e8189c4420
tool_getparam: avoid -Wcomma with Apple clang in C89 mode
Seen with Apple clang 17:
```
curl/src/tool_getparam.c:3062:12: warning: possible misuse of comma operator here [-Wcomma]
 3062 |   for(i = 1, stillflags = TRUE; i < argc && !result; i++) {
      |            ^
curl/src/tool_getparam.c:3062:7: note: cast expression to void to silence warning
 3062 |   for(i = 1, stillflags = TRUE; i < argc && !result; i++) {
      |       ^~~~~
      |       (void)( )
```

Closes #20362
2026-01-20 00:20:43 +01:00
tommy
1cacfcd30f
sigpipe: unset SA_SIGINFO since it is using sa_handler
Closes #20278

Signed-off-by: tommy <tommyskypromax@gmail.com>
2026-01-19 23:19:47 +01:00
Daniel Stenberg
8edc0338f3
lib: separate scheme info from protocol implementation
This allows builds know about all schemes - but only have the protocol
implementations for those actually built-in.

It further allows multiple protocols to reuse the same protocol setup
and functions for both TLS and non-TLS implementations instead of
needing two (or more) structs.

The scheme information is now in 'struct Curl_scheme' and all the
function pointers for each scheme/protocol implementation are in struct
Curl_protocol.

The URL API now always work with all known protocols.

Closes #20351
2026-01-19 23:15:13 +01:00
Arnav-Purushotam-CUBoulder
63baa10951
docs/INSTALL: update configure details
Note the default libpsl requirement in INSTALL and polish the TLS
library wording.

Closes #20301
2026-01-19 23:06:04 +01:00
Viktor Szakats
2d5a063121
build: merge TrackMemory (CURLDEBUG) into debug-enabled option
Drop separate `TrackMemory` (aka `CURLDEBUG`) debug feature.

After recent changes (thread-safety,
193cb00ce9, and updates leading up to
it), `TrackMemory` is unlikely to cause build or runtime issues.

To simplify builds and debug options, enable `TrackMemory`
unconditionally for debug-enabled (aka `DEBUGBUILD`) builds. Before
this patch, this was already the default, with an option to disable
it, or enable it in non-debug-enabled builds.

Note, in practice these two debug options already went hand in hand. It
was not possible to toggle them separately for a long time due to bugs,
before 59dc9f7e69 (2024-05-28) fixed it.

This patch also removes/deprecates separate knobs and feature flags for
`TrackMemory`:
- autotools: `--enable-curldebug`/`--disable-curldebug`
- cmake: `-DENABLE_CURLDEBUG=ON`/`OFF`
- C macro: `CURLDEBUG`
- libcurl: `CURL_VERSION_CURLDEBUG` symbol deprecated in favor
  of `CURL_VERSION_DEBUG`. They always return the same value after this
  patch.

Also:
- drop `TrackMemory` from `curl -V` output.
- rename internal `CURLDEBUG` macro to `CURL_MEMDEBUG` internally.
  To avoid confusion with `DEBUGBUILD`, but to keep guarding
  `TrackMemory`-related internals for readability.
- runtests: bind `TrackMemory` to debug feature. Keep it a separate
  test feature requirement, for clarity.
- CI: drop test builds for combinations of the two options.
- GHA/linux: no longer disable TrackMemory in the TSAN job.

Ref: https://github.com/curl/curl/pull/20328#issuecomment-3754528407

Closes #20331
2026-01-19 18:43:17 +01:00
Daniel Stenberg
0002184015
imap: simplify imap_is_bchar() with strchr()
Closes #20358
2026-01-19 16:53:22 +01:00
Viktor Szakats
b8ba798d18
GHA/non-native: fix size/file listing for Android shared lib
Follow-up to 4cf43508e8 #20355
2026-01-19 16:26:43 +01:00
Viktor Szakats
4cf43508e8
CI: show curl tool and libcurl sizes
To see how they change throughout code and/or build changes.

Also:
- improve `file` output.
- tidy-ups.

Closes #20355
2026-01-19 14:12:27 +01:00
Stefan Eissing
9703dabd77
lib: make sigpipe handling more lazy
Define `struct Curl_sigpipe_ctx` that can be passed as argunent
to "lower" functions so that applying a transfers 'no_signal'
setting can be delayed as much as possible and sometimes avoided
alltogether.

Fixes #20326
Closes #20329
Reported-by: Dag Haavi Finstad
2026-01-19 09:37:47 +01:00
Viktor Szakats
4ed578af7a
INSTALL-CMAKE.md: document Apple framework options
Also document when they are used.

Closes #20350
2026-01-19 08:55:04 +01:00
Viktor Szakats
0e8683ee2a
cmake: fix variable name for Apple Security framework
Follow-up to eefd03c572 #18703

Closes #20349
2026-01-19 07:48:15 +01:00
Viktor Szakats
ec1dbaabe4
REUSE: drop broken reference to MAIL-ETIQUETTE
It has been renamed and converted to Markdown.

Follow-up to 271896ab33 #13247

Closes #20348
2026-01-19 07:48:15 +01:00
Viktor Szakats
0fdc61ffd7
INSTALL.md: suggest -Wl,-dead_strip for Apple targets
For reducing binary size. Also to remove (or greatly mitigate)
the side-effect of using "unity" builds. Similar to `-Wl,--gc-sections`
on non-Apple platforms.

For example with curl-for-win builds, macOS arm+intel:

curl (unity):                      7.7MB -> 6.8MB
libcurl.dylib (unity):             7.2MB -> 6.4MB
trurl /w static libcurl (!unity):  535KB -> 251KB (same size with unity)

Ref: c4008d658a

Closes #20346
2026-01-18 18:56:56 +01:00
Sascha Frinken
57c2690f7e
MQTT.md: remove no TLS (mqtts) support
As curl now supports TLS (mqtts), it is no longer necessary to list it
as a limitation in the docs.

Closes #20343
2026-01-18 16:43:18 +01:00
Viktor Szakats
aef128ef50
hostip: fix unreachable code in rare build configuration
with cmake options:
```
-DCMAKE_UNITY_BUILD=OFF -DCURL_DISABLE_HTTP=ON -DENABLE_THREADED_RESOLVER=OFF
```

Fixing (seen with Apple clang 17):
```
lib/hostip.c:939:16: error: code will never be executed [-Werror,-Wunreachable-code]
  940 |       *entry = dns;
      |                ^~~
```

Closes #20344
2026-01-18 12:45:39 +01:00
Viktor Szakats
ba7e51af2d
autotools: fix indentation in help output for two options
By using weird indentation in the autoconf source.

Fixing:
```
  --enable-sspi           Enable SSPI
    --disable-sspi          Disable SSPI
[...]
  --enable-websockets     Enable WebSockets support
    --disable-websockets    Disable WebSockets support
```

Follow-up to 923db3515d #18116
Follow-up to d78e129d50 #14936

Closes #20342
2026-01-18 01:23:44 +01:00
Daniel Stenberg
6d6899c2f0
tool: support fractions for --limit-rate and --max-filesize
Allow 2.5k or 3.7M etc. Add mention in documentation.

Verify in test case 1623.

Closes #20266
2026-01-17 23:25:26 +01:00
Daniel Stenberg
6aaac9dd38
vquic: drop support for OpenSSL-QUIC
- It is slower and uses more memory than the alternatives and is only
  experimental in curl.
- We disable a few tests for OpenSSL-QUIC because of flakiness
- It gets little attention from OpenSSL and we have no expectation of the
  major flaws getting corrected anytime soon.
- No one has spoken up for keeping it
- curl users building with vanilla OpenSSL can still use QUIC through the
  means of ngtcp2

Closes #20226
2026-01-17 22:49:34 +01:00
Daniel Stenberg
6c31df453b
mqtt: initial support for MQTTS
Closes #19418
2026-01-17 22:43:36 +01:00
Viktor Szakats
1730407b74
windows: add build option to use the native CA store
With the same semantics as Apple SecTrust, in both libcurl and the curl
tool, when using non-Schannel TLS backends. In practice it means that
it makes TLS work without manually or implicitly configuring a CA bundle
`.crt` file, such as `curl-ca-bundle.crt`.

To enable:
- autotools: `--enable-ca-native`
- cmake: `-DCURL_CA_NATIVE=ON`
- CPPFLAGS: `-DCURL_CA_NATIVE`

When enabled:
- enables `CURLSSLOPT_NATIVE_CA` (libcurl) / `--ca-native`
  and `--proxy-ca-native` (curl tool) options by default.
- unsafe search for an on-disk CA bundle gets disabled by default.
  Equivalent to `--disable-ca-search` with autotools,
  `-DCURL_DISABLE_CA_SEARCH=ON` with CMake.
- build-time detection of CA bundle and CA path gets disabled. As with
  Apple SecTrust. This was already the default for Windows.
- native CA can be disabled at run-time with the `--no-ca-native`
  and/or `--no-proxy-ca-native` command-line options.

Rationale: This build option:
- has a repeat and active interest from packagers and users.
- helps integrating curl with Windows for those who need this.
- it also applies to macOS: #17525
  Shipped in curl 8.17.0.
- makes it trivial to use custom certs configured on the OS.
- frees applications/packagers/users from the task of securely
  distributing, and keeping up-to-date, a CA bundle.
- frees potentially many curl tool from configuring a CA bundle manually
  to access HTTPS (and other TLS) URLs. This is traditionally difficult
  on Windows because there is no concept of a universal, protected,
  non-world-writable, location on the file system to securely store
  a CA bundle.
- allows using modern features regardless of Windows version. Some of
  these features are not supported with Schannel (e.g. HTTP/3, ECH) on
  any Windows version.
- is necessary for HTTP/3 builds, where bootstrapping a CA bundle is not
  possible with Schannel, because MultiSSL is not an option, and HTTP/3
  is not supported with Schannel.

Ref: #16181 (previous attempt)
Ref: https://github.com/curl/curl/discussions/9348
Ref: https://github.com/curl/curl/issues/9350
Ref: https://github.com/curl/curl/pull/13111
Ref: https://github.com/microsoft/vcpkg/pull/46459#issuecomment-3162068701
Ref: 22652a5a4c #14582
Ref: eefd03c572 #18703

Closes #18279
2026-01-17 19:18:52 +01:00
Daniel Stenberg
5aa303f1bf
RELEASE-NOTES: synced
bump pending version to 8.19.0
2026-01-17 16:48:15 +01:00
Viktor Szakats
85c841cb45
msvc: drop exception, make BIT() a bitfield with Visual Studio
Add casts to `bool`, or use `bit` type in local variables, where
neccessary to avoid MSVC compiler warnings C4242.

Note: There may remain places needing the above updates, where not
tested in CI, and missed in manual review.

Also:
- urldata: convert struct field `connect_only` to bitfield to match its
  counterpart in another struct.
- rename curl-specific `bit` type to `curl_bit`.

Closes #20142
2026-01-17 11:46:31 +01:00
Viktor Szakats
57ff2d6c91
dns: flatten the include tree
Closes #20106
2026-01-17 11:45:18 +01:00
Viktor Szakats
b17ef873ae
windows: bump minimum to Vista (from XP)
After this patch curl requires targeting Vista or newer, and a toolchain
with Vista support.

Supported MSVC compilers (VS2010+) all support Vista:
- VS2012+ target Win8 (or later) by default.
- VS2010 targets Win7 by default.

Supported mingw-w64 versions (v3+) all support Vista:
- mingw-w64 v9+ target Win10 by default.
- mingw-w64 v8 and older target Server 2003 (~XP) by default.
  After this patch it may be necessary to override the default Windows
  target version to Vista (or newer) via:
  autotools: `CPPFLAGS=-D_WIN32_WINNT=0x0600`
  cmake: `-DCURL_TARGET_WINDOWS_VERSION=0x0600`
- mingw-w64 v6+ allow changing the default at toolchain build-time.

Notes:
- For non-MSVC, non-mingw-w64 toolchains, `if_nametoindex` needs to be
  allowlisted in `curl_setup.h`, if they do support it.

Fixes #17985 (discussion)
Closes #18009
2026-01-17 11:41:49 +01:00
Stefan Eissing
6c8956c1cb
socketpair: cleaner interface
Declutter the ifdefs in socketpair.h. Introduce Curl_wakeup_*()
function that encapsulate the details about how the socketpair
is implemented.

This moves the EVENTFD specials from the using code into socketpair
implemenatation, avoiding duplications in three places.

Closes #20340
2026-01-16 16:43:43 +01:00
Stefan Eissing
1a57302d1a
ratelimit: download finetune
When a download size is known and rate limiting is in effect, adjust the
duration of each measurement step and its rate for maximum precision.

Since it is unpredictable how long the last bytes of a download will
take, download speed can be thrown off if the "last bytes" are a
significant amount of the total download. Make the "last bytes" small in
comparision to the rest and "stretch" the rate limit intervals to
accommodate the difference.

Fix ngtcp2 receive data acknowldgements to be based on a local window
size tracking. This allows window updates controlled by rate limits.

Fix ratelimit wait time calculation to accomodate negative tokens.

h3 rate limit, update timeers

Make download rate limits work correctly in ngtcp2. Fix multi handling
of rate limits to set a timer for when limits will update again.

Without running the transfer on limit updates, protocols like h2/h3 may
stall if the server does not send due to stream windows being too small.

scorecard: measure download speedlimits

When running scorecard with --limit-rate=n, show the reported download
speed averages plus percentage deviation from the limit.

Closes #20228
2026-01-16 16:42:31 +01:00
Viktor Szakats
9f120d2b50
GHA: silence fresh zizmor 1.21.0 warnings
- MSYS2/Cygwin bash shells are now tagged "misfeature".
  It is not something we can fix. We need these shells, and using
  documented/necessary settings to use these environments should be
  allowed without workarounds.

- untagged actions within curl's own organization are now also flagged
  as "action is not pinned to a hash (required by blanket policy)". This
  seems overkill. Making internal releases would not be helpful or
  practical. Also considering that the referred internal action uses an
  unpinned external action anyway (google/oss-fuzz/infra/cifuzz), with
  near-zero chance to fix.

Ref: https://github.com/zizmorcore/zizmor/pull/1517#issuecomment-3759740853

Closes #20339
2026-01-16 13:48:28 +01:00
Daniel Stenberg
af274feabf
lib: use STRCONST() when possible in curlx_strcopy() calls
Follow-up to a535be4ea0

Closes #20335
2026-01-16 10:55:10 +01:00
Daniel Stenberg
493e3d6166
hostip6: remove debug-only code
Introduced in 021e786c71. Not used these days.

Closes #20334
2026-01-16 10:52:02 +01:00
Daniel Stenberg
7755df3a48
mbedtls: remove newline from failf() call
Follow-up from 1dc6ddde06

Closes #20333
2026-01-16 08:35:34 +01:00
Daniel Stenberg
65714f8130
easy: fix build with --disable-form-api and --disable-mime
Follow-up to 44312b4b11

Closes #20332
2026-01-15 23:32:52 +01:00
Stefan Eissing
fd82773820
TODO: add point about improving SIGPIPE handling
Closes #20330
2026-01-15 22:42:28 +01:00
Michał Antoniak
75c7d2aeba
mbedtls: no pinnedpubkey wo MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
Behavior similar to when MBEDTLS_PK_WRITE_C is not defined.

Closes #20319
2026-01-15 22:41:07 +01:00
calm329
de69e67793
imap: skip literals inside quoted strings
Fixes #20320
Closes #20322
2026-01-15 22:38:15 +01:00
Daniel Stenberg
5fac56a8b3
GOVERNANCE.md: Post-Daniel BDFL
Some words on what happens at the point in a future when Daniel steps
away from the project

Closes #20325
2026-01-15 17:49:29 +01:00
Viktor Szakats
84ff0f6474
lib: fix two CURLDEBUG guards to be DEBUGBUILD
Both guard the use of `CURL_DNS_SERVER` debug env.

Follow-up to df2b4ccc22 #18157
Follow-up to 02e9690c3e #17015
Follow-up to 59dc9f7e69 #13718

Closes #20328
2026-01-15 13:08:19 +01:00
Viktor Szakats
ac6264366f
tidy-up: miscellaneous
- tool_bname: scope an include.
- `endif` comments.
- Markdown fixes.
- comment tidy-ups.
- whitespace, newlines, indent.

Closes #20309
2026-01-15 13:06:13 +01:00
Viktor Szakats
62ba3604dc
checksrc: do not apply BANNEDFUNC to struct member functions
Omit this warning, when `close()` is banned:
```
./lib/vtls/vtls.c:947:13: warning: use of close is banned (BANNEDFUNC)
   Curl_ssl->close(cf, data);
             ^
```
Ref: https://github.com/curl/curl/actions/runs/21012427938/job/60410334312?pr=20212#step:3:6

Ref: #20212

Closes #20323
2026-01-15 02:06:06 +01:00
Viktor Szakats
82e0d387a2
build: drop more forward function declarations
Most by moving functions around. Also delete unused ones.
Reducing their number from 83 to 33.

Remaining ones due to:
- circular dependencies.
- H3 code, that I did not attempt to update and likely the above applies.
- static declarations with attributes (`CURL_PRINTF`, `WARN_UNUSED_RESULT`).
- OS400 code.

Closes #20321
2026-01-14 23:34:05 +01:00
Viktor Szakats
6437bd79ae
cmake: avoid setting custom property on built-in interface targets
In some cases `ZLIB::ZLIB` and/or `OpenSSL::SSL` may be aliases, which
prevents setting a curl-specific property (.pc module name) in them:
```
CMake Error at [...]/curl/CMakeLists.txt:910 (set_target_properties):
  set_target_properties can not be used on an ALIAS target.
```

Fix by special-casing these built-in targets and manually converting
them to .pc module names, without using the targets themselves
to carry this information throughout curl's internal build logic.

Reported-by: Tomáš Malý
Fixes #20313
Follow-up to 16f073ef49 #16973
Closes #20316
2026-01-14 20:46:25 +01:00
Daniel Stenberg
2b12dbc116
tool_cb_hdr: move etag and content-disposition logic into funcs
Co-authored-by: Jay Satiro
Closes #20288
2026-01-14 14:54:54 +01:00
Viktor Szakats
c6cd54d3a2
tool_doswin: document ENABLE_VIRTUAL_TERMINAL_PROCESSING toolchain support
Closes #20315
2026-01-14 12:53:14 +01:00
Viktor Szakats
2623e333fd
build: drop stray ifndef guards for local/internal macros
For:
- lib/vtls: `MAX_PINNED_PUBKEY_SIZE`.
- src: `UNPRINTABLE_CHAR`.
- tests/server/tftpd: `PKTSIZE`.

Closes #20314
2026-01-14 12:53:14 +01:00
Viktor Szakats
20900e4a1e
tool_doswin: merge if blocks, drop forward declarations
Closes #20311
2026-01-14 12:06:33 +01:00
Viktor Szakats
59a5fd8518
build: drop redundant unused variable suppressions
Also:
- digest_sspi: merge some `ifdef`s.

Closes #20310
2026-01-14 10:38:34 +01:00
Daniel Stenberg
134fb66121
digest: handle quotes in the path
- The 'uri' component needs to be escaped as well
- Rewrote the quote function to use dynbuf
- Build the digest at least partly with dynbuf
- Use goto as a general error mechanism
- Make test 64 use a double quote in the URL

Closes #20295
2026-01-14 09:57:00 +01:00
Viktor Szakats
2949faa93c
badwords: fix typos found
Not caught in CI.

Closes #20308
2026-01-14 03:11:33 +01:00
Viktor Szakats
4651d4c76b
badwords: catch and fix more variants of NN-bit
Closes #20304
2026-01-14 02:35:00 +01:00
Viktor Szakats
60ab58a8a5
cmake: replace an outlier set(var) with set(var, "")
For consistency with the rest of these expressions and readability.

Closes #20305
2026-01-14 00:55:05 +01:00
Viktor Szakats
7d9004ee47
build: drop duplicate C includes
- `stdlib.h` and `string.h` is included via `curl_setup_once.h`,
  allowing to drop from `tests/server` sources and `tool_doswin.c`.

- `stdlib.h` is also included via `setup-vms.h` (earlier than above),
  allowing to drop it from `curl_addrinfo.h` on VMS.

Closes #20303
2026-01-14 00:55:05 +01:00
Viktor Szakats
ea94afe318
ldap: silence potential unused variable warning (OS400)
Also:
- add `endif` comment.
- unfold a line.

Follow-up to 64350280d3 #20197

Closes #20302
2026-01-14 00:55:04 +01:00
Viktor Szakats
0431cbe71a
build: globally suppress DJGPP warnings in FD_SET()
Replacing the many local `#pragma` used before this patch,
reducing the number of `__DJGPP__` guards from 58 to 13.

Closes #20299
2026-01-13 23:17:10 +01:00
dependabot[bot]
ad8374aedc
GHA: bump pip-dependencies
- update `ruff` from 0.14.10 to 0.14.11
- update `filelock` from 3.20.1 to 3.20.3 (CVE-2026-22701) (used in pytests)
- update `psutil` from 7.2.0 to 7.2.1

Closes #20300
2026-01-13 23:17:10 +01:00
Viktor Szakats
1593eeb264
mime: drop fallback for unused R_OK macro
Follow-up to fc81bf42be #13497

Closes #20298
2026-01-13 21:15:36 +01:00
Viktor Szakats
60f9d3dd7b
build: omit forward declarations
- drop redundant forward declarations.
- reorder local functions to not need forward declarations.
- tftpd: merge two `ifdef` blocks.

Closes #20297
2026-01-13 21:15:36 +01:00
Viktor Szakats
8680a07589
examples: omit forward declarations, apply misc fixes
- reorder functions to not need forward declarations.
- sync `ephiperfifo.c` and `evhiperfifo.c`.
- drop redundant casts for `calloc()` return value.
- ephiperfifo: silence unused variable warning.
- fix indent and apply clang-format more.

Closes #20296
2026-01-13 19:37:34 +01:00
Viktor Szakats
df246eeb8f
url.h: fix -Wdocumentation
Seen when testing `-Weverything`:
```
lib/url.h:84:11: warning: parameter 'nowp' not found in the function declaration [-Wdocumentation]
   84 |  * @param nowp      NULL or pointer to time being checked against.
      |           ^~~~
```

Follow-up to 2de22a00c7 #19961

Closes #20294
2026-01-13 18:13:33 +01:00
Viktor Szakats
60186cec78
openldap: avoid forward declarations in ldaps code
Follow-up to b85cb8cb4e #18485

Closes #20293
2026-01-13 18:13:32 +01:00
Viktor Szakats
b6298a2336
mod_curltest: silence unused argument compiler warning
Closes #20292
2026-01-13 17:43:35 +01:00
Viktor Szakats
c446ada2a6
md4, md5: drop redundant forward declarations
Closes #20291
2026-01-13 17:43:35 +01:00
Viktor Szakats
f6a83894eb
lib: reorder protocol functions to avoid forward declarations (ssh)
Move protocol handler table to the end of sources, rearrange static
functions in reverse dependency order as necessary.

Closes #20290
2026-01-13 17:43:35 +01:00
Viktor Szakats
7d2c65e6ee
lib: reorder protocol functions to avoid forward declarations (misc cont.)
For protocols: ldap, openldap, rtmp, rtsp, telnet

Move protocol handler table to the end of sources, rearrange static
functions in reverse dependency order as necessary.

Closes #20289
2026-01-13 17:43:34 +01:00
Viktor Szakats
060e479a19
imap: check imap_sendf() printf masks at compile-time
Closes #20287
2026-01-13 14:27:27 +01:00
Viktor Szakats
80739fa89d
tests/server: use CURL_PRINTF(), drop -Wformat-nonliteral workaround
Closes #20286
2026-01-13 14:27:27 +01:00
Daniel Stenberg
236c7d3c4d
curl_easy_nextheader.md: a new transfer invalidates 'prev'
Closes #20285
2026-01-13 14:11:15 +01:00
Daniel Stenberg
db86f2de9b
tftp: correct the filename length check
Reported-by: z2_
Bug: https://hackerone.com/reports/3508321
Closes #20283
2026-01-13 11:16:47 +01:00
Daniel Stenberg
8582ecf5bb
setopt: split up setopt_long and setopt_cptr
- Split setopt_long() into multiple functions
  (setopt_long_bool/net/http/proxy/ssl/proto/misc) and dispatch them
  using a small function table

- Extract proxy string option handling into setopt_cptr_proxy() and call
  it early from setopt_cptr()

- Reorder options to simplify #ifdef blocks and reduce per-function size

- Updates code paths to return CURLE_UNKNOWN_OPTION from helper defaults
  so dispatching can continue cleanly

Closes #20280
2026-01-13 09:55:09 +01:00
Daniel Stenberg
f057ed05be
checksrc: warn for leading spaces before the preprocessor hash
Fix the 40+ fallouts

Closes #20282
2026-01-13 09:52:26 +01:00
Daniel Stenberg
dac98ccfa2
mqtt: better too-big-message-check
Reported-by: gudyuu on hackerone
Reviewed-by: Daniel Gustafsson
Bug: https://hackerone.com/reports/3508500
Closes #20281
2026-01-13 09:46:49 +01:00
Daniel Stenberg
4b566d8310
top-complexity: always show the top-25
Accept argument as a custom amount. Previously it showed all functions
with a complexity score above 57. This way it adapts better as we
gradually decrease complexity in functions.

Closes #20273
2026-01-13 07:32:53 +01:00
Viktor Szakats
9570d53b75
lib: reorder protocol functions to avoid forward declarations (ftp)
There remains 4 forward declarations.

Move protocol hander table to the end of sources, rearrange static
functions is reverse dependency order as possible.

Closes #20276
2026-01-13 01:31:27 +01:00
Viktor Szakats
2ded1e3c6e
lib: reorder protocol functions to avoid forward declarations (email)
For protocols: imap, pop3, smtp.

Move protocol hander table to the end of sources, rearrange static
functions is reverse dependency order as necessary.

Closes #20275
2026-01-13 01:31:27 +01:00
Viktor Szakats
07926b5982
lib: reorder protocol functions to avoid forward declarations (misc)
For protocols: dict, file, gopher, tftp, http, mqtt, smb.

Move protocol hander table to the end of sources, rearrange static
functions is reverse dependency order as necessary.

Closes #20274
2026-01-13 01:31:27 +01:00
Viktor Szakats
3ee1d3b573
tidy-up: merge root packages directory into projects
To simplify the directory layout.

- OS400 and vms support move from `packages` to `projects`.

- Windows README and `generate.bat` files move from `projects`
  to `projects/Windows`.

Closes #20271
2026-01-12 23:49:35 +01:00
Daniel Stenberg
0d4beb26d2
RELEASE-NOTES: synced 2026-01-12 23:18:48 +01:00
Viktor Szakats
e52e6dac8e
spacecheck: show line numbers of duplicate empty lines
Also:
- drop separate check for 3 or more consecutive empty lines.

Ref: https://github.com/curl/curl/pull/20266#issuecomment-3738955165

Closes #20269
2026-01-12 22:21:01 +01:00
Viktor Szakats
27a1e629b5
Makefile.am: drop stray VC project files from dist
Most files were removed 2 years ago, the remaining two do not work
without those.

Follow-up to 3d93d18ded #12288

Closes #20272
2026-01-12 22:19:40 +01:00
Viktor Szakats
716637520d
Makefile.am: delete RPM targets referencing non-existent files
Follow-up to bae0d473f5 #3331

Closes #20270
2026-01-12 22:19:40 +01:00
Jay Satiro
3652127e81 tool_cb_hdr: suppress header output when --out-null
This change brings --out-null more in line with the documentation which
says --out-null is expected to behave like a portable -o /dev/null.

Prior to this change curl did not suppress the header output from --head
when --out-null was used to suppress output.

Assisted-by: Daniel Stenberg
Reported-by: Andrew Kvalheim

Ref: https://curl.se/docs/manpage.html#--out-null

Fixes https://github.com/curl/curl/discussions/20235
Closes https://github.com/curl/curl/pull/20256
2026-01-12 15:36:44 -05:00
Viktor Szakats
13f0ede730
build: add curl-lint/lint targets, CURL_LINT cmake option
To run checksrc and spacecheck on the source tree. Also for cmake
to sync up with autotools' `checksrc` target.

- cmake: `curl-lint`
  With `-DCURL_LINT=ON`, checks run automatically for all targets.
- autotools: `lint`

Closes #20175
2026-01-12 16:45:24 +01:00
Viktor Szakats
9dc2552ed1
GHA/checkdocs: drop duplicate spacecheck job
No longer necessary after making GHA/checksrc also run on `*.md` file
changes.

Reported-by: Daniel Stenberg
Bug: https://github.com/curl/curl/pull/20266#issuecomment-3738955165
Follow-up to 3800a26582 #18935
Follow-up to 9acecc923d #15423
Closes #20268
2026-01-12 16:31:23 +01:00
Patrick Monnerat
67d0bfc6c2
tool_filetime: sync dummy macro signature with function prototype
Closes #20265
2026-01-12 16:29:32 +01:00
Patrick Monnerat
c326506115
rtsp: match connection_check procedure with required signature
Follow-up to e3691612ea

Closes #20265
2026-01-12 16:29:32 +01:00
Viktor Szakats
41a6eeadf6
GHA/non-native: disable FreeBSD arm CI jobs (upstream breakage)
Package manager is not finding packages.

FreeBSD 15, moving to cmake, dropping impacket, stunnel, ldap, kerberos,
could not fix it.

Closes #20267
2026-01-12 16:26:49 +01:00
Daniel Stenberg
44312b4b11
mimepost: allocate main struct on-demand
This makes the easy handle 432 bytes smaller (totally 5352 bytes on my
rather maximized Linux 64 bit build). The 440 byte mimepost struct is
now allocated only when needed.

Closes #20260
2026-01-12 16:21:02 +01:00
Daniel Stenberg
9e0b02c19c
urldata: change 'keep_post' into three distinct bitfields
Closes #20262
2026-01-12 16:20:14 +01:00
Daniel Stenberg
31fbbb322e
altsvc: only accept 17 byte dates from files
Since the date format is fixed there is no need to accept more data.

Update test355 to verify reject of too long date in alt-svc file

This test case was originally supposed to verify alt-svc loading from a
file but never did because it was done incorrectly.

Now it verifies that a too long date in the input file makes curl
disregard the entry.

Closes #20259
2026-01-12 13:49:57 +01:00
Daniel Stenberg
40fee505a0
tool_operate: split single_transfer into sub functions
To make it more manageable and less complex

Closes #20258
2026-01-12 08:42:23 +01:00
Daniel Stenberg
bd3b2a626a
libssh: simplify myssh_statemach_act()
Reduce complexity by splitting out sub functions.

Made myssh_quote_error() to reduce code duplication.

Closes #20252
2026-01-11 23:28:54 +01:00
Viktor Szakats
1b24428d62
GHA: delete disable-man-db hack, runners doing it by default now
Refs:
1f107542ae
https://github.com/actions/runner-images/pull/13268
https://github.com/actions/runner-images/issues/13213

Follow-up to 5acba8bc36 #17181

Closes #20254
2026-01-11 15:40:21 +01:00
Viktor Szakats
a6087d69a9
GHA: delete new apt sources adding the flaky distro source
CI workflows deleted apt package source `microsoft-prod.list` due to
flakiness seen in the past with those sources. Sources are still flaky
and they are now also used from `azure-cli.sources` which is included
by default by the runner images. Add it to the delete list.

Also: remove another new, unnecessary (for curl CI) package source seen
on the `ubuntu-24.04-arm` runner, for good measure, and performance.

Fixing:
```
Reading package lists...
E: Failed to fetch https://packages.microsoft.com/repos/azure-cli/dists/noble/InRelease  403  Forbidden [IP: 13.107.246.66 443]
E: The repository 'https://packages.microsoft.com/repos/azure-cli noble InRelease' is no longer signed.
Error: Process completed with exit code 100.
```
Ref: https://github.com/curl/curl/actions/runs/20896127602/job/60034941964?pr=20142#step:2:79

Follow-up to 303bb8785c #13473

Closes #20253
2026-01-11 15:25:19 +01:00
Daniel Stenberg
0596357584
wolfssl: fix build without USE_BIO_CHAIN
Reported-by: Megamouse on github
Fixes #20250
Closes #20251
2026-01-11 11:52:40 +01:00
Daniel Stenberg
2725d3cb85
altsvc: move logic from setopt into Curl_altsvc_ctrl()
To keep it all in one place.

Closes #20247
2026-01-11 10:44:43 +01:00
Viktor Szakats
219245a616
GHA: include runner CPU arch in cache keys (revert)
Turns out in practice the internal cache name contains the arch where it
matters (arm or dual-arch local builds), which is part of the cache key
string. Drop `runner.arch` to avoid two arch strings in the key.

Cache keys without an explicit arch designator mean intel.

Revert ff78af5752 #20234

Closes #20249
2026-01-11 01:42:21 +01:00
Viktor Szakats
d9fe60d457
GHA/linux: fix 'mbedtls' internal name confusion
`mbedtls-arm` and `mbedtls-prev` were matching `contains()` expressions
looking for `mbedtls`. It caused an unnecessary cache restore and an
redundant mbedtls build on bumps, and made the build flavors require
different local directory names to avoid this accidental collision.

Also drop `-threadsafe` from internal names. All local builds are.

Follow-up to 8806035344 #20240
Follow-up to 3a305831d1 #19077

Closes #20248
2026-01-11 01:01:13 +01:00
Viktor Szakats
5225e69ed9
GHA/linux: move 6 jobs with locally built dependencies to arm
All libresll jobs, wolfssl-all, and one mbedtls job.

As noted earlier, arm jobs run faster than intel ones, especially
valgrind steps that run almost twice as fast. Package install runs
slower, but this is offset by faster build and test steps, even in
non-valgrind jobs.

Follow-up to ff78af5752 #20234
Follow-up to 2b0d8dcc16 #20231

Closes #20246
2026-01-10 23:43:28 +01:00
Viktor Szakats
ff78af5752
GHA: include runner CPU arch in cache keys
To clarify the arch for cache entries, also to allow building/caching
multiple archs in parallel if necessary.

Closes #20234
2026-01-10 23:03:18 +01:00
Viktor Szakats
bfacfb2355
plan9: drop special build and orphaned references
Would need 64-bit support.

Ref: https://github.com/curl/curl/pull/20233#issuecomment-3732556015
Follow-up to 0159100f4f #20233

Closes #20243
2026-01-10 23:03:17 +01:00
Daniel Stenberg
7433a6eb3f
urldata: restore bitfield to unsigned int
Bug: https://github.com/curl/curl/pull/20209#pullrequestreview-3647160739

Reported-by: Patrick Monnerat
Follow-up to e3691612ea
Closes #20244
2026-01-10 22:42:05 +01:00
Viktor Szakats
f4b16563ab
cmake: drop unused LONG_LONG reference from Windows prefills
It's no longer used in curl.

Follow-up to 0159100f4f #20233

Closes #20241
2026-01-10 17:39:11 +01:00
Viktor Szakats
2465f7c61d
tool: improve error/warning messages when output filename sanitization fails
On MS-DOS (OOM and bad filename) and Windows (OOM only).

Given the rarity of both platform and error, we make a compromise and
return an unrelated libcurl error (43) in case of a bad output filename
on MS-DOS.

After:
```
$ CURL_FN_SANITIZE_OOM=1 wine curl.exe https://curl.se/ --output out.txt
curl: (27) Out of memory

$ CURL_FN_SANITIZE_BAD=1 wine curl.exe https://curl.se/ --output out.txt
Warning: bad output filename
curl: (43) A libcurl function was given a bad argument

$ CURL_FN_SANITIZE_OOM=1 wine curl.exe https://curl.se/index.html --globoff -O
curl: (27) Out of memory

$ CURL_FN_SANITIZE_BAD=1 wine curl.exe https://curl.se/index.html --globoff -O
curl: bad output filename
curl: (43) A libcurl function was given a bad argument
```

Before:
```
$ CURL_FN_SANITIZE_OOM=1 wine curl.exe https://curl.se/ --output out.txt
Warning: bad output glob
curl: (27) Out of memory

$ CURL_FN_SANITIZE_BAD=1 wine curl.exe https://curl.se/ --output out.txt
Warning: bad output glob
curl: (3) URL using bad/illegal format or missing URL

$ CURL_FN_SANITIZE_OOM=1 wine curl.exe https://curl.se/index.html --globoff -O
curl: Failed to extract a filename from the URL to use for storage
curl: (27) Out of memory

$ CURL_FN_SANITIZE_BAD=1 wine curl.exe https://curl.se/index.html --globoff -O
curl: Failed to extract a filename from the URL to use for storage
curl: (3) URL using bad/illegal format or missing URL
```

Ref: #20116 (simpler reboot of)
Ref: #20113 #20121
Ref: 40c1748af5 #20198
Ref: eb7f5b71e5 #20143
Ref: 8c02407bef #20125
Fixes #20044
Closes #20199
2026-01-10 13:21:27 +01:00
Daniel Stenberg
3e1179a695
KNOWN_BUGS.md: absolute Unix domain filename for SOCKS on Windows
Closes #20236
Closes #19825
2026-01-10 13:05:46 +01:00
renovate[bot]
f1422960bf
GHA: update awslabs/aws-lc to v1.66.2
Closes #20238
2026-01-10 12:50:39 +01:00
Daniel Stenberg
0159100f4f
lib: use (u)int64_t instead of long long
Remove config-plan9.h because it does not support 64 bit, meaning it has
not been working for years.

Closes #20233
2026-01-10 12:40:54 +01:00
Viktor Szakats
8806035344
GHA/linux: fix 'libressl' internal name confusion
`libressl-filc` was matching `contains()` expressions looking for
`libressl`, causing build confusion and failure in specific cases.

Rename `libressl` to `libressl-c` to avoid this. Also rename the cache
id for consistency, though not necessary for the fix.

Bug: https://github.com/curl/curl/actions/runs/20860412340/job/59938315276
Follow-up to c262481873 #19407
Cherry-picked from #20234

Closes #20240
2026-01-10 12:36:20 +01:00
Joshua Vandaële
97f518e193
cmake: reference OpenSSL and ZLIB imported targets only when enabled
This otherwise broke building on a parent with a static library which is
available but disabled (e.g. CURL_ZLIB is set to OFF but ZLIB::ZLIB
exists)

Closes #20217
2026-01-09 22:03:28 +01:00
Viktor Szakats
2b0d8dcc16
GHA: switch 12 Linux jobs to arm64
More cost-effective and seems as fast or faster than Intel.

In particular, valgrind seems to be almost 2x fast. So fast the job pair
could fit under 10 minutes if merged again (but would be the longest in
GHA/Linux.)

Installing packages is slightly slower. The package repo is Ubuntu's
which is slower than the Azure mirror used on Intel (unless Azure is
broken, which happened a lot last year).

To add to more jobs, the locally built deps also need to be migrated.

Also:
- add workaround for failing sshd server on Linux arm runners, caused by
  world-writable `HOME` directory.

Closes #20231
2026-01-09 19:35:16 +01:00
Viktor Szakats
91c24d3e10
cmake: silence useless compiler warnings triggered by the FASTBuild generator
Silencing all of these:
```
11>/tmp/_fbuild.tmp/0x0752c383/core_2/70816E19/krb5_sspi.c:1:5: error: this style of line directive is a GNU extension [-Werror,-Wgnu-line-marker]
    1 | # 1 "<built-in>"
      |     ^
/path/to/curl/lib/vauth/krb5_sspi.c:29:6: error: this style of line directive is a GNU extension [-Werror,-Wgnu-line-marker]
   29 | # 26 "/path/to/curl/lib/vauth/krb5_sspi.c"
      |      ^
[...]
```

FASTBuild is slightly faster than Ninja in basic (single-machine, build
from scratch) cases (and can be more faster in other build cases). It
doesn't support unity builds. Maybe it can bring slightly better
performance to non-unity cmake CI jobs, in jobs having an 'install
prereq' phase already, and installing the fastbuild package being faster
than this gain. It overall seems marginal if any in curl CI. At least
for now. But it doesn't hurt if it works, and may be useful for some.

Requires CMake 4.2+.

That said this workaround may have a better place within CMake.

Refs:
https://www.kitware.com/cmake-fastbuild-distributed-cached-and-fast/
https://cmake.org/cmake/help/latest/generator/FASTBuild.html
https://github.com/fastbuild/fastbuild
https://fastbuild.org/docs/home.html

Closes #20230
2026-01-09 17:05:16 +01:00
renovate[bot]
1dedcbc35d
GHA: update dependency cloudflare/quiche to v0.24.7
Closes #20224
2026-01-09 17:05:15 +01:00
Stefan Eissing
3b261e2ad7
pytest: bump quiche version check update
Since the Lazy Lucas did not manage to get the fix merged in 0.24.7,
increase the pytest version check number in the hope that it will happen
in the next release.

Closes #20229
2026-01-09 15:47:27 +01:00
Viktor Szakats
9552d9c0c0
build: detect and include inttypes.h again (revert)
Since not using `PRI*` macros, it isn't needed.

Follow-up to 13c1a93414 #20215
Revert 4c9e4e99c1 #20208

Closes #20225
2026-01-09 14:59:30 +01:00
Daniel Stenberg
d881b91133
urldata: convert 'long' fields to fixed variable types
Makes sure they work identically cross-platform, as long varies in size
between Windows vs non-Windows. Makes Curl_easy 16 bytes smaller on 64
bit Linux.

This reduces support for the RTSP cseq counters to 32 bit (down from 63
bit previously on 64 bit non-Windows), but it is probably safe.
Implementations probably rarely support anything above 32 bits anyway
and this is how curl has worked on Windows since always.

There is now only one 'long' left in urldata.h (in the ssl_config_data
struct). That field, certverifyresult, is used to store the response
code from TLS backend code and in the OpenSSL case that function returns
an actual 'long'.

Closes #20227
2026-01-09 13:32:33 +01:00
Viktor Szakats
3402036e1a
spacecheck: exclude RELEASE-NOTES from a check 2026-01-09 09:45:30 +01:00
Viktor Szakats
df7718b5cf
curl: limit Windows-specific code to Windows builds, other tidy-ups
Prior to this patch, some Windows logic, including a Windows-specific
warning message was compiled in for all platforms.

Also:
- fix double space in warning message on UWP.
- formatting.

Follow-up to 9a2663322c #17572

Closes #20213
2026-01-09 09:42:01 +01:00
Daniel Stenberg
470e26ff6e
RELEASE-NOTES: synced
Bump to 8.18.1 tentatively
2026-01-09 07:54:36 +01:00
Daniel Stenberg
e83c82f05f
COPYING: bump copyright year range to 1996 - 2026 2026-01-08 23:19:44 +01:00
Stefan Eissing
f2d008811d
ngtcp2: stabilize recv
When receiving on a stream that already failed or has already been closed,
return the matching error code without touching the connection. In case
the connection shows errors, e.g. the server closed, those errors should
not have impact on an already failed/closed stream.

This might mitigate flakiness in pytest 07_13 where unexpected errors
occur after a successful upload.

Closes #20220
2026-01-08 22:36:38 +01:00
Daniel Stenberg
e3691612ea
urldata: switch to uint* types more widely
In particular, it turns 'unsigned long' into 'uint32_t' since the code
needs to build and run just as fine on Windows which has 32 bit longs,
so we know the code works with 32 bit field versions.

This makes Curl_easy 56 bytes smaller on my 64 bit Linux (maximized
build).

Closes #20209
2026-01-08 22:35:06 +01:00
Daniel Stenberg
97a02fade6
curl: rename a struct OutStruct field to 'regular_file'
From 's_isreg'. It explains better in plain English what it is for.

Closes #20222
2026-01-08 22:34:05 +01:00
Daniel Stenberg
8a25cf3d7c
tool_operate: remove 'else' for VMS
It seems malplaced as it then avoids the following logic when invoked
from a VMS shell and that seems unlikely to be desired.

Based on code review. I have no system to try this on.

Follow-up to f1261bcdd7
Closes #20221
2026-01-08 22:33:06 +01:00
Daniel Stenberg
2aba8f613c
urldata.h: remove two forward-declared structs not used
Closes #20206
2026-01-08 22:31:07 +01:00
Daniel Stenberg
13c1a93414
lib: remove uses of PRIu32 by adding "hack" for DJGPP
Avoid using PRIu32 and PRId32 in product source code. We don't need it.
It reduces readability. It is also inconsistent since unsigned int has
the same size and does not require the define.

DJGPP warns about using %u for uint32_t by default because it seems to
typedef it to unsigned long instead of unsigned int. Which even that is
annoying since long and int are both 32 bit on this platform.

We use our own *printf() implementation and we know this is safe.

This work-around defines uint32_t for DJGPP into unsigned int to avoid
the warnings and thus the need to use PRIu32 and PRId32.

Closes #20215
2026-01-08 14:15:47 +01:00
JimFuller-RedHat
af18d8ea1b
docs: explicitly call out Slowloris as not a security flaw
Closes #20219
2026-01-08 10:19:16 +01:00
Daniel Stenberg
7de35515d9
mprintf: drop old sprintf fallback
1. No modern systems lack snprintf()

2. If there actually exist any such systems, they get to manage without
   floating point output.

Closes #20218
2026-01-08 09:31:39 +01:00
Viktor Szakats
bb7f69f9a2
tool_dirhie: drop superfluous F_OK fallback (Windows)
Follow-up to cb5ba675a7

Closes #20214
2026-01-07 22:59:52 +01:00
Viktor Szakats
d8f6175edc
GHA/macos: switch one H3 pytest job to cmake
To:
- see if build tool makes a difference for flaky 8x pytest slowdowns.
- to make this job finished faster.

`curl -V`, number of runtests (1793) and pytests (568/159) verified
to remain the same.

Closes #20211
2026-01-07 17:34:57 +01:00
Viktor Szakats
1b9f1c2086
GHA/non-native: restore MS-DOS jobs
In `!ssl` variant.

It's useful to catch `uint32_t` mismatches with `unsigned int` or its
printf mask.

Also add Renovate version bump rule.

It takes about 1m (autotools) + 30s (cmake) in CI.

Bug: https://github.com/curl/curl/pull/20199#discussion_r2666363334
Follow-up to 8881a52ab0 #20210
Follow-up to e70436a88a #20200
Follow-up to 0630e66cb4 #18338

Closes #20204
2026-01-07 17:07:40 +01:00
Viktor Szakats
8881a52ab0
tests: fix to use uint32_t where necessary
Fixes MS-DOS DJGPP buidls, possibly others.

Follow-up to e70436a88a #20200
Follow-up to 4701a6d2ae #19695

Closes #20210
2026-01-07 17:01:06 +01:00
Viktor Szakats
e70436a88a
lib: sync printf masks with uint32_t types
Also adjust a printf mask for signedness.

Fixing with MS-DOS DJGPP gcc 12.2.0:
```
lib/conncache.c:612:22: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi.c:394:22: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi.c:520:20: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi.c:520:20: error: format '%u' expects argument of type 'unsigned int', but argument 5 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi.c:611:20: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi.c:614:22: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi.c:887:20: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi.c:887:20: error: format '%u' expects argument of type 'unsigned int', but argument 5 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi.c:2719:26: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi.c:2725:30: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi.c:2729:28: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi.c:3126:34: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi.c:3348:34: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi.c:3991:28: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi_ev.c:343:24: error: format '%u' expects argument of type 'unsigned int', but argument 6 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi_ev.c:413:24: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi_ev.c:584:36: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi_ntfy.c:113:34: error: format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi_ntfy.c:113:34: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'}
lib/multi_ntfy.c:171:22: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'}
lib/url.c:883:22: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'}
lib/url.c:889:22: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'}
```

Bug: https://github.com/curl/curl/pull/20199#discussion_r2666363334
Follow-up to 4c9e4e99c1 #20208

Closes #20200
2026-01-07 16:28:30 +01:00
Viktor Szakats
4c9e4e99c1
build: detect and include inttypes.h again
For `PRI*` printf masks for fixed-size C99 types.

Also:
- add simple fallback for `PRIu32`, `PRIx32`, if `inttypes.h` is
  missing.

Cherry-picked from #20200
Ref: #20207
Follow-up to 4701a6d2ae #19695
Ref: 60359ad504 #12275
Closes #20208
2026-01-07 16:10:23 +01:00
Daniel Stenberg
5f612acaa1
urlapi: split parts of parseurl() into sub functions
- parse_file
- parse_scheme
- guess_scheme
- handle_fragment
- handle_query
- handle_path

Closes #20205
2026-01-07 14:31:08 +01:00
Stefan Eissing
f6e8531c03
http/3: add description for known server error codes
When a server resets a stream with an error code, list that code
and its known name in the failure message of the transfer.

Ref: #20195
Closes #20202
2026-01-07 14:30:21 +01:00
Viktor Szakats
c25fdaf081
GHA/macos: merge two autotools !ssl jobs into others, switch one to cmake
Number of jobs down to 34 (from 56 at end of last year.)
Out of them 7 autotools (was 24 at end of last year.)

Also:
- stop install brew packages preinstalled.
- make some dependency options explicit.

Closes #20203
2026-01-07 12:44:42 +01:00
Viktor Szakats
671df8d357
config-plan9: set HAVE_STDINT_H again
Follow-up to 1ecf2f1113 #16585 #15907
Follow-up to 60359ad504 #12275

Closes #20201
2026-01-07 10:43:34 +01:00
Daniel Stenberg
2eebc58c4b
RELEASE-NOTES: synced
curl 8.18.0 release
2026-01-07 07:56:22 +01:00
Daniel Stenberg
45802c9bdb
THANKS: add contributors from 8.18.0 2026-01-07 07:56:22 +01:00
Daniel Stenberg
4c9f868686
VERSIONS.md: add date for 8.18.0, mention 8.19.0 is pending 2026-01-07 07:56:22 +01:00
Viktor Szakats
40c1748af5
tool_urlglob: fix propagating OOM error from sanitize_file_name()
Make sure to convert a low-level OOM error code a libcurl one, to make
the curl tool to display an accurate error code and messages. On Windows
and MS-DOS.

Improving:
```
$ CURL_FN_SANITIZE_OOM=1 wine curl.exe https://curl.se/ --output out.txt
[...]
curl: (3) URL using bad/illegal format or missing URL
```
to:
```
[...]
curl: (27) Out of memory
```

Cherry-picked from #20116
Closes #20198
2026-01-06 20:02:55 +01:00
Viktor Szakats
e2d61a6b30
curlx_win32_fopen: use _fsopen()/_wfsopen() with _SH_DENYNO
Replacing `fopen_s()`/`_wfopen_s()`, to allow customizing share mode,
and keep the sharing mode as was with `fopen()`/`_wopen()` earlier and
as used in `_sopen_s()`/`_wsopen_s()`.

The replaced functions used `_SH_SECURE` internally. Otherwise they are
identical to the replacements.

Ref: https://learn.microsoft.com/cpp/c-runtime-library/reference/fsopen-wfsopen

Reported-by: Jay Satiro
Fixes #20155
Ref: #20156
Follow-up to 1e7d0bafc6 #19643
Closes #20186
2026-01-06 12:20:01 +01:00
Andrew
64350280d3
ldap: fix LDAP version display on IBMi
Fixes #20196
Closes #20197
2026-01-06 12:08:16 +01:00
Samuel Henrique
dce81d3c4e
wcurl: import v2026.01.05
Closes #20194
2026-01-06 10:12:31 +01:00
Viktor Szakats
5a4cd75863
GHA/macos: switch 5 jobs from autotools to cmake
To save 0.5 to 3 minutes per job.

There remain 7 main autotools jobs, plus 1 in combinations and 1 more
for iOS.

Also:
- fix to disable MQTT, WebSockets, IPFS in HTTP-only job.

Closes #20193
2026-01-06 04:15:22 +01:00
pojomi
dc739fee16
config2setopts: add space in cookie header with multiple -b
Closes #20184
2026-01-05 23:32:00 +01:00
Viktor Szakats
fecc987ebf
GHA: reduce total timeouts for Linux and macOS jobs
- Linux: 25 -> 15 minutes.
- Linux H3: 45 -> 10 minutes.
- macOS: 25 -> 15 minutes.

On macOS this may catch flaky slowness seen sometimes in pytests:
https://github.com/curl/curl/pull/20187#issuecomment-3711753097

Closes #20192
2026-01-05 23:27:36 +01:00
Andrew
d3def68d3b
multi: fix to build on IBMi
Sync function declaration with definition. Update related local vars.

Follow-up to 4701a6d2ae #19695
Fixes #20190
Closes #20191
2026-01-05 23:16:04 +01:00
Andrew
0343951cb5
ldap: fix Curl_ldap_version() for IBMi/OS400
- `LDAP_OPT_SUCCESS` (== 0) is missing from some LDAP implementations
  and documented to use `LDAP_SUCCESS` (== 0) instead. Use literal zero
  to avoid macro name differences.

- fix freeing `LDAP_OPT_API_INFO` buffers:
  - docs suggest `ldapai_vendor_name` on IBMi is `const char *`.
    Nothing in docs says it need to be freed.
  - `ldapai_extensions` need to be freed, according to docs.
    However, on IBMi there is `ldap_value_free()` function for it.
  Ref: https://www.ibm.com/docs/en/svd/10.0.3?topic=settings-ldap-opt-api-info

Fixing, on OS400 (V7R4M0):
```
CZM1003:  LDAP__819.c, 1028.56: CZM0045(30) Undeclared identifier LDAP_OPT_SUCCESS.
CZM1003:  LDAP__819.c, 1036.21: CZM0280(30) Function argument assignment between types "char*" and "const char*" is not allowed.
CZM1001:  LDAP__819.c, 1037.5: CZM0304(10) No function prototype given for "ber_memvfree".
...
CZS0601:  Module LDAP is not created because statement errors occurred.
```

Follow-up to 859ce48de1 #19832
Fixes #20188
Closes #20189
2026-01-05 23:10:47 +01:00
Viktor Szakats
0ec07e38f3
GHA/macos: drop compiler matrix for macos jobs
To reduce the number of jobs, and the time spent running macos runners.
The curl codebase has just a few Apple-specific parts, and they remain
well-covered after this patch.

Makes the number of jobs 24, down from 32.

Perhaps more jobs could be merged or dropped, and CPU use reduced by
moving some to cmake. Unique, but not Apple-specific jobs may also be
moved to Linux.

Follow-up to b869932392 #20178

Closes #20187
2026-01-05 19:43:23 +01:00
Viktor Szakats
9f1838e965
GHA/macos: enable Apple IDN and SecTrust for combination jobs
Closes #20185
2026-01-05 11:00:19 +01:00
Daniel Stenberg
20ac5531cd
mk-lib1521: make the test set each string option again
In an attempt to make sure that setting it again does not leak memory.

The second string is set to `""`, which is done so that this now finds
the problem reported in #20179.

Ref: #20179
Closes #20181
2026-01-04 14:48:13 +01:00
Daniel Stenberg
193397bf4e
progress: narrower time display, multiple fixes
- Each time field is now 7 characters wide, so that the total width
  never exceeds 79 columns so that it works correctly also in Windows
  terminals. The title lines are adjusted accordingly.

  This is accomplished by using h:mm:ss style up to 10 hours, and for
  longer periods switch to "nnX nnY" style output. For hours, days,
  months and years.

  For less than one hour, the hour field is now dropped.

  When no time info is provided, the field is now space-only. No more
  `-:--:--`.

  Also fixed the output for really long times which previously was
  completely broken. The largest time now shows as ">99999y". (Becase
  I can't figure out a better way).

- For sizes, the widths are now properly fixed to 6 characters. When
  displaying a unit with less than 3 digits, it shows two decimal
  precision like "16777215 => 15.99M" and one decmal otherwise: "262143
  => 255.9k"

  Also fixes the decimal math. 131071 is 127.9k, which it previously did
  not show.

- The time and size field outputs are now properly verified in test
  1636.

Fixes #20122
Closes #20173

fixup use only space when no time exists

Drop the hour from the display when zero
2026-01-04 14:42:08 +01:00
Daniel Stenberg
3c8f9c9247
setopt: free the previous STRING_ENCODING before storing the new
Follow-up to 6b9c75e219

Fixes #20179
Reported-by: correctmost on github
Closes #20180
2026-01-04 14:32:28 +01:00
Daniel Stenberg
eb7f5b71e5
tool_doswin: remove the max length check
A too long name is likely to cause a problem later anyway and get
reported there. We don't enforce file name lengths for any other
systems.

Assisted-by: Jay Satiro
Assisted-by: Viktor Szakats

Closes #20143
2026-01-04 11:22:43 +01:00
Viktor Szakats
b869932392
GHA/macos: reduce number of combination jobs
- drop autotools (except one) from combination jobs.
  They seem to add little value over cmake ones, yet take a lot of time
  even after restricting them to shared libs.

  20-25s to install autotools via Homebrew, for each 11 jobs. autoreconf
  taking 10s, configure 25s, build 30-35s. A total of 1m30s to 1m45s per
  job. Sometimes jumping up to 2-4 minutes.

  Compare this to 20-25s total job times with cmake.

  Keep one job with an indentical cmake pair to help detecting
  build-tool-specific fallouts.

- drop more combination jobs.
  To avoid overlap with main build jobs.

Reducing number of jobs to 9, from 22 (-13),
total job time to 5.5 minutes, from 25 (-20m).

Before: https://github.com/curl/curl/actions/runs/20637652089
After: https://github.com/curl/curl/actions/runs/20686390641?pr=20178

Considering the small amount of Apple-specific code in curl since
dropping Secure Transport, and that most combination issue were in
the toolchains, not curl, there is likely more room to avoid wasting
cycles (at 41 macOS + 3 iOS jobs after this patch).

Follow-up to d057b705fd #20167

Closes #20178
2026-01-04 04:01:37 +01:00
Daniel Stenberg
b32e66a8ee
tool_progress: fix large time outputs and decimal size display
Time output:

- was broken for really large times

- now uses spaces instead of --:--:--

- >99999y is now the largest shown time

- show HH:MM:SS as long as hours are fewer than 100

Size:

- made the decimal output always only use a single decimal

Test:

- Add test 1622 to verify these functions

Closes #20177
2026-01-04 00:16:59 +01:00
Tobias Zimmermann
09374f6e75
docs: add a note about --compressed to note about binary output
Closes #20168
2026-01-04 00:10:40 +01:00
Daniel Stenberg
5ef7fa39d5
tool_getparam: use UNITTEST not, ifdef
Closes #20174
2026-01-04 00:09:12 +01:00
Viktor Szakats
b374a8f07f
servers.pm: say the protocol when http server failed to start
To serve as possibly more signal to see when/why the http server fails
to start in some random cases (on Windows).

Seen it happen in the 'mingw, CM clang-x86_64 gnutls libss' CI job:
https://github.com/curl/curl/pull/20163#issuecomment-3705572750
https://github.com/curl/curl/pull/20163#issuecomment-3707231458

Closes #20176
2026-01-03 20:39:27 +01:00
Stefan Eissing
68b94daeb8
pytest: test 16_01 stabilize
When checking the reported times of a transfer, do not exptect
the 'queue' time to be in any relation to others. 'queue' uses its own
start timestamp and the reported duration is thereofore independant.

Ref: #20112
Closes #20163
2026-01-03 13:04:21 +01:00
Viktor Szakats
d07024cf93
GHA: restore --shallow value for some torture tests
It also means that now all torture test-pairs use the same shallowness,
while earlier FTP used 20.

Also:
- This made macOS torture jobs slow enough to split them into 3 jobs.

Follow-up to 2cbcde90e7 #20153

Closes #20172
2026-01-03 01:02:41 +01:00
Stefan Eissing
a348f19bd1
pytest: test 07_22 stabilize
Do not generate a 400 response code, but use a 200 one. The upload needs
to fail on sending, not on seeing a 400 response. Seeing a 400 before
the sending fails (when CI timings shift) will expose the wrong error
code.

Ref: #20112
Closes #20164
2026-01-03 00:48:54 +01:00
Stefan Eissing
2c32ab12a0
pytest: test 07_70 stabilize (curl_ngtcp2)
We recently allowed a larger send buffer in ngtcp2 streams. This allowed
curl to send more early data then previously when the server was slow in
performing the handshake. This led to flaky test failures when the
amount of early data was larger than expected.

Change test expectations to allow for varying amount of early data.

Ref: #20112
Closes #20161
2026-01-03 00:48:54 +01:00
Stefan Eissing
ac06643f71
pytest: test 03_02 stabilize (curl_ngtcp2)
The special handling for draining server connections during a connect
attempt was only done on CURLE_RECV_ERROR. But it may also happen when
ngtcp2 errors on writing data. Check for CURLE_SEND_ERROR also.

Ref: #20112
Closes #20162
2026-01-03 00:48:54 +01:00
Daniel Stenberg
46bda31702
RELEASE-NOTES: synced 2026-01-02 23:53:33 +01:00
Daniel Stenberg
03c9215e62
altsvc: accept ma/persist per alternative entry
The 'ma' and 'persist' keywords should be considered per list entry, not
once per header.

Expand test 1654 to verify such headers

Reported-by: Hunt Darlener
Closes #20160
2026-01-02 23:50:21 +01:00
Viktor Szakats
003dddae2b
GHA/non-native: reduce workflow timeouts
Closes #20171
2026-01-02 23:43:23 +01:00
Viktor Szakats
9de7001b5e
GHA/windows: reduce workflow timeouts
From 15 to 10 minutes.

To reduce the idle wait for hung jobs from 20 to 15 minutes (hopefully),
so that the failed just can be restarted manually eariler. It appears
that GitHub Actions notices a hung job 5 minutes past the workflow
timeout (reason undiscovered).

Also: Leave extra time for torture and arm64 jobs.

Closes #20170
2026-01-02 23:43:23 +01:00
Viktor Szakats
d057b705fd
GHA: disable autotools static libcurl in many jobs
To avoid building libcurl in both static and shared flavor by default.
It results in 1.5-2.x speed-up for the curl build step in most jobs.
Saving a total of 6-7 minutes. In the Cygwin job alone it saves 1-1.5m.

Also:
- enable static + shared in a Windows job to keep testing this combo.

Follow-up to ff958fc4b2 #20159

Closes #20167
2026-01-02 22:39:28 +01:00
Viktor Szakats
7e08d56c23
GHA/linux: simplify configuring mbedTLS in two jobs
Closes #20165
2026-01-02 16:34:40 +01:00
Viktor Szakats
2cbcde90e7
GHA/linux: split valgrind jobs to job-pairs for parallelism, to finish in 10m
To make CI turnaround time shorter, by cutting the longest running jobs.
After this patch all jobs should finish around 10-11 minutes. Down from
15-16 minutes before this patch.

Suggested-by: Stefan Eissing

The fuzzing workflow is now the slowest (with a 7-minute startup time
needed to build deps from source on each run), followed by macOS
and Windows torture tests (both split in two now). Without fuzzing, it's
under 10 minutes.

Notes:
- an extra cost with job-pairs is installing prereqs,
  configuring/building curl and tests twice. GitHub doesn't support
  making a matrix job a prereq for another workflow that may fix this:
    https://github.com/orgs/community/discussions/42335
  This overhead is significant on Windows: 11m20 -> 9m20 + 8m40
- job-pairs are annoying to maintain and keep in sync.
- splitting tests into halves is a manual process and needs to be
  revisited from time to time. Possibly something to automate with
  a runtests option, e.g. with `1 of 50%` and `2 of 50%`?

Also:
- split torture tests in two equal pieces, replacing the `FTP` + `!FTP`
  split used earlier.

Related perf improvements from today:
- make scan-build 2x fast:
  ff958fc4b2 #20159
- drop build-only Testi386 fuzz workflow (from curl), saving 9m per run:
  0106023c1f
  https://github.com/curl/curl-fuzzer/pull/236

Closes #20153
2026-01-02 15:51:00 +01:00
Viktor Szakats
ff958fc4b2
GHA/linux: switch scan-build jobs to cmake (for 2x perf)
Somewhat unexpectedly, switching autotools jobs to identical (non-unity,
non-debug, same options) cmake ones, makes them complete 2x faster.
Most of it comes from cmake building shared libcurl only, while autotools
was using defaults and building both, in two separate passes. Thers is
about a minute (per job) of gain due to other reasons.

Before:
MultiSSL: 10m30: https://github.com/curl/curl/actions/runs/20656775456/job/59311070197
H3: 9m14s: https://github.com/curl/curl/actions/runs/20656775456/job/59311070204

After:
MultiSSL: 4m52s: https://github.com/curl/curl/actions/runs/20658343323/job/59315501903
H3: 4m7s: https://github.com/curl/curl/actions/runs/20658343323/job/59315501918
H3: 5m4s: https://github.com/curl/curl/actions/runs/20659294959/job/59318215987 (autotools shared only, for comparison, not merged)

Also:
- drop building examples with scan-build in the second (shorter) job.
  This offers no extra coverage over the long job that has both GnuTLS
  and OpenSSL. Saving an extra ~30s.

Closes #20159
2026-01-02 15:13:53 +01:00
Daniel Stenberg
ae1597c312
VULN-DISCLOSURE-POLICY.md: CRLF in data
we reject the idea of *CRLF injection* by the user itself as a general
security problem

Closes #20157
2026-01-02 12:19:11 +01:00
Daniel Stenberg
ce423079dc
progress: make it one column narrower
To make it fit 80 columns appropriately

Reported-by: Jay Satiro
Fixes #20122
Closes #20124
2026-01-02 11:44:33 +01:00
Daniel Stenberg
7e48a34bf8
badwords.pl: don't mention the whitelisted finds
They obscure the real finds

Closes #20158
2026-01-02 11:21:31 +01:00
Viktor Szakats
438ba94461
vtls: drop unused use_alpn from ssl_connect_data struct
Closes #20154
2026-01-02 10:45:12 +01:00
Viktor Szakats
d3bf8d391f
src: drop redundant definition of BIT()
It's defined in `lib/curl_setup_once.h` which is always included before
the duplicate definition in `src/tool_cfgable.h`. Delete the latter.

Follow-up to 06bb158737 #16211

Closes #20152
2026-01-02 10:45:12 +01:00
Viktor Szakats
74c4bdc244
ws: replace a cast by matching the format string
Closes #20151
2026-01-02 10:45:12 +01:00
Joshua Vandaële
27ffb81a58
cmake: set found status to OFF when not found (for compression deps)
This fixes curl using libraries if `CURL_{BROTLI|ZLIB|ZSTD}` is set to
`OFF` but the library was found in a parent project that includes curl.

Closes #20147
2026-01-02 01:29:47 +01:00
Viktor Szakats
8292820b73
pytest: replace allowlist with feature check to enable OCSP test 17_08
Add a `cert-status` feature flag to `curlinfo`, based on the conditions
used in `lib/vtls` sources.

To:
- fix disabling this test when using OpenSSL (or fork) built with
  the `no-ocsp` option.
- enable this test for AWS-LC in CI.

Note:
- BoringSSL (and quiche) has OSCP disabled by default.
- MultiSSL dynamic selection continues to confuse this test.
  (To fix it, support would need to be detected by querying libcurl
  via curl. Probably overkill given that OCSP is on its way out.)

Follow-up to f2c765028f #20149

Closes #20133
2026-01-02 01:23:27 +01:00
Viktor Szakats
f2c765028f
pytest: enable OCSP test 17_08 for LibreSSL
Before: 735 passed, 115 skipped
After: 738 passed, 112 skipped

Closes #20149
2026-01-01 23:46:05 +01:00
Daniel Stenberg
84e43eefc8
mqtt: return error when a too large packet is decoded
Closes #20148
2026-01-01 23:30:10 +01:00
Viktor Szakats
26c437b1bb
GHA/non-native: stop building examples in a cross-job
To make the longest running FreeBSD job finish 1.5 minutes faster
(9.5m -> 8m).

Examples are still built with both autotools and cmake, one on Intel and
one on ARM.

Closes #20146
2026-01-01 23:07:03 +01:00
dependabot[bot]
ef97f47635
GHA: bump pip-dependencies
- update `ruff` from 0.14.9 to 0.14.10
- update `psutil` from 7.1.3 to 7.2.0

Closes #20141
2026-01-01 20:49:00 +01:00
dependabot[bot]
34683b552c
GHA: bump gha-dependencies
- update `github/codeql-action` from 4.31.8 to 4.31.9
- update `cross-platform-actions/action` from 0.30.0 to 0.32.0
  - support for OmniOS and FreeBSD 15.0
  - releases are now immutable

Closes #20140
2026-01-01 20:48:59 +01:00
Daniel Stenberg
f7d8725a55
inet_ntop: avoid the strlen()
Also, skip adding the terminating null that is not used.

Closes #20139
2026-01-01 18:06:39 +01:00
Daniel Stenberg
d3eddf4761
source: misc typos
Found by typos-cli

Closes #20138
2026-01-01 12:43:59 +01:00
Daniel Stenberg
23b080401a
tool_getparam: simplify the --rate parser
Avoids a memcpy()

Closes #20119
2026-01-01 12:34:54 +01:00
Stuart Henderson
c257831471
CHANGES: fix typo in filename
Closes #20137
2026-01-01 12:20:10 +01:00
Daniel Stenberg
c7b26b6679
tool_paramhlp: simplify number parsing
Closes #20134
2026-01-01 12:15:34 +01:00
Viktor Szakats
1ca678472f
tests: drop redundant parenthesis from two macro expressions
Closes #20136
2025-12-31 18:49:53 +01:00
Viktor Szakats
e4f4eeb0c5
libssh: fix indent
Closes #20135
2025-12-31 18:49:53 +01:00
Daniel Stenberg
0c278cd586
tool_paramhlp: remove a malloc+free from proto2num()
Closes #20120
2025-12-31 17:59:30 +01:00
Daniel Stenberg
bfa5857c44
test1664: extend with more tests for curlx_str_quotedword
Closes #20123
2025-12-31 17:06:09 +01:00
Viktor Szakats
258521e170
hostip.h: drop redundant setjmp.h include
Already included directly via `hostip.c`, and other header users do not
use it.

Also add comment about why `setjmp.h` is used.

Cherry-picked from #20106

Closes #20132
2025-12-31 17:00:57 +01:00
Viktor Szakats
352f3f140c
tests: include headers only when used
Cherry-picked from #20106

Closes #20131
2025-12-31 17:00:56 +01:00
Viktor Szakats
7ad830bb58
openssl: stop checking for OPENSSL_NO_SHA* macros
Macros have been deleted upstream and never defined in OpenSSL 1.1.0+:
474e469bbd

BoringSSL deleted the last internals uses in 2014:
457112e197

LibreSSL refers to them internally and in two public headers, but never
set them via `openssl/opensslfeatures.h` / `openssl/opensslconf.h`.

Follow-up to 69c89bf3d3 #18330

Closes #20130
2025-12-31 17:00:03 +01:00
Viktor Szakats
0d0ac29cdd
openssl: stop checking for OPENSSL_NO_TLSEXT macro
The macro has been deleted upstream and never defined in OpenSSL 1.1.0+:
e481f9b90b

BoringSSL and LibreSSL deleted the last uses in 2014:
6dbd73db5d
7b2f3298f7

Also:
- drop internal guard `HAS_ALPN_OPENSSL`. It's always set.

Follow-up to 69c89bf3d3 #18330

Closes #20129
2025-12-31 16:55:52 +01:00
Viktor Szakats
c7b25e6e82
lib: drop unused or duplicate curlx/timeval.h includes
Note: This patch doesn't aim to add `timeval.h` includes missing from
local headers using `curltime` type. They remain relying on `urldata.h`
being included first. This patch also doesn't delete existing, used
includes already present in local headers (as internal users may rely
on them).

Ref: #20106
Closes #20126
2025-12-31 15:59:19 +01:00
Viktor Szakats
def95e3bbc
openssl: fix building against no-ocsp openssl with Apple SecTrust
(Not tested in CI. Regression in 8.17.0.)

Fixing:
```
lib/vtls/openssl.c:4750:8: error: variable 'sectrust_verified' set but not used [-Werror,-Wunused-but-set-variable]
 4750 |   bool sectrust_verified = FALSE;
      |        ^
1 error generated.
```

Follow-up to b4630ed8fa #19308

Closes #20128
2025-12-31 15:51:02 +01:00
Viktor Szakats
be675eeb6d
openssl: fix building against no-dsa openssl
(Not tested in CI. Regression within this release cycle.)

Fixing:
```
lib/vtls/openssl.c:304:48: error: unused parameter 'data' [-Werror,-Wunused-parameter]
  304 | static CURLcode get_pkey_dsa(struct Curl_easy *data,
      |                                                ^
lib/vtls/openssl.c:305:40: error: unused parameter 'pubkey' [-Werror,-Wunused-parameter]
  305 |                              EVP_PKEY *pubkey, BIO *mem, int i)
      |                                        ^
lib/vtls/openssl.c:305:53: error: unused parameter 'mem' [-Werror,-Wunused-parameter]
  305 |                              EVP_PKEY *pubkey, BIO *mem, int i)
      |                                                     ^
lib/vtls/openssl.c:305:62: error: unused parameter 'i' [-Werror,-Wunused-parameter]
  305 |                              EVP_PKEY *pubkey, BIO *mem, int i)
      |                                                              ^
```

Follow-up to 833efb437d #19471

Closes #20127
2025-12-31 15:51:01 +01:00
renovate[bot]
ba7e729ffd
Dockerfile: update debian:bookworm-slim Docker digest to d5d3f9c
Closes #20115
2025-12-31 12:22:53 +01:00
Yedaya Katsman
660600c747
badwords: add fist -> first, fix fallouts
There are still `curl_fistrgs` in packages/OS400/curl.inc.in but
I'm not sure what that's supposed to be exactly.

Closes #20066
2025-12-31 12:21:42 +01:00
Viktor Szakats
8c02407bef
tool_doswin: add debug envs to test filename sanitization failure modes
- `CURL_FN_SANITIZE_BAD=<any-value>` to simulate
  `SANITIZE_ERR_INVALID_PATH`.

- `CURL_FN_SANITIZE_OOM=<any-value>` to simulate
  `SANITIZE_ERR_OUT_OF_MEMORY`.

Both are Windows/MS-DOS-specific and require debug-enabled curl build.

Cherry-picked from #20116
Closes #20125
2025-12-31 12:16:11 +01:00
Daniel Stenberg
37d871af01
tool_getparam: use memdup0() instead of malloc + copy
Closes #20118
2025-12-30 23:53:24 +01:00
trxvorr
f81e7197c1
digest: fix OWS and escaped quote handling
The migration to the strparse API introduced regressions in Digest
authentication parsing where Optional Whitespace (OWS) after commas was
not skipped, and escaped quotes in values were not correctly parsed.

This change ensures whitespace is skipped before key lookups and escaped
characters are properly handled and unescaped in quoted values.

Reported-by: herdiyanitdev on hackerone
Closes #20102
2025-12-30 23:22:26 +01:00
Viktor Szakats
5f5e000278
RELEASE-NOTES: codespell 2025-12-30 17:35:00 +01:00
Daniel Stenberg
d6be42eafa
delta: fix grep patterns after white space edits
To make the command line option counter work again

Follow-up to 308c347c8b
2025-12-30 14:04:10 +01:00
Daniel Stenberg
8870fd2b87
RELEASE-NOTES: synced 2025-12-30 14:02:03 +01:00
Viktor Szakats
65993d9c5f
libcurl-errors: delete stray double quote
Closes #20117
2025-12-30 12:01:05 +01:00
Jay Satiro
1068d048ec tool_doswin: increase allowable length of path sanitizer
- Use 32767-1 instead of PATH_MAX-1 (260-1) as the maximum allowable
  length of a path in Windows.

Prior to this change the path sanitizer in Windows used 32767-1 as the
maximum length only for paths that had the "\\" prefix like
"\\?\longpath". Since then we added some workarounds to open longer
paths without "\\?\" prefix by normalizing the path and adding that
prefix, and the sanitizer is called before the prefix is added.

Bug: https://github.com/curl/curl/issues/20044
Reported-by: Viktor Szakats

Closes https://github.com/curl/curl/pull/20046
2025-12-30 04:00:50 -05:00
Stefan Eissing
52ac8104e1
ratelimit blocking: fix busy loop
Fix the pollset in perform state to not add sockets for directions
that are blocked. This otherwise will lead to busy loops for a
transfer that cannot be progressed.

Reported-by: Fizn-Ahmd on github
Fixes #20091
Closes #20109
2025-12-29 22:44:34 +01:00
Harry Sintonen
16d5f2a566
libssh: require private key or user-agent for public key auth
Closes #20110
2025-12-29 17:28:22 +01:00
Daniel Stenberg
bc9ab557df
telnet: abort on bad suboption sequence
Instead of trying to repair.

Reported-by: Huseyin Tintas

Closes #20108
2025-12-29 10:49:30 +01:00
Daniel Stenberg
7fc78c2c1c
urlapi: set uncondtional return code
Curl_parse_login_details() can only return a single return code so
adjust accordingly.

Pointed out by CodeSonar

Closes #20107
2025-12-29 10:17:49 +01:00
Daniel Stenberg
2754e0f3d3
url: return error at once when OOM in netrc handling
Closes #20103
2025-12-29 10:16:48 +01:00
Daniel Stenberg
5c0cdd26d6
strcopy: minor comment edit to avoid matching a grep for strcpy use 2025-12-27 23:25:13 +01:00
Daniel Stenberg
6842d4ec4d
curl_quiche: refuse headers with CR, LF or null bytes
Also renamed the struct field to 'h1hdr' from 'scratch' to better say
what its purpose is.

Closes #20101
2025-12-27 16:27:11 +01:00
Daniel Stenberg
0e054134b7
urlapi: return OOM correctly from parse_hostname_login()
Closes #20100
2025-12-27 16:25:55 +01:00
Daniel Stenberg
0ccd16d29a
ftp: return from ftp_state_use_port immediately on OOM
Closes #20100
2025-12-27 16:25:52 +01:00
Daniel Stenberg
19ca87d4e2
cf-socket: return OOM error if socket() failes due to OOM
Closes #20100
2025-12-27 16:25:38 +01:00
Viktor Szakats
7032982896
tidy-up: miscellaneous
- asyn-thrdd.c: scope an include.
- apply more clang-format suggestions.
- tidy-up PP guard comments.
- delete empty line from the top of headers.
- add empty line after `curl_setup.h` include where missing.
- fix indent.
- CODE_STYLE.md: add `strcpy`.
  Follow-up to 8636ad55df #20088
- lib1901.c: drop unnecessary line.
  Follow-up to 436e67f65b #20076

Closes #20070
2025-12-26 22:06:09 +01:00
Daniel Stenberg
abcb10f3ac
ftp: return better on OOM in two places
Found with strict torture testing.

Closes #20099
2025-12-26 10:48:41 +01:00
Daniel Stenberg
a585cc35e5
memdebug: stop tracking send and recv
- they rarely catch any problems
- we have other ways to test different send/recv problems
- the number of such calls vary much more per invoke than others, making
  memdebugging harder
- reducing the total number of fallible functions per test is good
- they were not used as intended anyway

Closes #20097
2025-12-26 10:27:27 +01:00
Daniel Stenberg
d4b62bff64
curl_threads: don't do another malloc if the first fails
Closes #20095
2025-12-25 22:14:39 +01:00
Viktor Szakats
685173e881
src: drop unused includes
Also replace some indirect includes with direct ones.

Closes #20096
2025-12-25 18:42:54 +01:00
Daniel Stenberg
ed966832b6
RELEASE-NOTES: synced 2025-12-25 12:13:55 +01:00
Daniel Stenberg
18af4e4e10
cookie: flush better
The cookie flushing (saving to a cookie jar) should only be done if a
transfer has been started. This is now done by checking the
cookies->running field, which is not reset in curl_easy_reset() so the
saving works correctly even after a call to that.

Follow-up to fd6eb8d6e7

Verified by test 1920

Reported-by: Alexander Batischev
Fixes #20090
Closes #20094
2025-12-25 12:05:23 +01:00
Viktor Szakats
e78a466ebd
lib: drop unused protocol headers
- drop unused `http.h` includes.
- drop unused `http1.h` include.
- drop unused `http2.h` includes.
- vssh/ssh.h: drop unused `vssh.h` include.
- urldata.h: drop unused protocol includes.
- url: include `smtp.h` directly.
- rtsp.h: include directly where used.
- imap, smtp: drop redundant include, move another from .h to .c.

Verified with an all non-unity CI run.

Closes #20093
2025-12-25 12:00:22 +01:00
Daniel Stenberg
adca486c12
libssh: set both knownhosts options to the same file
Reported-by: Harry Sintonen

Closes #20092
2025-12-25 11:01:41 +01:00
Viktor Szakats
c882439d53
os400sys: replace strcpy() with memcpy()
Source and target are the same size, null-terminator is already present
in the target buffer.

Closes #20089
2025-12-24 23:53:40 +01:00
Daniel Stenberg
ca46112991
curl_ntlm_core: fix DES_* symbols for some wolfSSL builds
Recent wolfSSL with OPENSSL_COEXIST enabled does not provide the DES_*
symbols, so we do.

Reported-by: Daniel Pouzzner
Closes #20083
2025-12-24 22:49:43 +01:00
Daniel Stenberg
76e7d496b6
escape: add a length check in curl_easy_escape
Only accept up to SIZE_MAX/16 input bytes. To avoid overflows, mistakes
and abuse.

Follow-up to 9bfc7f9234

Reported-by: Daniel Santos

Closes #20086
2025-12-24 22:47:26 +01:00
Viktor Szakats
8636ad55df
checksrc: ban strcpy
No longer used in the codebase. Replacement is `curlx_strcopy()`, possibly
`memcpy()` or dynbuf.

Also:
- OS400: allow three calls.

Closes #20088
2025-12-24 13:55:25 +01:00
Viktor Szakats
532d134767
build: stop disabling strcpy checks with clang-tidy
Follow-up to 436e67f65b #20076

Closes #20084
2025-12-24 00:02:40 +01:00
Viktor Szakats
436e67f65b
tests: replace strcpy() with curlx_strcopy()
Also:
- examples/hsts-preload: apply the same change as it's based on lib1915
  in tests. Make a local clone of `curlx_strcopy()`. Then drop the
  `_CRT_SECURE_NO_WARNINGS` hack, that's no longer necessary.
- curl_setup.h: delete `strcpy()` from the `_CRT_SECURE_NO_WARNINGS`
  list.

Closes #20076
2025-12-23 22:25:39 +01:00
Viktor Szakats
66aec526fc
lib547, 555: fix off-by-one null-terminator in read callback
`strcpy()` wrote an unnecessary null-terminator past the available read
buffer.

test551 was also affected because it reuses lib547.

Cherry-picked from #20076
Closes #20082
2025-12-23 19:49:59 +01:00
Daniel Stenberg
7e064d0756
cf-h1-proxy: support folded headers in CONNECT responses
Update test 1941 to verify this

Remove unused code from dynhds for handling folded headers, and the
associated unit tests of those functions in test 2602 and 2603.

Closes #20080
2025-12-23 17:12:14 +01:00
renovate[bot]
cb9db70dbe
GHA: update ngtcp2/nghttp3 to v1.14.0
Closes #20078
2025-12-23 17:09:05 +01:00
renovate[bot]
1b4ef87dee
GHA: update ngtcp2/ngtcp2 to v1.19.0
Closes #20079
2025-12-23 17:01:38 +01:00
Viktor Szakats
17628b15ec
vquic: initialize new callback in nghttp3 1.14.0+
Fixing (seen in curl-for-win production build):
```
lib/vquic/curl_ngtcp2.c:1257:1: error: missing field 'recv_settings2' initializer [-Werror,-Wmissing-field-initializers]
 1257 | };
      | ^
1 error generated.
```
Ref: https://ci.appveyor.com/project/curlorg/curl-for-win/builds/53281785#L6752
Ref: https://github.com/curl/curl/actions/runs/20459295003/job/58788229134#step:3:5513

Also:
- Mark previous callback deprecated.
- Document ngtcp2, nghttp3 versions for callback entry feature guards.

Refs:
https://github.com/ngtcp2/nghttp3/releases/tag/v1.14.0
https://github.com/ngtcp2/nghttp3/pull/432
1616ab8350

Closes #20077
2025-12-23 13:34:07 +01:00
Daniel Stenberg
a535be4ea0
curlx: curlx_strcopy() instead of strcpy()
This function REQUIRES the size of the target buffer as well as the
length of the source string. Meant to make it harder to do a bad
strcpy().

Removes 23 calls to strcpy().

Closes #20067
2025-12-22 23:01:05 +01:00
Stefan Eissing
f099c2ca55
apple sectrust: fix ancient evaluation
On versions before macOS 10.14, ios 12 and watchos 5, check the
evaluation code to return the error from evaluation.

Reported-by: Stanislav Fort
Closes #20074
2025-12-22 23:00:08 +01:00
Daniel Stenberg
230ee539e6
CURLOPT_HAPROXY_CLIENT_IP.md: emphasize reused connection use
Closes #20075
2025-12-22 22:53:14 +01:00
Daniel Stenberg
6b9c75e219
content_encoding: avoid strcpy
Build list with dynbuf.

Closes #20072
2025-12-22 14:17:21 +01:00
Viktor Szakats
d92e264ff0
curlx: rename Curl_-prefixed symbols to curlx_
Closes #20069
2025-12-22 01:47:22 +01:00
Viktor Szakats
6e6fafa9b0
binmode: delete extra nop instruction from fallback macro
Follow-up to 250d613763 #15787

Closes #20068
2025-12-22 01:47:21 +01:00
Viktor Szakats
4ad87f2cb8
checksrc: ensure using ifdef/ifndef when possible, fix fallouts
Follow-up to 89771d19d5 #18018

Closes #20065
2025-12-21 21:12:31 +01:00
Viktor Szakats
e8415a8296
lib: drop, or replace sendf.h with curl_trc.h where possible
- replace `sendf.h` with `curl_trc.h` where it was included just for it.
- drop unused `curl_trc.h` includes.
- easy: delete obsolete comment about `send.h` include reason.

Also:
- move out `curl_trc.h` include from `sendf.h` and include it directly
  in users, where not done already. To flatten the include tree and
  to less rely on indirect includes.
- stop including `sendf.h` from other headers, replace it with forward
  declaration of `Curl_easy`, as done already elsewhere.

Verified with an all non-unity CI run.

Closes #20061
2025-12-21 12:39:25 +01:00
Viktor Szakats
4df7269ba8
test96: fix to accept non-unity memdump content with MSVC
In unity builds the source filename (via `__FILE__`) has no path (or
uses slashes?), while in non-unity ones it does contain backslashes
on Windows, with MSVC. Fix the test to recognize backslashes in the
`stripfile` regexp.

Seen in MSVC jobs in CI:
```diff
-MEM tool_cfgable.c[LF]
-MEM tool_paramhlp.c[LF]
-MEM tool_cfgable.c[LF]
-MEM tool_cfgable.c[LF]
-MEM tool_cfgable.c[LF]
-MEM tool_cfgable.c[LF]
+MEM D:\a\curl\curl\src\tool_cfgable.c[LF]
+MEM D:\a\curl\curl\src\tool_paramhlp.c[LF]
+MEM D:\a\curl\curl\src\tool_cfgable.c[LF]
+MEM D:\a\curl\curl\src\tool_cfgable.c[LF]
+MEM D:\a\curl\curl\src\tool_cfgable.c[LF]
+MEM D:\a\curl\curl\src\tool_cfgable.c[LF]
```
Ref: https://github.com/curl/curl/actions/runs/20408366058/job/58641468316?pr=20061#step:13:303
Ref: https://github.com/curl/curl/actions/runs/20408522070/job/58641826216?pr=20064#step:13:298

Closes #20064
2025-12-21 12:11:56 +01:00
Viktor Szakats
4cf88d8477
x509asn1: drop unused hostcheck.h, vtls_int.h includes
Closes #20063
2025-12-21 11:14:22 +01:00
Viktor Szakats
884b5ea921
lib: include curlx/warnless.h from curl_setup.h
To make it available for all files. Drop includes from individual
sources. This header was already included from most sources and not
specific to any internal subsystem.

Also to ensure that two system symbol redefines on Windows (`read()` and
`write()`) get applied to all sources. Move them to `curl_setup.h`.

Closes #20056
2025-12-21 02:36:33 +01:00
Viktor Szakats
70651cb6de
lib: drop unused vssh/ssh.h includes
Closes #20060
2025-12-21 02:31:58 +01:00
Viktor Szakats
a3f866ac76
transfer: drop unused vquic/vquic.h include
Closes #20059
2025-12-21 02:31:58 +01:00
Viktor Szakats
6011b83852
curl_ntlm_core: move vauth/vauth.h include from header to source
To not include it implicitly for all `curl_ntlm_core.h` users.

Closes #20058
2025-12-21 02:16:34 +01:00
Viktor Szakats
d4298603b5
tidy-up: curlx/nonblock.h includes
Delete where unused, include where to used to avoid relying on
side-effect of other headers.

Also: delete "for curlx_nonblock" comments. That's the only symbol
offered by this header.

Closes #20055
2025-12-21 02:16:34 +01:00
Viktor Szakats
fdb5152091
lib: drop unused vtls/vtls.h includes
Closes #20057
2025-12-21 02:16:34 +01:00
Viktor Szakats
3c1c299b27
lib: drop unused curlx headers
`curlx/base64.h` and `curlx/strparse.h`.

Closes #20054
2025-12-21 02:16:33 +01:00
Viktor Szakats
a354cc8664
lib: drop includes unused or duplicate
Closes #20051
2025-12-20 22:02:20 +01:00
Viktor Szakats
df4edd28f2
socks.h: delete obsolete, unused, macros
Unused since dafdb20a26 #9855

Cherry-picked from #20051

Closes #20053
2025-12-20 21:14:56 +01:00
Viktor Szakats
b5aafb81df
lib: use SOCKET_WRITABLE()/SOCKET_READABLE() where possible
Closes #20052
2025-12-20 21:14:55 +01:00
Daniel Stenberg
94a57b4e15
contrithanks.sh: adopt the stricter by: check from contributors.sh 2025-12-20 17:45:15 +01:00
Daniel Stenberg
50b29440a3
contributors.sh: even stricter requirements for the -by: line 2025-12-20 17:44:18 +01:00
Wyatt O'Day
1dc6ddde06
mbedTLS: cleanup insecure/deprecated code
1. With `MBEDTLS_SSL_PROTO_TLS1_2` not enabled, the mbedTLS code was not
able to connect to any server due to broken logic in curl's
`mbed_set_ssl_version_min_max()`. Now it correctly sets the minimum
supported TLS version based on what is compiled in the library.

2. If debugging is enabled, move the debugging enabling earlier in the
`mbed_connect_step1()` so that verbose errors are actually displayed if
failures happen (see the previous point -- it would've made debugging
that issue easier).

3. Remove the constant `mbedtls_x509_crt_profile_fr` and instead use
mbedTLS-included profile `mbedtls_x509_crt_profile_next` with
`mbedtls_ssl_conf_cert_profile()`. This will follow the latest standards
as new mbedTLS versions are released (rather than being stuck-in-time
until someone comes along to fix what was hard-coded here). This has the
immediate benefit of no longer supporting SHA1 certs and insecure RSA
key-lengths (1024). This fix immediately prevents previously possible
MITM attacks (SHA1 hashes and RSA-1024 keys can be forged relatively
easily by nation-state actors and criminal organizations with
deep-pockets).

4. Added [predictive
resistance](https://mbed-tls.readthedocs.io/en/latest/kb/how-to/add-a-random-generator/#enabling-prediction-resistance)
to the random number generator (adding more entropy to the RNG).

5. Split the random number generator into initialization, the actual
random generation, and the "freeing" of the resources. This
significantly reduces the overhead of using the RNG.

6. Removed the separate RNG function in the TLS connect stage (instead
use the "main" one) and remove the ad-hoc threading support. Instead
properly document how to enable threading in mbedTLS. As it was, other
internals of mbedTLS could have race conditions (in the RSA module in
particular) if `MBEDTLS_THREADING_C` was *not* enabled. And if it is
enabled, then these race-conditions cannot happen. And also, if
MBEDTLS_THREADING_C is enabled then the RNG functions [are fully
thread-safe](https://mbed-tls.readthedocs.io/en/latest/kb/development/thread-safety-and-multi-threading/).

   So, the previous ad-hoc threading support was both partial and broken.

7. Enable support for disabling `MBEDTLS_PEM_PARSE_C`.

8. Add support for `CURLOPT_SSLCERTTYPE` so user can specify `PEM` or
`DER` and get faster execution.

Closes #19983
2025-12-20 17:33:57 +01:00
Stefan Eissing
d405ac84ea
multi-notify: add check macro
Since Curl_mntfy_dispatch_all() is called with high frequency and
mostly unnecessary, add a check macro to avoid the call when not
needed.

Closes #20034
2025-12-20 17:30:54 +01:00
Daniel Stenberg
c85994d53b
http: minor cleanup after the unfold rework
Closes #20037
2025-12-20 16:46:12 +01:00
Viktor Szakats
6d0ee7b17b
curlx: add curlx_rename(), fix to support long filenames on Windows
Move existing `Curl_rename()` `rename()` wrapper from lib to
curlx/fopen, and make it a curlx macro/function. To allow using
the local worker function to fixup long filenames on Windows.

Then fix the Windows-specific rename implementation to support long
filenames. This operation may happen when using a cookie jar, HSTS cache
or alt-svc cache, via libcurl or the curl tool.

Before this patch, when passing a long filename to the above options,
a `<random>.tmp` file was left on the disk without renaming it to the
filename passed to curl. There was also 1 second delay for each
attempted rename operation.

Also:
- checksrc: ban raw `rename()` and `MoveFileEx*()` functions.
- Note: `Curl_rename()` returned 1 on failure before this patch, while
  `curlx_rename()` returns -1 after, to match POSIX `rename()`.

Refs:
https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-movefileexa
https://learn.microsoft.com/windows/win32/fileio/maximum-file-path-limitation

Ref: #20040

Closes #20042
2025-12-20 16:03:11 +01:00
Viktor Szakats
424cef6733
GHA/http3-linux: set minimum number of runtest tests
Tailored for each job with a relatively tight limits. Also with no
tolerance in valgrind tests: 4 of the 4 has to be run.

Based on Test Clutch feature matrix which displays the minimum and
actual number of tests:
https://testclutch.curl.se/static/reports/feature-matrix.html

Also:
- runtests.pl: include total number of tests in the error message shown
  when the limit was not met.

Assisted-by: Dan Fandrich
Follow-up to 3f1cd809ee #19942

Closes #20050
2025-12-20 15:31:30 +01:00
Viktor Szakats
969351bb1e
windows: fix CreateFile() calls to support long filenames
It makes them work in Schannel's CA bundle loader, and curl tool's
set/get file timestamp operations (e.g. in `-R`/`--remote-time`). Also
to match file open operations, that already support long filenames.

E.g. when using `--remote-time`, fixing:
```
Warning: Failed to set filetime 1741363917 on outfile: CreateFile failed:
Warning: GetLastError 0x00000003
```

The special long filename logic is necessary to support Windows releases
prior to Windows 10 v1607. With the latter, it's possible to opt-in to
this behavior via a manifest setting. Note that Windows itself also needs
to opt-in to support this. Finally note that curl itself needs passing
`--globoff` to let long filenames through, pending #20044 and #20046.

Refs:
https://learn.microsoft.com/windows/win32/api/fileapi/nf-fileapi-createfilea
https://learn.microsoft.com/windows/win32/fileio/maximum-file-path-limitation

Ref: #8361
Inspired by: #19286
Inspired-by: Mathesh V
Closes #19286
Closes #20040
2025-12-20 14:16:42 +01:00
Viktor Szakats
a468e605eb
openssl: drop includes unused or duplicate
Also:
- vquic-tls.h: do not include unused headers for non-H3 builds.
- autotools: stop looking for `openssl/x509.h` header.
- cmp-config.pl: delete exception for `openssl/x509.h`.
- examples: format/comment sync between the two touched files.
- openssl: drop unused `curlx/wait.h` include.

Closes #20049
2025-12-20 13:51:05 +01:00
Viktor Szakats
43baf7a426
lib: drop unused rand.h includes
Closes #20047
2025-12-20 13:51:04 +01:00
Viktor Szakats
ff85571115
curl_ntlm_core: drop unused OpenSSL/wolfSSL headers
`openssl/rand.h` and `openssl/ssl.h`.

Closes #20048
2025-12-20 12:59:06 +01:00
Viktor Szakats
e157638981
curlx: use curl alloc in curlx_win32_stat() (Windows)
It's safe because we do not call `curlx_win32_stat()` from memdebug.c.

Closes #20043
2025-12-20 12:06:25 +01:00
Viktor Szakats
c0d8fedb49
tool_urlglob: constify an argument
Also: add argument names to prototypes.

Closes #20045
2025-12-20 11:34:28 +01:00
Viktor Szakats
1892286086
cmake: match filename suffixes with file content
To:
- simplify recognizing CMake sources.
- ensure syntax highlighters use the correct file type.
- sync .h template filename with its autotools counterpart.

Also:
- cmakelint.sh: simplify, alpha sort the filelist.
- perlcheck.sh: simplify.

Closes #20039
2025-12-20 11:34:27 +01:00
Viktor Szakats
7ded0e21cd
cmake: delete unused file CMake/CMakeConfigurableFile.in
Follow-up to 8cb0101449

Closes #20038
2025-12-19 15:35:15 +01:00
Stefan Eissing
4ec7136010
scorecard: more upload options
`--upload-no-cl` for uploads without "Content-Length:"
`--upload-parallel=1` for testing only serial uploads

Closes #20035
2025-12-19 13:58:12 +01:00
Stefan Eissing
0f7b182f2f
ngtcp2: retune window sizes
With 24b36fd stream flow control window sizes have been set too
restrictive, crippling transfer rates when no rate limit is in effect.

Disable ngtcp3 stream window auto-tuning and extend the stream window
from the small initial size to the effective rate limit. If no rate
limit is configured, extend stream window to maximum value right away.

This cannot shrink the stream window later, however. But growing the
limit or removing it, will work mid download.

Fixes #20030
Reported-by: koujaz on github
Closes #20033
2025-12-19 13:56:07 +01:00
Daniel Stenberg
3388afd2b6
http: more unfold fixing
Extended test 798 with some mini-sleeps to better trigger a problem that
was

Reported-by: Stefan Eissing

Closes #20036
2025-12-19 13:52:10 +01:00
Viktor Szakats
3233304224
socketpair: drop redundant _WIN32 branch and include
`io.h` already included via `curl_setup.h`, the other headers are
already guarded off for Windows. `INADDR_LOOPBACK` fallback remains
a no-op on Windows.

Closes #20032
2025-12-19 11:40:59 +01:00
Daniel Stenberg
eeb9689755
RELEASE-NOTES: synced 2025-12-19 11:07:53 +01:00
Daniel Stenberg
828d2e8762
contributors.sh: only check -by: lines for names
Avoid catching lines that otherwise just says "by:" something.
2025-12-19 11:07:53 +01:00
Viktor Szakats
d11b8593a2
build: drop duplicate include curl/curl.h and others
- curl_range: replace `sendf.h` with direct header dependency
  `curl_trc.h`.
- drop `curl/curl.h` includes from internal sourcees in favor of the
  include made from `curl_setup.h`. Replace it with the latter where
  it's the only include.
- include `curl_setup.h` before using macros, where missing.
- drop redundant `stdlib.h`, `string.h` includes, in favor of
  `curl_setup_once.h` including them.
- drop redundant `limits.h` in favor of `curl_setup.h` including it.
- fake_addrinfo.h: fix typo in comment.
- curl_setup_once.h: drop `stdio.h` in favor of earlier include in
  `curl_setup.h`.
- drop stray, unused, `stddef.h` includes.
- memdebug.h: add missing `stddef.h` include. (relying on accidental
  includes via other headers before this patch.)
- stddef.h: document why it's included.
- strerr: drop `curl/mprintf.h` in favor of `curl/curl.h` including it
  via `curl_setup.h`.

Closes #20027
2025-12-19 10:58:11 +01:00
Daniel Stenberg
6c7bc9871f
http: fix for unfolding line starting with TAB
It should still insert a (single) space when unfolding

Follow-up to 9941e7c95b following up to 67ae101666.

Updated test 1274 and 1940 accordingly.

Closes #20029
2025-12-19 10:52:39 +01:00
Daniel Stenberg
481f11d96f
CURLOPT_ACCEPT_ENCODING.md: warn about the expansion
also mention it in KNOWN_RISKS.md

Closes #20031
2025-12-19 10:44:43 +01:00
Daniel Stenberg
26d3b9e7b9
compressed.md: might generate a huge amount of bytes
Make sure this is not a surprise

Closes #20028
2025-12-19 10:11:27 +01:00
Viktor Szakats
7db60495ad
build: drop unused includes
`curl_endian.h`, `easyif.h`, `llist.h`, `progress.h`, `slist.h`.

Also:
- multi_ev.h: delete unused include, add a missing direct one.

Closes #20025
2025-12-19 02:04:20 +01:00
Viktor Szakats
fb50214604
build: drop unused multiif.h includes
Closes #20023
2025-12-19 01:45:05 +01:00
Viktor Szakats
e59e512635
curl_trc: delete unused DoH remains
Closes #20026
2025-12-19 01:35:07 +01:00
Viktor Szakats
eb72ec4f12
build: drop unused curlx/inet_pton.h includes
Closes #20024
2025-12-19 01:34:56 +01:00
Viktor Szakats
951d778c33
build: drop unused curl_share.h includes
Closes #20022
2025-12-19 01:34:56 +01:00
Viktor Szakats
2c31dc45b4
timeval: scope a variable, merge two PP branches
Closes #20021
2025-12-18 23:31:50 +01:00
Viktor Szakats
1e0865b630
TIME-KEEPING.md: fold long lines 2025-12-18 23:00:06 +01:00
Stefan Eissing
b4be1f271e
time-keeping: keep timestamp in multi, always update
Always use curlx_now() when calling Curl_pgrs_now(data). Tests with the
"manual" updates to now proved differ more then 100ms in parallel testing.

Add `curlx_nowp()` to set current time into a struct curltime.
Add `curlx_ptimediff_ms() and friends, passing pointers.

Update documentation.

Closes #19998
2025-12-18 22:10:06 +01:00
Viktor Szakats
308c347c8b
tidy-up: miscellaneous
- apply more clang-format.
- lib/version: use `CURL_ARRAYSIZE()`.
- INSTALL-CMAKE.md: sync-up an option description with others.
- examples: delete unused main args.
- examples/ftpgetinfo: document `_CRT_SECURE_NO_WARNINGS` symbol.
- delete remaining stray duplicate lines.
- acinclude.m4: drop an unnecessary x-hack.
- vtls/mbedtls: join a URL split into two lines.
- src/tool_cb_see: add parentheses around macro expressions.
- src/tool_operate: move literals to the right side of comparisons.
- libtests: sync up fopen/fstat error messages between tests.
- curl_setup.h: replace `if ! defined __LP64` with `ifndef __LP64`.
  I assume it makes no difference on Tandem systems, as the latter form
  is already used in `include/curl/system.h`.

Closes #20018
2025-12-18 21:27:58 +01:00
Viktor Szakats
cd9da30e76
INSTALL-CMAKE.md: add recently added targets
Follow-up to d7bde803ee #20014

Closes #20020
2025-12-18 21:27:58 +01:00
Daniel Stenberg
9941e7c95b
http: when unfolding, leave single-space for new header line
Restore the unfolding behavior from before 67ae101666. This change
(leaving more whitespace in the delivered headers) turned out causing
some friction in the git project so presumably others might also find it
a little surprising.

Reported-by: Jeff King
Ref: https://marc.info/?l=git&m=176606332701171&w=2
Closes #20016
2025-12-18 17:41:46 +01:00
Viktor Szakats
673e02a616
cmake/FindRustls: merge two ifs
Closes #20017
2025-12-18 15:16:33 +01:00
Viktor Szakats
d7bde803ee
cmake: add curl-optiontable, curl-listhelp, curl-listcats targets
To match autotools `optiontable`, `listhelp`, `listcats` targets.

Closes #20014
2025-12-18 12:22:35 +01:00
Viktor Szakats
7e2b15ee56
build: replace -pedantic with -Wpedantic when supported
To use the modern form when possible. The modern option also allows
using the `no-` prefix to disable.

Supported by: gcc 4.8+, clang 3.2+ (= appleclang 4.2+)

This also automatically changes `-clang:-pedantic` to `-Wpedantic` in
clang-cl builds.

Refs:
9877f689f2
https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/Warning-Options.html

Closes #20010
2025-12-18 01:35:59 +01:00
Viktor Szakats
9cd827a226
cmake: replace deprecated OPENSSL_FOUND with OpenSSL_FOUND
Used in `CMake/FindLibrtmp.cmake`.

`OpenSSL_FOUND` available since CMake v3.3.
`OPENSSL_FOUND` deprecated since v4.2.

Ref: https://cmake.org/cmake/help/v4.2/module/FindOpenSSL.html

Closes #20012
2025-12-17 17:56:33 +01:00
Viktor Szakats
14d5b6c7a7
cmake: replace deprecated PERL_FOUND with Perl_FOUND
`Perl_FOUND` available since CMake v3.3.
`PERL_FOUND` deprecated since v4.2.

Ref: https://cmake.org/cmake/help/v4.2/module/FindPerl.html

Closes #20011
2025-12-17 17:56:32 +01:00
Daniel Stenberg
cd046f6c93
openssl: toggling CURLSSLOPT_NO_PARTIALCHAIN makes a different CA cache
Reported-by: Stanislav Fort

Closes #20009
2025-12-17 15:29:37 +01:00
Stefan Eissing
be3c226bb0
wolfssl: proof use of wolfSSL_i2d_SSL_SESSION
While wolfSSL_i2d_SSL_SESSION() does not change the passed pointer, like
OpenSSL does, it may one day decide to do so. Pass a copy instead to be
future-proof to such a change in wolfSSL's implementation.

Closes #20008
2025-12-17 13:52:59 +01:00
Daniel Stenberg
de8470c6e5
multi: remove useless assignment
Pointed out by CodeSonar

Closes #20006
2025-12-17 08:57:44 +01:00
Daniel Stenberg
09f01f28ec
docs: rename CURLcode variables to 'result' 2025-12-17 08:55:12 +01:00
Daniel Stenberg
d21f4372ff
docs: use mresult as variable name for CURLMcode 2025-12-17 08:55:12 +01:00
Daniel Stenberg
56f600ec23
tests: rename CURLMcode variables to mresult 2025-12-17 08:55:12 +01:00
Daniel Stenberg
0a26e3a660
lib: name the main CURLMcode variable 'mresult'
To make it distinctly different from 'result' and keep consistency
betwen functions.

Closes #19997
2025-12-17 08:55:07 +01:00
dependabot[bot]
1b205078bd
GHA: bump pip-dependencies
- update `filelock` from 3.20.0 to 3.20.1 (CVE-2025-68146) (used in pytests)
- update `pytest` from 9.0.1 to 9.0.2
- update `ruff` from 0.14.8 to 0.14.9

Closes #20004
2025-12-17 00:55:26 +01:00
Viktor Szakats
e88209da1f
examples/threaded-ssl: delete in favor of examples/threaded
After applying a recent fix made to `threaded.c` (formerly
`multithread.c`) to `threaded-ssl.c`, syncing and updating comments,
the two examples turned out to be identical except their test URLs.

Delete one of them to avoid duplication.

Also:
- examples/threaded: scope a variable.
- examples/threaded: merge comments from its deleted sibling.

Follow-up to 61273f5812 #20001
Follow-up to 971e8d661c #19526 #19524

Closes #20002
2025-12-17 00:32:20 +01:00
Daniel Stenberg
680f050301
HISTORY: add current website stats 2025-12-16 23:33:54 +01:00
Dan Fandrich
fe91d5d52b tests: add a standard log line for alloc failures
This type of test failure requires a test status line in order to be
consistent with other failures and to be parsed properly by Test Clutch.
This is the same style as an exit or postcheck failure.

Closes #19995
2025-12-16 13:38:56 -08:00
Viktor Szakats
61273f5812
badwords: catch and fix threading-related words
Also:
- sync newlines between the two threaded examples.

Closes #20001
2025-12-16 21:26:58 +01:00
Viktor Szakats
8dadff9434
schannel: use Win8 CERT_NAME_SEARCH_ALL_NAMES_FLAG with old SDKs
Define `CERT_NAME_SEARCH_ALL_NAMES_FLAG` macro if missing.
To allow using a runtime branch regardless of build-time SDK version,
when running on Windows 8+.

In practice it enables this branch for builds using mingw-w64 v3, and
MSVC with Windows SDK <8.

Also reducing build variations.

Follow-up to 29e40a6d8a #4761 #3711
Follow-up to 8996300211 #1325
Follow-up to 172b2beba6 #264 (comment)

Closes #20000
2025-12-16 20:41:11 +01:00
Dan Fandrich
5196abad73 lib: create unitprotos.h in the builddir, not srcdir
The make rule confused automake by changing directories before creating
the file, causing unitprotos.h to be created in the srcdir instead of
the builddir. This results in a stale file and confusing compile errors
in out-of-tree builds.

Fixes #19966
Closes #19993
2025-12-16 09:51:06 -08:00
Viktor Szakats
627e32fa12
cf-socket: enable Win10 TCP_KEEP* options with old SDKs
Define `TCP_KEEP*` macros if they are missing in Windows builds.
To allow using these runtime `setsockopt()` options regardless of
build-time SDK version, when running on Windows 10.0.16299+.

In practice in enables them for builds using mingw-w64 <12, and
MSVC with Windows SDK <10.

Before this patch these runtime options required building curl with
a recent toolchain.

Follow-up to f0de14168a #19559

Closes #19999
2025-12-16 17:22:50 +01:00
Viktor Szakats
be76b32aed
idn: clarify null-termination on Windows
Add comments to clarify that a terminating null is always present in
the buffers returned to the caller.

The curl APIs `win32_idn_to_ascii()` or `win32_ascii_to_idn()` receive
a null-terminated UTF-8 string as input. They first convert it to wide
chars by first asking `MultiByteToWideChar()` to calculate the length,
by passing -1. This API returns the length with the null char included
(= `strlen() + 1`), does the conversion, with the output also
null-terminated. `IdnTo*()` preserve this null character as documented.
Then we pass this null-terminated, fixed-length buffer ito
`WideCharToMultiByte()`, which keeps preserving the null, ending up in
the buffer returned to the caller.

Refs:
https://learn.microsoft.com/windows/win32/api/stringapiset/nf-stringapiset-multibytetowidechar
https://learn.microsoft.com/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte
https://learn.microsoft.com/windows/win32/api/winnls/nf-winnls-idntoascii
https://learn.microsoft.com/windows/win32/api/winnls/nf-winnls-idntounicode

WINE source code:
https://gitlab.winehq.org/wine/wine/-/blob/wine-10.20/dlls/kernelbase/locale.c
https://gitlab.winehq.org/wine/wine/-/blob/wine-10.20/dlls/ntdll/locale.c
https://gitlab.winehq.org/wine/wine/-/blob/wine-10.20/dlls/ntdll/locale_private.h

Ref: https://github.com/curl/curl/pull/19976#issuecomment-3656005765
Follow-up to 6694a42aa0 #19798

Closes #19980
2025-12-16 16:30:43 +01:00
Viktor Szakats
32454b954a
localtime: detect thread-safe alternatives and use them
- add local API `toolx_localtime()` to wrap the banned function
  `localtime()`. Used from libcurl, libtests and test servers.
- auto-detect and use `localtime_r()` where available (e.g. Linux).
  Also to support multi-threading.
- use `localtime_s()` on Windows. It requires MSVC or mingw-w64 v4+.
  Also to support multi-threading.
  Use local workaround to also support mingw-w64 v3.
- add `src/toolx` to keep internal APIs used by the curl tool and tests,
  but not by libcurl. `toolx_localtime()` is the first API in it.
- replace `localtime()` calls with `toolx_localtime()`.
  Except in examples.
- note Windows XP's default `msvcrt.dll` doesn't offer secure CRT APIs.
  XP likely needs a newer version of this DLL, or may not run.
- note that `localtime()` mirrors `gmtime()`, with the difference that
  `gmtime()`'s internal wrapper lives in curlx.

Also:
- drop redundant `int` casts.

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/localtime-localtime32-localtime64
https://learn.microsoft.com/cpp/c-runtime-library/reference/localtime-s-localtime32-s-localtime64-s
https://pubs.opengroup.org/onlinepubs/9799919799/functions/localtime.html
https://linux.die.net/man/3/localtime_r

Ref: #19955 (for `gmtime_r()`)
Follow-up to 54d9f060b4
Closes #19957
2025-12-16 14:30:06 +01:00
Viktor Szakats
c6988f9131
curlx: move Curl_gmtime(), use gmtime_s() on Windows
Move `Curl_gmtime()` to curlx and rename to `curlx_gmtime()`. Then call
the internal wrapper also from the curl tool, to avoid using the banned
`gmtime()` directly, and using better, thread-safe alternatives when
available.

Windows `gmtime_s()` requires mingw-w64 v4+ or MSVC. Use local
workaround to also support mingw-w64 v3. `gmtime_s()` also makes
defining `_CRT_SECURE_NO_WARNINGS` unnecessary.

Also:
- lib: drop unused `parsedate.h` includes.
- drop redundant cast from `gmtime_r()` result.
- autotools: reverse condition in the proto detection to avoid
  misleading readers. (the condition plays no role in detection.)
- note Windows XP's default `msvcrt.dll` doesn't offer secure CRT APIs.
  XP likely needs a newer version of this DLL, or may not run.

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/gmtime-gmtime32-gmtime64
https://learn.microsoft.com/cpp/c-runtime-library/reference/gmtime-s-gmtime32-s-gmtime64-s
https://pubs.opengroup.org/onlinepubs/9799919799/functions/gmtime.html
https://linux.die.net/man/3/gmtime_r

Ref: #19957 (for `localtime_r()`)
Follow-up to 54d9f060b4
Closes #19955
2025-12-16 14:30:05 +01:00
Viktor Szakats
74a2828279
runtests: log the required minimum number of tests in CI
For Test Clutch.

If set (via env or tflags), include the minimum number of tests required
in runtests' log output:
```
* Min tests: 1750
```

Follow-up to 3f1cd809ee #19942

Closes #19987
2025-12-16 13:43:31 +01:00
Viktor Szakats
5431b3dd6b
build: unix socket tidy-ups
- lib: delete two unused `<sys/un.h>` includes.

- lib: drop interim macro `WIN32_SOCKADDR_UN`.
  Follow-up to 0fe9018e1a #7737
  Also fixing a potential issue of leaving unix socket support disabled
  if any header would include Windows' `afunix.h`, and define
  `UNIX_PATH_MAX` on its own.

- connect: honor unix socket disable option.

- connect: simplify unix socket PP condition.
  `USE_UNIX_SOCKETS` already means the necessary header/type are
  available, guaranteed by configure. `AF_UNIX` is already used
  elsewhere in the code without explicit checks.

- curl_setup.h: document availability of `afunix.h` on Windows more.
  It requires mingw-w64 10+ or MS SDK 10.17763.0 VS2017 15.8+.

- curl_setup.h: use `afunix.h` with mingw-w64 v10+ to start avoiding
  the local workaround if possible.

- GHA/windows: test disable unix socket option on Windows.

Ref: https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/

Closes #19989
2025-12-16 13:41:25 +01:00
Stefan Eissing
3a485c2ea0
pytest: do not ignore server issues
When a test server is found or configured, do not silently ignore
errors to start and disable them when checking their version.

This forces pytest to fail when a server is not operating
as it should.

Closes #19996
2025-12-16 13:19:00 +01:00
Daniel Stenberg
222fce0a50
cookie. return proper error on OOM
Follow-up to a78a07d3a9

Closes #19992
2025-12-16 09:45:41 +01:00
Stefan Eissing
2de22a00c7
lib: keep timestamp in easy handle
Use `data->progress.now` as the timestamp of proecssing a transfer.
Update it on significant events and refrain from calling `curlx_now()`
in many places.

The problem this addresses is
a) calling curlx_now() has costs, depending on platform. Calling it
   every time results in 25% increase `./runtest` duration on macOS.
b) we used to pass a `struct curltime *` around to save on calls, but
   when some method directly use `curx_now()` and some use the passed
   pointer, the transfer experienes non-linear time. This results in
   timeline checks to report events in the wrong order.

By keeping a timestamp in the easy handle and updating it there, no
longer invoking `curlx_now()` in the "lower" methods, the transfer
can observer a steady clock progression.

Add documentation in docs/internals/TIME-KEEPING.md

Reported-by: Viktor Szakats
Fixes #19935
Closes #19961
2025-12-16 08:48:44 +01:00
Daniel Stenberg
425a2aa1af
curl_sasl: username cleanups
Remove 'user' from the sasl_ctx struct and instead refer to conn->user.

conn->user is always non-NULL, so remove the checks for that.

Closes #19981
2025-12-16 08:19:35 +01:00
Viktor Szakats
7b2783496c
GHA/non-native: fix passing some envs to the VMs
Also increase the minimum for FreeBSD.

Ref: #19987
Follow-up to 3f1cd809ee #19942
Closes #19988
2025-12-16 00:21:39 +01:00
Viktor Szakats
c36416eb29
getenv: drop internal 1-to-1 wrapper
Closes #19984
2025-12-16 00:21:38 +01:00
Sergey Katsubo
9570fa7908
docs: fix time_posttransfer output unit as seconds
Closes #19986
2025-12-15 22:40:25 +01:00
Stefan Eissing
6a3d0b6d63
vquic: ignore 0-length UDP packets
When someone gives us 0-length UDP packets, ignore
them as they cannot be valid QUIC packets. This also
prevents us from messing up any GSO calculations.

Reported-by: Stanislav Fort
Closes #19978
2025-12-15 14:20:38 +01:00
renovate[bot]
9b3557b706
GHA/linux: update dependency pizlonator/fil-c to v0.677
Closes #19974
2025-12-15 12:51:30 +01:00
Daniel Stenberg
5914b9c66f
TODO: consider a multi-threaded curl tool
Closes #19971
2025-12-15 11:47:20 +01:00
Daniel Stenberg
6f3124eaa2
RELEASE-NOTES: synced 2025-12-15 07:50:51 +01:00
Viktor Szakats
b10b7c1fce
tests/server: fix initialization on Windows Vista+
Make sure to call `curlx_now_init()` before the first call to
`curlx_now()`.

Before this patch the first `curlx_now()` used the non-Vista code path
calling `GetTickCount()` on Vista+. This is harmless, but the upcoming
PR #18009 is going to drop the non-Vista code path, causing a division
by zero at startup in test servers, without this fix.

Bug: https://github.com/curl/curl/pull/18009#issuecomment-3652154307

Closes #19973
2025-12-15 02:14:28 +01:00
Viktor Szakats
2399ec74c3
tidy-up: replace banned printf() with puts()
In `curlinfo` and CMake integration test app.

Closes #19972
2025-12-15 02:14:28 +01:00
Viktor Szakats
43a95aa1bd
renovate: try bumping Fil-C on releases, not tags
CI needs the binary packages attached to the release, which appears some
time after tagging. Hopefully this patch helps getting a clean build
by the time Renovate opens its PR.

Ref: https://docs.renovatebot.com/modules/datasource/github-releases/
Ref: #19905, #19974
Closes #19975
2025-12-15 02:04:21 +01:00
Gabriel Marin
15de32f09d easy: fix debug ev poll builds
Prior to this change the wrong variable name was used for one of the
debug messages.

Closes https://github.com/curl/curl/pull/19963
2025-12-14 19:03:54 -05:00
Viktor Szakats
187e219616
runtests: improve XML prolog check, enable -w permanently, fix two tests
To really verify the presence of the XML prolog, also in CI.

- move the prolog check from `loadtest` to `checktest`.
  (load did a soft error, silently skipping the test instead of failing)
- runtests: enable `-w` functionality permanently for all test targets,
  drop the option. It has no measurable performance impact.
- test 798, 1665: add XML prolog.
  Follow-up to f0d277cb0e

Follow-up to b5ea0736bb #19946
Follow-up to 904e7ecb66 #19347

Closes #19970
2025-12-14 12:26:38 +01:00
Viktor Szakats
b714c674f3
synctime: tidy up, make it work on all platforms
The `--synctime` option remains non-UWP-Windows-specific.

Also:
- replace default URL with `ntp.org`.
- delete unused example URL.

Closes #19965
2025-12-14 12:26:37 +01:00
renovate[bot]
e6146418df
GHA: update actions
- update actions/checkout action to v6.0.1
- update github/codeql-action action to v4.31.8
- update msys2/setup-msys2 action to v2.30.0

Closes #19962
Closes #19967
Closes #19968
2025-12-14 09:17:31 +01:00
Viktor Szakats
20ffdfffaa
renovate: try to disable GitHub Actions updates differently
Follow-up to a9b1be555a #19954

Closes #19969
2025-12-14 09:17:08 +01:00
Viktor Szakats
c8375c905e
examples: delete unresponsive example URL
Also:
- sync header layout with rest of examples.
- replace rest of arbitrary website links with example ones.

Closes #19959
2025-12-14 09:06:10 +01:00
Viktor Szakats
a9b1be555a
renovate: leave bumping GitHub Actions to Dependabot
To avoid update noise. Renovate bumps everything instantly, meaning
a major version a couple hours after release, then all minor bugfix
releases throughout the next 1-2 days. Also putting major versions in
a different group than the bugfix release, and there is no support for
a cooldown period.

After this patch GitHub's Dependabot remains the single tool responsible
to bump GitHub Actions, once a month, grouped, with a cooldown period.
In sync with most other curl repos.

Both Renovate and Dependabot keep bumping pinned pips for now. Also
Renovate keeps updating C dependencies and Dockerfile.

Closes #19954
2025-12-14 09:06:09 +01:00
Daniel Stenberg
1c8c34c88e
schannel: cap the maximum allowed size for loading cert
To avoid problems with mistakes or abuse, cap the largest allowed
certificate size to load to CURL_MAX_INPUT_LENGTH bytes (8MB).

Closes #19964
2025-12-14 00:47:33 +01:00
Daniel Stenberg
f0d277cb0e
tests: verify new header undfolder
test 798 - incoming cookie header in a folded line

test 1665 - verify HTTP headers without final CRLF. Make sure all complete
headers are delivered even if the reponse is partial
2025-12-13 23:02:27 +01:00
Daniel Stenberg
67ae101666
http: unfold response headers earlier
Make the low-level HTTP header "builder" unfold headers so that
everything else can keep pretending folding does not exist.

This code no longer tries to reduce repeated leading whitespace (in the
continued folded header) to a single one. To avoid having to have a
special state for that.

Adjusted two test cases accordingly

Closes #19949
2025-12-13 23:02:18 +01:00
Viktor Szakats
23f9d629f5
GHA/checksrc: fix -z position, also use --output with xmllint
Fixing:
```
fatal: option '-z' must come before non-option arguments
```
Ref: https://github.com/curl/curl/actions/runs/20183280533/job/57948203944#step:4:5

Follow-up to b5ea0736bb #19946
Closes #19958
2025-12-13 20:50:33 +01:00
Daniel Stenberg
28d27570fa
tool_urlglob: support globs as long as config line lengths
libcurl supports up to 8MB string inputs, the config file accepts up to
10MB line lengths. It did not make sense to limit the globs to a maximum
of one megabyte.

Closes #19960
2025-12-13 14:26:20 +01:00
Dan Fandrich
e0a77ec90f tests: fix perl scalar warning
Fixes the warning "Scalar value @xml[0] better written as $xml[0]"

Follow-up to b5ea0736bb

Ref: #19946
2025-12-12 15:39:10 -08:00
renovate[bot]
72f55c1c12
GHA: update actions
- actions/cache action to v5.0.1
- actions/download-artifact to v7.0.0
- actions/upload-artifact to v6.0.0

Closes #19952
Closes #19953
2025-12-12 23:21:33 +01:00
Viktor Szakats
74494d620b
GHA: enable libssh and libssh2 in 10 more Linux jobs
To run more pytest sshd tests, and for more static analysis.

Also:
- drop redundant option from `openssl libssh2 ...` config.
- GHA/linux: enable pytest in the LTO job (to test libssh2).
- avoid both with local builds of OpenSSL-forks, due to crypto lib
  mixups causing a mixture of build error, crashes, test failures.

Follow-up to eb39fee40b #19934

Closes #19943
2025-12-12 17:41:20 +01:00
Viktor Szakats
5e14d623cf
tests/data: delete stray comments
Closes #19950
2025-12-12 17:41:20 +01:00
Viktor Szakats
b5ea0736bb
tests/data: add XML prolog to test files
To formalize they are now XML-compliant (with some asterisks.)

Also to help syntax highlighters work on them to make their content more
readable.

Also:
- Delete empty comment decorations.
- GHA/checksrc: simplify XML check.
- runtests: fail to load test data with XML prolog missing.

Follow-up to bfe6eb1c06 #19927
Follow-up to 87ba80a6df

Closes #19946
2025-12-12 17:17:24 +01:00
Daniel Stenberg
7d79ef926b
test567: add a header separating CRLF
To make it a valid response.

Closes #19948
2025-12-12 16:58:49 +01:00
Viktor Szakats
b83fb8cde7
GHA/windows: move dl-mingw tests from 9.5.0 to 15.1.0
To see if it's less flaky. Also to finish 1m faster due to faster builds.

Closes #19947
2025-12-12 14:14:32 +01:00
Viktor Szakats
77eb6697f5
test568: fix codespell, catch it next time early in CI
Also:
- GHA/checksrc: do not exclude `tests/data/*` changes.

Follow-up to 407d2f3d57 #19944

Closes #19945
2025-12-12 13:33:51 +01:00
Viktor Szakats
d248d17cf3
cmake: update a comment 2025-12-12 13:09:52 +01:00
Viktor Szakats
e413a38190
build: disable typecheck for analyzers and Fil-C
- cmake: automatically disable typecheck when running clang-tidy,
  to avoid possible interference, and to improve performance.

- INSTALL-CMAKE: document both this, and unity=off for clang-tidy.

- GHA/linux: disable for some static analyzers CI jobs to avoid possible
  interference.

- GHA/linux: disable in Fil-C job to improve build performance.

Follow-up to 9e6f1c5efb #19637
Follow-up to fd2ca2399e #17955

Closes #19941
2025-12-12 12:21:45 +01:00
Viktor Szakats
3f1cd809ee
runtests: add options to set minimum number of tests, use them
To detect mistakes made in the runtests framework that reduce
the number of test runs. Before this patch it could go undetected with
a green CI.

The minimum thresholds will need light maintenance going forward (either
bumping them periodically, or adjust if some may fell below minimums for
justified reasons). We may also make minimums tighter or looser, or more
job-specific.

Latest number of test runs for each job can be seen at Test Clutch:
https://testclutch.curl.se/static/reports/feature-matrix.html

Also:
- GHA: set minimums.

Assisted-by: Dan Fandrich

Follow-up to f2a75a14dd
Follow-up to bb1391f943 #19510

Closes #19942
2025-12-12 12:20:22 +01:00
Stefan Eissing
eb39fee40b
pytest: add tests using sshd
With either /usr/sbin/sshd found or configured via --with-test-sshd=path
add tests for SCP down- and uploads, insecure, with known hosts or not,
with authorized user key or unauthorized one.

Working now with libssh and libssh2, using a hashed known_hosts file.

Closes #19934
2025-12-12 11:58:57 +01:00
Daniel Stenberg
407d2f3d57
test568: remove what looks like an email and a URL
Closes #19944
2025-12-12 11:50:29 +01:00
Viktor Szakats
fe8393d7db
tidy-up: miscellaneous
- drop stray duplicate empty lines in docs, scripts, test data, include,
  examples, tests.
- drop duplicate PP parenthesis.
- curl-functions.m4: move literals to the right side in if expressions,
  to match rest of the source code.
- FAQ.md: delete language designator from an URL.
- packages: apply clang-format (OS400, VMS).
- scripts/schemetable.c: apply clang-format.
- data320: delete duplicate empty line that doesn't change the outcome.
- spacecheck: extend to check for duplicate empty lines
  (with exceptions.)
- fix whitespace nits

Closes #19936
2025-12-12 04:18:48 +01:00
renovate[bot]
141ce4be64
GHA: update actions/cache action to v5
Closes #19940
2025-12-12 01:12:43 +01:00
Daniel Stenberg
2e3687c60c
mdlinkcheck: only look for markdown links in markdown files
It finds debug outputs in source code otherwise.

Output the whitelist "warnings" to stderr to better allow us to count
URLs with `./mdlinkcheck --dry-run | wc -l`.

Closes #19938
2025-12-11 23:40:07 +01:00
Daniel Stenberg
846eaf4e6b
RELEASE-NOTES: synced 2025-12-11 15:38:00 +01:00
Christian Schmitz
624d98e79c
transfer: remove @param for err for xfer_recv_resp function.
The err parameter in xfer_recv_resp doesn't exist anymore. Removed in
cb2bcb681f.

Closes #19937
2025-12-11 15:32:16 +01:00
Viktor Szakats
46429d6f44
GHA/checkdocs: re-enable proselint, update setup, fix issues found
- update configuration and invocation.
- install via pip.
- drop a file exception.
- alpha sort proselint settings.
- FILEFORMAT: update text about XML compliance.
- CI job takes 22 seconds total.

Ref: https://github.com/amperser/proselint/releases/tag/v0.16.0

Follow-up to 38bfe1c2aa #15314

Closes #19931
2025-12-11 11:42:28 +01:00
Viktor Szakats
8ff5222b4e
docs: fold long lines
Also:
- replace a 'will' found by badwords.
- drop duplicate empty lines.

Closes #19930
2025-12-11 11:42:28 +01:00
Viktor Szakats
421f931e7a
test1165: drop reference to deleted CURL_DISABLE_TESTS
Follow-up to bf823397ba #16134

Closes #19929
2025-12-11 11:42:28 +01:00
Viktor Szakats
869248cc3e
autotools: drop reference to deleted CURL_CHECK_CURLDEBUG
The referred function has been deleted earlier.

Also:
- drop commented reference to deleted `CURL_CHECK_OPTION_THREADS`.
  0d4fdbf15d #16054

Follow-up to 96a1a05f66 #14096

Closes #19928
2025-12-11 11:42:27 +01:00
Daniel Stenberg
f72c377914
tests: verify setting bearer and doing redirects
Test 778, 779 and 795
2025-12-11 09:42:54 +01:00
Daniel Stenberg
1a822275d3
curl_sasl: if redirected, require permission to use bearer
Closes #19933
2025-12-11 09:42:49 +01:00
Daniel Stenberg
bb134bba29
test3214: allow a larger struct Curl_easy
In my local build it is now 5840 bytes. Add a 10 byte margin.

Closes #19932
2025-12-11 09:41:45 +01:00
Viktor Szakats
bfe6eb1c06
runtests: drop notxml keyword, verify all test data files as XML
Follow-up to 7f3731ce14 #19595

Closes #19927
2025-12-11 00:50:18 +01:00
Viktor Szakats
319298484f
runtests: add support for single-quoted attributes, use it
With this, all test data files are XML-compliant.

Also:
- test1158, test1186: use single quotes for the test filename attribute
  containing a double quote. For XML-compliance.
- drop support for unquoted attributes. For XML-compliance.

Closes #19926
2025-12-11 00:08:16 +01:00
Viktor Szakats
2397be8349
tests/data: replace <, > with %LT, %GT
For XML-compliance.

Closes #19925
2025-12-11 00:08:16 +01:00
Viktor Szakats
7109b427fb
tests/data: replace < with %LT
For XML-compliance.

Closes #19924
2025-12-11 00:08:16 +01:00
Viktor Szakats
73b732e3e8
tests/data: replace & with %AMP
For XML-compliance.

Closes #19923
2025-12-11 00:08:15 +01:00
Viktor Szakats
8db0e286b3
autotools: tidy-up if expressions
- drop x-hacks for curl internal variables and certain autotools ones
  that do not hold custom values.
- make x-hacks consistently use `"x$var" = "xval"` style.
- add a few x-hacks for input/external variables that may hold custom
  values.
- prefer `-z` and `-n` to test empty/non-empty.
  This also makes some x-hacks unnecessary.
- optimized negated test `-z` and `-n` options.
- prefer `&&` and `||` over `-a` and `-o`.
  For better POSIX compatibility:
  https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
- quote variables passed to `test`, where missing.
- quote string literals in comparisons.
- fix some indentation, whitespace.

Note that a few `case` statements also use the x-hack, which looks
unnecessary. This patch does not change them.

Verified by comparing feature detection results with a reference CI run
from before this patch (PR #19922).

Refs:
https://www.shellcheck.net/wiki/SC2268
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
https://www.vidarholen.net/contents/blog/?p=1035
https://mywiki.wooledge.org/BashPitfalls#A.5B_.24foo_.3D_.22bar.22_.5D

Closes #18189
2025-12-10 22:29:19 +01:00
Viktor Szakats
cc285649dc
autotools: fix LargeFile feature display on Windows (after prev patch)
Always show it on Windows, regardless of the `--disable-largefile`
build option.

Follow-up to 163705db75 #19888
Closes #19922
2025-12-10 19:37:56 +01:00
Stefan Eissing
a73040ac8a
quiche: fix version for skip due to flakiness
0.24.6 is the quiche version without the fix for proper handling fo
RESET streams. Require a verion higher than that to run test_05_02.

Follow-up to 14478429e7 #19916

Closes #19921
2025-12-10 18:07:51 +01:00
Viktor Szakats
edbbcbb127
config-win32.h: drop unused/obsolete CURL_HAS_OPENLDAP_LDAPSDK
Meant for use from `Makefile.mk`. The suggested replacement is CMake or
autotools.

Follow-up to ba8752e556 #12224

Closes #19920
2025-12-10 16:02:56 +01:00
Viktor Szakats
0295c9401d
ldap: drop PP logic for old, unsupported, Windows SDKs
`LDAP_VENDOR_NAME` and `winber.h` are available in all supported
MS SDK and mingw-w64 versions. Stop checking for them.

Also drop redundant parenthesis in PP expression.

Closes #19918
2025-12-10 16:02:55 +01:00
Stefan Eissing
14478429e7
pytest: quiche flakiness
Let nghttpx only use http/1.1 to backend. This reproduces the bug in
quiche with higher frequency. Allow test_14_05 to now return a 400 in
addition to the 431 we get from a h2 backend to nghttpx.

Skip test_05_02 in h3 on quiche not newer than version 0.24.4 in which
its bug is fixed: https://github.com/cloudflare/quiche/pull/2278

Ref: https://github.com/cloudflare/quiche/issues/2277
Closes #19770 (original Issue)
Closes #19916
2025-12-10 15:26:27 +01:00
Viktor Szakats
0b96f7573f
GHA/checkurls: add dry run on push
To verify if the basics work.

Downside is that the scheduled (live) runs are intermixed with the dry
runs and less obvious to find in the default list:
https://github.com/curl/curl/actions/workflows/checkurls.yml

This URL filters for scheduled runs only:
https://github.com/curl/curl/actions/workflows/checkurls.yml?query=event%3Aschedule

Seems fine, because we're only interested in red runs.

Closes #19917
2025-12-10 15:11:12 +01:00
Daniel Stenberg
26d766596e
mdlinkcheck: add --dry-run to only show all found URLs
- remove the debug tracing leftovers from d9d2e339ce that made exit
  unconditonally

Closes #19914
2025-12-10 10:51:10 +01:00
Daniel Stenberg
2180d7b4bc
CURLOPT_FOLLOWLOCATION.md: s/Authentication:/Authorization:/
Closes #19915
2025-12-10 10:50:24 +01:00
Daniel Stenberg
b11b67c96f
test318: tweak the name a little
to make it properly differ from test 317
2025-12-10 09:29:43 +01:00
renovate[bot]
6532398af4
GHA: update dependencies and actions
- update dependency awslabs/aws-lc to v1.65.1
- update dependency pizlonator/fil-c to v0.676
- update github/codeql-action action to v4.31.7

Closes #19905
Closes #19912
Closes #19913
2025-12-10 03:46:23 +01:00
Viktor Szakats
d9d2e339ce
tidy-up: URLs (cont.) and mdlinkcheck
- add missing ending slashes.
  To avoid duplicates and to use canonical URLs.
- reapply lost updates.
  Follow-up to 2ae983bf4e #19879
- mdlinkcheck: include the `include` directory.
- mdlinkcheck: show unused whitelist items.
- mdlinkcheck: improve debug output.
- mdlinkcheck: delete redundant whitelist items.
- examples/simplessl: lowercase the protocol part.
- BINDINGS: replace one remaining HTTP URL with HTTPS.
  Issue: https://github.com/pycurl/pycurl/issues/892
- BINDINGS: fix a broken link.
- BINDINGS: follow a refresh content redirect.
- KNOWN_BUGS: whitespace.

Closes #19911
2025-12-10 01:21:07 +01:00
Stefan Eissing
00f06127ce
memdebug: fix realloc logging
Do the whole realloc and the subsequent logging under mutex lock. This
fixed log entries that state allocation a memory location before realloc
logs it as being freed.

Closes #19900
2025-12-10 00:24:42 +01:00
Stefan Eissing
d371288de7
test: increase altsvc test reliability
Move new tests from test_12 to test_06 (eyeballing) where they better
fit. Increase reliability by check Alt-Svc redirects from h3 to a lower
version for a port where no h3 is available.

Closes #19903
2025-12-10 00:23:33 +01:00
Viktor Szakats
bd19433b0e
build: set -Wno-format-signedness
Explicitly disable these warnings to allow using `-Weverything`.

There are around 600 of them across the codebase.

Silencing them has some drawbacks:
- enums (`CURLcode` mostly) would have to be cast to int to avoid
  different signedness depending on C compiler.
  (llvm/gcc: unsigned, MSVC/clang-cl: signed by default)
- hex masks need casts to unsigned to avoid the warning.
- fixing remaining warnings is annoying without fixing the above.
- without fixing all warnings the option cannot be enabled, to keep
  the codebase warning free.

Ref: #18343 (silenced all warnings, but without the enum cast)
Follow-up to 92f215fea1 #18477
Closes #19907
2025-12-09 23:54:55 +01:00
Viktor Szakats
3fb932d492
mdlinkcheck: do not pick up single quote and backslash after URLs
Closes #19910
2025-12-09 23:54:55 +01:00
Viktor Szakats
920319855d
mdlinkcheck: exclude self from URL search
To avoid picking up the whitelist.

Closes #19909
2025-12-09 23:54:54 +01:00
Viktor Szakats
a7c974e038
DEPRECATE: add CMake <3.18 deprecation for April 2026
CMake 3.18 was released on 2020-07-15.

It enables using (and/or dropping workarounds) for these features:
LTO support, better performance and pkg-config support, `OBJECT` target,
`-S`, `-B`, `--verbose`, `--install` on the command-line, lib directory
support in interface targets, target_link_options(), LINK_OPTIONS,
FetchContent, `list(PREPEND ...)`, unity, Ninja, fixed imported global
issues.

Ref: https://github.com/curl/curl/discussions/18704

Closes #19902
2025-12-09 19:34:13 +01:00
Viktor Szakats
163705db75
windows: assume USE_WIN32_LARGE_FILES
All Windows platforms support it. It was permanently enabled with most
build methods. The exception is autotools where it is enabled by
default, with an option to disable it. It changed the build in a few
places for rarely tested code paths, but not bringing other advantages
(and used some 64-bit APIs anyway). This patch makes autotools'
`--disable-largefile` option a no-op for Windows.

Closes #19888
2025-12-09 19:34:13 +01:00
Daniel Stenberg
073b85cefe
GHA: make links get checked daily
Assisted-by: Viktor Szakats
Closes #19898
2025-12-09 16:28:23 +01:00
Viktor Szakats
74bc0c80b3
configure: delete unused variable
Follow-up to 4d73854462 #9044

Closes #19901
2025-12-09 16:23:58 +01:00
Viktor Szakats
197904d4b1
config-win32.h: delete obsolete, non-Windows comments
Closes #19899
2025-12-09 16:23:58 +01:00
Stefan Eissing
44e64919cf
pytest: socksd startup delay
Add a small delay after the startup of the danted socks daemon to
give it more time to become responsive.

Closes #19895
2025-12-09 16:03:38 +01:00
Stefan Eissing
9711c986ba
multi: remove MSTATE_TUNNELING
MSTATE_TUNNELING is no longer in use now that we have proxy connection
filters. Remove the state.

Remove the http handler `connect_it` method as it was merely a NOP.

Closes #19894
2025-12-09 16:01:51 +01:00
Stefan Eissing
5ed7b5b01b
alt-svc: more flexibility on same destination
When the Alt-Svc points to the same host and port, add the destination
ALPN to the `wanted` versions and set it also as the `preferred` version
in negotiations.

This allows Alt-Svc for h3 to point to h2 and have it tried first. Also,
this allows Alt-Svc to say http/1.1 is preferred and changes the ALPN
protocol ordering for the TLS handshake.

Add tests in various combination to verify this works.

Reported-by: yushicheng7788 on github
Fixes #19740
Closes #19874
2025-12-09 15:59:09 +01:00
Viktor Szakats
f450f3801b
GHA/windows: re-enable taskkill
Nothing conclusive for the last ~30 days when `taskkill` was made
a no-op. Jobs remained flaky with all known failure modes. Sometimes
they finish green on the first run, sometimes they fail. Hard to say
more without comparing detailed stats for this period and the
preceding (or upcoming) one.

In almost all runs, the PID to be killed did not exist at the time of
check.

Follow-up to 2701ac6a4d #19421
Closes #19897
2025-12-09 14:46:00 +01:00
Yedaya Katsman
8e847fa536
gtls: Call keylog_close in cleanup 2025-12-09 14:14:50 +01:00
Yedaya Katsman
e76080fb73
test: add test 2090 for SSLKEYLOGFILE structure
Only the TLS 1.2 structure for now since it's simpler, and only has a
single label type. This has the bonus of also testing libressl that only
supports logging keys in TLS 1.2

Closes #19816
2025-12-09 14:14:50 +01:00
Viktor Szakats
e28dc58b65
examples: use 64-bit fstat on Windows
Closes #19896
2025-12-09 13:38:17 +01:00
Daniel Stenberg
b739102ea6
TODO: remove ancient entries no longer considered
- TCP Fast Open support on Windows

TFO doesn't really work on the internet and isn't really used anywhere.
We use QUIC now.

- get rid of PATH_MAX

Not a priority and when using 3rd party libraries not really up to us.

- auto-detect proxy

A dream we can just stop having.

- config file parsing

Let's not do that in our library.

- add asynch getaddrinfo support

Let's not add a limited glibc specific backend with bad API

- FTP HOST

If we managed this far without name based vhost FTP, let's not.

Closes #19890
2025-12-09 12:55:37 +01:00
Viktor Szakats
d14bf19fda
test1025, 1221: fold long command-lines
Closes #19893
2025-12-09 12:40:21 +01:00
Viktor Szakats
1dd758b36d
test1464: mark XML-compliant
Closes #19892
2025-12-09 12:40:21 +01:00
renovate[bot]
4fe629c12a
Dockerfile: update debian:bookworm-slim digest to e899040
Closes #19891
2025-12-09 12:40:18 +01:00
renovate[bot]
761750b9de
Dockerfile: update debian:bookworm-slim digest to 1371f81
Closes #19883
2025-12-09 12:02:48 +01:00
Daniel Stenberg
4fb609f963
FAQ: fix minor link syntax mistake 2025-12-09 11:13:31 +01:00
Daniel Stenberg
3dd1ffdeb0
FAQ/TODO/KNOWN_BUGS: convert to markdown
- convert to markdown
- auto-generate the TOCs on the website, remove them from the docs
- cleanups
- spellchecked
- updated links

Closes #19875
2025-12-09 10:52:56 +01:00
Daniel Stenberg
43c781a116
imap: check buffer length before accessing it
Pointed out by ZeroPath

Closes #19887
2025-12-09 10:50:29 +01:00
Daniel Stenberg
4c3614304f
headers: add length argument to Curl_headers_push()
- the length is already known by parent functions
- avoids strlen() calls
- avoids strchr() calls for trimming off newline characters

Closes #19886
2025-12-09 10:49:28 +01:00
Viktor Szakats
70d71e8761
tests/data: move section data to external files
To make the test files XML-compliant, and the expected results
possibly easier to manage by keeping them in `.md`, `.html`, `.1`
and `.txt` files.

Non-XML-compliant files are down to 31 (1.6%) after this patch.

Closes #19882
2025-12-09 10:12:49 +01:00
Daniel Stenberg
bf70031518
RELEASE-NOTES: synced 2025-12-09 09:23:49 +01:00
Viktor Szakats
86f5bd3c6e
curl_setup.h: fix FMT_SOCKET_T to be unsigned on Windows
To match the Windows socket type.

Ref: https://learn.microsoft.com/windows/win32/winsock/socket-data-type-2

Cherry-picked from #18343
Closes #19881
2025-12-09 09:20:10 +01:00
Viktor Szakats
cce660693c
tests/data: use more %TESTNUMBER macro for previous patch
Follow-up to d75716e4e5 #19799
Cherry-picked from #19882
Closes #19885
2025-12-09 09:20:10 +01:00
Viktor Szakats
d75716e4e5
tests/data: move --libcurl output to external data files
To make the test files XML-compliant, and the expected results
possibly easier to manage by keeping them in `.c` files.

Non-XML-compliant files are down to 36 after this patch.

Also:
- make all macro expansions apply to `%includetext` contents.

Closes #19799
2025-12-09 00:19:10 +01:00
Viktor Szakats
2ae983bf4e
tidy-up: URLs
- to avoid dupes.
- missing slashes.
- drop `.git` suffix from GitHub git repo URLs for a few outliers.
- use short YouTube URL like curl-www does.
- sync two RFC doc URLs with others.

Closes #19879
2025-12-09 00:19:10 +01:00
Daniel Stenberg
09e48d5a04
mk-ca-bundle.md: the file format docs URL is permaredirected
Closes #19877
2025-12-08 22:07:32 +01:00
Daniel Stenberg
16f4b20385
KNOWN_BUGS: remove link to codepoints.net
The site is so slow it often triggers a failure for the link checker.

Closes #19878
2025-12-08 22:07:00 +01:00
Viktor Szakats
64a1092a79
IPFS.md: wrap long lines
Closes #19880
2025-12-08 17:28:43 +01:00
dependabot[bot]
cc853ddc3d
GHA: bump pip-dependencies ruff, psutil, pytest
- update `ruff` from 0.14.5 to 0.14.8
- update `psutil` from 7.1.2 to 7.1.3
- update `pytest` from 8.4.2 to 9.0.1

Closes #19876
2025-12-08 15:37:43 +01:00
Viktor Szakats
7dd5bb77c3
CI/windows: add torture tests with Schannel
With Schannel and Unicode, `-shallow=13`. It finishes in 12 minutes,
making it the slowest Windows job. It's still on par with torture jobs
on other platforms (though they manage to fit `-shallow=25`).

Also `-shallow=13` still caught leaks in multiple tests.

Also:
- test2300: exclude from CI Windows torture tests.
- experimental.

The downside of going with deeper torture tests, is that it requires
increasing the job timeout. This in turns means that a hung job takes
more minutes to be killed (due to GitHub bugs where a hung step does not
honor the per-step timeout on Windows, another bug where a hung job gets
killed +5 minutes above the workflow timeout, and another bug (or
feature?) where other failed/hung jobs in the the workflow cannot be
restarted till the last job finishes or gets killed. And all this
probably related to a Perl bug which makes it hang on fork errors, which
is turn related to Cygwin/MSYS2 runtime bugs which breaks fork in case
of curl's mixed MSYS2-Perl/native-curl-binaries environment.)
The end result in longer forced waits before being able to restart flaky
jobs, which slows down iterations and annoying.

Also tried:
- non-c-ares job: detected known issues much less often.
- replaced libidn2 with WinIDN: detected known issues much less often.
- runtests -j9-j20 values: did not make a difference.
- other `-shallow` values: 20 is the max feasible, but comes with the
  downside described above.

Ref: #19675 (reboot of)
Follow-up to f08417c425 #19863

Closes #19865
2025-12-08 13:08:14 +01:00
Daniel Stenberg
ab9beda1b3
docs: switch more URLs to https://
Normalize using https:// almost everywhere instead of http://

Closes #19872
2025-12-08 12:57:51 +01:00
Daniel Stenberg
a1c01b2015
mdlinkcheck: ignore IP numbers, allow '@' in raw URLs 2025-12-08 12:57:51 +01:00
renovate[bot]
c56ee2ab78
GHA/linux: update dependency pizlonator/fil-c to v0.675
Closes #19873
2025-12-08 12:16:57 +01:00
Viktor Szakats
81e5e2434e
GHA/linux: blind try to make Renovate detect Fil-C releases
0.675 has been out for 2 weeks, Renovate did not detect it with
`semver-partial`. Try with `semver-coerced`.

Refs:
https://docs.renovatebot.com/modules/versioning/semver-coerced/
https://docs.renovatebot.com/modules/versioning/semver-partial/

Follow-up to 16c6ea36cc #19391
2025-12-08 12:06:22 +01:00
Daniel Stenberg
4a92afce70
DISTROS: fix a Mageia URL
Since we check the provided URLs now, use the direct, working URL.
2025-12-08 11:43:12 +01:00
Stefan Eissing
96ba7a79fc
gnutls: add PROFILE_MEDIUM as default
Raise the default GnuTLS priority settings by adding PROFILE_MEDIUM for
more secure connection handling.

Reported-by: Harry Sintonen
Closes #19853
2025-12-08 11:34:48 +01:00
Fabian Keil
d360ddb1b2
test1475: consistently use %CR in headers
Gets the test working when using Privoxy as proxy.

Closes #19870
2025-12-08 10:44:00 +01:00
Daniel Stenberg
2535c4298f
hostcheck: fail wildcard match if host starts with a dot
A hostname cannot start with a dot when DNS is used, but there are other
ways.

Amend unit test 1397

Closes #19869
2025-12-08 10:42:49 +01:00
Viktor Szakats
121c540168
sspi: fix memory leaks on error paths in Curl_create_sspi_identity()
Detected by Windows torture test 1072 (with `-shallow=20/13`),
test 579 (with `-shallow=18/14/13`), and test 1286 (with `-shallow=15`).

```
** MEMORY FAILURE
Leak detected: memory still allocated: 20 bytes
At 1a1e8136328, there is 18 bytes.
 allocated by D:/a/curl/curl/lib/curl_sspi.c:133
At 1a1e8139368, there is 2 bytes.
 allocated by D:/a/curl/curl/lib/curl_sspi.c:143
 1072: torture FAILED: function number 207 in test.
 invoke with "-t207" to repeat this single case.
Warning: http2 server unexpectedly alive
```
Ref: https://github.com/curl/curl/actions/runs/20008523913/job/57374427439?pr=19865

Also simplify the code a little.

Cherry-picked from #19865
Closes #19866
2025-12-08 10:27:49 +01:00
Daniel Stenberg
a78a07d3a9
cookie: cleanups and improvements
- Stricter cookie validation with earlier rejection of empty/invalid
  cookie names

- secure and httponly attributes no longer accept = with empty values
  (only bare keywords)

- Validation checks (length, TAB, prefixes) moved into the first
  name/value pair block for better code organization

- Deferred time(NULL) calls for better performance when expires/max-age
  aren't used

- Simplified loop control flow by removing done flag

- The cookie size restriction now only applies to name + value, not other
  parts of the header line.

- Fixed a gcc 4.8.1 quirk

Closes #19868
2025-12-08 09:52:58 +01:00
Daniel Stenberg
a093c93994
cookie: only keep and use the canonical cleaned up path
Instead of keeping both versions around.

Closes #19864
2025-12-08 08:03:57 +01:00
Daniel Stenberg
524936fbeb
cookie: when parsing a cookie header, delay all allocations until okay
To avoid wasting time allocating data for incoming cookies that are
discarded for one reason or another, delay allocations until after
verifications are done.

Closes #19864
2025-12-08 08:03:57 +01:00
Daniel Stenberg
c6e5dfa2c6
cookie: allocate the main struct once cookie is fine
This delays the allocating of the cookie struct until after all the
checks have been done, as many cookies are received and discarded
instead of accepted and this then saves one allocation for every
discarded cookie.

Closes #19864
2025-12-08 08:03:57 +01:00
Viktor Szakats
f08417c425
runner.pm: run memanalyzer as a Perl module
To improve performance of torture tests.

Also on Windows, where this patch may make those viable for CI.

Linux   !FTP    4m47 ->  4m24 (-shallow=25)
Linux    FTP    2m30 ->  2m23 (-shallow=25)
macOS   !FTP   14m30 -> 13m07 (-shallow=25)
macOS    FTP    3m57 ->  3m59 (-shallow=25)
Windows !FTP  >25m   ->  4m47 to 14m45 (-shallow=5 to 25) (not in CI)

Linux
Before: https://github.com/curl/curl/actions/runs/20006771767/job/57370205514
After: https://github.com/curl/curl/actions/runs/20006783210/job/57370236911?pr=19863

macOS:
Before: https://github.com/curl/curl/actions/runs/20006771786/job/57370205769
After: https://github.com/curl/curl/actions/runs/20006783177/job/57370236995?pr=19863

Windows:
Before: https://github.com/curl/curl/actions/runs/19667198537/job/56326962912?pr=19675
After: https://github.com/curl/curl/actions/runs/20007175773/job/57371768734?pr=19863
After shallow=25: https://github.com/curl/curl/actions/runs/20008523913/job/57374427449?pr=19865

Ref: #19675
Follow-up to 472bc90323 #19821
Closes #19863
2025-12-07 19:51:45 +01:00
Viktor Szakats
cc5c1553fb
wolfssl: fix possible assert with !HAVE_NO_EX wolfSSL builds
Without this option `wolfSSL_get_app_data()` always returns NULL.
Disable codepaths using it (and its `set` pair) when curl is built
against a wolfSSL library with this option missing.

Fixing:
```
curl: ../../lib/vtls/wolfssl.c:486: wssl_vtls_new_session_cb: Assertion `cf != ((void *)0)' failed.
```

wolfSSL can be built with the `--enable-context-extra-user-data` or
`-DWOLFSSL_EX_DATA` option to enable this feature. Some higher-level
features also enable it automatically like QUIC, ASIO.

Reported-by: Yedaya Katsman
Bug: https://github.com/curl/curl/pull/19816#issuecomment-3606447845
Ref: https://github.com/curl/curl/actions/runs/19871780796/job/56949160740

Closes #19852
2025-12-07 17:01:45 +01:00
Daniel Stenberg
a3f4fd25d3
http: return OOM errors from hsts properly
When Curl_hsts_parse() fails with out of memory, return it to parent.

Closes #19862
2025-12-07 12:54:45 +01:00
Daniel Stenberg
9ec63d8565
hsts: use one malloc instead of two per entry
Closes #19861
2025-12-07 12:54:03 +01:00
Daniel Stenberg
65597f8fc9
noproxy: fix build on systems without IPv6
Follow-up to ff2aaed9ba
Reported-by: Harry Sintonen
Closes #19860
2025-12-07 00:42:16 +01:00
Daniel Stenberg
f4b56f34ba
asyn-thrdd: fix Curl_async_getaddrinfo() on systems without getaddrinfo
Follow-up to ce06fe7771
Bug: ce06fe7771 (r172215567)
Reported-by: Harry Sintonen
Closes #19859
2025-12-07 00:08:19 +01:00
Daniel Stenberg
0b5ece553c
altsvc: make it one malloc instead of three per entry
Also return OOM correctly.

Closes #19857
2025-12-06 23:50:58 +01:00
Robert W. Van Kirk
1c0822e8cb
formdata: validate callback is non-NULL before use
curl_formget() accepts a user-provided callback function but does not
validate it is non-NULL before calling it. If a caller passes NULL,
the function will crash with SIGSEGV.

Add NULL check at the start of the function to return an appropriate
error code instead of crashing.

Signed-off-by: Robert W. Van Kirk <robert@rwvk.tech>
Closes #19858
2025-12-06 23:47:50 +01:00
Stefan Eissing
891566c72d
ftp: make EPRT connections non-blocking
On platforms where neither accept4 nor fcntl was available, an
EPRT connection did not send the accepted socket as non-blocking.

This became apparent when TLS was in use and the test receive
on shutdown did simply hang.

Reported-by: Denis Goleshchikhin
Fixes #19753
Closes #19851
2025-12-06 14:48:04 +01:00
Daniel Stenberg
15e5ac6da8
RELEASE-NOTES: synced 2025-12-05 23:51:47 +01:00
Daniel Stenberg
51587f6f14
mdlinkcheck: detect and check "raw" links
- URLs specified outside of the markdown []() are now extracted and
  checked

- also check TODO, FAQ and KNOWN_BUGS

- more aggressive avoiding to check github.com/curl/curl, all uses of
  example domains and some more established URLs on the curl.se site

- list all errors in the end to make them easier to spot in CI logs

Closes #19848
2025-12-05 23:41:41 +01:00
Daniel Stenberg
ca24b6a061
DISTROS: remove broken URLs for buildroot 2025-12-05 23:41:41 +01:00
Daniel Stenberg
e80682d429
FAQ: fix hackerone URL 2025-12-05 23:41:41 +01:00
Daniel Stenberg
58394b1c8c
docs: use .example URLs for proxies 2025-12-05 23:41:41 +01:00
Daniel Stenberg
0b69c47131
docs: remove dead URLs
- KNOWN_BUGS: remove dead URL
- ECH: remove two dead URLs
- MAIL-ETIQUETTE: remove dead URL
2025-12-05 23:41:41 +01:00
Viktor Szakats
cca815ccfd
test1498: disable 'HTTP PUT from stdin' test on Windows
Test became flaky with memanalyze errors after merging #19845,
in a TrackMemory Windows Unicode c-ares openssl-quic build:
GHA/windows: mingw, AM x86_64 c-ares U.

Disable it until further investigation.

This test uses the Windows-specific multi-threaded stdin code
that caused issues in the past. It's also using `TerminateThread()`,
that apps aren't supposed to.

Examples:
https://github.com/curl/curl/pull/19845#issuecomment-3614921298
https://github.com/curl/curl/actions/runs/19948992659/job/57205061260?pr=19845#step:13:3028
https://github.com/curl/curl/actions/runs/19966429786/job/57259325027?pr=19852#step:13:3030

Also seen to fail earlier while testing torture tests on Windows:
https://github.com/curl/curl/pull/19675#issuecomment-3573154110

Ref: 4e051ff550 #19845

Closes #19855
2025-12-05 17:45:16 +01:00
Viktor Szakats
af5def0738
tidy-up: avoid (()), clang-format fixes and more
- drop redundant parentheses from macro definitions.
- apply clang-format in some places missed earlier.
- wolfssl: fix a macro guard comment.
- curl_setup.h: drop empty lines
- FAQ: fix C formatting.

Closes #19854
2025-12-05 16:07:03 +01:00
Viktor Szakats
4e051ff550
curlx: limit use of system allocators to the minimum possible
Clone a multibye conversion function into curlx/fopen, and use that
local copy from curlx/fopen functions. Adjust allocators in curlx/fopen
to use curl's in normal builds, and system allocators in TrackMemory
builds to avoid recursion.

This allows to switch curlx/multibyte functions to curl allocators in
all configurations, as they are no longer called by curlx/fopen, and
a recursive call can no longer happen.

After this patch the system allocator is only used in TrackMemory
Windows builds, within curlx `fopen`, `freopen`, `stat` and `open`
functions.

Also:
- test 1, 440, 767: raise allocation limitsto fit the extra allocations
  in Windows Unicode builds.
- replace all uses of `curlx_unicodefree()` macro with `curlx_free()`
  across the codebase.
- curlx/multibyte: delete `curlx_unicodefree()`.
- ldap: join Windows and non-Windows codepaths that became
  identical after moving from `curlx_unicodefree()` to `curlx_free()`.
- vauth: drop a strdup from standard to curl allocator since
  the original allocation is now already done by curl's.
- tool_doswin: drop now superfluous strdup from `FindWin32CACert()`.
- memanalyzer.pm: sync weirdo `calloc` log message with `malloc`'s.

Fixes #19748
Closes #19845
2025-12-05 15:32:59 +01:00
Viktor Szakats
2d6ade19fc
ldap: improve detection of Apple LDAP
When detecting the Apple fork of "legacy" LDAP, replace the `__APPLE__`
macro (which can be present also when using an old mainline OpenLDAP
while building for an Apple platform) with `LDAP_OPT_X_TLS_PASSPHRASE`
which is an Apple-specific macro, merged by Apple in 2007, later adding
the comment 'Apple Specific code'. This macro hasn't been retrofitted
to OpenLDAP since then, and unlikely to happen in the future.

Refs:
c4d990a6cf (diff-0f7a5f85bae4de860b70aabf34aa12b0ecc37e748cd96e203e2d8ddb30a207c3R145)
49ac28a486 (diff-0f7a5f85bae4de860b70aabf34aa12b0ecc37e748cd96e203e2d8ddb30a207c3R166)

Follow-up to 859ce48de1 #19832
Closes #19849
2025-12-05 13:16:07 +01:00
Stefan Eissing
8d9aa6d6e1
tests/servers: put unix-domain-path inside LOGDIR
Change Unix domain socket paths from `/tmp/curl-socksd-<random>` to
`/drive/path/to/LOGDIR/PIDDIR/*-uds` to avoid having to create and
delete them before use. Also to use a path which remains an absolute one
while passed from MSYS2 Perl to native Windows curl tool and test server
via the command-line, and keep pointing to the same location, fixing:
```
=== Start of file commands.log
../src/curl.exe -q --output log/3/curl1468.out --include --trace-ascii log/3/trace1468
  --trace-time http://this.is.a.host.name:64405/1468
  --proxy socks5h://localhost/tmp/curl-socksd-YnbvRo98 [...]
=== End of file commands.log
=== Start of file socks2_server.log
[...]
14:11:54.597968 Listening on Unix socket D:/a/_temp/msys64/tmp/curl-socksd-YnbvRo98
```
Ref: https://github.com/curl/curl/actions/runs/19896583933/job/57028545111?pr=19812

The curl tool is pending #19825 to fix accepting an absolute unix domain
socket path on Windows.

Assisted-by: Viktor Szakats
Closes #19810
2025-12-05 13:00:19 +01:00
Daniel Stenberg
68a44edd50
TODO: remove a mandriva.com reference
It's a casino now
2025-12-05 08:51:11 +01:00
Viktor Szakats
859ce48de1
ldap: detect version of "legacy" LDAP
Legacy LDAP means an OpenLDAP-compatible implementation
without the private API `ldap_init_fd()` introduced in OpenLDAP
2.4.6+ (2007-10-31), and not WinLDAP.

One known example is Apple's LDAP build, which is based on
OpenLDAP 2.4.28 (2011-11-25), without providing this private API.

The version query API was introduced around 1998-1999, before
the minimum (2.0 2000-08-01) required by curl.

Follow-up to 3e2a946926 #19808
Closes #19832
2025-12-04 23:14:01 +01:00
Daniel Stenberg
f1f76e0ea8
url: if curl_url_get() fails due to OOM, error out properly
Even if the scheme is "file"!

Closes #19838
2025-12-04 23:01:01 +01:00
Daniel Stenberg
a1531261b1
CURLMOPT_SOCKETFUNCTION.md: fix the callback argument use
The example code does not use curl_multi_assign(), but its callback
function used socketp (called sockp in the function) to get the struct
priv pointer instead of the correct clientp (cbp).

Reported-by: Greg Hudson
Fixes #19840
Closes #19841
2025-12-04 22:59:51 +01:00
Viktor Szakats
ebe6fa08c9
docs/libcurl: fix C formatting nits
Closes #19844
2025-12-04 22:49:03 +01:00
Viktor Szakats
6d042273cd
openssl: simplify HAVE_KEYLOG_CALLBACK guard
non-LibreSSL always includes BoringSSL and AWS-LC, no need to check for
them explicitly.

Follow-up to 69c89bf3d3 #18330
Closes #19843
2025-12-04 22:49:03 +01:00
Viktor Szakats
df07f431e2
mbedtls: sync format across log messages
Closes #19842
2025-12-04 22:49:03 +01:00
Viktor Szakats
f97e62ff14
sws: fix binding to unix socket on Windows
Windows 10.17063+ (having unix socket support) fails to set for unix
sockets the `SO_REUSEADDR` option, with error 10045 (`WSAEOPNOTSUPP`),
and also fails to set `SO_KEEPALIVE` with error 10042 (`WSAENOPROTOOPT`).

Fix by not enabling these socket options on Windows for unix sockets.

Also:
- fixing test 1435, 1436 to run in CI.
- fixing the `socksd` test server for test 1467, 1468, 1470. But, also
  disable these for now due to another Windows issue: #19825

Ref: https://stackoverflow.com/questions/68791319/unix-domain-socket-bind-failed-in-windows/68794755#68794755
Ref: #19810
Closes #19812
2025-12-04 22:49:03 +01:00
Viktor Szakats
dfd781ff62
tidy-up: miscellaneous
- gnutls, mbedtls: fix casing in log messages.
- src/tool_cfgable.h: drop unused header.
- appveyor.sh: variable style.
- cmakelint.sh: sync with libssh2, catch `.cmake.in` explicitly.
- examples: drop obsolete comments, exclamation marks.
- fix comment typos, casing.

Closes #19839
2025-12-04 20:14:11 +01:00
Viktor Szakats
0476e4fc65
tidy-up: one more round of formatting nits
Closes #19835
2025-12-04 19:30:59 +01:00
Viktor Szakats
7a1e99eefa
badwords: check FAQ with allowlisted 'will', fix a typo
Also:
- badwords.pl: add support for filename:word exceptions.
- badwords.pl: handle `-w` file open errors.

Ref: https://github.com/curl/curl/pull/19817#issuecomment-3612386568
Closes #19837
2025-12-04 19:30:08 +01:00
Daniel Stenberg
d517efe5bd
bufref: add Curl_bufref_dup that returns a strdup()ed version
Cleans up a common pattern somewhat. Implemented as a macro.

Closes #19834
2025-12-04 19:04:19 +01:00
Stefan Eissing
d7928029fc
connection: attached transfer count
Since we no longer traverse the transfers attached to a connection,
change the sparse bitset to just a `uint32_t` counter.

This makes multi_ev the single user of sparse bitsets for transfers
using a socket and allocation failures are handled there correctly.

Refs #19818
Closes #19836
2025-12-04 18:45:38 +01:00
Daniel Stenberg
1def380032
bufref: rename *memdup() to *memdup0()
To make it clearer to readers of the code that the resulting dup also
has a null terminator. Something a "normal" memdup() does not provide.

Closes #19833
2025-12-04 16:49:16 +01:00
Patrick Monnerat
fe7703a0b3
formdata: use struct bufref for maybe-dynamic fields.
Lengths are not stored in the structures, as they may be given before
the data locations.

Closes #19827
2025-12-04 16:17:36 +01:00
Patrick Monnerat
2cb868242d
lib: turn state.referer into a struct bufref
Closes #19827
2025-12-04 16:17:33 +01:00
Patrick Monnerat
36542b7349
lib: turn state.url into a struct bufref
Closes #19827
2025-12-04 16:17:31 +01:00
Patrick Monnerat
f39b8a1174
lib: add a Curl_bufref_uptr() function and use it
Function Curl_bufref_ptr() now returns a const char *.
New function Curl_bufref_uptr() returns a const unsigned char *.

Usage and doc updated.

Closes #19827
2025-12-04 16:17:21 +01:00
Daniel Stenberg
39d1976b7f
ldap: call ldap_init() before setting the options
Closes #19830
2025-12-04 16:14:48 +01:00
Theo Buehler
608f5dd455
vtls: do not reach into ASN1_STRING
OpenSSL 4 has plans to make ASN1_STRING opaque, which will break the
build, so convert the code to use accessors. ASN1_STRING_length() and
ASN1_STRING_type() go way back to SSLeay and ASN1_STRING_get0_data() is
OpenSSL 1.1 API present in BoringSSL since foreer and also available
since LibreSSL 2.7, so this should not cause compat issues with any
libcrypto in a supported version of the fork family.

https://github.com/openssl/openssl/issues/29117

Closes #19831
2025-12-04 16:14:12 +01:00
Viktor Szakats
472bc90323
runtests: make memanalyzer a Perl module (for 1.1-2x speed-up per test run)
Patch #19786 removed an exception, which caused many more CI jobs to run
`memanalyze.pl`. It resulted in a 10-30% (Linux), 15% (macOS), 100% (2x,
on Windows) slowdown of runtest steps. It also made some jobs exceed
their time limits and fail (seen with the Windows ARM64 job.)

Turns out the overhead was caused by calling `memanalyze.pl` as
an external process (twice per test), which in turn had to load a full
Perl stack from scratch each time.

Fix by converting memanalyze to a Perl modul, loaded as part of
`runtests.pl`, which eliminated the overhead completely.

It also sped up existing jobs where memanalyze was run for a long time,
e.g. two c-ares Windows jobs, saving 4.5m per CI run.

Supersedes #19819
Bug: https://github.com/curl/curl/pull/19786#issuecomment-3598679397
Follow-up to fb7033d760 #19786
Closes #19821
2025-12-04 13:14:32 +01:00
Georg Schulz-Allgaier
ff2aaed9ba
noproxy: fix ipv6 handling
Closes #19828
2025-12-04 12:16:02 +01:00
Daniel Stenberg
e8a4068e68
docs: clarify how to do unix domain sockets with SOCKS proxy
Ref: #19825
Closes #19829
2025-12-04 11:13:16 +01:00
Viktor Szakats
276a4af474
test787: fix possible typo & -> % in curl option
They are close on the keyboard and don't affect test results.

To make this test XML-compliant.

Ref: #14479
Follow-up to 40c264db61 #15739
Closes #19826
2025-12-04 01:22:54 +01:00
Viktor Szakats
004f41c186
tests: add %AMP macro, use it in two tests
To allow replacing `&` characters in `tests/data/test*` files for
XML-compliance.

Also:
- document `%GT`, `%LT`
  Follow-up to de49cc89ab #19470

Closes #19824
2025-12-03 20:50:19 +01:00
Viktor Szakats
0417d323c9
src: fix formatting nits
Closes #19823
2025-12-03 20:50:18 +01:00
Viktor Szakats
1753de9d7a
GHA/checksrc: give more time for slow Azure servers [ci skip]
Sometimes 1 minutes is too short to install 39.4 kB of archives.

Ref: https://github.com/curl/curl/actions/runs/19898949860/job/57036965452
2025-12-03 16:34:10 +01:00
Viktor Szakats
6694a42aa0
idn: avoid allocations and wcslen on Windows
Eliminate a heap buffer in both `win32_idn_to_ascii()` and
`win32_ascii_to_idn()`, by replacing it with stack buffer. The maximum
size is fixed in these cases, and small enough to fit there.

Also reuse length returned by the UTF-8 to wchar conversion, allowing
to drop `wcslen()` call in both functions, and allowing to call
the wchar to UTF-8 conversion API `WideCharToMultiByte()` with the known
length, saving length calculations within that API too.

Ref: https://github.com/curl/curl/pull/19748#issuecomment-3592015200

Closes #19798
2025-12-03 14:50:21 +01:00
Viktor Szakats
c3b030b860
lib: fix formatting nits (part 3)
From `lib/h` to `lib/w`.

part 1: 47a1ab2ebe #19764
part 2: 86b346443b #19800

Closes #19811
2025-12-03 14:50:16 +01:00
Daniel Stenberg
dc8c0d54a5
test3207: enable memdebug for this test again
Closes #19813
2025-12-03 09:30:00 +01:00
Viktor Szakats
d993d46eb1
GHA/windows: install MSYS2 c-ares only when used
Closes #19820
2025-12-03 04:45:26 +01:00
Stefan Eissing
aba3c63ae8
pytest: fix and improve reliability
Address issues listed in #19770:
- allow for ngttpx to successfully shut down on last attempt that might
  extend beyond the finish timestamp
- timeline checks: allos `time_starttransfer` to appear anywhere in
  the timeline as a slow client might seen response data before setting
  the other counters
- dump logs on test_05_02 as it was not reproduced locally

Fixes #19970
Closes #19783
2025-12-02 17:15:36 +01:00
Stefan Eissing
9cf4a400d2
pytest: improve stragglers
A fix for the tests that took the longest:
- test_05: make the server close the HTTP/1.1 connection when
  simulating an error during a download. This eliminates waiting
  for a keepalive timeout
- test_02: pause tests with slightly smaller documents, eliminate
  special setup for HTTP/2. We test stream window handling now
  elsewhere already
- cli_hx_download: run look in 500ms steps instead of 1sec, resuming
  paused tranfers earlier.

Closes #19809
2025-12-02 17:04:20 +01:00
Viktor Szakats
86b346443b
lib: fix formatting nits (part 2)
From `lib/curl*` to `lib/g*`. With fixes to part 1.

part 1: 47a1ab2ebe #19764

Closes #19800
2025-12-02 16:52:54 +01:00
Daniel Stenberg
3e2a946926
ldap: provide version for "legacy" ldap as well
It displays in version output as WinLDAP and LDAP/1, compared to
OpenLDAP/[version] for the OpenLDAP backend code.

Closes #19808
2025-12-02 16:27:16 +01:00
Stefan Eissing
b30c1b97b9
quiche: use client writer
Instead of buffering response body data until it is received by the
transfer loop, write the response data directly to the client.

Use a connection wide scratch buffer to get the response body from
quiche. Eliminates need for maintaining individual buffers for each
stream.

Fixes #19803
Reported-by: Stanislav Fort
Closes #19806
2025-12-02 16:25:03 +01:00
Daniel Stenberg
4f2374810a
DEPRECATE.md: remove OpenSSL-QUIC in January 2026 instead
Move it up two months. It was only ever experimental so this cannot
interfere with any production code so shorten the "quarantine".

Closes #19805
2025-12-02 13:41:37 +01:00
Daniel Stenberg
c1c3487d79
curl_gssapi: make sure Curl_gss_log_error() has an initialized buffer
Reported-by: Stanislav Fort (Aisle Research)

Closes #19802
2025-12-02 10:14:15 +01:00
Daniel Stenberg
8dedcce7a3
RELEASE-NOTES: fix typo 2025-12-02 10:13:32 +01:00
Daniel Stenberg
055f1a3d02
RELEASE-NOTES: synced 2025-12-02 09:16:20 +01:00
Stefan Eissing
dc29590d60
memdebug: log socket close before closing
To not get a mixup in the memdebug log order.

Closes #19793
2025-12-02 00:58:31 +01:00
Daniel Stenberg
85a6936d76
libssh2: consider strdup() failures OOM and return correctly
In the ssh_state_pkey_init function.

Closes #19791
2025-12-01 22:17:21 +01:00
Viktor Szakats
58673ac837
runtests: fix Perl warning
```
Use of uninitialized value $cmdhash{"option"} in pattern match (m//) at tests/runtests.pl line 1753.
```
Ref: https://github.com/curl/curl/actions/runs/19833947198/job/56831923295?pr=19794#step:13:3694

Follow-up to 02aa75a8c2 #19752
Closes #19797
2025-12-01 21:32:10 +01:00
Viktor Szakats
9517b41b50
multibyte: limit curlx_convert_*wchar*() functions to Unicode builds
Follow-up to ccb68d2e3b #19790

Closes #19796
2025-12-01 21:32:10 +01:00
Viktor Szakats
189fda0026
memdebug: replace macro constant with sizeof()
Closes #19795
2025-12-01 21:32:10 +01:00
Viktor Szakats
5356bce6ab
windows: use _strdup() instead of strdup() where missing
To replace deprecated `strdup()` CRT calls with the recommended
`_strdup()`.

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/strdup-wcsdup
https://learn.microsoft.com/cpp/c-runtime-library/reference/strdup-wcsdup-mbsdup

Closes #19794
2025-12-01 21:32:09 +01:00
Viktor Szakats
a3fcd80de4
curlx: use curlx allocators in non-memdebug builds (Windows)
To limit raw allocators to `CURLDEBUG` (memdebug/TrackMemory) Windows
UNICODE builds.

Closes #19788
2025-12-01 19:42:56 +01:00
Viktor Szakats
ccb68d2e3b
idn: use curlx allocators on Windows
Replace `curlx_convert*()` functions with local copies that always use
the curlx allocator.

Closes #19790
2025-12-01 18:46:55 +01:00
Viktor Szakats
3387133450
lib: delete unused curlx/multibyte.h includes
Closes #19792
2025-12-01 18:09:09 +01:00
Viktor Szakats
ca1919caee
idn: fix memory leak in win32_ascii_to_idn()
Closes #19789
2025-12-01 16:39:07 +01:00
Viktor Szakats
c421c3e325
cmake: verify minimum CMake version in curl-config.cmake
Show a message if the CMake version is lower than that when consuming
libcurl via the CMake config.

The minimum CMake version on consumption is for now the same as
the minimum required (v3.7) to build curl itself.

Ref: https://cmake.org/cmake/help/v3.7/variable/CMAKE_MINIMUM_REQUIRED_VERSION.html
Ref: #18704 (discussion)
Follow-up to 16f073ef49 #16973
Closes #19776
2025-12-01 14:46:44 +01:00
Daniel Stenberg
a2ebae61ca
tool_urlglob: acknowledge OOM in peek_ipv6
Previously, an OOM error would just imply not an IPv6 address.

Closes #19784
2025-12-01 14:44:41 +01:00
Daniel Stenberg
fb7033d760
runtests: enable torture testing with threaded resolver
Since a7bebd8502 made it possible.
Closes #19786
2025-12-01 14:42:40 +01:00
Stefan Eissing
d1b85bc49c
memdebug: log before free
add the debug log before freeing the memory, otherwise another thread
might allocate and log it before the free is logged.

Follow-up to a7bebd8502
Closes #19787
2025-12-01 14:12:59 +01:00
Stefan Eissing
a7bebd8502
memdebug: add mutex for thread safety
Protect modification to the `membuf` by different threads
via a mutex. This ensure that index updates are correct and
that data gets written in order.

Closes #19785
2025-12-01 13:43:41 +01:00
Daniel Stenberg
c6c4a99300
http: acknowledge OOM errors from Curl_input_ntlm
Closes #19781
2025-12-01 12:47:57 +01:00
Daniel Stenberg
012fa2b91b
auth: always treat Curl_auth_ntlm_get() returning NULL as OOM
Closes #19782
2025-12-01 12:47:23 +01:00
Viktor Szakats
4aed2dcc89
krb5: fix detecting channel binding feature
Use the already detected `gssapi/gssapi_krb5.h` MIT Kerberos header
to pull in `gssapi_ext.h`, which in turn sets `GSS_C_CHANNEL_BOUND_FLAG`
if supported. Channel binding is present in MIT Kerberos 1.19+.

Also:
- lib: de-duplicate GSS-API header includes.
- vauth: de-duplicate `urldata.h` includes.
- drop interim feature macro in favor of the native GSS one.

Assisted-by: Max Faxälv
Reported-by: Max Faxälv
Bug: https://github.com/curl/curl/pull/19164#issuecomment-3551687025
Follow-up to 8616e5aada #19164
Closes #19603
Closes #19760
2025-12-01 11:43:20 +01:00
Viktor Szakats
dabfae84f0
cmake: namespace all local variables in curl-config.cmake
Also:
- apply it to the local copy of this code in `lib/CMakeLists.txt`.
- replace 'CURL' with `@PROJECT_NAME@` in a message.

Closes #19777
2025-12-01 11:43:20 +01:00
Daniel Stenberg
729316a9e4
http: handle oom error from Curl_input_digest()
Closes #19780
2025-12-01 10:47:33 +01:00
Daniel Stenberg
cffc912844
url: fix return code for OOM in parse_proxy()
Closes #19779
2025-12-01 10:18:58 +01:00
Daniel Stenberg
41931f1659
imap: make sure Curl_pgrsSetDownloadSize() does not overflow
Follow-up to c1e3a760b. The previous update missed an addition that also
can wrap and cause confusion. Fixing this by calling
Curl_pgrsSetDownloadSize() after the overflow check.

Reported-by: Deniz Parlak
Closes #19774
2025-12-01 08:37:23 +01:00
Viktor Szakats
bf58ca6e8f
cmake: narrow scope of custom CMAKE_MODULE_PATH in curl-config.cmake
Set it only while using local Find modules, leave it as-is while using
system ones.

Follow-up to 16f073ef49 #16973
Cherry-picked from #19776
2025-12-01 01:28:24 +01:00
Viktor Szakats
7799d15eef
cmake: fix ws2_32 reference in curl-config.cmake
Follow-up to 16f073ef49 #16973
Follow-up to 554dfa5568 #17927

Closes #19775
2025-12-01 00:57:12 +01:00
Viktor Szakats
f553bff6ee
cmakelint: also lint CMake .in files, fix a long line
```
CMakeConfigurableFile.in
cmake_uninstall.cmake.in
curl-config.cmake.in
```

Follow-up to 16f073ef49 #16973
Closes #19773
2025-12-01 00:03:07 +01:00
Viktor Szakats
4e8d5da7ee
vtls: drop interim ECH feature macros (OpenSSL, wolfSSL)
Use the macros set by autotools and cmake, to simplify.

Closes #19772
2025-11-30 22:27:25 +01:00
Viktor Szakats
815bf76649
autotools: delete idle AM_CFLAGS, AM_LDFLAGS variables
Closes #19771
2025-11-30 22:27:25 +01:00
Viktor Szakats
003689c3d3
cf-socket: drop feature check for IPV6_V6ONLY on Windows
The macro is present in all supported Windows toolchains.

It's present in mingw-w64 v3+, and in MS SDK 6.0A+ (maybe earlier).

Also:
- restrict this logic to `USE_WINSOCK` (was: `_WIN32`), to exclude
  alternate socket libraries (i.e. lwIP). lwIP supports `IPV6_V6ONLY`
  since its 2.0.0 (2016-11-10) release and it's disabled by default,
  unlike in Winsock.
  Ref: e65202f825
- delete interim setter function/dummy macro `set_ipv6_v6only()`.

Follow-up to a28f5f68b9 #18010
Follow-up to ca3f6decb9 #10975

Closes #19769
2025-11-30 22:27:25 +01:00
Viktor Szakats
fdf9937cef
rtmp: stop redefining setsockopt system symbol on Windows
Before this patch it added Windows-specific casts. In unity builds this
also affected other source files.

`setsockopt()` is called without special casts in other places in
the code, and passing a non-const char ptr to a const char ptr arg also
should work.

Basic compile test with mingw-w64 confirms. In case of issues, a cast to
`curl_socklen_t` can be used, or do the special case in an `#if` branch.

Also: merge Windows-specific guards for `SET_RCVTIMEO()`.

Follow-up to 639d052e44 #3155
Follow-up to 04cb15ae9d

Closes #19768
2025-11-30 22:27:25 +01:00
Viktor Szakats
0180af2481
tests/data: add %PERL to postcheck commands where missing
To avoid potentially executing a different Perl than used by the rest
of the build and tests.

Also to be more portable by not relying on shebang support, though these
particular tests require POSIX shell anyway.

Closes #19767
2025-11-30 11:01:50 +01:00
Viktor Szakats
2d2d70b6e5
test613.pl: integrate mtime check for test 1445, 1446
Move check logic from postchecks to `test613.pl`.

To make these test data files XML-compliant.
Also to avoid POSIX/bash-shellisms in postcheck.

Closes #19766
2025-11-30 11:01:50 +01:00
Viktor Szakats
6d156bc05f
tests/data: replace Perl && with and for XML-compliance
Bringing down non-XML-compliant files to 50 (from 58).

Follow-up to 7f3731ce14 #19595

Closes #19765
2025-11-30 11:01:50 +01:00
Viktor Szakats
47a1ab2ebe
lib: fix formatting nits (part 1)
From `lib/a*` to `lib/cs*`.

Closes #19764
2025-11-30 11:01:50 +01:00
Viktor Szakats
2253bc330f
lib/subdirs: fix formatting nits
Closes #19757
2025-11-30 11:01:50 +01:00
Daniel Stenberg
0eed8b7330
tool_operatate: return error for OOM in append2query
Closes #19763
2025-11-30 10:37:41 +01:00
Viktor Szakats
c3add7130d
mbedtls: replace macro constant with CURL_ARRAYSIZE()
Also move from `int` to `size_t` for index variables.

Closes #19762
2025-11-30 00:19:32 +01:00
Daniel McCarney
985f86f0be
rustls: simplify init err path
Closes #19759
2025-11-29 22:47:22 +01:00
Daniel Stenberg
db32c0721f
rustls: verify that verifier_builder is not NULL
Since this function returns allocated resources there is probably at
least a theoretical risk this can return NULL.

Pointed out by ZeroPath

Closes #19756
2025-11-29 22:46:07 +01:00
Viktor Szakats
545f2f387d
lib/sendf.h: forward declare two structs
To fix non-unity builds using certain header orders (seen in ntlm.c with
the include order changed):
```
lib/vauth/../sendf.h:117:27: error: ‘struct Curl_cwriter’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
  117 |                    struct Curl_cwriter *writer);
      |                           ^~~~~~~~~~~~
lib/vauth/../sendf.h:215:54: error: ‘struct Curl_creader’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
  215 |   CURLcode (*do_init)(struct Curl_easy *data, struct Curl_creader *reader);
      |                                                      ^~~~~~~~~~~~
[...]
```
Ref: https://github.com/curl/curl/actions/runs/19785420705/job/56691185397?pr=19760

Ref: #19760
Closes #19761
2025-11-29 19:37:58 +01:00
Viktor Szakats
ed331cea80
cmake: save and restore CMAKE_MODULE_PATH in curl-config.cmake
Reported-by: Kai Pastor
Bug: https://github.com/curl/curl/pull/16973#discussion_r2572957270
Follow-up to 16f073ef49 #16973

Closes #19758
2025-11-29 15:10:42 +01:00
Viktor Szakats
16f073ef49
cmake: define dependencies as IMPORTED interface targets
Rework the way curl's custom Find modules advertise their properties.

Before this patch, Find modules returned detected dependency properties
(header dirs, libs, libdirs, C flags, etc.) via global variables. curl's
main `CMakeLists.txt` copied their values into global lists, which it
later applied to targets. This solution worked internally, but it was
unsuited for the public, distributed `CURLConfig.cmake` and publishing
curl's Find modules with it, due to polluting the namespace of consumer
projects. It's also impractical to apply the many individual variables
to every targets depending on libcurl.

To allow using Find modules in consumer projects, this patch makes them
define as imported interface targets, named `CURL::<dependency>`. Then
store dependency information as target properties. It avoids namespace
pollution and makes the dependency information apply automatically
to all targets using `CURL::libcurl_static`.

Find modules continue to return `*_FOUND` and `*_VERSION` variables.

For dependencies detected via `pkg-config`, CMake 3.16+ is recommended.
Older CMake versions have a varying degree of support for
propagating/handling library directories. This may cause issues in envs
where dependencies reside in non-system locations and detected via
`pkg-config` (e.g. macOS + Homebrew). Use `CURL_USE_PKGCONFIG=OFF`
to fix these issues. Or upgrade to newer CMake, or link libcurl
dynamically.

Also:
- re-enable `pkg-config` for old cmake `find_library()` integration
  tests.
- make `curlinfo` build after these changes.
- distribute local Find modules.
- export the raw list of lib dependencies via `CURL_LIBRARIES_PRIVATE`.
- `CURLconfig.cmake`: use curl's Find modules to detect dependencies in
  the consumer env.
- add custom property to target property debug function.
- the curl build process no longer modifies `CMAKE_C_FLAGS`.
  Follow-up to e86542038d #17047

Ref: #14930
Ref: https://github.com/libssh2/libssh2/pull/1535
Ref: https://github.com/libssh2/libssh2/pull/1571
Ref: https://github.com/libssh2/libssh2/pull/1581
Ref: https://github.com/libssh2/libssh2/pull/1623

Closes #16973
2025-11-29 01:41:40 +01:00
Daniel Stenberg
06e16167d6
memdebug: buffer output data
Instead of writing each line to file immediately, this now stores them
in an in-memory buffer until that gets full or curl exits. To make it
run faster and write to file less often.

Closes #19750
2025-11-28 23:19:07 +01:00
Viktor Szakats
d73efc62c1
tests: fix formatting nits
Also:
- lib1948: fix checksrc error TYPEDEFSTRUCT.
  (detected after formatting)

Closes #19754
2025-11-28 23:15:35 +01:00
Viktor Szakats
4be6707910
curlx/multibyte: stop setting macros for non-Windows
These macros are not used for non-Windows. Drop them with the unused
mappings to standard allocators.

Closes #19751
2025-11-28 23:15:34 +01:00
Daniel Stenberg
02aa75a8c2
runtests: allow a test to switch off memdebug
Test 3207 now uses this as its multi-threading is not fully memdebug
compliant.

Closes #19752
2025-11-28 22:39:19 +01:00
Stefan Eissing
3896152843
connection: give send methods/prototypes an uint8_t buffer
To conclude changing the send buffer type from `const void *` to `const
uint8_t *`, change the top level send function and its implementations.

Closes #19743
2025-11-28 16:08:15 +01:00
Stefan Eissing
8c68887d2d
http1: parse header from uint8_t buffer
To save casting the passed buffer when parsing HTTP/1 request
headers from an uint8_t buffer.

Closes #19742
2025-11-28 16:07:07 +01:00
Stefan Eissing
b06cd929bd
libssh: fix state machine loop to progress as it should 2025-11-28 16:05:52 +01:00
Stefan Eissing
12a3182fc3
ssh: tracing and better pollset handling
Remove connection member `waitfor` and keep it in the SSH connection
meta. Add `ssh` to supported tracing features, convert many DEBUGF
printgs to traces.

Closes #19745
2025-11-28 16:05:43 +01:00
Viktor Szakats
e25a3c6734
GHA/curl-for-win: drop WINE install, do not run curl after build
To reduce to amount of Debian packages to install, which hopefully
removes some flakiness due to sometimes very slow Azure package
distro servers. Possible also making these jobs finish 20s faster.

Windows from Debian | llvm               | gcc
:------------------ | :----------------: | :----------------:
build time          |  2m41s  ->  2m20s  |  3m19s  ->  2m57s
installed packages  |  288    ->  142    |  247    ->  99
downloads           |  403 MB ->  240 MB |  297 MB -> 134 MB
disk space          | 2132 MB -> 1289 MB | 1582 MB -> 739 MB

Before: https://github.com/curl/curl/actions/runs/19765983026
After: https://github.com/curl/curl/actions/runs/19766373960?pr=19749

Ref: 02149b7e36

Closes #19749
2025-11-28 15:39:12 +01:00
Viktor Szakats
aad3c2e8e1
example: fix formatting nits
Also:
- drop non-portable `__STRING()` macro use where still used.

Closes #19746
2025-11-28 15:01:59 +01:00
Yedaya Katsman
c10dda9ebb
curlx/fopen: fix typo in copyright
Follow-up to 193cb00ce9 #19626

Closes #19747
2025-11-28 15:01:59 +01:00
Viktor Szakats
193cb00ce9
build: stop overriding standard memory allocation functions
Before this patch curl used the C preprocessor to override standard
memory allocation symbols: malloc, calloc, strdup, realloc, free.
The goal of these is to replace them with curl's debug wrappers in
`CURLDEBUG` builds, another was to replace them with the wrappers
calling user-defined allocators in libcurl. This solution needed a bunch
of workarounds to avoid breaking external headers: it relied on include
order to do the overriding last. For "unity" builds it needed to reset
overrides before external includes. Also in test apps, which are always
built as single source files. It also needed the `(symbol)` trick
to avoid overrides in some places. This would still not fix cases where
the standard symbols were macros. It was also fragile and difficult
to figure out which was the actual function behind an alloc or free call
in a specific piece of code. This in turn caused bugs where the wrong
allocator was accidentally called.

To avoid these problems, this patch replaces this solution with
`curlx_`-prefixed allocator macros, and mapping them _once_ to either
the libcurl wrappers, the debug wrappers or the standard ones, matching
the rest of the code in libtests.

This concludes the long journey to avoid redefining standard functions
in the curl codebase.

Note: I did not update `packages/OS400/*.c` sources. They did not
`#include` `curl_setup.h`, `curl_memory.h` or `memdebug.h`, meaning
the overrides were never applied to them. This may or may not have been
correct. For now I suppressed the direct use of standard allocators
via a local `.checksrc`. Probably they (except for `curlcl.c`) should be
updated to include `curl_setup.h` and use the `curlx_` macros.

This patch changes mappings in two places:
- `lib/curl_threads.c` in libtests: Before this patch it mapped to
  libcurl allocators. After, it maps to standard allocators, like
  the rest of libtests code.
- `units`: before this patch it mapped to standard allocators. After, it
  maps to libcurl allocators.

Also:
- drop all position-dependent `curl_memory.h` and `memdebug.h` includes,
  and delete the now unnecessary headers.
- rename `Curl_tcsdup` macro to `curlx_tcsdup` and define like the other
  allocators.
- map `curlx_strdup()` to `_strdup()` on Windows (was: `strdup()`).
  To fix warnings silenced via `_CRT_NONSTDC_NO_DEPRECATE`.
- multibyte: map `curlx_convert_*()` to `_strdup()` on Windows
  (was: `strdup()`).
- src: do not reuse the `strdup` name for the local replacement.
- lib509: call `_strdup()` on Windows (was: `strdup()`).
- test1132: delete test obsoleted by this patch.
- CHECKSRC.md: update text for `SNPRINTF`.
- checksrc: ban standard allocator symbols.

Follow-up to b12da22db1 #18866
Follow-up to db98daab05 #18844
Follow-up to 4deea9396b #18814
Follow-up to 9678ff5b1b #18776
Follow-up to 10bac43b87 #18774
Follow-up to 20142f5d06 #18634
Follow-up to bf7375ecc5 #18503
Follow-up to 9863599d69 #18502
Follow-up to 3bb5e58c10 #17827

Closes #19626
2025-11-28 10:44:26 +01:00
Daniel Stenberg
bfc3d131b6
http: add asserts for null terminator for input strings
http_rw_hd() assumes the null terminator is present. These asserts make
sure this remains true.

Closes #19741
2025-11-28 10:06:09 +01:00
Viktor Szakats
48939a4575
GHA/linux-old: add support for using custom CMake versions
Install CMake from the Kitware GitHub release archive. To allow choosing
its version independently from the OS.

Switch to 3.7.0 (from 3.7.2) to test the earliest supported version.
Also tested OK with 3.18.4 and 3.7.2.

The download and install step takes 1-2 seconds.

Follow-up to c9e50e9e39 #19737

Closes #19738
2025-11-28 03:11:33 +01:00
renovate[bot]
9d059e27d1
GHA: update dependency pyspelling to v2.12.1
Closes #19712
2025-11-28 02:53:40 +01:00
renovate[bot]
e7c2f5bf53
GHA: update dependency google/boringssl to v0.20251124.0
Closes #19685
2025-11-28 02:53:40 +01:00
Viktor Szakats
5c275f7fef
GHA/linux-old: stop installing groff, it is unused 2025-11-28 02:40:19 +01:00
Viktor Szakats
c9e50e9e39
appveyor: add support for using custom CMake versions
To allow more flexibility and not be limited by defaults offered by
the runner machines:
- Visual Studio 2013: CMake 3.12.2
- Visual Studio 2015, 2017: CMake 3.16.2
Ref: https://www.appveyor.com/docs/windows-images-software/

Start using 3.18.4, 3.19.8, 3.20.6 in older VS jobs to add variations.

Time cost is a couple of seconds per job.

Ref: #18704 (Discussion)
Ref: #16973

Closes #19737
2025-11-28 00:51:08 +01:00
Viktor Szakats
376c7bddc4
unit1653: replace local macro with Curl_safefree()
Cherry-picked from #19626
Closes #19736
2025-11-27 21:02:18 +01:00
Viktor Szakats
6dc82c8046
memdebug: replace (fwrite) with fwrite
Cherry-picked from #19626
Closes #19735
2025-11-27 21:02:17 +01:00
Viktor Szakats
63eb0627b1
curl_setup.h: drop superfluous parenthesis from Curl_safefree macro
Cherry-picked from #19626
Closes #19734
2025-11-27 20:33:05 +01:00
Viktor Szakats
986e6d4eae
CODE_STYLE.md: sync banned function list with checksrc.pl
Also alpha sort the list in checksrc.pl.

Closes #19733
2025-11-27 18:53:35 +01:00
Daniel Stenberg
5c22bd5384
mbedtls_threadlock: avoid calloc, use array
Closes #19732
2025-11-27 18:09:14 +01:00
Daniel Stenberg
aa9342058f
RELEASE-NOTES: synced 2025-11-27 16:14:37 +01:00
Daniel Stenberg
53775baa1d
tests: allow 2500-2503 to use ~2MB malloc
On Linux using UDP_GRO, curl might allocate a (single) 1.5MB buffer for
maximum performance.

Fixes #19716
Closes #19731
2025-11-27 16:09:48 +01:00
Viktor Szakats
c1deea4c58
GHA/http3-linux: add H3 valgrind tests
Ref: #19714
Ref: #19717

Closes #19719
2025-11-27 16:05:42 +01:00
Stefan Eissing
56e88e7c14
cfilter: send uint8_t bytes
Change the send parameter from `const void *` to `const uint8_t *` and
adapt calling code. Several had already unsigned chars and were casting.

Closes #19729
2025-11-27 16:03:21 +01:00
Daniel Stenberg
1e048e932a
ngtcp2: remove the unused Curl_conn_is_ngtcp2 function
Closes #19725
2025-11-27 16:00:20 +01:00
Daniel Stenberg
a59a3cc7f1
cfilters: make conn_forget_socket a private libssh function
It is only used for (old) libssh builds.

Closes #19727
2025-11-27 15:59:40 +01:00
Viktor Szakats
c8b76ff42f
GHA/http3-linux: fix broken h3 server in non-openssl jobs, for more pytests
It also revealed 3 failing earlydata tests with two backends on Linux,
seen earlier on macOS:
```
LibreSSL     before: 571 passed, 141 skipped in 45.34s
LibreSSL      after: 736 passed,  95 skipped in 68.08s

aws-lc       before: 571 passed, 141 skipped in 78.87s
aws-lc        after: 736 passed,  95 skipped in 66.71s

BoringSSL    before: 511 passed, 201 skipped in 46.47s
BoringSSL     after: 676 passed, 155 skipped in 63.96s

GnuTLS       before: 515 passed, 197 skipped in 48.31s
GnuTLS        after: 688 passed, 140 skipped in 67.79s (3 failed)

wolfSSL      before: 541 passed, 171 skipped in 52.49s
wolfSSL       after: 714 passed, 114 skipped in 83.84s (3 failed)

OpenSSL      before: 757 passed,  74 skipped in 65.43s
OpenSSL       after: 757 passed,  74 skipped in 65.06s

OpenSSL-quic before: 741 passed,  90 skipped in 62.85s
OpenSSL-quic  after: 741 passed,  90 skipped in 57.20s

quiche       before: 511 passed, 201 skipped in 45.94s
quiche        after: 664 passed, 167 skipped in 59.57s
```
Before: https://github.com/curl/curl/actions/runs/19734972379
After: https://github.com/curl/curl/actions/runs/19736703398?pr=19723

Failures address via: 0081c5b126 #19730

Ref: #19724

Closes #19723
2025-11-27 15:57:52 +01:00
Viktor Szakats
0081c5b126
pytest: disable two H3 earlydata tests for all platforms (was: macOS)
Follow-up to 692c7f133e #19252
Follow-up to eefd03c572 #18703

Ref: #19719
Ref: #19723

Fixes #19724
Closes #19730
2025-11-27 15:51:47 +01:00
Viktor Szakats
7a10f49322
badwords: make some words match case-insensitively
Also:
- wcurl.md: sync with upstream to pass the badwords check.

Ref: 11f840cddd
Ref: https://github.com/curl/wcurl/pull/79

Closes #19713
2025-11-27 15:10:34 +01:00
Viktor Szakats
eae2df837e
runtests: fix showing nghttpx-h3 in the Env: log when detected
Ref: #19723
Closes #19728
2025-11-27 15:05:08 +01:00
Viktor Szakats
71e9920fcd
GHA: add timeouts to mitigate hung brew install step
Ref: https://github.com/curl/curl/actions/runs/19736703410/job/56550251534?pr=19723

Closes #19726
2025-11-27 15:05:08 +01:00
Stefan Eissing
bbb929112b
curlx_base64_encode: use uint8_t* for input
Change `inputbuff` parameter from `const char *` to `const uint8_t *` to
reflect the binary nature of the input bytes. Half the code was casting
unsigned char to signed already in calling.

Closes #19722
2025-11-27 14:35:01 +01:00
Stefan Eissing
fd5a117a67
ws: use uint8_t
Convert `unsigned char` use to `uint8_t`.

Closes #19721
2025-11-27 14:33:31 +01:00
Stefan Eissing
c4f29cc508
ip_quadruple/proxy: make port uint16_t
Make `port` member in these struct of type `uint16_t`.

add `uint8_t transport` to `struct ip_quadruple

Define TRNSPRT_NONE as 0. By assigning a valid transport only on a
successful connection, it is clear when the ip_quadruple members are
valid. Also, for transports not involving ports, the getinfos for
`CURLINFO_PRIMARY_PORT` and `CURLINFO_LOCAL_PORT` will now always return
-1.

Make all `transport` members and parameters of type `uint8_t`.

Document the return value of `CURLINFO_LOCAL_PORT` and
`CURLINFO_PRIMARY_PORT` in this regard. Add tests that writeout stats
report ports correctly.

Closes #19708
2025-11-27 14:32:01 +01:00
Stefan Eissing
feea968512
conncontrol: reuse handling
Add protocol handler flag `PROTOPT_CONN_REUSE` to indicate that the
protocol allows reusing connections for other tranfers. Add that
to all handlers that support it.

Create connections with `conn->bits.close = FALSE` and remove all
the `connkeep()` calls in protocol handlers setup/connect implementations.
`PROTOPT_CONN_REUSE` assures that the default behaviour applies
at the end of a transfer without need to juggle the close bit.

`conn->bits.close` now serves as an additional indication that a
connection cannot be reused. Only protocol handles that allow
reuse need to set it to override the default behaviour.

Remove all `connclose()` and `connkeep()` calls from connection
filters. Filters should not modify connection flags. They are
supposed to run in eyeballing situations where a filter is just
one of many determining the outcome.

Fix http response header handling to only honour `Connection: close`
for HTTP/1.x versions.

Closes #19333
2025-11-27 14:30:14 +01:00
Stefan Eissing
a9e7a027ed
vquic: do_sendmsg full init
When passing a `msg_ctrl` to sendmsg() as part of GSO handling, zero the
complete array. This fixes any false positives by valgrind that complain
about uninitialised memory, even though the kernel only ever accesses
the first two bytes.

Reported-by: Aleksei Bavshin
Fixes #19714
Closes #19715
2025-11-27 12:36:23 +01:00
Stefan Eissing
9bb5c0578b
ngtcp2+openssl: fix leak of session
Fix return value indicating to OpenSSL if reference to session is kept
(it is not), so OpenSSL frees it.

Reported-by: Aleksei Bavshin
Fixes #19717
Closes #19718
2025-11-27 12:35:39 +01:00
Daniel Stenberg
c273de193e
test433: verify "Note: Read config file from..."
Which was added in fc09a2da4a

Closes #19699
2025-11-27 08:39:40 +01:00
Yedaya Katsman
9ea6f2bc69
docs: add rustls to supported backends for CERT and KEY
Followup to 1c8c93ae15

Closes #19709
2025-11-27 08:38:25 +01:00
Stefan Eissing
94ce87c391
types: remove curl_int64_t/curl_uint64_t
These types and the definitions surrounding them are no longer needed.

Closes #19706
2025-11-26 13:53:53 +01:00
Viktor Szakats
0b09ad8ecb
examples/multi-uv: simplify passing uv struct
Reported-by: st751228051 on github
Follow-up to c722346518 #19538 #19462
Closes #19707
2025-11-26 13:19:36 +01:00
BANADDA
c722346518
examples/multi-uv: fix invalid req->data access
The on_uv_timeout callback was trying to access req->data as
a curl_context pointer, but uv.timeout.data was never initialized,
making it always NULL. This rendered the code inside the if(context)
block unreachable.

Fixes #19462
Closes #19538
2025-11-26 12:52:10 +01:00
Viktor Szakats
2acdc4f549
autotools: add nettle library detection via pkg-config (for GnuTLS)
Also:
- fix to restore full state when gnutls canary function is not found.
- fix indentation.

Closes #19703
2025-11-26 12:39:30 +01:00
Daniel Stenberg
0d2bb9c7c6
http: fix OOM exit in Curl_http_follow
Spotted by "strict torture" tests.

Closes #19705
2025-11-26 11:57:09 +01:00
Daniel Stenberg
cb722b32ad
urlapi: handle OOM properly when setting URL
Closes #19704
2025-11-26 10:42:46 +01:00
Daniel Stenberg
ea7df8d076
docs: spell it Rustls with a capital R
I believe this is how the project itself uses it.

Closes #19702
2025-11-26 09:41:09 +01:00
Viktor Szakats
4041eea61e
GHA/http3-linux: build nettle manually for GnuTLS 3.8.11+
GnuTLS 3.8.11 started requiring a nettle version new enough to be
missing from Ubuntu LTS released a year ago. To keep up testing it,
build nettle from source. Besides the necessary one time effort this
has the downside that nettle updates now need to be done manually
a couple of times per year when renovate detects one. (if I got the
renovate formula correct to catch the tag format).

Also:
- switch the local GnuTLS build to use the release tarball instead of
  the Git repo and calling the script `bootstrap`. The script could
  potentially download source code using the cleartext `git:` protocol.
  It's also downloading lots of content, including a full OpenSSL repo.

Ref: 955f7a7fc2/NEWS (L41-L44)
Follow-up to 905b718de3 #19642
Follow-up to a439fc0e37 #19613

Closes #19680
2025-11-26 02:16:49 +01:00
Daniel Stenberg
31b1527c1d
hostip: only store negative response for CURLE_COULDNT_RESOLVE_HOST
Follow-up from ce06fe7771

This allows us to drop the 'keep_negative' variable completely.

Closes #19701
2025-11-25 23:36:31 +01:00
Stefan Eissing
4701a6d2ae
lib: change uint sets to operate on uint32_t
- clarify names and change types
- make multi's `mid` a uint32_t
- update documentation

Closes #19695
2025-11-25 17:22:13 +01:00
Stefan Eissing
bb63518ba7
openssl-quic: use stdint types
Use int64_t and uint64_t directly without needing to cast to
curl_int64_t and curl_uint64_t.

Closes #19698
2025-11-25 16:55:53 +01:00
Stefan Eissing
ef4f791337
quiche: use stdint types
Use int64_t and uint64_t directly without needing to cast to
curl_int64_t and curl_uint64_t.

Closes #19697
2025-11-25 16:54:55 +01:00
Stefan Eissing
0f6ad5ab7d
ngtcp2: use stdint types
Use int64_t and uint64_t directly without needing to cast to
curl_int64_t and curl_uint64_t.

Closes #19696
2025-11-25 16:50:09 +01:00
Stefan Eissing
7e5f379d71
bufq: use uint8_t
instead of unsigned char

Closes #19690
2025-11-25 16:47:13 +01:00
Stefan Eissing
16b44f6a3a
multi: simplify admin handle processing
Fold the special connection pool shutdown handling in multi the things
the admin handle cares about. Add the admin handle to the 'process'
bitset, deduce it from the 'running' count.

The admin handle is the processed like any other transfer, but has a
special case in `multi_runsingle()`. Simplifies all other multi
processing parts.

Closes #19604
2025-11-25 16:20:44 +01:00
Stefan Eissing
208a6aebf2
lib: timer stats improvements
* move the TIMER_POSTQUEUE to the time a connection is chosen,
  so that TIMER_NAMELOOKUP always happens afterwards
* client writer: do not trigger TIMER_STARTTRANSFER on CLIENTWRITE_INFO
  as ftp and other pingpong protocols write that before starting anything
  that is the tranfer itself
* Elimnating debug trancing of "closed stream/connection - bailing"
  as confusing, as connection is not really closed on most cases.
* Setting 'data->req.upload_done` correctly, so that no "abort upload"
  is happening at the end of a perfectly fine download.
* Adding test cases with up-/download of 0-length files.
* pytest: add a "timeline" of timer value checks to Resulst in curl.py,
  so that this can be used in several test cases, replacing the local
  stuff in test_16
* add timeline checks to ftp test cases

Closes #19269
2025-11-25 16:18:59 +01:00
Yedaya Katsman
fc09a2da4a
tool: log when loading .curlrc in verbose mode
Inspired by @vszakats in
https://github.com/curl/curl/pull/19631#issuecomment-3560803674

Closes #19663
2025-11-25 16:06:27 +01:00
Stefan Eissing
2b0ca15c49
ratelimit: remove a debug mprintf
Follow-up to 24b36fdd15

Closes #19694
2025-11-25 12:01:41 +01:00
Viktor Szakats
4f807db155
INTERNALS.md: add more dependency versions and dates
Closes #19691
2025-11-25 11:11:06 +01:00
Viktor Szakats
62683ad3f4
curlx: replace sprintf with snprintf
To avoid using a deprecated function on Windows.

Also: de-dupe `SNPRINTF` definition in curlx.

Closes #19681
2025-11-25 11:11:06 +01:00
Patrick Monnerat
74bd3e2f98
slist: constify Curl_slist_append_nodup() string argument
Although finally stored as a non-const pointer, the string is intended
to be left unchanged.

This change allows using the function without the need of a cast for
const pointers.

Closes #19692
2025-11-25 11:05:48 +01:00
Patrick Monnerat
92e6782d1f
doc: some returned in-memory data may not be altered
Some public prototypes do not declare return values or out parameters as
const where they should be. Avoid changing the public interface, but
document those values as read-only.

Closes #19692
2025-11-25 11:05:27 +01:00
Stefan Eissing
ba65073037
speedlimit: also reset on send unpausing
The low speedlimit currently counts both up- and download speed
accumulated. So, when unpausing upload, also reset the counter.

Closes #19687
2025-11-25 11:01:37 +01:00
Daniel Stenberg
6069c340b4
tool_doswin: clear pointer when thread takes ownership
Attempt to address #19675
Closes #19689
2025-11-25 10:59:37 +01:00
Daniel Stenberg
b8f83738c3
asyn-ares: handle Curl_dnscache_mk_entry() OOM error
To avoid leaking memory.

Follow-up to ce06fe7771
Closes #19688
2025-11-25 10:26:56 +01:00
Daniel Stenberg
d0ad652552
progress: remove two redundant variable checks
The entry condition in the function already exits early if either
low_speed_time or low_speed_limit is not set.

Pointed out by CodeSonar

Closes #19686
2025-11-25 09:40:13 +01:00
Daniel Stenberg
729f36e90f
sendf: fix uninitialized variable in trace output
Initialize *nread early on.

Pointed out by CodeSonar

Closes #19684
2025-11-25 09:15:04 +01:00
Daniel Stenberg
ce06fe7771
hostip: make more functions return CURLcode
- Curl_async_getaddrinfo() always returned NULL so it was pointless.
  Return proper curlcode instead to distinguish between errors. Same for
  Curl_doh().
- simplify the IP address handling
- make Curl_str2addr() function return CURLcode

Closes #19669
2025-11-25 09:13:34 +01:00
Sunny
a075d1c0d8
examples: fix minor typo
Closes #19683
2025-11-25 08:58:03 +01:00
Viktor Szakats
1e7d0bafc6
curlx/fopen: replace open CRT functions their with _s counterparts (Windows)
- `_wopen`        -> `_wsopen_s`
- `_open`, `open` -> `_sopen_s`
- `_wfopen`       -> `_wfopen_s`
- `fopen`         -> `fopen_s`
- `_wfreopen`     -> `_wfreopen_s`
- `freopen`       -> `freopen_s`

For better error handling and for using the CRT functions recommended
via warnings suppressed by `_CRT_SECURE_NO_WARNINGS`.

Also:
- add missing `freopen_s()` prototype when building with mingw-w64 <5.
  https://sourceforge.net/p/mingw-w64/mingw-w64/ci/a5d824654cdc57f6eac1bb581b078986f3eb6856/
- tests/server: replace `open()` in the signal handler with `_sopen_s()`
  on Windows.
- tests/server: reduce scope of a checksrc exception to a single line.
- checksrc: ban replaced functions.

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/open-wopen
https://learn.microsoft.com/cpp/c-runtime-library/reference/sopen-s-wsopen-s
https://learn.microsoft.com/cpp/c-runtime-library/reference/freopen-wfreopen
https://learn.microsoft.com/cpp/c-runtime-library/reference/fopen-wfopen
https://learn.microsoft.com/cpp/c-runtime-library/reference/fopen-s-wfopen-s
https://learn.microsoft.com/cpp/c-runtime-library/reference/freopen-s-wfreopen-s

Closes #19643
2025-11-25 03:44:22 +01:00
Viktor Szakats
ee97c2a96a
tests/server: use curlx file open/close functions
Replace:
- `open()` with `curlx_open()` (1 call).
- `fopen()` with `curlx_fopen()`.
- `fclose()` with `curlx_fclose()`.

To centralize interacting with the CRT in preparation for using "safe"
alternatives on Windows. This also adds long-filename and Unicode
support for these operations on Windows.

Keep using `open()` in the signal handler to avoid any issues with
calling code not allowed in signal handlers.

Cherry-picked from #19643
Closes #19679
2025-11-25 01:46:06 +01:00
Viktor Szakats
56bfde6554
INTERNALS.md: add release dates to build dependencies
Also:
- delete `roffit`, that's not used anymore.
  Follow-up to ea0b575dab #12753

Follow-up to 92d9dbe4c0 #19611

Closes #19677
2025-11-25 00:26:50 +01:00
Viktor Szakats
3887069c66
lib: rename internal header share.h to curl_share.h to avoid collision
Windows CRTs have a `share.h`. Before this patch when trying to
`#include <share.h>` it, the compiler picked up curl's internal
`lib/share.h` instead. Rename it to avoid this issue.

CRT `share.h` has constants necessary for using safe open CRT functions.

Also rename `lib/share.c` to keep matching the header.

Ref: https://learn.microsoft.com/cpp/c-runtime-library/sharing-constants
Ref: 625f2c1644 #16949 #16991
Cherry-picked from #19643
Closes #19676
2025-11-25 00:26:50 +01:00
Daniel Stenberg
56f2479c14
manage: expand the 'libcurl support required' message
Example of old text:

 --dns-ipv4-addr requires that libcurl is built to support c-ares.

New version:

 For --dns-ipv4-addr to work, it requires that the underlying libcurl is
 built to support c-ares.

Closes #19665
2025-11-24 23:35:00 +01:00
Stefan Eissing
24b36fdd15
ratelimit: redesign
Description of how this works in `docs/internal/RATELIMITS.ms`.

Notable implementation changes:
- KEEP_SEND_PAUSE/KEEP_SEND_HOLD and KEEP_RECV_PAUSE/KEEP_RECV_HOLD
  no longer exist. Pausing is down via blocked the new rlimits.
- KEEP_SEND_TIMED no longer exists. Pausing "100-continue" transfers
  is done in the new `Curl_http_perform_pollset()` method.
- HTTP/2 rate limiting implemented via window updates. When
  transfer initiaiting connection has a ratelimit, adjust the
  initial window size
- HTTP/3 ngtcp2 rate limitin implemnented via ack updates
- HTTP/3 quiche does not seem to support this via its API
- the default progress-meter has been improved for accuracy
  in "current speed" results.

pytest speed tests have been improved.

Closes #19384
2025-11-24 23:34:05 +01:00
Daniel Stenberg
bfde781121
RELEASE-NOTES: synced 2025-11-24 23:32:59 +01:00
Daniel Stenberg
be4462a415
INTERNALS.md: add brotli and zstd version info
And alpha-sort the dependency list

Closes #19672
2025-11-24 23:26:45 +01:00
Viktor Szakats
2b57d415e5
content_encoding: drop a guard for brotli 1.0.0+ macro
Also add comment with version requirement for the other guard.

Refs:
19d86fb9a6
03739d2b11

Ref: #19672
Follow-up to e639d4ca4d
Closes #19673
2025-11-24 22:33:22 +01:00
Viktor Szakats
2b7515ae8e
tftpd: fix/tidy up open() mode flags
- replace 0777 with `S_I*` macros.
- fix to not pass invalid flags on Windows.

Follow-up to 537987d8c6 #19645

Closes #19671
2025-11-24 22:33:22 +01:00
Viktor Szakats
fa1270a0d1
vquic: do not pass invalid mode flags to open() (Windows)
Follow-up to 82013066a6 #19647

Closes #19670
2025-11-24 22:33:21 +01:00
renovate[bot]
3696ac4e29
GHA: update dependency ngtcp2/nghttp3 to v1.13.1
Closes #19664
2025-11-24 17:41:50 +01:00
Viktor Szakats
1eca08a541
curlx/strerr: use strerror_s() on Windows
To replace deprecated, unsafe `sys_nerr`, `sys_errlist` global
variables with the function suggested by the CRT warning silenced via
`_CRT_SECURE_NO_WARNINGS`:
```
lib/curlx/strerr.c(291): warning C4996: '__sys_nerr': This function or variable may be unsafe. Consider using strerror instead.
lib/curlx/strerr.c(292): warning C4996: '__sys_errlist': This function or variable may be unsafe. Consider using strerror instead.
```
(where `strerror` in turn suggests `strerror_s`...)

Upside: returns an error and has a Unicode variant. Downaside: happy
to return success when passing unrecognized error codes. Work it around
by looking for the string "Unknown error" returned in such cases and
falling back to other methods to retrieve a description.

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr
https://learn.microsoft.com/cpp/c-runtime-library/reference/strerror-s-strerror-s-wcserror-s-wcserror-s

Closes #19646
2025-11-24 14:29:44 +01:00
Viktor Szakats
82013066a6
file: do not pass invalid mode flags to open() on upload (Windows)
Ref: https://learn.microsoft.com/cpp/c-runtime-library/reference/open-wopen

Ref: #19645
Cherry-picked from #19643
Closes #19647
2025-11-24 14:29:39 +01:00
Viktor Szakats
537987d8c6
curl_fopen: do not pass invalid mode flags to open() on Windows
The safe (`_s`) variants of the Windows `open()` reject these flags,
while the classic ones silently accepted them.

Also:
- also drop the now unused `stat()` call on Windows.
- replace magic number with their equivalent Windows and Unix-specific
  `S_*` macros.

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/open-wopen
https://learn.microsoft.com/cpp/c-runtime-library/reference/fstat-fstat32-fstat64-fstati64-fstat32i64-fstat64i32

Cherry-picked from #19643
Closes #19645
2025-11-24 14:29:39 +01:00
Viktor Szakats
d03712169b
cmake: add support for libbacktrace, fix two build issues
Also:
- memdebug: fix symbol collision in unity builds.
- memdebug: fix compiler warning by making a variable static.

Follow-up to c77bed81a2 #19657

Closes #19666
2025-11-24 14:29:29 +01:00
Daniel Stenberg
039fb84cb4
tool_writeout: bail out proper on OOM
Closes #19667
2025-11-24 13:32:51 +01:00
Daniel Stenberg
c77bed81a2
memdebug: produce stack trace dump with libbacktrace
Enable with "configure --enable-backtrace", inserts a backtrace in the
memdump log when a torture test limit is reached.

Closes #19657
2025-11-24 11:58:18 +01:00
bttrfl on github
b5265b24b0
speedcheck: do not trigger low speed cancel on transfers with CURL_READFUNC_PAUSE
When a trasfer is paused from a read callback with a CURL_READFUNC_PAUSE
code, it should be excluded from the speedcheck. Currently only
transfers paused from write callbacks are excluded, because the code
only checks for "recv direction" of the transfer. This commit adds a
check for "send direction".

Issue similar to https://github.com/curl/curl/issues/6358

Closes #19653
2025-11-24 11:40:30 +01:00
renovate[bot]
4d04a03016
GHA: update ngtcp2/nghttp3 to v1.13.0 from v1.12.0
Closes #19654
2025-11-23 23:51:04 +01:00
renovate[bot]
74cf7725d7
GHA: update ngtcp2/ngtcp2 to v1.18.0 from v1.17.0
Closes #19655
2025-11-23 23:49:56 +01:00
Stefan Eissing
29b3b1ae6d
wolfssl: fix cipher list, skip 5.8.4 regression
- adjust cipher list in infof() statement for min/max TLS version

- skip test_17_07 for wolfSSL 5.8.4 when CHACHA20 is negotiated
  due to regression with homebrew build on ARM systems.

Fixes #19644
Reported-by: Viktor Szakats
Closes #19662
2025-11-23 18:05:42 +01:00
Daniel Stenberg
74f7505974
asyn-ares: remove hostname free on OOM
The freeing of the already allocated hostname is done by
Curl_async_shutdown(). This extra free in the RR code path made a
double-free.

Presumably not detected because the CI torture tests don't run HTTPS-RR
enabled?

Follow-up to 8d0bfe74fb
Closes #19658
2025-11-23 15:13:54 +01:00
Daniel Stenberg
f13f320dee
tool_msgs: make voutf() use stack instead of heap
For printf()ing the message to show.

Closes #19651
2025-11-23 12:52:00 +01:00
Daniel Stenberg
36b9987acb
tool_operate: fix a case of ignoring return code in operate()
If get_args() returns error, do not overwrite the variable in the next
call.

Also, avoid allocating memory for the default user-agent.

Closes #19650
2025-11-22 22:22:41 +01:00
Daniel Stenberg
4ebef2f0d9
tool_operate: fix case of ignoring return code in single_transfer
When glob_url() returns error, stop.

Closes #19649
2025-11-22 22:21:43 +01:00
Daniel Stenberg
7d75c728a6
KNOWN_RISKS: known risks when running and using curl and libcurl
Closes #19631
2025-11-22 13:09:46 +01:00
Daniel Stenberg
905b718de3
Revert "GHA: update gnutls/gnutls to 3.8.11 from 3.8.10"
This reverts commit a439fc0e37.

It requires a version of libnettle that is not included in these Ubuntu
versions: "Libnettle 3.10 was not found"

Closes #19642
2025-11-21 22:39:39 +01:00
Viktor Szakats
18b9429313
curlx: replace mbstowcs/wcstombs with _s counterparts (Windows)
They are used in Windows-specific `fopen()`, `freopen`, `open()` and
`curlx_get_winapi_error()` calls, and in `fix_excessive_path()` in
Unicode builds.

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/mbstowcs-mbstowcs-l
https://learn.microsoft.com/cpp/c-runtime-library/reference/mbstowcs-s-mbstowcs-s-l
https://learn.microsoft.com/cpp/c-runtime-library/reference/wcstombs-wcstombs-l
https://learn.microsoft.com/cpp/c-runtime-library/reference/wcstombs-s-wcstombs-s-l

Also ban these functions via checksrc.

Co-authored-by: Jay Satiro

Closes #19581
2025-11-21 16:45:42 +01:00
Viktor Szakats
acfcc2b288
checksrc: ban _tcsncpy, wcscpy, wcsncpy
Follow-up to eaa7651374 #19589

Closes #19641
2025-11-21 16:42:45 +01:00
renovate[bot]
a439fc0e37
GHA: update gnutls/gnutls to 3.8.11 from 3.8.10
Closes #19613
2025-11-21 16:00:34 +01:00
Stefan Eissing
e2be568974
multi: make max_total_* members size_t
Check size_t conversion on setting these members via CURLMIPT_*. Use
members without casting.

Closes #19618
2025-11-21 15:57:26 +01:00
Daniel Stenberg
047b36d7a6
smb: fix a size check to be overflow safe
In smb_send_message, although it could never actually overflow it might
as well be done correctly. Also do the check earlier.

Closes #19640
2025-11-21 15:55:51 +01:00
Stefan Eissing
6aa8fa3fdf
apple-sectrust: always ask when native_ca_store is in use
When OpenSSL fails to verify the peer certificate, we checked for
one specific reason code and did not ask Apple SecTrust for any
other failure.

Always ask Apple SecTrust after OpenSSL fails when the `native_ca_store`
is enabled. If the user configures a CAfile or CApath, the native store
is disabled, so this does not affect use cases where users asks curl
to use a specific set of trust anchors.

Do the same for GnuTLS

Fixes #19636
Reported-by: ffath-vo on github
Closes #19638
2025-11-21 14:02:46 +01:00
Viktor Szakats
9e6f1c5efb
build: add build-level CURL_DISABLE_TYPECHECK options
Usage:
- autotools: `--disable-typecheck` (or `--enable-typecheck` (default))
- cmake: `-DCURL_DISABLE_TYPECHECK=ON`.

To disable `curl_easy_setopt()`/`curl_easy_getinfo()` type checking with
supported (new) gcc and clang compilers. It is useful to improve build
performance for the `tests/libtest` target. In particular the CodeQL
analyzer may take above an hour to compile with type checking enabled,
and disabling it brings it down to seconds. On local machines it may
also cut build times in half when build testdeps, depending on platform
and compiler.

Other than these cases, we recommend leaving type checking enabled.

Ref: fdacf34aae #19632

Also:
- GHA/codeql: use it.
- test1165: check in `include/curl`.
- lib1912: delete stray todo comment.
- spelling and comment nits.

Closes #19637
2025-11-21 13:48:35 +01:00
Viktor Szakats
eaa7651374
lib: replace _tcsncpy/wcsncpy/wcscpy with _s counterparts (Windows)
Replace:
- curl_sspi: macro `_tcsncpy()` with `_tcsncpy_s()`.
- curlx/fopen: `wcsncpy()` with `wcsncpy_s()`.
- curlx/fopen: `wcscpy()` with `wcscpy_s()`.

Use of the pre-existing functions were safe. This patch aims to use the
recommended Windows CRT functions. Handle errors returned by them. Also
to avoid the compiler warnings silenced via `_CRT_SECURE_NO_WARNINGS`:

```
lib/curl_sspi.c(152): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
lib/curlx/fopen.c(161): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
lib/curlx/fopen.c(162): warning C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
lib/curlx/fopen.c(174): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
lib/curlx/fopen.c(175): warning C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
```

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/strncpy-strncpy-l-wcsncpy-wcsncpy-l-mbsncpy-mbsncpy-l
https://learn.microsoft.com/cpp/c-runtime-library/reference/strncpy-s-strncpy-s-l-wcsncpy-s-wcsncpy-s-l-mbsncpy-s-mbsncpy-s-l
https://learn.microsoft.com/cpp/c-runtime-library/security-features-in-the-crt

Cherry-picked from #19581 (in part)
Closes #19589
2025-11-21 13:48:35 +01:00
x2018
3561f2c7bf
lib: cleanup some whitespace nits
Closes #19588
2025-11-21 11:25:59 +01:00
Stefan Eissing
dd36dacd3e
openssl: no verify failf message unless strict
If verifypeer and verifyhost are disabled, to not generate
a failf() message for failed verifications.

Fixes #19615
Reported-by: ncaklovic on github
Closes #19625
2025-11-21 11:10:08 +01:00
Daniel Stenberg
de7ee1c962
GHA: disable TLS in the linux-old build
There are no supported TLS libraries left in "stretch".
2025-11-21 10:37:33 +01:00
Daniel Stenberg
49ab46c9c5
gtls: drop support for GnuTLS < 3.6.5
Release date 2018-12-01. Has TLS 1.3 support.

Closes #19609
2025-11-21 10:37:24 +01:00
Marc Aldorasi
529f61388f
gnutls: implement CURLOPT_CAINFO_BLOB
This adds support for in-memory CA certs using CURLOPT_CAINFO_BLOB to
the GnuTLS backend.

Closes #19612
2025-11-21 08:55:44 +01:00
Viktor Szakats
fd23d9505c
src: move memdebug.h to be the last include
`memdebug.h` must be included last within each source. This breaks when
including it in a header, which ends up being included in the middle of
other headers, and `memdebug.h` also ending up in the middle of
includes.

Follow-up to c255d2fdcb #19602

Closes #19629
2025-11-21 04:30:44 +01:00
Viktor Szakats
b4220bde0b
GHA/checksrc: switch xmllint job to Linux (from macOS)
macOS was chosen because xmllint comes preinstalled, saving the prereq
install step. But, macOS's xmllint jobs sometimes doesn't finish in 1m
(instead of under 1 second) and gets cancelled, causing flaky failures.
Go with Linux and an install phase (of 15s) instead.

Examples:
https://github.com/curl/curl/actions/runs/19558021722/job/56004334495

Closes #19634
2025-11-21 04:01:27 +01:00
Viktor Szakats
fdacf34aae
GHA/codeql: add tweak to successfully build libtests for CodeQL
Turns out the cause of CodeQL hangs (or probably just extreme long
compile) is the header `curl/typecheck-gcc.h`. By accident I noticed
that the preprocessed output of libtests.c is 75 MB (megabytes). This
is much higher than the amounf of source code hinted, also compared to
e.g. units.c or other build targets. The reason for the extreme size
is each easy option call pulling in the large checker logic defined
in this header.

By compiling with `-DCURL_DISABLE_TYPECHECK`, preprocessed output drops
to 2.2 MB (34x), and the libtests target builds without issues.

Also build all tests and examples with the Linux HTTP/3 config, covering
3 more files.

With these, CodeQL C coverage is 893 out of 930 (96%) (was: 645 69%)

Follow-up to 71fc11e6bb #18695
Follow-up to a333fd4411 #18557
Follow-up to b4922b1295 #18564

Closes https://github.com/vszakats/curl/pull/11
Closes #19632
2025-11-21 03:48:16 +01:00
renovate[bot]
27a7cf40bb
GHA: update dependency wolfSSL/wolfssl to v5.8.4
Closes #19633
2025-11-21 03:48:16 +01:00
Daniel Stenberg
51f5d30a36
RELEASE-NOTES: spellfix 2025-11-20 23:59:10 +01:00
Daniel Stenberg
8e1c7165bc
RELEASE-NOTES: synced 2025-11-20 22:42:32 +01:00
Stefan Eissing
de1a6f80eb
quiche: eliminate size_t casts
Use new curlx_sotouz_fits() instead.

Remove an unnecessary cast in osslq code while we are here.

Closes #19623
2025-11-20 22:38:21 +01:00
Stefan Eissing
7a22141de1
file: eliminate size_t cast
Use curlx_sztouz() instead.

Closes #19620
2025-11-20 22:36:47 +01:00
Daniel Stenberg
5f273fdddf
tool_urlglob: clean up used memory on errors better
Previously it had to realloc the pattern array to store the last entry
even when that last entry triggered an error and could be only half
filled in.

Also cleaned up for readability and better reallocs for sets.

Reported-by: letshack9707 on hackerone
Closes #19614
2025-11-20 22:34:34 +01:00
renovate[bot]
c5ef882e90
GHA: update actions/checkout action to v6 from v5
Closes #19628
2025-11-20 22:27:00 +01:00
Daniel Stenberg
92d9dbe4c0
INTERNALS: add release dates to the oldest supported dependencies
Closes #19611
2025-11-20 22:11:48 +01:00
Daniel Stenberg
01623e26d0
http: error on OOM when creating range header
Closes #19630
2025-11-20 22:11:03 +01:00
Stefan Eissing
ad9b12d411
httpsrr/altsvc: eliminate size_t casts
Treat alpn raw data as unsigned chars, avoids size_t and char* casts.
Add method to convert a struct Curl_str to an alpnid.

Closes #19621
2025-11-20 17:56:57 +01:00
Stefan Eissing
6c55dd0028
vquic: eliminate size_t casts
Use new curlx_sotouz_fits() instead.

Closes #19624
2025-11-20 17:53:36 +01:00
Stefan Eissing
d2ab42d786
cf-socket: elminiate size_t casts
Use curlx_sztouz() instead.

Closes #19617
2025-11-20 17:43:06 +01:00
Stefan Eissing
ffcf8c5ce4
rtmp: eliminate size_t casts
Use curlx_sztouz() instead.

Closes #19619
2025-11-20 17:41:42 +01:00
Stefan Eissing
b812be567a
mqtt: eliminate size_t cast
Use new curlx_sotouz_fits() instead.

Closes #19622
2025-11-20 17:39:39 +01:00
Stefan Eissing
d9e9dd7f20
h2-proxy: eliminate size_t cast
Use curlx_sztouz() instead.

Closes #19616
2025-11-20 17:25:52 +01:00
Viktor Szakats
7e8f36bf8e
cmake: honor CURL_DISABLE_INSTALL and CURL_ENABLE_EXPORT_TARGET in lib and src
Based on existing code and commit history it appears
`CURL_DISABLE_INSTALL` means to prevent calling `install()`;
`CURL_ENABLE_EXPORT_TARGET` means to prevent calling `export()` and
`install()`s with `EXPORT` in them.

Fix them to also apply to the lib and src directories in that vain:
- lib: honor `CURL_DISABLE_INSTALL`
- src: honor `CURL_DISABLE_INSTALL`
- src: honor `CURL_ENABLE_EXPORT_TARGET`

https://cmake.org/cmake/help/v4.2/command/install.html
https://cmake.org/cmake/help/v4.2/command/export.html

- `CURL_DISABLE_INSTALL` follow-up to:
  aace27b096 #12287
- `CURL_ENABLE_EXPORT_TARGET` follow-up to:
  8698825106 #9638
  643ec29645 #7060

Closes #19144
2025-11-20 00:23:08 +01:00
Viktor Szakats
3d80d37cf0
curlx: add and use curlx_freopen()
To complement the existing `curlx_fopen()` internal API.
It's used by the curl's `--stderr` option.

`curlx_freopen()` adds two features to the bare `freopen()`:
- tracing for debug-enabled builds.
- Unicode and long-filename support for Windows builds.

In effect this adds long-filename and enables Unicode support for
the `--stderr <filename>` curl command-line option on Windows.

Also add to checksrc.

Follow-up to 2f17a9b654 #10673

Closes #19598
2025-11-19 22:04:53 +01:00
Viktor Szakats
2decbb1c1f
runtests: add -m=seconds to override test curl command timeout
To override the curl default of 5 minutes (300000 ms).

Sometimes a simple test data change can result in a stuck test, this
option makes it exit with an error early. Possible future use in CI
or fast machines to prevent a single test taking 5 minutes and failing
the whole job.

Example hangers:

tests/data/test65:
```diff
-<data1000 crlf="yes">
+<data1000 crlf="headers">
```

tests/data/tests993:
```diff
-%repeat[1000 x 95 328485%0d%0a]%</data>
+%repeat[1000 x 95 328485%0d%0a]%
+</data>
```

Closes #19319
2025-11-19 22:04:52 +01:00
Christian Schmitz
991119051c
libssh2: add paths to error messages for quote commands
We really like to know what path curl parsed from our input.

Closes #19605
2025-11-19 16:25:07 +01:00
Stefan Eissing
17dc43ce6c
http: eliminate ssize_t
Use size_t to avoid conversions.

Closes #19610
2025-11-19 16:20:18 +01:00
Stefan Eissing
30afc66b88
gopher: convert ssize_t to size_t
Make type conversions unnecessary.

Closes #19608
2025-11-19 16:18:22 +01:00
Stefan Eissing
9fb843ac8f
ftp: use size_t instead of ssize_t
Make type conversions unnecessary.

Closes #19607
2025-11-19 16:16:20 +01:00
Viktor Szakats
47b8e1dbd3
tidy-up: move CURL_UNCONST() out from macro curl_unicodefree()
To stop applying it where not needed (most uses) and make it visible
where it's actually used (5 uses).

Follow-up to f4e23950c7 #16142

Closes #19606
2025-11-19 15:48:21 +01:00
Viktor Szakats
b0d23b901f
GHA: set --buildinfo for test-torture jobs
Only the `test-ci` build target sets `--buildinfo` automatically,
since 985f39c0ce. It needs to be set
manually for other targets used in CI, such as `test-torture`,
to enable the `buildinfo.txt` dump in the runtests step.

For Test Clutch. In an attempt to re-sync `targetarch` with the rest of
macOS jobs on the feature matrix page:
https://testclutch.curl.se/static/reports/feature-matrix.html
Before this patch and possibly since the breaking update It's `aarch64e`
for torture jobs and `aarch64` for the rest

(stricly speaking `aarch64e` is the correct value for all macOS jobs, but
autotools and cmake report arm64/aarch64 without the `e`.)

Regression from 985f39c0ce #18147

Closes #19601
2025-11-19 15:48:20 +01:00
Daniel Stenberg
b98e791e57
test777: simple ---ssl-sessions test with wrong sessions 2025-11-19 12:58:24 +01:00
Daniel Stenberg
abe6ea0531
curlinfo: add "ssl-sessions" as a feature to show
To allow tests depend on it
2025-11-19 12:58:24 +01:00
Daniel Stenberg
c255d2fdcb
tool_cfgable: free ssl-sessions at exit
Also free the memory correctly in tool_ssls_load

Closes #19602
2025-11-19 12:58:15 +01:00
Viktor Szakats
8bb8984e9d
curl_setup.h: document more funcs flagged by _CRT_SECURE_NO_WARNINGS
Based on these logs (non-Unicode, Unicode Schannel):
https://github.com/curl/curl/actions/runs/19446115443/job/55640968722?pr=19175
https://github.com/curl/curl/actions/runs/19446115443/job/55640968764?pr=19175

Follow-up to 5fa2d8320c #19175

Closes #19597
2025-11-19 01:48:20 +01:00
Viktor Szakats
7f3731ce14
tests/data: mark non-XML-compliant files as such, xmllint the rest in CI
There are 58 non-compliant files. Mark them with the `notxml` keyword.
Also include the compliant ones in the GHA/checksrc xmllint CI job.

Also:
- delete XML prolog from the 3 test data files that had them.
- FILEFORMAT.md: document the `notxml` keyword.
- FILEFORMAT.md: fix a typo.

Follow-up to de49cc89ab #19470
Follow-up to f3095f0dbd #19528
Follow-up to 87ba80a6df

Closes #19595
2025-11-19 00:02:45 +01:00
Viktor Szakats
36d0f12881
DISTROS.md: add OpenBSD
Closes #19596
2025-11-19 00:02:45 +01:00
Daniel Stenberg
318cd4f2ee
lib: error for OOM when extracting URL query
Closes #19594
2025-11-18 23:42:24 +01:00
Viktor Szakats
9726fc8259
test2405, 2407: mark tests based on lib2405 flaky
Flaky in macOS CI jobs.

2405:
https://github.com/curl/curl/actions/runs/19448567968/job/55648448197 CM gcc-13 aws-lc
https://github.com/curl/curl/actions/runs/19432797208/job/55595742192 AM clang !ssl
https://github.com/curl/curl/actions/runs/19431697816/job/55591941993 AM clang !ssl !debug brotli zstd
https://github.com/curl/curl/actions/runs/19421214342/job/55558775785 CM llvm@18 GnuTLS !ldap krb5 +examples
https://github.com/curl/curl/actions/runs/19413038235/job/55537174590 CM llvm@18 mbedTLS !ldap brotli zstd MultiSSL AppleIDN

2407:
https://github.com/curl/curl/actions/runs/19462732039/job/55691022408 AM clang !ssl
https://github.com/curl/curl/actions/runs/19440283144/job/55621665647 CM gcc-13 OpenSSL gsasl rtmp AppleIDN SecTrust +examples
https://github.com/curl/curl/actions/runs/19440283144/job/55621665682 AM gcc-13 !ssl !debug
https://github.com/curl/curl/actions/runs/19436530386/job/55608724437 CM gcc-13 aws-lc
https://github.com/curl/curl/actions/runs/19436530386/job/55608724641 CM llvm@18 GnuTLS !ldap krb5 +examples
https://github.com/curl/curl/actions/runs/19435651588/job/55605648449 CM llvm@18 OpenSSL gsasl rtmp AppleIDN SecTrust +examples

Ref: https://testclutch.curl.se/static/reports/results-count.html

Bug: https://github.com/curl/curl/pull/19487#issuecomment-3546858203
Bug: https://github.com/curl/curl/pull/19487#issuecomment-3546921877

Follow-up to 2c7e1792a0 #19487
Follow-up to 96a5ce5a82 #19481
Follow-up to c78044c07e #15146 #15155

Closes #19587
2025-11-18 21:27:44 +01:00
Viktor Szakats
de49cc89ab
tests/data: more XML-compliance via %LT and %GT macros in email addresses
Reduce number of files failing `xmllint --format` from 133 to 57 (-76)
(3% of 1894), by replacing `<` and `>` with new macro `%LT` and `%GT`,
in most places, which is in email addresses (192 lines).

Follow-up to a9ec2a676c #19491

Closes #19470
2025-11-18 18:57:53 +01:00
Daniel Stenberg
97169a91d9
hsts: propagate and error out correctly on OOM
Closes #19593
2025-11-18 16:40:32 +01:00
Daniel Stenberg
80005b4c8a
cookie: return error on OOM
Follow-up to 3f0629ca44
Closes #19591
2025-11-18 15:57:05 +01:00
Daniel Stenberg
6dac2631df
url: if OOM in parse_proxy() return error
Closes #19590
2025-11-18 14:54:16 +01:00
Daniel Stenberg
833efb437d
openssl: exit properly on OOM when getting certchain
Previously, a momentary OOM error in the middle could produce a broken
result instead of correctly returning error.

Closes #19471
2025-11-18 13:04:19 +01:00
Daniel Stenberg
88024c6d39
tool_getparam: verify that a file exists for some options
Passing the option as-is to libcurl is fine, but checking that the file
exists allows the tool to better provide a helpful message.

This now done for the following options:

  --cacert, --crlfile, --knownhosts, --netrc-file, --proxy-cacert amd
  --proxy-crlfile

Bonus: bail out properly on OOM errors in the --cert parser.

Reported-by: Wesley Moore
Fixes #19583
Closes #19585
2025-11-18 11:37:08 +01:00
Viktor Szakats
54a3f63520
GHA: reduce timeouts for Linux and macOS jobs
Also syncing the run tests timeout in GHA/linux with GHA/maos.

Closes #19582
2025-11-18 11:20:01 +01:00
Daniel Stenberg
1cbe510d8b
TEST-SUITE.md: correct the man page's path
Closes #19586
2025-11-18 11:02:17 +01:00
boingball
a41cea7d67
AmigaOS: increase minimum stack size for tool_main
In testing, the older stack size of 16384 was causing curl to crash on
heavy TLS loads

Closes #19578
2025-11-18 07:54:11 +01:00
Viktor Szakats
3c7cf8eac3
examples: tidy-up headers and includes
To have a more similar layout across examples.

Closes #19580
2025-11-18 02:05:07 +01:00
Viktor Szakats
0a2618b265
examples: make functions/data static where missing
Also to avoid compiler warnings on missing declarations.
Missed by CI for these "complicated" examples.

Closes #19579
2025-11-18 01:05:14 +01:00
Viktor Szakats
5fa2d8320c
build: tidy-up MSVC CRT warning suppression macros
- curl_setup.h: replace `_CRT_SECURE_NO_DEPRECATE` with
  `_CRT_SECURE_NO_WARNINGS`, which seems to be the preferred,
  more recent macro for this. Also syncing with libssh2.
  They are equivalent for curl sources with the supported compilers.
- cmake: stop setting `_CRT_SECURE_NO_DEPRECATE` globally for examples.
- examples: suppress CRT deprecation warnings on a per-file basis.
  To make it work when compiling examples out of curl's build systems.
  Use `_CRT_SECURE_NO_WARNINGS`.
- examples: document the functions requiring `_CRT_SECURE_NO_WARNINGS`.
- examples/block_ip: delete superfluous `_CRT_SECURE_NO_WARNINGS`.
- examples/block_ip: limit `_CRT_NONSTDC_NO_DEPRECATE` to MSVC.
- examples/log_failed_transfers: fix to set `_CRT_SECURE_NO_WARNINGS`
  before headers and limit to MSVC.
- curl_setup.h: document which SDKs support `_CRT_NONSTDC_NO_DEPRECATE`.

Closes #19175
2025-11-18 00:49:26 +01:00
Viktor Szakats
1e1ec7f6c2
badwords: add more contractions, fix fallouts
Also fix hits in autotools scripts (not to enforce).

Closes #19576
2025-11-17 19:29:15 +01:00
Viktor Szakats
ad35ecba97
badwords: fix issues found in scripts and other files
Single pass, not enforced.

Also:
- pyspelling.words: drop `web page`

Closes #19572
2025-11-17 17:18:07 +01:00
Viktor Szakats
42c43f695c
renovate.json: replace CI: prefix with GHA:
All bumped dependencies are in GHA.

Follow-up to 6225d7ba2f #19547
2025-11-17 16:50:20 +01:00
renovate[bot]
39320e1e1b
GHA: update dependencies
- github/codeql-action to 4.31.3
- google/boringssl to v0.20251110.0
- ruff to 0.14.5

Closes #19442
Closes #19455
2025-11-17 16:48:56 +01:00
Daniel Stenberg
b360fc62fb
http: avoid two strdup()s and do minor simplifications
Closes #19571
2025-11-17 16:43:01 +01:00
Viktor Szakats
142fd1cf32
appveyor: add VS2010 x86 Release VS project job and switch VS2013 to x64
To have a test case for VS2010 after bumping to minimum Vista.

Ref: #18009
Closes #19570
2025-11-17 15:50:24 +01:00
Stefan Eissing
ea105708c9
h2/h3: handle methods with spaces
The parsing of the HTTP/1.1 formatted request into the h2/h3 header
structures should detect CURLOPT_CUSTOMREQUEST methods and forward them
correctly.

Add test_01_20 to verify

Fixes #19543
Reported-by: Omdahake on github
Closes #19563
2025-11-17 15:43:28 +01:00
Daniel Stenberg
2459dc7a22
http: the :authority header should never contain user+password
Pointed-out-by: Stanislav Fort
Closes #19568
2025-11-17 15:19:39 +01:00
Viktor Szakats
4075339db2
projects/README.md: Markdown fixes
Closes #19569
2025-11-17 15:09:09 +01:00
x2018
821cba8fac
digest_sspi: fix a memory leak on error path
Closes #19567
2025-11-17 14:46:30 +01:00
x2018
11c0aaa339
openssl: fix a potential memory leak of bio_out
Closes #19561
2025-11-17 14:44:34 +01:00
x2018
22b8a6430d
openssl: fix a potential memory leak of params.cert
Closes #19560
2025-11-17 14:43:34 +01:00
x2018
a6c940a752
schannel_verify: fix a memory leak of cert_context
Closes #19556
2025-11-17 14:42:21 +01:00
x2018
b42f226b94
libssh: properly free sftp_attributes
Closes #19564
2025-11-17 14:40:39 +01:00
Marcel Raad
e9a973c513
build: exclude clang prereleases from compiler warning options
Starting with clang 18, stable clang releases start with minor version 1.
Exclude pre-releases with minor version 0 from the compiler warning
options for that major version.

This fixes the build with Android NDK r29, which uses a prerelease
version of clang 21 that doesn't know the new options yet.

Closes #19566
2025-11-17 13:43:50 +01:00
Viktor Szakats
1b48c6148a
tidy-up: miscellaneous
- schannel: delete superfluous parenthesis.
- tftp: delete stray space from log output.
- ws: update guard comment.
- docs/examples: constify variables.
- runtests/servers: enclose unknown parameter between quotes.
- scripts/perlcheck.sh: drop redundant grep `-E` option.
- THANKS: move names from comments to THANKS.
- sync `--depth` option style across scripts.
- sync git repo URL ending between some scripts.
- BINDINGS.md: drop protocol from archive.org URL path.
- whitespace, indent, unfold lines.

Closes #19565
2025-11-17 13:32:43 +01:00
Viktor Szakats
a87383828e
badwords: fix issues found in tests
There remain some false positives, hits in test data, and `dir` use,
around 100 issues in total.

There is no plan to enforce badwords on tests.

Also:
- badwords.txt: let a few `manpage[s]` occurrences through
  (in Perl code).

Closes #19541
2025-11-17 13:30:35 +01:00
Viktor Szakats
f0de14168a
cf-socket: limit use of TCP_KEEP* to Windows 10.0.16299+ at runtime
Before this patch `TCP_KEEP*` socket options were unconditionally used
if the build-time SDK supported them. This caused curl logging errors
(or trace messages since #19527) on Windows versions missing support
for them. After this patch, use them only when the runtime environment
supports it and fall back to the alternate method (`SIO_KEEPALIVE_VALS`)
dynamically.

Also:
- log a trace message when using the Win10 method.
- document which SDK versions offer `TCP_KEEP*` macros.

Ref: https://learn.microsoft.com/windows/win32/winsock/ipproto-tcp-socket-options
Ref: https://learn.microsoft.com/windows/win32/winsock/sio-keepalive-vals

Reported-by: Aleksandr Sergeev
Fixes #19520
Follow-up to dc34498d18 #19527
Closes #19559
2025-11-17 12:16:51 +01:00
Viktor Szakats
f2460e2cb5
RELEASE-NOTES: update upcoming removals
Also add a missed commit (noticed by accident)

Closes #19558
2025-11-17 12:16:50 +01:00
Stefan Eissing
217f0e4d59
pytest fixes and improvements
- fix test_17_20 flakiness: the test case did not have `nghttpx` in
  its parameters, causing it to no check if a reload was necessary.
  When that test ran behind one that gave nghttpx another certificate,
  eg. in parallel mode, it used the wrong pinned pubkey.
- Have `env` provide lists of HTTP protocol versions available for
  testing. Replace parameterized tests on a fixed protocol list with
  the dynamic one from env. This makes checks for protocol availability
  in the test function bodies superfluous.

refs #19489
Closes #19540
2025-11-17 08:02:52 +01:00
Daniel Stenberg
b3d4f17e3d
curl_sasl: make Curl_sasl_decode_mech compare case insenstively
The provided mechanisms should be compared case insenstively.

Found by ZeroPath

Closes #19535
2025-11-17 08:01:13 +01:00
Daniel Stenberg
f5fa8048f7
RELEASE-NOTES: synced 2025-11-16 23:38:48 +01:00
x2018
205a8e861f
wolfssl: fix a potential memory leak of session
Closes #19555
2025-11-16 23:32:41 +01:00
Viktor Szakats
c07a7f6bf8
runtests: detect bad libssh differently for test 1459 (fixing CircleCI libssh job)
test 1459 "SFTP with corrupted known_hosts" was seen failing in the past.
To fix it, the test was automatically disabled when detecting libssh
0.9.3 or older, as in the curl CircleCI job, running on Ubuntu 20.04.
This work for a long time, until bumping the CircleCI runner to Ubuntu
22.04 (to have OpenSSL 3), where the test was running again, and failing
with the isssue seen in the past.

- Test skipped with Ubuntu 20.04 (libssh 0.9.3):
  https://app.circleci.com/pipelines/github/curl/curl/16445/workflows/7f198763-e0b0-4037-9245-4c4b40ab8726/jobs/155164
- Failure seen with Ubuntu 22.04 (libssh 0.9.6):
  https://app.circleci.com/pipelines/github/curl/curl/16452/workflows/b817a808-0fd4-40b0-8eb0-d064926efe12/jobs/155206?invite=true#step-107-211709_45
- Failure seen with Ubuntu 24.04 (libssh 0.10.6):
  https://app.circleci.com/pipelines/github/curl/curl/16455/workflows/86c631f1-3c5f-4438-b398-3df2bdab5d20/jobs/155218

Turns out the issue issue isn't libssh 0.9.3 itself, but
a CircleCI-specific default configuration in `/etc/ssh/ssh_config`:
```
# BEGIN ANSIBLE MANAGED BLOCK
Host *
StrictHostKeyChecking no     <------ this particular line
HashKnownHosts no
SendEnv LANG LC_*
# END ANSIBLE MANAGED BLOCK
```

libssh will consult configuration files on hard-coded default system
locations and alter its behavior based on settings found in them.

This libssh behavior is present in all supported versions:
5a2abd34ce
https://gitlab.com/libssh/libssh-mirror/-/tags/libssh-0.9.0

It means the existing disable logic based on libssh version worked by
coincidence, and what needs to be checked is these configurations
to decide if it's safe to run the test. Another, simpler option is
to also accept the result code 67, though in that case the test
wouldn't actually test what we want, but would pass anyway.

With the old `oldlibssh` workaround deleted, and the problematic setting
manually overridden (`StrictHostKeyChecking yes`):
- CircleCI Ubuntu 20.04 passes with 1459 enabled:
  https://app.circleci.com/pipelines/github/curl/curl/16483/workflows/87a9f389-76a2-4a32-acde-c0b411a4c842/jobs/155302
- CircleCI Ubuntu 22.04 does too:
  https://app.circleci.com/pipelines/github/curl/curl/16483/workflows/87a9f389-76a2-4a32-acde-c0b411a4c842/jobs/155303

To fix, replace the `runtests` `oldlibssh` detection logic to parse
libssh config files (instead of checking for libssh version) and disable
test 1459 based on that. Notice the detection is making a light attempt
to parse these files, and does not implement most config file features
(such as includes, quoted values and `=` operator.)

The new runtests workaround tests OK with the:
- default CircleCI configuration, disabling 1459 automatically.
- a sudoless configuration fix, with 1459 run successfully.
  Also keep setting this option in CircleCI jobs.
- a sudo configuration fix, with 1459 run successfully.
Ref: https://app.circleci.com/pipelines/github/curl/curl/16492/workflows/56f39335-97ba-412c-9a9b-3d662694375a

GHA jobs are not affected and they work fine, with 1459 running successfully
before and after this patch.

It's possible the libssh API offers ways to control config file use
and/or set the strict host checking option programatically. Maybe
to enable in debug mode (albeit CircleCI job are not debug-enabled),
or offer an option for them. It may be something for a future patch.

Follow-up to 23540923e1 #8622
Follow-up to 4b01a57c95 #8548
Follow-up to bdc664a640 #8490
Follow-up to 7c140f6b2d #8444

Ref: 6d9c5c91b9 #19549

Closes #19557
2025-11-16 23:28:44 +01:00
Viktor Szakats
ea2203c1aa
GHA/codeql: limit cron job to the origin repository
To avoid running it in every fork, every week.

Closes #19552
2025-11-16 19:51:20 +01:00
Viktor Szakats
6d9c5c91b9
CI: avoid restart prompt on libssh-dev install in CircleCI
By setting `DEBIAN_FRONTEND=noninteractive`.

Also:
- add `curl -V` step to CircleCI jobs.
- drop duplicate `libpsl` from `apt install`.
- replace sudo pip with venv, fixing a warning and syncing with GHA.
- Note that test 1459 was disabled on Ubuntu 20.04 due to past issues.
  When running on newer CircleCI Ubuntu runners (22.04 or 24.04), the
  test is not disabled, and also fails with the issue seen in the past.
  I've identified the root cause and will fix it in a separate PR.

Ref: https://circleci.com/developer/images?imageType=machine
Ref: https://discuss.circleci.com/t/ubuntu-20-04-22-04-24-04-q3-current-release/51856/7
Ref: https://app.circleci.com/pipelines/github/curl/curl/16450/workflows/af1f2a99-6452-4cc3-96c1-18a217ebabfc/jobs/155194

Follow-up to 8ba10a790a #19546

Closes #19549
2025-11-16 19:51:04 +01:00
Daniel Stenberg
eeff93013c
rustls: minor adjustment of sizeof()
The mistake is harmless because it is still a size of a pointer, but
this is the correct pointer.

Acked-by: Daniel McCarney
Reported-by: pelioro on hackerone
Bug: https://hackerone.com/reports/3427460
Closes #19545
2025-11-16 17:54:49 +01:00
Viktor Szakats
517a12922e
GHA/linux: add missing condition for nghttp2-filc cache step
Follow-up to 67ef4a34f2 #19457

Closes #19548
2025-11-16 00:52:41 +01:00
Viktor Szakats
4c76cdc157
runtests: drop Python 2 support remains
Used in the test SMB and telnet servers.

Closes #19544
2025-11-16 00:52:41 +01:00
Viktor Szakats
6225d7ba2f
CI: drop no longer used install-wolfssl step in Circle CI
Follow-up to b011e3fcfb #18700

Closes #19547
2025-11-16 00:27:49 +01:00
Viktor Szakats
8ba10a790a
CI: bump Circle CI jobs to Ubuntu 22.04 runners for OpenSSL 3
Ref: https://packages.ubuntu.com/jammy/libssl-dev

Follow-up to 69c89bf3d3 #18330

Closes #19546
2025-11-16 00:27:49 +01:00
Viktor Szakats
dbe06f38ae
DEPRECATE.md: move OpenSSL to past removals (fixup)
Follow-up to bb213bd769 #19542
2025-11-15 22:33:13 +01:00
Viktor Szakats
bb213bd769
DEPRECATE.md: move OpenSSL to past removals
Follow-up to 69c89bf3d3 #18330

Closes #19542
2025-11-15 22:30:15 +01:00
Viktor Szakats
69c89bf3d3
openssl: bump minimum OpenSSL version to 3.0.0
It also means that all supported OpenSSL versions and forks support
TLSv1.3 after this patch.

It reduces `openssl.c` size by more than 10%, or 400 LOC.

Ref: #18822
Closes #18330
2025-11-15 15:56:31 +01:00
Viktor Szakats
2e1a045d89
build: drop support for VS2008 (Windows)
Require Visual Studio 2010 or newer.

Ref: https://github.com/curl/curl/discussions/15972

Follow-up to dc28bb86c1 #17798
Follow-up to 63e513b106 #17380

Closes #17931
2025-11-15 15:56:19 +01:00
Viktor Szakats
554dfa5568
build: drop Windows CE / CeGCC support
Windows CE support was limited to successful builds with ming32ce
(a toolchain that hasn't seen an update since 2009, using an ancient gcc
version and "old mingw"-style SDK headers, that curl deprecated earlier).
Builds with MSVC were broken for a long time. mingw32ce builds were never
actually tested and runtime and unlikely to work due to missing stubs.
Windows CE toolchains also miss to comply with C89. Paired with lack of
demand and support for the platform, curl deprecated it earlier.

This patch removes support from the codebase to ease maintaining Windows
codepaths.

Follow-up to f98c0ba834 #17924
Follow-up to 8491e6574c #17379
Follow-up to 2a292c3984 #15975

Closes #17927
2025-11-15 15:35:23 +01:00
Viktor Szakats
2dc71ba8bf
badwords: check indented lines in source code, fix fallouts
- badwords.pl: add `-a` option to check all lines in source code files.
  Before this patch indented lines were skipped (to avoid Markdown code
  fences.)
- GHA/checksrc: use `-a` when verifying the source code.
- GHA/checksrc: disable `So` and `But` rules for source code.
- GHA/checksrc: add docs/examples to the verified sources.
- badwords.txt: delete 4 duplicates.
- badwords.txt: group and sort contractions.
- badwords.txt: allow ` url = `, `DIR`, `<file name`.

Closes #19536
2025-11-15 13:25:02 +01:00
Viktor Szakats
8a968095df
mk-ca-bundle.pl: default to SHA256 fingerprints with -t option
Replacing previous default: MD5.

You can use the existing `-s` option to override the default.

Also bump version to 1.30.

Closes #19359
2025-11-15 03:06:33 +01:00
Viktor Szakats
7bb59a7dc7
badwords.pl: fix variable in printf mask
Causing warnings if a matched line has mask patterns.

Closes #19534
2025-11-14 18:14:31 +01:00
Viktor Szakats
231e8a71e1
docs: fix checksrc warning, fix checkdocs CI filter
Also:
- GHA/checkdocs: fix CI filters to catch it early.
  Follow-up to 28dd14aafe #15797

Closes #19533
2025-11-14 17:32:04 +01:00
Viktor Szakats
af4c789e00
badwords: fix two exceptions and drop them
Also:
- extend `dir` rule to exclude C assignments.

Closes #19532
2025-11-14 17:32:04 +01:00
Viktor Szakats
f3095f0dbd
GHA/checksrc: check XML files for errors
Closes #19528
2025-11-14 17:32:04 +01:00
nait-furry
57b4fe1817
limit-rate: add example using --limit-rate and --max-time together
Closes #19473
2025-11-14 17:09:07 +01:00
Stefan Eissing
f37c956d0f
test07_22: fix flakiness
The HTTP/3 tests did send 20 transfers against nghttpx with a backend
that failed the uploads with a 400 and an incomplete response body. This
causes stream resets.

Apache keeps the connection open, but newer nghttpx closes the front
connection after "too many" reset. When that bites, it depends on the
number of transfers ongoing how the test case fails. This led to flaky
outcomes.

Reduce the transfers to just a single one and check the result of
that one. Parallelism is not important here.

refs #19489
Closes #19530
2025-11-14 17:06:23 +01:00
Daniel Stenberg
3d91ca8cdb
vquic-tls/gnutls: call Curl_gtls_verifyserver unconditionally
Closes #19531
2025-11-14 17:05:11 +01:00
Stefan Eissing
dc34498d18
cf-socket: trace ignored errors
Instead of blasting the user with infof() statements.

Reported-by: Aleksandr Sergeev
Fixes #19520
Closes #19527
2025-11-14 17:04:15 +01:00
Stefan Eissing
9f979ea683
vtls: pinned key check
Cleanup the vtls pinned key matching somewhat. Add a DEBUGF
for pinned key hashes that do not match, so we can see in
traces what was going on.

Ref #19489
Closes #19529
2025-11-14 17:01:44 +01:00
Stefan Eissing
0abb72210e
getinfo: improve perf in debug mode
Save some cpu cycles in debug mode for getinfo. Look up env vars for
overwriting variables only when variables are actually requested.

Closes #19525
2025-11-14 16:47:47 +01:00
Daniel Stenberg
9a633ec04f
connect: reshuffle Curl_timeleft_ms to avoid 'redundant condition'
Line 143: "if(duringconnect)" would always equal true. While this is
harmless, I believe this minor tweak makes the flow slightly more
obvious to the reader and avoids the redundant condition.

Pointed out by CodeSonar

Closes #19523
2025-11-14 15:12:58 +01:00
Stefan Eissing
971e8d661c
examples/multithread: fix race condition
Reported-by: Nick Korepanov
Fixes #19524
Closes #19526
2025-11-14 15:11:53 +01:00
Daniel Stenberg
5f4cd4c689
DEPRECATE: remove RTMP support in April 2026
URL: https://curl.se/mail/lib-2025-11/0008.html
2025-11-14 09:42:03 +01:00
Daniel Stenberg
3fc31c4ee2
config2setopts: bail out if curl_url_get() returns OOM
Closes #19518
2025-11-14 09:39:42 +01:00
Viktor Szakats
ae7b4eeade
curl_setup.h: drop stray #undef stat (Windows)
Follow-up to 9678ff5b1b #18776

Closes #19519
2025-11-14 01:47:12 +01:00
Viktor Szakats
96500f466e
tidy-up: result code variable names in tests and examples
Sync outliers with the rest of the code.

Also:
- return error in some failed init cases, instead of `CURLE_OK`:
  1908, 1910, 1913, 2082, 3010
- lib1541: delete unused struct member.

Closes #19515
2025-11-14 01:47:12 +01:00
Daniel Stenberg
e3e0559ed2
config2setopts: exit if curl_url_set() fails on OOM
An error case that previously did not properly return error.

Closes #19517
2025-11-13 22:57:08 +01:00
Daniel Stenberg
42098d1ee6
checksrc: verify close brace indent level
Closes #19512
2025-11-13 17:27:48 +01:00
Daniel Stenberg
0afb52a0cd
code: minor indent fixes before closing braces
Closes #19512
2025-11-13 17:27:40 +01:00
Daniel Stenberg
75955c0851
tool_operate: exit on curl_share_setopt errors
Continuing when one of these has failed is fragile and error-prone.

Closes #19513
2025-11-13 17:24:40 +01:00
Daniel Stenberg
f2a75a14dd
sws: repair --port, and accept any port
Also for mqttd and sockfilt. The < 1025 check was not serving any
purpose.

Follow-up to bb1391f943
2025-11-13 17:20:41 +01:00
Viktor Szakats
6384e2aca0
checksrc: disallow atoi and atol globally
No longer used in core and test code.

Also: allowlist in docs/examples.

Closes #19508
2025-11-13 14:28:25 +01:00
Viktor Szakats
bb1391f943
tests/server: replace atoi() and atol() with curlx_str_number()
Closes #19510
2025-11-13 14:09:03 +01:00
Daniel Stenberg
833c429627
wolfssl: simplify wssl_send_earlydata
Move out logic from a switch() expression and return error directly
instead of using goto. This also removes the odd-looking two subsequent
closing braces at the same indent level.

Closes #19509
2025-11-13 13:46:28 +01:00
Stefan Eissing
cb2bcb681f
lib: eliminate size_t casts
Add new functions in `curlx/warnless.h` for controlled type
conversions:

* curlx_uitouz, convert unsigned into to size_t (should always work)
* curlx_uztoso, convert size_t to curl_off_t, capping at CURL_OFF_T_MAX
* curlx_sztouz, convert ssize_t to size_t, return TRUE when ok
* curlx_sotouz_range, convert curl_off_t to size_t interval, capping
  values to interval bounds

Remove some unnecesary casts, convert some internal recv functions
to the "return result, have size_t* arg" pattern.

Closes #19495
2025-11-13 13:32:19 +01:00
Stefan Eissing
78a610cb83
lib: rename curlx_timediff to curlx_timeleft_ms
Rename `Curl_timeleft()` to `Curl_timeleft_ms()` to make the units in
the returned `timediff_t` clear. (We used to always have ms there, but
with QUIC started to sometimes calc ns as well).

Rename some assigned vars without `_ms` suffix for clarity as well.

Closes #19486
2025-11-13 13:12:58 +01:00
Viktor Szakats
ca27404d27
tests/data: add %includetext, dedupe XML payloads into external file
To reduce duplication and to avoid keeping XML-like markup within XML
markup (`test*`), that was tripping `xmllint`.

Ref: #19470

Closes #19504
2025-11-13 12:24:50 +01:00
Viktor Szakats
85cfc15601
RELEASE-NOTES: codespell 2025-11-13 11:46:13 +01:00
Viktor Szakats
e18ad59e46
runtests: add missing Perl semicolon
Follow-up to f477f3efc3 #19398

Closes #19507
2025-11-13 11:41:12 +01:00
Viktor Szakats
4415e865ad
libtests: replace atoi() with curlx_str_number()
Also:
- lib1568: fail in global initialization error.

Closes #19506
2025-11-13 11:41:12 +01:00
Viktor Szakats
e496bcfd0a
FILEFORMAT.md: drop some text from the command section
Special meanings of URLs became outdated, and it's also no longer
necessary to pass the test number via the URL or domain anymore.
Delete the text.

Follow-up to c6f1b0ff49 #19429

Closes #19503
2025-11-13 11:41:11 +01:00
Daniel Stenberg
3f0629ca44
cookie: propagate errors better, cleanup the internal API
Overhaul of the internal cookie APIs and an attempt to better return
errors for OOM and similar critical problems, separate from ordinary and
benign parsing problems.

Closes #19493
2025-11-13 10:07:24 +01:00
Daniel Stenberg
296ffc45c3
schannel: replace atoi() with curlx_str_number()
The last atoi() call removed from libcurl

Closes #19483
2025-11-13 09:06:02 +01:00
Daniel Stenberg
f1fec22776
RELEASE-NOTES: synced
curlver: 8.18.0 is the next planned release version
2025-11-13 08:49:49 +01:00
Viktor Szakats
3d42510118
runtests: allow client/command to span multiple lines, and use it
Some curl command-lines are long, often repetitive, and difficult
to read or write:

Before this patch (1 test == 1 line):
- <=78 characters: 1099 tests
- 79-132 characters: 500 tests
- 133+ characters: 217 tests: patch meant to help with some of these.

After this patch:
- <=78 characters: 1288 lines
- 79-132 characters: 526 lines
- 133+ characters: 190 lines

After this patch it's possible to fold long lines into multiple ones.
Folding can reduce greppability, thus this is primarily useful for cases
when the options are repetitive, e.g. a list of form options, headers,
mail parameters and the like.

Closes #19500
2025-11-13 01:05:01 +01:00
Patrick Monnerat
64c03bbdf2 OS400: fix build
- Fix failed build due to missing parameter.

Follow-up to 8c9946d3 from yesterday.

Closes https://github.com/curl/curl/pull/19494
2025-11-12 17:46:37 -05:00
Daniel Stenberg
c6eb9bb3dc
_PROGRESS.md: add the E unit, mention kibibyte
The suffixes used are not standard since we want them to be single
characters and the proper ones would be KiB, MiB etc.

Closes #19502
2025-11-12 23:44:25 +01:00
Viktor Szakats
4b2da75bca
test716: use repeat macro
Closes #19501
2025-11-12 21:40:21 +01:00
Viktor Szakats
6b26d465e1
tests/data: use more repeat macro
Found in `client/command` sections.

Closes #19499
2025-11-12 20:07:19 +01:00
Viktor Szakats
8a19bf862a
test2045: replace HTML multi-line comment markup with # comments
As used everywhere else in tests/data. To play nice with XML.

Follow-up to 9756d1da76

Closes #19498
2025-11-12 20:07:18 +01:00
Viktor Szakats
d7b0b654ea
test1404, 1547: replace & char in comment and name for XML-friendliness
Closes #19497
2025-11-12 17:10:22 +01:00
Viktor Szakats
d077d5473d
test1554: make test output XML-friendly
Meaning no `<` and `>` characters.
Reducing the number of `xmllint` failures by 1.

Closes #19496
2025-11-12 16:26:57 +01:00
Viktor Szakats
ce329affa7
test557: avoid & symbol in test output to be XML-friendly
Closes #19492
2025-11-12 16:26:57 +01:00
Viktor Szakats
1e5cb75218
test363: delete stray character (typo) from a section tag
Did not cause an issue in runtests. Caught by `xmllint`.

Follow-up to 63e9721b63 #19313

Closes #19490
2025-11-12 16:26:57 +01:00
Viktor Szakats
a9ec2a676c
tests/data: avoid tag markup in comments
To avoid confusing `xmllint`, and reducing the number of files failing
`xmllint --format` from 169 to 144.

Closes #19491
2025-11-12 16:26:57 +01:00
Viktor Szakats
2c7e1792a0
test2405: split off H2 tests to new test 2407, fix callback prototype
To untangle the different curl/server requirements of these tests.
Also to make this test run for non-H2 builds. Searching the cause of
the flakiness documented in #19481.

Also:
- fix the callback function prototype. Detected by ASAN with this patch,
  though the issue was pre-existing.
  ```
  lib/cw-out.c:211:14: runtime error: call to function emptyWriteFunc
    through pointer to incorrect function type
    'unsigned long (*)(char *, unsigned long, unsigned long, void *)'
  tests/libtest/lib2405.c:72: note: emptyWriteFunc defined here
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior lib/cw-out.c:211:14
  ```
  Ref: https://github.com/curl/curl/actions/runs/19296686908/job/55180334364?pr=19487#step:44:3768

Follow-up to 96a5ce5a82 #19481

Closes #19487
2025-11-12 13:56:02 +01:00
Viktor Szakats
ebead15f4e
lib1509: make callbacks static
Closes #19488
2025-11-12 13:49:30 +01:00
Viktor Szakats
96a5ce5a82
test2405: report fd_count* variables on failure
This test is frequently failing in macOS !ssl jobs:

"curl_multi_waitfds() should return at least the number of fds needed":
https://github.com/curl/curl/actions/runs/19290229745/job/55159015942 AM clang !ssl !debug brotli zstd
https://github.com/curl/curl/actions/runs/19289578332/job/55157058146 AM clang !ssl !debug brotli zstd
https://github.com/curl/curl/actions/runs/19188515879/job/54859474947 AM clang !ssl
https://github.com/curl/curl/actions/runs/19165077858/job/54783776869 AM clang !ssl libssh2 AppleIDN
https://github.com/curl/curl/actions/runs/19046554157/job/54396096298 AM gcc-12 !ssl !debug

"curl_multi_waitfds() should return the amount of fds needed if enough isn't passed in":
https://github.com/curl/curl/actions/runs/19184546172/job/54848549080 AM gcc-13 !ssl !debug

Also high on the test clutch list:
2405 FAIL times: 165
Ref: https://testclutch.curl.se/static/reports/results-count.html

```
libtests returned 44, when expecting 0

FAIL 2405: 'checking curl_multi_waitfds functionality' multi, HTTP, HTTP/2
```
44 = `CURLE_OBSOLETE44` = `TEST_ERR_FAILURE`

Also: fix a newline in log output.

Follow-up to c78044c07e #15146 #15155

Closes #19481
2025-11-12 12:51:29 +01:00
Daniel Stenberg
a862920246
hostip: don't store negative lookup on OOM
When convert_ipaddr_direct() returns error due to OOM, it must not be
stored as a negative cache result.

Closes #19484
2025-11-12 12:19:12 +01:00
Viktor Szakats
9c87b3ef80
OS400/makefile.sh: fix shellcheck warning SC2038 differently
Reported-by: Patrick Monnerat
Bug: https://github.com/curl/curl/pull/19451#discussion_r2517335957
Follow-up to af5a1647af #19451

Closes #19482
2025-11-12 11:21:25 +01:00
Daniel Stenberg
b2e0b4d008
libssh2: replace atoi() in ssh_force_knownhost_key_type
Closes #19479
2025-11-12 11:18:26 +01:00
Daniel Stenberg
7428060b0e
libssh2: cleanup ssh_force_knownhost_key_type
- Use arrays instead pointers
- Narrow variable scopes

Closes #19479
2025-11-12 11:18:18 +01:00
Daniel Stenberg
7aaf9a3152
http: replace atoi use in Curl_http_follow with curlx_str_number
In an attempt to weed out atoi() use all over.

Closes #19478
2025-11-12 10:44:49 +01:00
Daniel Stenberg
3b4bf3fcfa
telnet: replace atoi for BINARY handling with curlx_str_number
Also, only consider 0 to be a valid switch-off. Previously any value
except 1 had the same effect.

Closes #19477
2025-11-12 10:41:52 +01:00
Daniel Stenberg
97b0abb46b
noproxy: replace atoi with curlx_str_number
To better reject junk and detect overflows. There were already
additional precautions and protections in place, but this is cleaner.

Extended the 1614 unit tests with some more bad syntax cases.

Closes #19475
2025-11-12 10:30:59 +01:00
Daniel Stenberg
207721165e
src/checksrc: ban atoi use 2025-11-12 10:27:54 +01:00
Daniel Stenberg
4bb6a5d50f
tool_operate: use curlx_str_number intead of atoi
For consistency. This instance is for debug-only code and is not
important.

Closes #19480
2025-11-12 10:27:48 +01:00
Viktor Szakats
4841e4290d
badwords: re-sync with curl-www, fix issues found
Also:
- replace `manpage` with `man page`, add to `badwords.txt`.
- badwords.pl: import `-w` feature from curl-www, syncing the two
  scripts fully.
- badwords.txt: import missing items from curl-www, syncing the two
  files fully.
- pyspelling.words: drop `cURL` allowed word.

Closes #19468
2025-11-12 00:53:44 +01:00
Viktor Szakats
ebc5fea64d
autotools: drop autoconf <2.59 compatibility code (zz60-xc-ovr)
The minimum required autoconf is 2.59, since curl 7.76.0 (2021).

Follow-up to a59f046116 #6748

Closes #19464
2025-11-12 00:53:44 +01:00
Viktor Szakats
d499aa5238
mk-ca-bundle.pl: use open() with argument list to replace backticks
On Windows this requires Perl 5.22 from year 2015.

Also:
- mdlinkcheck: delete redundant error handling logic.
  Follow-up to 77be4a7ab2 #19437

Closes #19461
2025-11-12 00:53:43 +01:00
Dan Fandrich
f544eb97da docs: Line endings are no longer significant in test files
Since commit f477f3efc, CR/LF characters in test files are no longer
significant, making the files a little more XML-like.

Closes #19469
2025-11-11 10:07:41 -08:00
Daniel Stenberg
f1f5cc781c
cf-socket: split out the MTU and GRO setopts into sep functions
It simplifies the #ifdefs and declaring of local variables slightly.

Closes #19467
2025-11-11 17:57:40 +01:00
Daniel Stenberg
8c9946d35f
ccsidcurl: make curl_mime_data_ccsid() use the converted size
dynconvert() now offers to return the size of the converted data as it
might be different that the provided input size.

Bonus: minor indent fixing of some closing braces.

Reported-by: Stanislav Fort (Aisle Research)
Closes #19465
2025-11-11 17:36:13 +01:00
Daniel Stenberg
3d9f7b436c
noproxy: simplify Curl_check_noproxy
By creating two separate matching functions for name and IP.

Closes #19466
2025-11-11 16:43:41 +01:00
Daniel Stenberg
6ca1d05797
ftp: remove #ifdef for define that is always defined
The CURL_FTP_HTTPSTYLE_HEAD logic was added back in 2007 with the
intention to remove that logic one day, but since we never bump the
SONAME it is not likely to happen anytime soon. Remove again for
readability.

Follow-up to 3217809294

Closes #19463
2025-11-11 16:27:19 +01:00
Daniel Stenberg
5bd670c393
wolfssl: avoid NULL dereference in OOM situation
Verify that wolfSSL_BIO_meth_new() actually works and handle situations
where it returns NULL.

Reported-by: Stanislav Fort (Aisle Research)
Closes #19459
2025-11-11 16:23:27 +01:00
Daniel Stenberg
28380bb9fd
progress: show fewer digits
Without unit, show up to 99999 "raw" (5 digits). After that, prefer to
show the number as less than 1000 per unit and use single decimal
fraction. Like '123.4M' (spending 6 characters).

This now makes the largest possible size to show 8.0E (exabytes).

Probably makes the output easier to read.

Fixes #19431
Reported-by: Fd929c2CE5fA on github
Closes #19433
2025-11-11 16:22:34 +01:00
x2018
0dacc07969
cf-https-connect: allocate ctx at first in cf_hc_create()
Closes #19454
2025-11-11 16:18:55 +01:00
x2018
10b2dd8e6b
krb5_sspi: unify a part of error handling
Closes #19452
2025-11-11 16:17:53 +01:00
x2018
3f1a8dbb98
rustls: fix a potential memory issue
Closes #19425
2025-11-11 16:16:23 +01:00
Daniel Stenberg
c545e10fa7
sftp: fix range downloads in both SSH backends
When asking for the last N bytes of a file, and that size was larger
than the file size, it would miss the first byte due to a logic error.

The fixed range parser is now made a common function in the file now
renamed to vssh.c (from curl_path.c) - used by both backends.

Unit test 2605 verifies the parser.

Reported-by: Stanislav Fort (Aisle Research)
Closes #19460
2025-11-11 14:51:22 +01:00
Viktor Szakats
67ef4a34f2
GHA/linux: build and enable nghttp2 for Fil-C job
pytests after: 527 passed, 286 skipped
pytests before: 392 passed, 423 skipped

runtests after: TESTDONE: 1646 tests out of 1646 reported OK: 100%
runtests before: TESTDONE: 1643 tests out of 1643 reported OK: 100%

Ref: b81d30ade3 #19458

Closes #19457
2025-11-11 00:15:47 +01:00
Viktor Szakats
b81d30ade3
pytest: fix conditions for test_02_28
- allow 02_28 to run in HTTP/1.1 without H2 support again.
  Follow-up to 3752de465d #19412

- fix to skip 02_28 for all protocols for curl without compression
  support (either zlib, brotli or ztsd).

Closes #19458
2025-11-10 23:30:20 +01:00
Viktor Szakats
cdb7ac11b4
GHA/linux: disable test 776 in valgrind jobs to avoid delay
Saving ~30 seconds in jobs affected.

Closes #19456
2025-11-10 23:14:01 +01:00
Viktor Szakats
af5a1647af
OS400/makefile.sh: fix shellcheck warning SC2038
Also:
- OS400/makefile.sh: use end-of-options marker in xargs command.
- OS400/make-tests.sh: drop warning suppression.
  Seems to not trigger anymore as of shellcheck 0.11.0

Closes #19451
2025-11-10 18:52:29 +01:00
Viktor Szakats
6aab1dc263
scripts: use end-of-options marker in find -exec commands
Closes #19450
2025-11-10 18:52:29 +01:00
Viktor Szakats
a8e46c5ab1
verify-release: update to avoid shellcheck warning SC2034
```
SC2034: dl appears unused
```

Also to shorten the code.

Closes #19449
2025-11-10 16:06:48 +01:00
Viktor Szakats
77be4a7ab2
mdlinkcheck: pass curl arguments to open() as list
To prevent misinterpreting quotes or other special characters.

Requires Perl 5.22+ (2015-Jun-01) on Windows.

Ref: https://perldoc.perl.org/functions/open

Closes #19437
2025-11-10 14:21:35 +01:00
Viktor Szakats
b39c158e4a
scripts: fix shellcheck SC2046 warnings
Fix SC2046: "Quote this to prevent word splitting."
Ref: https://www.shellcheck.net/wiki/SC2046

Also:
- shellcheck.sh: add `set -eu`.
- shellcheck.sh, yamlcheck.sh: always run from repo root.
- pass `--` before passing the list of files, where missing.
- badwords.pl, cleancmd.pl: rework to accept `git ls-files` arguments.
  Requires Perl 5.22+ (2015-Jun-01) on Windows.
  Ref: https://perldoc.perl.org/functions/open
- INTERNALS.md: require Perl 5.22 on Windows.
- spacecheck.pl: formatting.
- GHA/http3-linux: rework command to avoid SC2046.
- stop suppressing SC2046 warnings.

The yamlcheck.sh issue reported-by: Stanislav Fort (Aisle Research)
Ref: 20251109163515_6eb31da3-deb2-4f4d-8327-935904f27da5

Closes #19432
2025-11-10 14:21:35 +01:00
Viktor Szakats
f477f3efc3
tests/data: support using native newlines on disk, drop .gitattributes
Data files no longer depend on mixed newline styles. Before this
patch the harness still assumed data files to use LF newlines,
ensured by `.gitattribute` and distributing sources with LF newlines.

To allow using platform native newlines (CRLF on Windows typically),
update the test harness to support data files with any newline style
on disk. And delete `.gitattributes`.

Fix to:
- load original data files (from test/data) so that their newline-style
  doesn't matter on the checked out source repo, meaning it works
  when its CRLF on Windows, just like any other file.
  (if a BOM slips in, it's caught by `spacecheck.pl` as binary content.)
- do the same in `util.py` used by `smbserver.py` (for test 1451).
- also fix `util.py` to use us-ascii encoding for data files, replacing utf-8.

Also:
- runtests: rework the stray CR checker to allow full CRLF data files,
  and keep warning for mixed newlines.

Follow-up to 904e7ecb66 #19347

Closes #19398
2025-11-10 14:21:34 +01:00
Daniel Stenberg
8e321a53df
examples/crawler: fix variable
A variable missed in the previous rename cleanup

Follow-up to 928363f28c
Reported-by: Gisle Vanem
Closes #19446
2025-11-10 13:40:13 +01:00
Daniel Stenberg
7e87255020
socks_sspi: use free() not FreeContextBuffer()
The memory is allocated with malloc().

This reverts commit 1d01d4975f.

Reported-by: Stanislav Fort (Aisle Research)
Closes #19445
2025-11-10 13:39:22 +01:00
Daniel Stenberg
37050a1462
OS400/ccsidcurl: fix curl_easy_setopt_ccsid for non-converted blobs
When a blob option is used and it does not convert, the code would
erroneously pass along an uninitialized stack struct.

Reported-by: Stanislav Fort (Aisle Research)
Closes #19444
2025-11-10 13:38:36 +01:00
Daniel Stenberg
2f29a8f19e
RELEASE-NOTES: spellcheck 2025-11-10 10:41:38 +01:00
Daniel Stenberg
2f768b8c62
RELEASE-NOTES: synced 2025-11-10 10:09:03 +01:00
Daniel Stenberg
4efe88ee7e
renovate.json: drop parentheses from group names
They make git branch names using those parentheses, that need to be
quoted when used with git command lines. Avoid parentheses for easier to
use branch names.

Follow-up to f77c574445

Closes #19441
2025-11-10 09:48:05 +01:00
renovate[bot]
24774bbb5e
GHA: update awslabs/aws-lc to v1.63.0
Closes #19435
2025-11-10 09:21:25 +01:00
x2018
323b33d51f
digest_sspi: properly free sspi identity
Closes #19426
2025-11-10 09:20:26 +01:00
Daniel Stenberg
660f244640
urlapi: fix mem-leaks in curl_url_get error paths
Reported-by: Stanislav Fort (Aisle Research)
Closes #19440
2025-11-10 09:16:20 +01:00
x2018
baafa5ff76
schannel: fix potental memory leak of cert_store_path on four error paths
Closes #19423
2025-11-10 09:14:56 +01:00
x2018
87149c8383
mqtt: properly handle the message which exceeds maxsize
We should goto fail as topic is allocated.

Follow-up to 92fd791

Closes #19417
2025-11-10 09:07:27 +01:00
Stanislav Fort
b0aba1005b
cshutdn: acknowledge FD_SETSIZE for shutdown descriptors
In the logic called for curl_multi_fdset().

File descriptors larger than FD_SETSIZE size are simply ignored, which
of course will make things break but at least it does not trash memory.

Reported-by: Stanislav Fort (Aisle Research)
Closes #19439
2025-11-10 08:54:43 +01:00
Daniel Stenberg
00872d5c98
rtmp: fix double-free on URL parse errors
Reported-by: Stanislav Fort (Aisle Research)
Closes #19438
2025-11-10 08:53:30 +01:00
Samuel Henrique
79d3e1d7d4
wcurl: import v2025.11.09
Closes #19430
2025-11-10 08:52:55 +01:00
Daniel Stenberg
c791223743
setopt: disable CURLOPT_HAPROXY_CLIENT_IP on NULL
As documented.

Reported-by: Stanislav Fort (Aisle Research)
Closes #19434
2025-11-10 07:49:00 +01:00
Viktor Szakats
2701ac6a4d
processhelp.pm: log taskkill pid info, add debug envs, enable in CI
To debug the Windows CI fails further. Acting on the suspicions that
`taskkill` may sometimes be applied to the wrong process.

- log task info, and task child info before calling `taskkill` on a PID.
  (on native Windows.)
  One of the calls needs PowerShell.

- add env `CURL_TEST_NO_TASKKILL` to disable using `taskkill`.

- add env `CURL_TEST_NO_TASKKILL_TREE` to use `taskkill` without
  `-t`, meaning to kill the process, but not child processes.

- GHA/windows: disable `taskkill` calls, to see what happens.
  I'll revert or tweak this in a future commit depending on results.

Ref: https://github.com/curl/curl/discussions/14854#discussioncomment-13062859
Ref: https://github.com/curl/curl/discussions/14854#discussioncomment-14913014

Closes #19421
2025-11-10 02:00:17 +01:00
Viktor Szakats
c6f1b0ff49
tests/server: do not fall back to original data file in test2fopen()
Before this patch servers were loading the original data source file
(from `tests/data/test*`) if they failed to open the preprocessed data
file.

It was causing issues in many (most?) tests, because original data files
are not preprocessed, thus may be incomplete and/or come with wrong
newline characters. It's also causing difficult to diagnose issues when
a test accidentally references another test's data, which by chance
makes the test pass initially, until either that or the executed test
data gets an update, and breaking it, as seen in #19329.

Historically, the fallback existed first, then the preprocessed copy.
The fallback is no longer used by tests (except by stray accidents).

Fix it by dropping the fallback logic and relying on the preprocessed
data file saved there by the runtests framework.

Also fix two remaining test data cross-references:
- test1565: reference own server input data instead of test1's.
- test3014: reference own server input data instead of test1439's.
  Ref: #19398

Follow-up to aaf9522a2c #19329

Closes #19429
2025-11-09 21:14:41 +01:00
Viktor Szakats
28ff2b260e
tests/data: replace hard-coded test numbers with %TESTNUMBER
Closes #19427
2025-11-09 19:27:19 +01:00
Viktor Szakats
67236f7edd
tests/data: delete stray space indentation from xml tags
Closes #19428
2025-11-09 19:27:19 +01:00
Viktor Szakats
49ef2f8d1e
cmake: adjust defaults for target platforms not supporting shared libs
If CMake reports the target platform not supporting shared libs, turn
`BUILD_SHARED_LIBS` off by default. CMake 3.30+ fails with an error
when trying to create a `SHARED` target for such platforms. Earlier
versions used a workaround that may or may not have worked in practice.

Ref: https://cmake.org/cmake/help/v3.30/policy/CMP0164.html

Seen this with a build setting `-DCMAKE_SYSTEM_NAME=Generic`, e.g.
AmigaOS.

Note this may introduce incompatibility for "Generic" targets, which
support shared libs. If that's the case, set `BUILD_SHARED_LIBS=ON`
manually.

Also drop AmigaOS-specific logic handled automatically after this patch.

Ref: https://cmake.org/cmake/help/v3.7/command/get_property.html
Ref: https://cmake.org/cmake/help/v3.7/prop_gbl/TARGET_SUPPORTS_SHARED_LIBS.html

Closes #19420
2025-11-09 17:56:20 +01:00
Viktor Szakats
f760a5cef7
tests/data: replace %CR with crlf=headers where possible
Missed them in previous rounds of updates:
test 433, 1375, 1376, 1377, 1429

Closes #19424
2025-11-09 16:39:34 +01:00
Viktor Szakats
d35c880a75
INSTALL-CMAKE.md: document static option defaults more
Closes #19419
2025-11-09 13:16:02 +01:00
Daniel Stenberg
7aa50124c2
TODO: improve code for large MQTT payloads
Closes #19416
2025-11-09 11:53:39 +01:00
Daniel Stenberg
92fd791f31
mqtt: reject overly big messages
Reported-by: Jiyong Yang
Closes #19415
2025-11-09 11:40:28 +01:00
x2018
a002c50510
ftp: refactor a piece of code by merging the repeated part
Closes #19411
2025-11-09 11:39:56 +01:00
x2018
1bddfe02d5
asyn-thrdd: release rrname if ares_init_options fails
Closes #19410
2025-11-09 11:35:04 +01:00
x2018
59584399a5
tftp: release filename if conn_get_remote_addr fails
Closes #19409
2025-11-09 11:32:57 +01:00
x2018
239c389836
openssl: release ssl_session if sess_reuse_cb fails
Closes #19405
2025-11-09 11:31:20 +01:00
Viktor Szakats
019874f197
GHA/linux: stop disabling TLS-SRP tests in event-based & duphandle jobs
They were disabled since these jobs ran in Zuul. The tests are 320, 321,
322, 323, 324. Of which, 323 runs in CI, the rest needs `gnutls-serv`
with SRP enabled, which is not available in current jobs and no longer
offered by Ubuntu's `gnutls-bin` package. 324 doesn't appear as
a skipped test, 323 seems to be running fine, the rest are logged as
skipped. This suggests it's safe to drop the exceptions.

Closes #19413
2025-11-09 00:53:22 +01:00
Viktor Szakats
c262481873
GHA/linux: build and test LibreSSL with Fil-C curl, enable pytests
Build and cache LibreSSL locally with Fil-C and enable it in the Fil-C
job.

Also:
- disable test 776 in the Fil-C job. It fails consistently, and due to
  flakiness seen earlier its result is disabled. In this job it seems to
  be adding 1 to 9 minues to the test run step and fails consistently.
- include Fil-C version in the LibreSSL cache key to prepare for Fil-C
  ABI changes.
- GHA/linux: fully quote `tflags` values to avoid breaking YAML.

Tested and confirmed working with OpenSSL too, but ended up with
LibreSSL for faster, smaller builds.

Closes #19407
2025-11-08 22:51:33 +01:00
Viktor Szakats
3752de465d
pytest: skip H2 tests if feature missing from curl
To allow running pytests on more curl configurations.

Also delete a redundant H3 feature check from test_17_14_expired_cert.

Cherry-picked from #19407
Closes #19412
2025-11-08 22:40:24 +01:00
Daniel Stenberg
7e0d4dd4a8
CURLOPT_SSH_KEYFUNCTION.md: fix minor indent mistake in example 2025-11-08 17:49:30 +01:00
Daniel Stenberg
64489bc3be
CURLOPT_READFUNCTION.md: clarify the size of the buffer
No need to multiply with size as size is always 1 - and documented so.

Closes #19402
2025-11-08 17:11:28 +01:00
Daniel Stenberg
d083f529e8
CURLINFO_SCHEME/PROTOCOL: they return the "scheme" for a "transfer"
Not protocol. Not for connection.

Closes #19403
2025-11-08 17:09:50 +01:00
Daniel Stenberg
a5c0dfc19f
CURLINFO_TLS_SSL_PTR.md: remove CURLINFO_TLS_SESSION text
That option is properly documented in its own page.

Closes #19404
2025-11-08 17:07:23 +01:00
Daniel Stenberg
8442c24c9a
CURLINFO: remove 'get' and 'get the' from each short desc
The short descriptions describe the data each info retrieves. The info
itself does not 'get' the data.

This simplifies and shortens the descriptions and make them more
consistent.

Closes #19406
2025-11-08 17:05:55 +01:00
Stefan Eissing
f55974c139
vtls: fix CURLOPT_CAPATH use
A regression in curl 8.17.0 led to a customer CAPATH set by the
application (or the curl command) to be ignored unless licurl was built
with a default CAPATH.

Add test cases using `--capath` on the custom pytest CA, generated with
the help of the openssl command when available.

Fixes #19401
Reported-by: Brad King
Closes #19308
2025-11-08 17:02:54 +01:00
Viktor Szakats
16c6ea36cc
GHA/linux: add minimal Fil-C build with tests
Requirements for Fil-C:
- not to accidentally pick up system headers. E.g. from `/usr/include`
  on Linux. It can happen when any dependency is auto-detected on this
  header path. This makes Fil-C find the wrong system headers, which
  in turn breaks the configuration step in subtle ways (with CMake) and
  less subtle ways (autotools). Then CMake ends up running into an error
  while compiling.
- build all dependencies with Fil-C too.
  (this patch doesn't build any dependencies yet.)
- "unity" mode disabled. It should work, but needs a lot of memory and
  slower than a standard compiler, or a Fil-C non-unity build.
- x86_64 Linux host platform when using the pre-built toolchain.

Observations on a minimal, static build made with no dependencies and
Fil-C 0.674 (based on clang 20.1.8).
- curl tool sizes:
  - cmake, default, w/o -O: 30 MB (gcc 14.2.0: 1.7 MB)
  - cmake, default, w/o -O, stripped: 29.6 MB (gcc: 1.4 MB)
  - cmake, Release, -O3: 7.2 MB (gcc: 1 MB)
  - cmake, Release, -O3, stripped: 6.8 MB (gcc: 0.93 MB)
  - autotools, default, -O2: 7 MB
- libcurl.a size is 32 MB (cmake, default, w/o -O) (gcc: 2.7 MB)
- build times 3-3.5x longer (compared to system gcc 14.2.0):
- all runtests available pass OK.
- all pytests skipped due to missing features/dependencies.
- shared libcurl builds also work (cmake, default: 25 MB libcurl.so and
  5.75 MB (5.6 stripped) curl tool)
- autotools works fine too, with dependencies disabled or set to avoid
  `/usr/include`.

Closes #19391
2025-11-08 13:42:03 +01:00
x2018
9c0ccd2739
vtls: handle possible malicious certs_num from peer
For GnuTLS, mbedTLS, Rustls, Schannel and wolfSSL

This check was previously added for OpenSSL in 3df71e6dc2

Closes #19397
2025-11-08 10:33:06 +01:00
x2018
a6fcaf2958
rtmp: precaution for a potential integer truncation
On some platforms, socket descriptors may use types larger than int.
When these values exceed INT_MAX, conversion to int can truncate to
negative values causing RTMP connection failures, and even accidentally
affect other socket when high-value descriptors map to existing
lower-value sockets after integer conversion. This check ensures socket
values are within the safe range before passing them to the RTMP
library.

Closes #19399
2025-11-08 10:28:43 +01:00
Andrew
2d99cf0761
lib: fix gssapi.h include on IBMi
Fixes #19336
Closes #19337
2025-11-08 10:25:12 +01:00
Daniel Stenberg
9d1acd048c
gtls: skip session resumption when verifystatus is set
Resumed TLS sessions skip OCSP stapled-response verification. Force a
full handshake so verifystatus() runs.

Follow-up to 4bfd7a9615

Pointed out by ZeroPath
2025-11-07 14:14:54 +01:00
Daniel Stenberg
d8bad9926c
docs: mention umask need when curl creates files
for cookies, alt-svc and HSTS, command line and library

Closes #19396
2025-11-07 14:12:59 +01:00
Daniel Stenberg
891714acb4
RELEASE-NOTES: synced 2025-11-07 13:06:28 +01:00
x2018
608d96694b
lib: refactor the type of funcs which have useless return and checks
Some internal functions always return CURLE_OK.

- Curl_http_proxy_get_destination() does that from bb4032a, (2 years
  ago) And the original inline code does not need to check the status.

- Curl_wildcard_init() does that from e60fe20. (8 years ago)

- Curl_initinfo() does that from a very beginning.

- Curl_pgrsSetDownloadCounter() did not have a return before 914e49b,
  ad051e1 recovered its content (2 years ago) but did not completely
  recovered the changes related to it.

- auth_digest_get_qop_values() does that from 676de7f.

This directly changes their type to void and cleaned the remaining
checks for their return value.

Closes #19386
2025-11-07 13:01:39 +01:00
Stefan Eissing
2684af257e
osslq: code readability
- remove assertions that are unnecessary
- lookup stream after assertions

Closes #19394
2025-11-07 12:58:26 +01:00
Viktor Szakats
f77c574445
renovate: update ruff less often
`ruff` seems to be getting a new release every week. Make renovate bump
it once every month.

Closes #19392
2025-11-07 11:36:25 +01:00
Daniel Stenberg
40b1724f58
tool: consider (some) curl_easy_setopt errors fatal
Instead of happily ignoring return codes.

Calls that allocate data, like duplicating strings, can fail because of
lack of memory which could then leave the option unset and curl would
unknowingly continue (if the memory shortage was momentary).

Closes #19385
2025-11-07 11:12:34 +01:00
Daniel Stenberg
a6eaa67c55
mbedtls: fix potential use of uninitialized nread
When Curl_conn_cf_recv() returns error, the variable might not be
assigned and the tracing output may (harmlessly) use it uninitialized.

Also add a comment about the typecast from size_t to int being fine.

Pointed out by ZeroPath

Closes #19393
2025-11-07 11:09:51 +01:00
Daniel Stenberg
684af00181
setopt: when setting bad protocols, don't store them
Both CURLOPT_PROTOCOLS_STR and CURLOPT_REDIR_PROTOCOLS_STR would
previously return error on bad input but would wrongly still store and
keep the partial (unacceptable) result in the handle.

Closes #19389
2025-11-07 08:15:42 +01:00
Daniel Stenberg
8e93a74a73
tool_paramhlp: refuse --proto remove all protocols
curl is for transfers so disabling all protocols has to be a mistake.
Previously it would allow this to get set (even if curl_easy_setopt()
returns an error for it) and then let libcurl return error instead.

Updated 1474 accordingly.

Closes #19388
2025-11-06 23:42:47 +01:00
Viktor Szakats
e108778db3
GHA/macos: replace deleted gcc-12 with gcc-13/gcc-14
GitHub dropped gcc-12 for the remaining two macos runner images.
Replace it with gcc-13 in normal jobs, and gcc-14 in combination jobs.

Ref: f7e2c3f34b
Ref: https://github.com/actions/runner-images/pull/13249

Ref: 1c1351b635
Ref: https://github.com/actions/runner-images/pull/13253

Closes #19387
2025-11-06 22:18:27 +01:00
Viktor Szakats
904e7ecb66
tests: replace remaining CR bytes with the new macro %CR
There is no more mixed-newline file in the repository after this patch.
Except for`.bat` and `.sln` files (4 in total), all files use LF
newlines.

Also:
- `spacecheck.pl`: drop mixed-EOL exception for test data.
- runtests: add option `-w` to check if test data has stray CR bytes in
  them.
- build: enable the option above in test targets, except the CI-specific
  one where `spacecheck.pl` does this job already.
- tested OK (with expected failures) in CI with stray CRs added.
- cmake: enable option `-a` for the `tests` target. To continue testing
  after a failed test.

Follow-up to 63e9721b63 #19313
Follow-up to 6cf3d7b1b1 #19318
Follow-up to 4d2a05d3fe #19284

Closes #19347
2025-11-06 20:45:45 +01:00
Juliusz Sosinowicz
672886f734
wolfSSL: able to differentiate between IP and DNS in alt names
Fix implemented in https://github.com/wolfSSL/wolfssl/pull/9380

Closes #19364
2025-11-06 15:45:02 +01:00
x2018
69622ff37d
tool_help: add checks to avoid unsigned wrap around
Closes #19377
2025-11-06 15:37:53 +01:00
Stefan Eissing
f12a81de4f
curl: fix progress meter in parallel mode
With `check_finished()` triggered by notifications now, the
`progress_meter()` was no longer called at regular intervals.

Move `progress_meter()` out of `check_finished()` into the perform loop
and event callbacks.

Closes #19383
2025-11-06 13:37:57 +01:00
Viktor Szakats
9825a3b708
cmake: disable CURL_CA_PATH auto-detection if USE_APPLE_SECTRUST=ON
Syncing behavior with `CURL_CA_BUNDLE` and autotools.

`/etc/ssl/certs` is empty by default on macOS systems, thus no likely
auto-detection finds something there.

Follow-up to eefd03c572 #18703

Closes #19380
2025-11-06 11:42:34 +01:00
Viktor Szakats
ede6a8e087
conncache: silence -Wnull-dereference on gcc 14 RISC-V 64
A false positive that appeared after a recent patch for no reason.

Seen in curl-for-win unity native Linux builds on debian:testing and
debian:trixie with gcc 14.3.0 and 14.2.0 respectively:
```
-- curl version=[8.17.1-DEV]
-- The C compiler identification is GNU 14.2.0
-- Cross-compiling: Linux/x86_64 -> Linux/riscv64
[...]
lib/conncache.c: In function 'Curl_cpool_conn_now_idle':
lib/conncache.c:539:11: error: null pointer dereference [-Werror=null-dereference]
  539 |   if(!data->multi->maxconnects) {
      |       ~~~~^~~~~~~
```
Ref: https://github.com/curl/curl-for-win/actions/runs/19111497271/job/54609512969#step:3:5788

```
-- The C compiler identification is GNU 14.3.0
```
Ref: https://github.com/curl/curl-for-win/actions/runs/19111497271/job/54609512899#step:3:5801

Patch confirmed silencing:
https://github.com/curl/curl-for-win/actions/runs/19112580362/job/54613288202

Follow-up to fbc4d59151 #19271

Closes #19378
2025-11-06 11:42:34 +01:00
Viktor Szakats
8e6149598b
gnutls: report accurate error when TLS-SRP is not built-in
With GnuTLS 3.8.0+ the build-time SRP feature detection always succeeds.
It's also disabled by default in these GnuTLS versions.

When using TLS-SRP without it being available in GnuTLS, report
the correct error code `CURLE_NOT_BUILT_IN`, replacing the out of memory
error reported before this patch.

Also add comments to autotools and cmake scripts about this feature
detection property.

Detecting it at build-time would need to run code which doesn't work
in cross-builds. Once curl requires 3.8.0 as minimum, the build-time
checks can be deleted.

```
# before:
curl: (27) gnutls_srp_allocate_client_cred() failed: An unimplemented or disabled feature has been requested.
# after:
curl: (4) GnuTLS: TLS-SRP support not built in: An unimplemented or disabled feature has been requested.
```

Ref: dab063fca2
Ref: a21e89edac

Closes #19365
2025-11-06 11:42:34 +01:00
Daniel Stenberg
66a66c596b
tool_operate: remove redundant condition
And avoid an early return.

Pointed out by CodeSonar

Closes #19381
2025-11-06 11:39:52 +01:00
Daniel Stenberg
56129718b8
tool_ipfs: check return codes better
Closes #19382
2025-11-06 11:38:54 +01:00
Viktor Szakats
58023ba522
docs: fix checksrc EQUALSPACE warnings
```
docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.md:86:16
docs/libcurl/opts/CURLOPT_SSL_CTX_FUNCTION.md:139:16
```

Also sync `CURL *` and result variable names with rest of docs.

Follow-up to 6d7e924e80 #19375

Closes #19379
2025-11-06 00:04:15 +01:00
Daniel Stenberg
d7d4de07c2
tests/Makefile.am: fix 'checksrc' target
Skip the http and client subdirs as they contain no code to check. The
http clients are in libtests/ now.

Closes #19376
2025-11-05 23:13:55 +01:00
Dan Fandrich
e6e1899b6e tests: Add tests to validate that path is ignored with -J
curl is correctly dropping the Content-Disposition: filename path, but
there was no test ensuring that.

Ref: https://hackerone.com/reports/3408126
2025-11-05 11:03:35 -08:00
Viktor Szakats
60dd72b1be
GHA/checksrc: add actionlint, fix or silence issues found
It also does shellcheck on `run:` elements, overlapping with
the homegrown `shellcheck-ci.sh` with the same purpose. But it also does
more and perhaps could replace the script too, especially in curl
sub-repos.

Also:
- GHA/macos: delete potentially useful, but commented, and ultimately
  unused, non-default Xcode-testing logic. It's causing unused matrix
  exceptions, upsetting actionlint.

Ref: https://github.com/rhysd/actionlint

Closes #19373
2025-11-05 15:59:43 +01:00
Viktor Szakats
403a2c2b06
tests: shorten space and tab macro names
Easier to write and read.

Follow-up to d29f14b9cf #19300

Closes #19349
2025-11-05 15:59:43 +01:00
renovate[bot]
87f448ed52
Dockerfile: update debian:bookworm-slim digest to 936abff
Closes #19348
2025-11-05 15:24:21 +01:00
Daniel Stenberg
6d7e924e80
checksrc.pl: detect assign followed by more than one space
And fix some code previously doing this.

Closes #19375
2025-11-05 15:18:28 +01:00
Daniel Stenberg
c12a1fdd0e
tests: remove trailing spaces in server responses
Allows us to drop lots of %spc% from test cases making them easier on
the eye.

Closes #19374
2025-11-05 15:17:29 +01:00
Daniel Stenberg
a8bef39036
openssl: remove code handling default version
Since it is no longer actually kept as default internally, that's just
dead code.

Follow-up to 9d8998c994
Closes #19354
2025-11-05 14:14:58 +01:00
Daniel Stenberg
33e7745eef
RELEASE-NOTES: synced
bumped to 8.17.1 for now

fixed typo in THANKS-filter
2025-11-05 14:12:23 +01:00
x2018
2db36f11b8
gtls: add return checks and optimize the code
This commit does the following things:

1. Update the description of gtls_init()

2. In gtls_client_init(), check the invaild SSLVERSION at first. Note
   that this part refactors the duplicate/incompatible checks and removes
   the useless local variable `sni`.

3. Check the return value of gnutls_ocsp_resp_init(). Although the
   original code is safe because gnutls_ocsp_resp_import() will check
   the validity of `ocsp_resp`, it is better to catch the error in time
   and record the proper message to output log.

Closes #19366
2025-11-05 14:09:34 +01:00
x2018
dd71f61ea2
lib: cleanup for some typos about spaces and code style
Closes #19370
2025-11-05 14:07:28 +01:00
Thomas Klausner
2e770b33e8
m4/sectrust: fix test(1) operator
'=' is the operator defined by POSIX, only bash supports '=='

Closes #19371
2025-11-05 12:47:16 +01:00
Viktor Szakats
8d00e28136
GHA/non-native: revert to OpenBSD 7.7 due to test hangs with 7.8
test 701 (SOCKS5) and 708 (SOCKS4) started hanging occasionally, and
most likely others too.

https://github.com/curl/curl/actions/runs/19081279902/job/54510279013 (701 hangs) https://github.com/curl/curl/actions/runs/19095657593/job/54555001348?pr=19370 (708 hangs)
https://github.com/curl/curl/actions/runs/19097996671/job/54562669865?pr=19371 (unknown test hangs)

Reverts c3b890b2c0 #19368

Closes #19372
2025-11-05 11:50:13 +01:00
Viktor Szakats
a39ff61a7b
GHA/windows: switch a dl-mingw job to skeeto/w64devkit gcc 15.1.0
To add another, so far untested standalone toolchain variant to the mix.
This distro is a fairly compact, GCC mingw-w64.

Replacing an existing 15.0.1 snapshot toolchain build job.

Ref: https://github.com/skeeto/w64devkit/releases

Closes #19369
2025-11-05 11:50:13 +01:00
Daniel Stenberg
400fffa90f
RELEASE-NOTES: synced
version 8.17.0 relese
2025-11-05 08:00:05 +01:00
Daniel Stenberg
6687379389
VERSIONS: 8.18.0 is now pending 2025-11-05 08:00:05 +01:00
Daniel Stenberg
7872ec968f
THANKS: add contributors from 8.17.0 2025-11-05 07:57:28 +01:00
Viktor Szakats
c3b890b2c0
GHA/non-native: bump to OpenBSD 7.8
Follow-up to e5cc5640b3 #19367

Closes #19368
2025-11-04 23:30:58 +01:00
renovate[bot]
e5cc5640b3
GHA: update cross-platform-actions/action action to v0.30.0
Closes #19367
2025-11-04 21:00:35 +01:00
x2018
8d4530537a
gtls: check the return value of gnutls_pubkey_init()
Closes #19362
2025-11-04 17:00:52 +01:00
Viktor Szakats
3806fd914b
cmake: fix HAVE_GNUTLS_SRP detection after adding local FindGnuTLS module
When GnuTLS is detected via pkg-config on a non-default path, e.g. with
Homebrew arm64 (`/opt/homebrew/`).

This was a regression from a commit made in this release cycle.

The Find module doesn't return an absolute path to the detected library
(as the former solution did), but a bare libname and a libpath. We thus
need to explicitly use the libpath while detecting a feature in GnuTLS
found this way. Syncing this with other dependencies.

Follow-up to 1966c86d71 #19163

Closes #19360
2025-11-04 16:41:34 +01:00
Daniel Stenberg
775add6e90
HISTORY: extend
With recent events and some more in the past

Closes #19361
2025-11-04 16:25:28 +01:00
Samuel Henrique
913c1f28c9
wcurl: import v2025.11.04
Closes #19353
2025-11-04 14:15:46 +01:00
x2018
11683f121d
tool_ipfs: check the return value of curl_url_get for gwpath
Closes #19358
2025-11-04 14:13:00 +01:00
Daniel Stenberg
0783ef2348
tests: remove most user-agent filters
Use the %VERSION instead. The user-agent stripping was introduced at the
time before we had %VERSION (introduced in e6b21d4). The tests would
then remove the user-agent header to make them possible to be compared
in a version independent way.

Fixes #19355
Reported-by: Stefan Eissing
Closes #19356
2025-11-04 13:05:11 +01:00
Daniel Stenberg
70a11c6f06
CURLOPT_COPYPOSTFIELDS.md: used with MQTT and RTSP as well
Follow-up to 5ec87346a9

Closes #19351
2025-11-04 09:08:16 +01:00
Daniel Stenberg
f8e7b1377b
BINDINGS: change dead link to archive.org version
The Hollywood binding host name www.hollywood-mal.com does not seem to
work anymore.

Closes #19352
2025-11-04 09:07:41 +01:00
Daniel Stenberg
e5299a1b87
README.md: use the first paragraph from the man page
Which also mentions all protocols

Closes #19335
2025-11-03 23:13:26 +01:00
Daniel Stenberg
5ec87346a9
CURLOPT_POSTFIELDSIZE*: these also work for MQTT and RTSP
Closes #19346
2025-11-03 22:29:28 +01:00
Joshua Rogers
feab390124
rtsp: use explicit postfieldsize if specified
Signed-off-by: Joshua Rogers <MegaManSec@users.noreply.github.com>
Closes #19345
2025-11-03 22:27:16 +01:00
Viktor Szakats
63e9721b63
tests: avoid hard-coded CRLFs in more sections
- `reply/data*`, `verify/stdout`, `verify/stderr`, `verify/file*`,
  `verify/proxy`:
  - make `crlf="yes"` force CRLF to all lines, instead of just applying
    to HTTP protocol headers.
  - add support for `crlf="headers"` that only converts HTTP protocol
    header lines to CRLF. (previously done via `crlf="yes"`.)
  - use `crlf="headers"` where possible.

- `reply/connect*`:
  - add support for `crlf="yes"` and `crlf="headers"`.
  - use them where possible.

- `client/file*`, `client/stdin`:
  - add support for `crlf="yes"`.
  - use it where possible.

- `reply/data*`, `verify/protocol`:
  - replace existing uses of `crlf="yes"` with `crlf="headers`" where it
    does not change the result.

Reducing the number of `tests/data/test*`:
- CRLF newlines from 10295 to 1985. (119985 lines total)
- files with mixed newlines from 656 to 113. (1890 files total)

After this patch there remain 141 sections with mixed newlines, where
the mixing is not split between headers/non-headers. There is no obvious
pattern here. Some of the CRLF uses might be accidental, or
non-significant. They will be tackled in a future patch.

Follow-up to 6cf3d7b1b1 #19318
Follow-up to 4d2a05d3fe #19284

Closes #19313
2025-11-03 21:15:12 +01:00
x2018
6adefe8ad0
multi: check the return value of strdup()
Closes #19344
2025-11-03 20:19:36 +01:00
x2018
231f0a2eec
http: check the return value of strdup
Closes #19343
2025-11-03 20:17:41 +01:00
Joshua Rogers
0d5e24281d
vtls: check final cfilter node in find_ssl_filter
find_ssl_filter used while(cf && cf->next) and skipped the last node.
If the SSL filter was last, channel binding lookup failed and we returned
CURLE_BAD_FUNCTION_ARGUMENT. Switch to while(cf) so the tail is examined.

This bug was found with ZeroPath.

Closes #19229
2025-11-03 18:21:57 +01:00
Devdatta Talele
8616e5aada
gssapi: make channel binding conditional on GSS_C_CHANNEL_BOUND_FLAG
Fixes #19109 - GSSAPI authentication fails on macOS with Apple's Heimdal
implementation which lacks GSS_C_CHANNEL_BOUND_FLAG support for TLS
channel binding.

Commit 0a5ea09a91 introduced TLS channel binding for SPNEGO/GSSAPI
authentication unconditionally, but Apple's Heimdal fork (used on macOS)
does not support this feature, causing "unsupported mechanism" errors
when authenticating to corporate HTTP services with Kerberos.

Solution:
- Add CURL_GSSAPI_HAS_CHANNEL_BINDING detection in curl_gssapi.h based
  on GSS_C_CHANNEL_BOUND_FLAG presence (MIT Kerberos >= 1.19)
- Make negotiatedata.channel_binding_data field conditional in vauth.h
- Guard channel binding collection/cleanup in http_negotiate.c
- Guard channel binding usage in spnego_gssapi.c

This follows the same pattern as GSS_C_DELEG_POLICY_FLAG detection and
ensures graceful degradation when channel binding is unavailable while
maintaining full support for implementations that have it.

Changes:
- lib/curl_gssapi.h: Add feature detection macro
- lib/vauth/vauth.h: Make struct field conditional
- lib/http_negotiate.c: Conditional init/cleanup (2 locations)
- lib/vauth/spnego_gssapi.c: Conditional channel binding usage

Tested on macOS with Apple Heimdal (no channel binding) and Linux with
MIT Kerberos (with channel binding). Both configurations authenticate
successfully without errors.

Closes #19164
2025-11-03 18:16:54 +01:00
Stefan Eissing
cccc65f051
openssl: check CURL_SSLVERSION_MAX_DEFAULT properly
The definition of these constants does not give a numeric ordering
and MAX_DEFAULT needs to be checked in addition of ciphers and QUIC
checks to apply correctly.

Fixes #19340
Reported-by: Peter Piekarski
Closes #19341
2025-11-03 16:31:22 +01:00
Stefan Eissing
7e91f24c73
cw-out: fix EAGAIN handling on pause
The interim CURLE_AGAIN result was not always converted to a
CURLE_OK and then caused write callers to report a failure.

Fixes #19334
Reported-by: pennae on github
Closes #19338
2025-11-03 16:10:20 +01:00
Viktor Szakats
1021c52c92
REUSE: add copyright header to two files
`.mailmap` supports comments and empty lines since at least 2.31.0:
https://git-scm.com/docs/gitmailmap/2.31.0

Closes #19339
2025-11-03 16:08:52 +01:00
Viktor Szakats
254e04b702
ftpserver.pl: fix newlines in 227/229 replies, adjust tests
The test FTP server returned LF newlines for 227/229 replies, instead of
the CRLF used for the rest.

Test data added later were explicitly made to expect an LF in these
response lines.

After this patch the FTP server returns CRLF newlines, allowing
to delete this special case in test data.

Follow-up to 3bfff57e1f
Follow-up to a7937ed49c

Closes #19330
2025-11-03 12:19:03 +01:00
Viktor Szakats
aaf9522a2c
test696: decouple from test556 data
Test 696 and 556 share the same libtest code. Make sure to issue
the `GET` request to the correct runtime test number instead of using
the hard-wired "556".

It makes the `sws` test server read the response string from `test696`
`<data>` section, instead of reading it from `test556`. To avoid this
hidden interaction between test data.

AFAICS there is no other similar hard-coded string in reused libtests.

Ref: https://github.com/curl/curl/pull/19313#issuecomment-3477448933
Follow-up to be82a3605a #16003
Closes #19329
2025-11-03 12:19:03 +01:00
Daniel Stenberg
c1e3a760ba
imap: avoid integer overflow
Follow-up to e64c28e243

Spotted by OSS-Fuzz

Closes #19332
2025-11-03 08:54:51 +01:00
Daniel Stenberg
3060495830
RELEASE-NOTES: synced 2025-11-02 23:09:54 +01:00
x2018
c898da26c6
http_aws_sigv4: check the return value of curl_maprintf()
Closes #9328
2025-11-02 23:04:24 +01:00
Viktor Szakats
2ffa8307b5
GHA/dependabot: tidy-ups 2025-11-02 17:45:50 +01:00
dependabot[bot]
7203498c6a
GHA: bump the pip-dependencies group across 2 directories with 3 updates
Closes #19321
2025-11-02 17:10:39 +01:00
Viktor Szakats
428faf6d47
GHA/dependabot: fix update group names 2025-11-02 17:10:00 +01:00
Viktor Szakats
986ef77833
runtests: fix Perl warning after recent patch
```
Use of uninitialized value $hash{"crlf"} in string eq at tests/runtests.pl line 1406.
```

Follow-up to 6cf3d7b1b1 #19318
Closes #19327
2025-11-02 13:09:16 +01:00
Viktor Szakats
6cf3d7b1b1
tests: avoid more hard-coded CRLFs in protocol sections
- fix regex to not catch CR (from CRLF), in `PORT`, `EPRT`
  commands, allowing to use `crlf="yes"` more.
- add `crlf="headers"` mode for `protocol` sections.
  To call `subnewlines()` without its force option.
  This is the mode used in `data` sections when `crlf="yes"`.
  (This confusion may be subject to a future commit.)
- subnewlines: apply CRLF to `HEAD` and `CONNECT` HTTP requests.
- subnewlines: apply CRLF to RTSP requests.
- delete remaining empty `protocol` sections.

Reducing the number of `tests/data/test*`:
- CRLF newlines from 11325 to 10295. (119984 lines total)
- files with mixed newlines from 707 to 656. (1890 files total)

Follow-up to 4d2a05d3fe #19284

Closes #19318
2025-11-01 23:52:55 +01:00
x2018
e2a12fcbdb
vtls: properly handle SSL shutdown timeout
Closes #19323
2025-11-01 23:28:40 +01:00
x2018
f6bbc2b3be
doh: cleanup resources on error paths
Closes #19310
2025-11-01 23:14:33 +01:00
Daniel Stenberg
8d0bfe74fb
httpsrr: send HTTPS query to the right target
When the target host is on a different port than 443, the name
"_[port]._https.[name]" shall be used.

Fixes #19301
Reported-by: Gunni on github
Closes #19324
2025-11-01 23:13:30 +01:00
Viktor Szakats
6a97bc2c97
tests/data: delete stray CRLFs in markup lines
Closes #19317
2025-11-01 04:36:09 +01:00
Viktor Szakats
cf4a62725d
CI: two display name tweaks
- use `AM`/`CM` where missing.
  In GHA/linux-old and AppVeyor CI.
  To denote autotools and CMake, and to align with rest of the jobs.

- rename `Old Linux` to `Linux Old` to align with the rest of Linux
  jobs on GitHub web views sorted by name.

Closes #19316
2025-11-01 02:24:17 +01:00
Viktor Szakats
2e408aa5cc
tests: replace standalone significant tabs with macro
Follow-up to d29f14b9cf #19300

Closes #19315
2025-10-31 23:44:21 +01:00
Viktor Szakats
d2f0a0e796
tests/libtest: consistent variable naming for easy/multi/share handles
Follow-up to 928363f28c #19299

Closes #19311
2025-10-31 23:44:21 +01:00
Stefan Eissing
c35a87d776
scorecard: more params for upload tests
Add --upload-parallel=n for controlling upload parallelism. Make upload
processing similar to download processing.

Closes #19302
2025-10-31 23:27:59 +01:00
x2018
27f55383fb
schannel: properly close the certfile on error
Closes #19304
2025-10-31 23:27:06 +01:00
Daniel Stenberg
d4d7139e70
openssl: combine all the x509-store flags
... intead of overwriting the previous ones in ossl_populate_x509_store()

Pointed out by ZeroPath

Closes #19306
2025-10-31 23:24:38 +01:00
Stefan Eissing
b4630ed8fa
sectrust: fix verifystatus via sectrust
When openssl does not verify the certificate, but apple sectrust
does, we also pass it the ocsp stapled response when configured and
available.

When openssl does not verify the cert chain, it will also not be able
to verify the ocsp stapling. Do not call it if sectrust is the
verifier of the cert chain.

Fixes #19307
Reported-by: Harry Sintonen
Closes #19308
2025-10-31 23:10:35 +01:00
Daniel Stenberg
d646d5a130
openssl: fix the ocsp len arg to Curl_vtls_apple_verify
If it has no data, pass in a zero.

Fixes #19303
Reported-by: Harry Sintonen
Closes #19305
2025-10-31 23:09:05 +01:00
Viktor Szakats
9c0b239ec1
spelling: fix new finds by typos-cli 1.39.0
Closes #19312
2025-10-31 21:31:32 +01:00
Viktor Szakats
70f240b2ed
tests/libtest/cli*: fix init/deinit, leaks, and more
- add global init and deinit where missing.
- check global init success.
- improve cleaning up on error codepaths.
- drop `CLI_ERR()` macro, that could quit.
  Also make error messages tell the reason.

Closes #19309
2025-10-31 20:56:05 +01:00
Viktor Szakats
d29f14b9cf
tests: replace significant invisible spaces with macros
To make them explicit, visible, avoid being accidentally trimmed.
Also prevents Git warnings, e.g. on `git am`.

Also:
- runtests: add support for `%spc%` and `%tab%` macros.
- test59: delete non-significant line-ending space.
- spacecheck.pl: drop line-ending whitespace exception for tests.

Closes #19300
2025-10-31 17:15:33 +01:00
Daniel Stenberg
928363f28c
examples: consistent variable naming across examples
- 'CURL *' handles are called 'curl'
- 'CURLM *' handles are called 'multi'
- write callbacks are called 'write_cb'
- read callbacs are called 'read_cb'
- CURLcode variables are called 'res'

It makes the examples look and feel more consistent. It allows for
easier copy and pasting between examples.

Closes #19299
2025-10-31 16:44:57 +01:00
Daniel Stenberg
0313223853
RELEASE-NOTES: synced 2025-10-31 16:28:13 +01:00
Viktor Szakats
c887a3f2f2
BINDINGS.md: point flaky URL to archive.org
To avoid linkcheck CI fails. It was failing regularly in the last months.
2025-10-31 16:21:41 +01:00
Stefan Eissing
1e85cb4b7b
scp/sftp: fix disconnect
When a SCP/SFTP connection calls the protocol handler disconnect, it
required the connections *and* the easy handles SSH meta data to be
present. When the disconnect is called with an admin handle, the easy
meta data is not present, which prevented the shutdown to run.

The easy meta data is however not necessary to run the shutdown state
machine. Calling it with a NULL `sshp` is fine. To avoid any mixups,
check `sshp` in state operations that need it.

Fixes #19293
Reported-by: And-yW on github
Closes #19295
2025-10-31 15:56:58 +01:00
Viktor Szakats
26e3f00469
test446, 1034, 1160: set US-ASCII encoding in XML header
To match the ASCII-7 requirement for curl test data files.

Follow-up to 9243ed59b3 #17329
Follow-up to 87ba80a6df

Closes #19297
2025-10-31 15:01:08 +01:00
Viktor Szakats
2147de554d
test429: use %repeat[]%
Follow-up to eb22e37060 #19281
Follow-up to 55d4767876 #19279

Closes #19296
2025-10-31 15:01:08 +01:00
Viktor Szakats
4d2a05d3fe
tests: use crlf=yes attribute more
To make special newlines more explicit and visible.
Mostly in `<protocol>` sections, some in `<data*>` and `<upload>`.

Reducing the number of `tests/data/test*`:
- CRLF newlines from 21535 to 11337.
- files with mixed newlines from 1335 to 707.

Also delete empty `<protocol>` sections.

Closes #19284
2025-10-31 15:01:08 +01:00
Viktor Szakats
869143b194
examples: fix more potential resource leaks, and more
Also:
- delete dead code.
- sync `http2-download.c` and `http2-upload.c` sources.
- simplessl: fix constant expression.
- simplessl: avoid `expression is constant` VS2010 warning, drop pragma.
- replace large stack buffers with dynamic allocation.
- http2-download: fix to fill transfer number.

Some of these were pointed out by TIOBE scanner via Coverity 2025.3.0.

Closes #19292
2025-10-31 13:35:53 +01:00
Viktor Szakats
4b85e489a4
examples/http2-serverpush: fix file handle leaks
Also:
- tests/libtest/cli_h2_serverpush: re-sync formatting.

Previously fixed in tests based on a local clang-tidy v20 report.

Pointed out by TIOBE scanner via Coverity 2025.3.0.
Follow-up to 83a8818cfe #17706

Closes #19291
2025-10-31 13:14:12 +01:00
Viktor Szakats
5bf9445315
ftp: fix leaking internal buffer newhost on error
Pointed out by TIOBE scanner via Coverity 2025.3.0.

Closes #19290
2025-10-31 13:14:09 +01:00
Viktor Szakats
d2e8acfaa6
test1100: fix missing <protocol> section
To make it actually run. Also fix the NTLM expected result, also syncing
it with other tests.

Follow-up to e6b21d422e #6037

Closes #19288
2025-10-31 13:14:06 +01:00
Daniel Stenberg
1afc4bb768
tool/var: explain how the null termination byte is there
Closes #19287
2025-10-30 20:22:37 +01:00
Viktor Szakats
eb22e37060
tests: use %repeat[] to make tests smaller (cont.)
tests: 46, 265, 304, 316, 397, 443, 551, 552, 559, 651, 742, 775, 1003,
1005, 1006, 1008, 1062, 1070, 1086, 1112, 1151, 1160, 1178, 1192, 1193,
1205, 1237, 3207.

Total `test*` size reduction: 2,395,537 -> 2,165,631 bytes.

Follow-up to 55d4767876 #19279

Closes #19281
2025-10-30 16:52:26 +01:00
renovate[bot]
a83eae4d53
GHA: update libressl/portable to v4.2.1
Closes #19283
2025-10-30 16:21:52 +01:00
Daniel Stenberg
c5de083bcc
base64: make base64_encode() error on too long input
The maximum size is set to 16MB.

It should not possible to call this function with this large input, but
this is a precaution to catch mistakes and replaces the earlier check on
architectures with small size_t.

Closes #19280
2025-10-30 15:41:28 +01:00
Daniel Stenberg
80258309b2
lib: reduce memcpy calls
socks_gssapi: the malloc + memcpy was superflous and can be skipped

cleartext: avoid malloc + three memcpy with aprintf()

digest_sspi: use memdup0 instead of malloc + memcpy

vtls: use memdup0 instead of malloc + memcpy

Closes #19282
2025-10-30 15:40:21 +01:00
x2018
fbc4d59151
conncache: prevent integer overflow in maxconnects calculation
Closes #19271
2025-10-30 10:38:32 +01:00
Daniel Stenberg
c1f1b66d78
pop3: check for CAPA responses case insensitively
Reported by ZeroPath

Closes #19278
2025-10-30 10:34:08 +01:00
Daniel Stenberg
55d4767876
tests: use %repeat[] to make tests smaller
Avoid putting huge chunks of repeated texts in test cases.

test3206, test1060, test1061 and test22

Closes #19279
2025-10-30 09:48:41 +01:00
TheBitBrine
e64c28e243
imap: fix custom FETCH commands to handle literal responses
Custom IMAP commands using -X (e.g. 'FETCH 123 BODY[1]') were only
returning the first line of responses containing literals, instead of
the full multi-line body data.

The issue was that custom commands route through imap_perform_list()
and imap_state_listsearch_resp(), which didn't detect or handle IMAP
literal syntax {size}.

This commit adds literal detection to imap_state_listsearch_resp():
- Detects literal syntax {size} in untagged responses
- Writes the response header line containing the literal marker
- Handles any literal body data already in the pingpong buffer
- Sets up transfer layer to read remaining literal data from socket
- Configures maxdownload and transfer size to include header + body
- Initializes pp->overflow to 0 when no buffered data present
- Modifies imap_done() to transition to FETCH_FINAL for custom
  commands that set up downloads

Test 841 and 3206 verify.

Fixes #18847
Reported-by: BohwaZ
Bug: https://github.com/curl/curl/issues/18847
Closes #19246
2025-10-30 08:48:28 +01:00
Viktor Szakats
25aee8648a
http: fix -Wunused-variable in !alt-svc !proxy !ws builds
```
lib/http.c:2783:23: error: unused variable 'conn' [-Werror,-Wunused-variable]
 2783 |   struct connectdata *conn = data->conn;
      |                       ^~~~
1 error generated.
```

Closes #19276
2025-10-29 16:17:35 +01:00
Viktor Szakats
7973cb0b3e
http: fix -Wunreachable-code in !websockets !unity builds
Also requires non-unity build. Possibly more non-default options are
necessary to reproduce. Seen with llvm/clang.

```
lib/http.c:1856:15: error: code will never be executed [-Werror,-Wunreachable-code]
 1856 |     httpreq = HTTPREQ_GET;
      |               ^~~~~~~~~~~
1 error generated.
```

Closes #19275
2025-10-29 16:17:34 +01:00
Stefan Eissing
446dae5bfe
ngtcp2: overwrite rate-limits defaults
In pytests test_08 with the Caddy server, the new rate-limiting in
ngtcp2 did close the connection because it found "too many" stream data
packet repeats.

It is unclear if this is some Caddy issue or if the ngtcp2 implementaton
is wrong. Or if curl can do anything here.

Reported as https://github.com/ngtcp2/ngtcp2/issues/1850

This PR overwrites the ratelimit defaults in ngtcp2 with ten times
increased values. This makes the errors disappear on macOS.

Enable test_08_04/05 in CI again to see if there are any issues
to be found there. (We had those disabled before having parallel
pytests.)

Closes #19274
2025-10-29 13:34:27 +01:00
Daniel Stenberg
a97f9d41cc
openldap/ldap; check for binary attribute case insensitively
This bug was found with ZeroPath

Fixes #19240
Reported-by: Joshua Rogers
Closes #19273
2025-10-29 10:03:35 +01:00
renovate[bot]
614895c045
GHA: update pyspelling to v2.12
Closes #19262
2025-10-29 08:32:28 +01:00
renovate[bot]
d3e7bef1ef
GHA: update reuse to v6.2.0
Closes #19257
2025-10-29 08:31:47 +01:00
Stefan Eissing
c82a70628d ssl-session-cache: check use on config and availability
Replace the check if a ssl session cache is configured with
a function checking if it is configured *and* if an ssl session
cache is available.

During normal operations, a session cache is always there, however
for "connect-only" transfers this might not be the case. When such
transfers receive new sessions/tickets, they need to silently
discard those and not fail.

Reported-by: Marc Aldorasi

Fixes https://github.com/curl/curl/issues/18983
Closes https://github.com/curl/curl/pull/19251
2025-10-29 03:07:59 -04:00
Jay Satiro
0ba006601f tool_operate: move the checks that skip ca cert detection
- Move the checks into the function that needs them, cacertpaths().

Prior to this change the caller made the determination whether to skip
calling cacertpaths for cert detection. However for posterity it is
better to have the checks in cacertpaths since other code could call it.

Closes https://github.com/curl/curl/pull/19148
2025-10-29 02:46:43 -04:00
Daniel Stenberg
ba85f9d605
RELEASE-NOTES: synced 2025-10-28 23:33:16 +01:00
Daniel Stenberg
fe9e0115b1
tests: reduce max allowed allocations for four tests
and completely remove the check for one

Closes #19260
2025-10-28 23:28:50 +01:00
Daniel Stenberg
875ea98c36
schannel: handle Curl_conn_cf_send() errors better
Avoid a resource leak in the error path.

Reported-by: Joshua Rogers

Closes #19265
2025-10-28 23:26:33 +01:00
Daniel Stenberg
9308ea22e8
cookie: remove the temporary file on (all) errors
Fixes #19267
Reported-by: Harry Sintonen
Closes #19268
2025-10-28 16:51:30 +01:00
x2018
02113a6307
Curl_resolv: explicitly set *entry to NULL at the top
Closes #19263
2025-10-28 11:39:13 +01:00
Daniel Stenberg
bc99770217
singleuse.pl: fix string warning
"Use of uninitialized value $unittests in concatenation on line 170"

Closes #19266
2025-10-28 11:34:19 +01:00
Viktor Szakats
fa49c50ac3
tests/server/dnsd: fix potential buffer overflow
When handling incoming DNS packets.

Reported-by: Joshua Rogers

Closes #19261
2025-10-27 21:55:36 +01:00
Daniel Stenberg
73811b4c51
header: see-also --proxy-header and vice versa
Closes #19259
2025-10-27 17:24:18 +01:00
Daniel Stenberg
05eea37e78
CURLOPT_SERVER_RESPONSE_TIMEOUT*: add default and see-also
Also move the old name mention to a HISTORY section

Closes #19258
2025-10-27 17:23:17 +01:00
Stefan Eissing
692c7f133e
TLS: IP address verification, extend test
Change the test certificate to carry a altname 'dns:127.0.0.1' which
should *not* match in test_17_05_bad_ip_addr.

wolfSSL: since `wolfSSL_check_domain_name()` does not differentiate
between DNS and IP names, use if only for DNS names. For IP addresses,
get the peer certificate after the handshake and check that using
wolfSSL_X509_check_ip_asc().

Unfortunately, this succeeds where it should not, as wolfSSL internally
used the same check code for both cases. So, skip the test case until
wolfSSL fixes that.

Reported-by: Joshua Rogers
Closes #19252
2025-10-27 17:22:17 +01:00
Daniel Stenberg
2bb33c18a7
pingpong: change repsonse timeout to one minute
It was previously two minutes by default and sometimes one minute.
Removes a struct field.

Closes #19254
2025-10-27 16:33:30 +01:00
x2018
6c97ff8c12
socks: properly maintain the status of 'done'
Closes #19255
2025-10-27 16:31:37 +01:00
Daniel Stenberg
f9dfabb42a
test1802: test --proxy-headers and --headers setting user-agent 2025-10-27 09:52:05 +01:00
Daniel Stenberg
cdd945e486
http_proxy: fix adding custom proxy headers
Reported-by: Joshua Rogers
Fixes #19227
Closes #19239
2025-10-27 09:52:00 +01:00
Samuel Henrique
fb0c014e30
wcurl: sync to +dev snapshot
Closes #19247
2025-10-27 08:09:58 +01:00
Viktor Szakats
ab20bb47cf
GHA/linux: make OpenLDAP local build smaller
By disabling its `slapd` component, that's not needed for curl.

Cache size: 2.7 -> 1.7 MB

Also merge two `make` invocations.

Closes #19250
2025-10-27 07:17:32 +01:00
TheBitBrine
a49e4e3d16
pop3: fix CAPA response termination detection
The code was checking if a line starts with '.', which would
incorrectly match capability names starting with dots. Per RFC 2449,
the terminator must be a line containing only a single dot.

RFC 2449 also explicitly excludes '.' from valid capability name
starting characters, so this is purely theoretical, but the code
should match the spec.

Changed to check for exact match: line length of 3 with '.\r' or
length 2 with '.\n' to handle both CRLF and LF-only servers.

(Mistake detected with ZeroPath)

Fixes #19228
Reported-by: Joshua Rogers
Closes #19245
2025-10-26 10:59:20 +01:00
Daniel Stenberg
b602de775e
test776: set as 'flaky'
I have not figured out why, but having this test failing in CI every so often
is disturbing.

Reported-by: Viktor Szakatas
Fixes #19235
Closes #19243
2025-10-26 10:47:40 +01:00
Viktor Szakats
4f03e3fcbd
socks_gssapi: also reset buffer length after free
To mimic this behavior of the previously used `gss_release_buffer()`.

Some or all of these zero assignments may be redundant.

Follow-up to e7818999db #19018

Closes #19167
2025-10-26 01:52:41 +02:00
Viktor Szakats
18119eb916
ECH.md: make OpenSSL branch clone instructions work
Closes #19237
2025-10-26 01:19:12 +02:00
renovate[bot]
c59bf90186
GHA: update nghttp2/nghttp2 to v1.68.0
Closes #19238
2025-10-25 17:58:18 +02:00
Daniel Stenberg
6f36d58c25
RELEASE-NOTES: synced 2025-10-25 17:55:58 +02:00
Daniel Stenberg
3e12ed955b
schannel: lower the maximum allowed time to block to 7 seconds
During TLS renegotiation, the schannel_recv_renegotiate() function is
allowed to block for a short while. Reduce the maximum allowed time to
block from 10 minutes down to 7 seconds.

Closes #19205
2025-10-25 17:52:29 +02:00
Viktor Szakats
a3793ee7e3
GHA/windows: delete MSYS2 ARM64 workaround
Follow-up to 5249b99a70 #18438
Follow-up to c4e776cafa #17103

Closes #19234
2025-10-25 00:19:00 +02:00
renovate[bot]
af8c98a0f3
GHA: bump GitHub artifact Actions
- actions/download-artifact: v5.0.0 -> v6.0.0
- actions/upload-artifact: v4.6.2 -> v5.0.0

Closes #19232
2025-10-25 00:19:00 +02:00
Viktor Szakats
a13d811044
lib: delete unused header includes
`escape.h`, `getinfo.h`, `strdup.h`.

Tested OK with full non-unity CI run.

Closes #19231
2025-10-25 00:19:00 +02:00
Viktor Szakats
71d1eec675
tidy-up: miscellaneous
- cmake/Find*: make double quotes consistent.
- drop redundant parenthesis.
- GHA/checksrc: sync a step name with others.
- whitespace.

Closes #19233
2025-10-25 00:19:00 +02:00
Viktor Szakats
543b78652a
curl_ngtcp2: fix -Wunreachable-code with H3 !verbose !unity clang
Not tested in default CI.

macOS / CM clang OpenSSL gsasl rtmp AppleIDN SecTrust +examples,
macOS / CM llvm@18 OpenSSL gsasl rtmp AppleIDN SecTrust +examples:
```
lib/vquic/curl_ngtcp2.c:530:5: error: code will never be executed [-Werror,-Wunreachable-code]
  530 |     const ngtcp2_transport_params *rp;
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```
Ref: https://github.com/curl/curl/actions/runs/18787154442/job/53608230871?pr=19225#step:11:183

Confirmed fixed via #19225
Closes #19226
2025-10-24 22:53:26 +02:00
Viktor Szakats
3fc727751f
lib: delete unused crypto header includes
Tested OK with full non-unity CI run.

Closes #19225
2025-10-24 22:53:26 +02:00
Viktor Szakats
2b30d29c3c
autotools: merge ifs in GnuTLS/OpenSSL feature detection
Closes #19222
2025-10-24 22:53:26 +02:00
Viktor Szakats
833da09b53
vtls: drop duplicate CURL_SHA256_DIGEST_LENGTH definition
Closes #19224
2025-10-24 19:16:53 +02:00
Viktor Szakats
207a74206b
mbedtls: fix building with sha-256 missing from PSA
Fixing:
```
lib/vtls/mbedtls.c:1505:10: error: call to undeclared function 'Curl_sha256it'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 1505 |   return Curl_sha256it(sha256sum, input, inputlen);
      |          ^
1 error generated.
```

with mbedTLS configuration:
```
tf-psa-crypto/scripts/config.py unset PSA_WANT_ALG_SHA_256
tf-psa-crypto/scripts/config.py unset PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS
tf-psa-crypto/scripts/config.py unset MBEDTLS_LMS_C
```

Follow-up to 3a305831d1 #19077

Closes #19223
2025-10-24 19:14:28 +02:00
Viktor Szakats
f4293cd81e
GHA/dependabot: group updates
To avoid update spam and PR that can't be applied on top of each other.

Ref: #19217 #19218 #19219

Closes #19220
2025-10-24 15:05:15 +02:00
dependabot[bot]
e0d6ecdf01
GHA: bump pips
- cryptography from 46.0.2 to 46.0.3 in /tests
- filelock from 3.19.1 to 3.20.0 in /tests
- psutil from 7.1.0 to 7.1.1 in /tests

Closes #19217
Closes #19218
Closes #19219
2025-10-24 15:02:24 +02:00
Viktor Szakats
7d0261c228
GHA/checksrc: extend zizmor to Dependabot, set cooldown periods
Closes #19216
2025-10-24 14:01:04 +02:00
Viktor Szakats
87ab1cd255
GHA/fuzz: try fixing concurrency group deadlock
```
Fuzzer
Canceling since a deadlock was detected for concurrency group:
'Fuzzer-82fa9862dfa3083d4014d6dcfb721a7278e66f0b' between a top level workflow and 'Fuzzing'
```
https://github.com/curl/curl/actions/runs/18778617351

Follow-up to 82fa9862df #19215
2025-10-24 13:46:14 +02:00
Viktor Szakats
82fa9862df
GHA: set concurrency: where missing
To silence zizmor 1.16.0 warnings.

Also:
- http3-linux: replace hard-coded workflow name with variable.
  Follow-up to a8174176b5 #13841
- codeql: set `cancel-in-progress: true`.
  zizmor apparently does not allow `false` in pedantic mode anymore:
  https://github.com/zizmorcore/zizmor/pull/1227
- codeql: sync concurrency setting with the rest of the jobs.
  (I'm not sure this is correct, or why it was previously special-cased.)

Expressions used (before and after this patch):
- `group: ${{ github.workflow }}-${{ github.event.sha }}-${{ github.event.target_url }}`
  for GHA/appveyor-status.
- `group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}`
  for all the rest.

Ref: https://github.com/curl/curl/actions/runs/18776245057/job/53571438139?pr=19209

Closes #19215
2025-10-24 13:38:11 +02:00
Viktor Szakats
c96b7c4636
des: merge curl_des into curl_ntlm_core.c
`curl_des.c` contained a single, short, function
`Curl_des_set_odd_parity()`, called from `curl_ntlm_core.c` alone.

Move it there, and define it only when needed.

Follow-up to 300876a7a6
Follow-up to 8cc70db2db

Closes #19209
2025-10-24 12:39:27 +02:00
Viktor Szakats
4a6fbd5e1d
NTLM: disable if DES support missing from OpenSSL or mbedTLS
Make autotools and cmake detect DES support in OpenSSL and mbedTLS.
Forward feature macros to C and omit NTLM from the feature preview list.
Use the feature macros in source. This ensure that `-V` output matches
the preview.

OpenSSL doesn't support DES when built with `no-des` or `no-deprecated`.
mbedTLS 4.x no longer supports it, and it's possible to disable it in
<4 with `scripts/config.py unset MBEDTLS_DES_C`.

Before this patch this worked for
mbedTLS 4 only, and with a regression for pending PR #16973.

Also:

- drop NTLM feature check from `curl_setup.h` in favour of autotools/
  cmake feature macros. This makes `curl_setup.h` no longer need
  to include an mbedTLS header, which in turn makes tests/server build
  without depending on mbedTLS.
  Fixing, in #16973:
  ```
  In file included from tests/server/first.h:40,
                   from bld/tests/server/servers.c:3:
  lib/curl_setup.h:741:10: fatal error: mbedtls/version.h: No such file or directory
    741 | #include <mbedtls/version.h>
        |          ^~~~~~~~~~~~~~~~~~~
  ```
  Ref: https://github.com/curl/curl/actions/runs/18689537893/job/53291322012?pr=16973
  Ref: #19181 (initial fix idea)
  Follow-up to 3a305831d1 #19077

- move back mbedTLS header include and version check from
  `curl_setup.h` to each source which consumes mbedTLS.

- GHA/http3-linux: drop workaround that disabled NTLM for
  `no-deprecated` OpenSSL builds.
  Follow-up to 006977859d #12384

- curl_ntlm_core: drop pointless macro `CURL_NTLM_NOT_SUPPORTED`.
  Follow-up to 006977859d #12384

Closes #19206
2025-10-24 12:12:20 +02:00
Viktor Szakats
1de4a9a5fb
mbedtls: fix building with <3.6.1
```
lib/vtls/mbedtls.c:786:3: error: call to undeclared function 'mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  786 |   mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets(&backend->config,
      |   ^
lib/vtls/mbedtls.c:787:5: error: use of undeclared identifier 'MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_ENABLED'; did you mean 'MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH'?
  787 |     MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_ENABLED);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH
dep/mbedtls-3.4.0/_pkg/include/mbedtls/ssl.h:700:5: note: 'MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH' declared here
  700 |     MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH,
      |     ^
2 errors generated.
```

Regression from d63e40f8e6 #18271 (8.16.0)

Closes #19208
2025-10-24 12:12:20 +02:00
Daniel Stenberg
ab590ba62f
TODO: a fixed FTP directory listing format
Closes #19212
2025-10-24 11:21:48 +02:00
Daniel Stenberg
576f9f7c07
cfilters: check return code from Curl_pollset_set_out_only()
I added WARN_UNUSED_RESULT to two of the cfilter functions to make this
mistake harder to slip in next time.

Pointed out by CodeSonar

Closes #19211
2025-10-24 11:11:40 +02:00
Dalei
e51966d9df
tool_cfgable: remove superfluous free calls
Fixes #19213
Closes #19214
2025-10-24 11:05:43 +02:00
Daniel Stenberg
48d314f262
connect: for CONNECT_ONLY, CURLOPT_TIMEOUT does not apply
Since using CONNECT_ONLY is by defintion only a connect, we make the
timeleft function return 0 after the connection is done so that it does
not - surprisingly - timeout later.

Fixes #18991
Reported-by: Pavel P
Closes #19204
2025-10-23 22:53:15 +02:00
Daniel Stenberg
3692cd837e
schannel: replace a run-time condition with an assert
For detecting a bad function argument that probably also would cause a
compiler warning.

Closes #19203
2025-10-23 22:52:02 +02:00
Viktor Szakats
3ac38a6b80
md4: drop mbedtls implementation (not available in mbedtls v3+)
Follow-up to 01a2308236 #18254

Closes #19202
2025-10-23 16:47:19 +02:00
Daniel Stenberg
0d1d35fa34
http: only accept ';' as a separator for custom headers
When parsing incoming headers, they need to have a plain normal colon.

Previously out of convenience we used the same parser function for both
cases (incoming + custom set headers via the API) which made the
function too liberal for incoming HTTP traffic.

Closes #19200
2025-10-23 14:18:11 +02:00
Theo Buehler
2edce44065
vtls: remove call to PKCS12_PBE_add()
Curl is one of the last callers of PKCS12_PBE_add(). It has been a noop
since OpenSSL 0.9.8k (2006) stubbed it out when moving the built-in PBE
algorithms to a static table:
b8f702a0af

Closes #19201
2025-10-23 14:13:26 +02:00
Daniel Stenberg
9752d5fe0b
netrc: when the cached file is discarded, unmark it as loaded
Pointed out by ZeroPath

Closes #19199
2025-10-23 13:05:25 +02:00
Stefan Eissing
a330117bb0
smtp: fix EOB handling
SMTP automatically appends a \n.\n to an upload if there is not already
one at the end of the input. The implementation had a bug where this did
not happen, depending on read size and buffering.

Change test 900 to reproduce the failure. The bug only happened for mail
body input of known length, where EOS was known on the last chunk read.
Change test 900 to use an input file and make it large enough.

Fixes #18798
Closes #19193
Reported-by: madoe on github
2025-10-23 13:03:10 +02:00
Stefan Eissing
0a79a599a9
transfer: fix retry for empty downloads on reuse
When a reused connection did transfer 0 bytes, it assumed the transfer
had failed and needed a retry. Add a check for data->red.done, so we can
successfully accept the transfer of a 0-length file via SFTP.

Add test case 1583 to verfiy.

Fix SFTP disconnect debug trace when there was nothing to
disconnect (like when reusing a connection).

Fixes #19165
Reported-by: Alexander Blach
Closes #19189
2025-10-23 13:01:35 +02:00
Daniel Stenberg
a7ece53e96
test776: NTLM with too long NTMLv2 ntresplen 2025-10-23 10:20:16 +02:00
Daniel Stenberg
41e6b45edd
test775: verify NTLM with too long user name set 2025-10-23 10:20:16 +02:00
Daniel Stenberg
d922db880c
ntlm: improved error path on bad incoming NTLM TYPE3 message
No leaks

Reported-by: Tim Becker
Closes #19198
2025-10-23 10:19:51 +02:00
x2018
6032b8f2a2
vtls: unify the error handling in ssl_cf_connect().
Check preference at first, then init peer and do connect. Also fixes
CF_DATA_RESTORE.

Closes #19196
2025-10-23 08:23:44 +02:00
x2018
28ebaf86ce
cw-out: unify the error handling pattern in cw_out_do_write
to proper set the error status and release resource

Closes #19195
2025-10-23 08:17:55 +02:00
Daniel Stenberg
9e15b07638
openssl: only try engine/provider if a certificate file/name is provided
Bug: https://issues.oss-fuzz.com/issues/435278402

Closes #19197
2025-10-23 07:54:34 +02:00
Daniel Stenberg
d51d19bd06
ftp: remove the retr_size_saved struct field
It was basically a duplicate of data->req.size already

Closes #19194
2025-10-22 23:43:39 +02:00
Daniel Stenberg
a8f16da712
ftp: remove the state_saved struct field
It was not necessary. Its only purpose was to know if an upload is done,
and that information is already available elsewhere.

Closes #19192
2025-10-22 22:52:36 +02:00
Viktor Szakats
96717dea4c
GHA/labeler: add FindGnuTLS.cmake
Follow-up to 1966c86d71 #19163
Cherry-picked from #16973
2025-10-22 18:58:10 +02:00
Daniel Stenberg
4d93592a26
ftp: reduce size of some struct fields
Closes #19191
2025-10-22 15:55:05 +02:00
Daniel Stenberg
61156f7921
ftp: remove 'newhost' and 'newport' from the ftp_conn struct
They are only needed locally, no need to keep them around.

Closes #19190
2025-10-22 14:13:19 +02:00
Daniel Stenberg
fb6a4802d7
imap: parse and use UIDVALIDITY as a number
Instead of a string. Saves a malloc, adds earlier format check.

RFC 3501 section 2.3.1.1 documents the value as a 32-bit value.

Closes #19188
2025-10-22 14:12:07 +02:00
Stefan Eissing
bb78c45407
vquic: fix recvmsg loop for max_pkts
The parameter `max_pkts` was not checked in the recvmsg() implementation
of vquic_recv_packets() as the packter counter was never increased. This
led to the loop running until an EAGAIN was encountered. Which, in any
real case scenario, does no harm as long as libcurl is ingesting packets
faster than a server is able to send them.

However on a slow device and a fast network this could happen and allow
a denial of serice.

Not a real regression as the vulnerable code has never been released.
libcurl 8.16.0 does not have this bug.

Closes #19186
2025-10-22 11:40:47 +02:00
Stefan Eissing
fcae0733a7
gnutls: fix re-handshake comments
With GnuTLS, a GNUTLS_E_REHANDSHAKE can be a renegotiate in TLSv1.2 or a
key update in TLSv1.3. This had been made non-blocking in
a1850ad7de but the comment warning about a
blocking call was not updated.

Closes #19187
2025-10-22 11:40:00 +02:00
Stefan Eissing
9c313b61b4
ftp: check errors on remote ip for data connection
Obtaining the remote ip of the control connection to be used for the
data connection can fail. Check that and fail the transfer when that
does not work.

Triggered by an OSS-Fuzz issue.
Closes #19185
2025-10-22 10:58:21 +02:00
Daniel Stenberg
f8ba00fe9d
RELEASE-NOTES: synced 2025-10-22 09:55:34 +02:00
x2018
68e63a7997
curl_path: add curlx_dyn_free() on an error path
Follow-up to 976333dd40

Closes #19183
2025-10-22 09:37:54 +02:00
Daniel Stenberg
7295546447
hostip: fix infof() output for non-ipv6 builds using IPv6 address
Pointed out by ZeroPath

Closes #19184
2025-10-22 08:41:19 +02:00
x2018
7d5d0645e5
http: unify error handling in Curl_http()
Closes #19182
2025-10-21 23:19:39 +02:00
renovate[bot]
30734e48d6
Dockerfile: update debian:bookworm-slim Docker digest to 78d2f66
Closes #19173
2025-10-21 17:33:46 +02:00
Viktor Szakats
ea6455b7a4
spelling: subdirectories
Closes #19180
2025-10-21 17:18:35 +02:00
Viktor Szakats
09f857803f
INSTALL-CMAKE.md: add manual configuration examples
Closes #19179
2025-10-21 17:18:34 +02:00
Daniel Stenberg
48df7b29d9
cookie: only count accepted cookies in Curl_cookie_add
The counter used to stop accepting cookies after a certain amount has
been received in a single response would previously also count some
cookies that were not actually accepted as they were discarded after the
counter was increased.

Starting now, the counter is increased only for cookies that were
accepted.

Pointed out by ZeroPath
Closes #19157
2025-10-21 16:33:32 +02:00
Stefan Eissing
40f7cd2bdd
mime: fix unpausing of readers
When unpausing a transfer, check if the reader pause state differs
in addition to the "keepon" flags.

Reported-by: 包布丁
Fixes #18848
Closes #19178
2025-10-21 16:30:47 +02:00
Daniel Stenberg
76d2852550
hmac: free memory properly on errors
If one of the hmac init calls fail, Curl_HMAC_init previously would
return without first freeing the allocated HMAC_context.

Fixes #19176
Reported-by: WangDaLei on github
Closes #19177
2025-10-21 16:24:21 +02:00
Viktor Szakats
38c19edd67
cmake: say 'absolute path' in option descriptions and docs
To not have to guess. Also to sync with autotools, which already uses
this wording.

Also:
- replace the stray term 'folder' with 'directory' for consistency.
- store help text in a temp variable to avoid overly long strings
  (mandatory in CMake <4.2.0 and can't be trivially split), also
  to avoid repeating this string 4 times.

Ref: https://cmake.org/cmake/help/v4.2/command/set.html

Closes #19169
2025-10-21 15:07:36 +02:00
Viktor Szakats
1966c86d71
cmake: add and use local FindGnuTLS module
Replacing a combination of custom logic in the main script and relying
on CMake's built-in Find module, with code and behavior used for
the rest of dependencies.

Also to:
- add version detection in the non-pkg-config path.
- make `GNUTLS_INCLUDE_DIR` and `GNUTLS_LIBRARY` take precedence over
  pkg-config. As with other dependencies.
- document the above two configuration options.
- prepare for #16973, which originally introduced this local Find
  module.

The local module is doing largely the same as CMake's built-in
FindGnuTLS. Differences:
- honors `CURL_USE_PKGCONFIG`.
- returns GnuTLS version for non-pkg-config detection.
- consistently returns `GNUTLS_VERSION`.
  (CMake's built-in uses s different name in <3.16.)
- CMake 3.16+ returns an imported target. curl supports 3.7,
  therefore we may only use it conditionally, which isn't worth it.

Cherry-picked from #16973

Closes #19163
2025-10-21 14:37:40 +02:00
Daniel Stenberg
9e198618de
tool_parsecfg: detect and error on recursive --config use
The config file parser now has a maximum level of inclusions allowed (5)
to detect and prevent recursive inclusions of itself leading to badness.

Bonus: clean up return code handling from the config parser.

Test 774 verifies
Closes #19168
2025-10-21 10:11:43 +02:00
Viktor Szakats
b4f57c8045
cmake: inline linter instructions
To avoid it applying to all the rest of the script.

Follow-up to b761eb5add #17576

Closes #19172
2025-10-21 01:53:35 +02:00
Viktor Szakats
1afdb65b55
INSTALL-CMAKE.md: fix descriptions for LDAP dependency options
After introducing the local FindLDAP module, these options work the same
way as with other dependencies.

Follow-up to 49f2a23d50 #15273

Closes #19170
2025-10-21 01:08:05 +02:00
Viktor Szakats
921ff01263
cmake: two minor tidy-ups
- flatten an if tree.
- fix a typo in comment.

Closes #19171
2025-10-21 01:08:04 +02:00
Stefan Eissing
dbff3eec45
cf-socket: give information when unable to open socket
Give ERRNO explanation in a failf() when unable to open a socket.
Helps in finding out what the issue preventing your curl to work
really is. Just had a wrong ulimit after a sys update.

Closes #19158
2025-10-20 15:21:47 +02:00
Stefan Eissing
4be9db7bc8
http: accept duplicate location with same value
When a server sends a Location: header repeat with the same location,
ignore the repeats silently.

Follow-up to 9596c4a258
Closes #19159
2025-10-20 14:48:20 +02:00
Viktor Szakats
e7818999db
socks_gssapi: replace gss_release_buffer() with curl free for buffers owned by libcurl
Before this patch, this code used to call `gss_release_buffer()` on
objects with buffers allocated via curl's allocator.
`gss_release_buffer()` calls system (or Win32) free on these buffers,
which may mismatch with curl's allocator. To fix it, align these calls
with the pattern used in vauth modules, by replacing
`gss_release_buffer()` with curl free to release the buffers.

Use `Curl_safefree()` to set the freed pointer to NULL, as
`gss_release_buffer()` did.

Also: use object length var when allocating.

Reported-by: Joshua Rogers

Closes #19018
2025-10-20 14:23:46 +02:00
Viktor Szakats
ccec2fae1b
GHA/curl-for-win: drop libssh
Switch back to default libssh2.

The distribution server has reliability issues (this time it works
locally though):
```
++ curl [...] --output pkg.bin https://www.libssh.org/files/0.11/libssh-0.11.3.tar.xz --output pkg.sig https://www.libssh.org/files/0.11/libssh-0.11.3.tar.xz.asc
curl: (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2) [4x]
```
Ref: https://github.com/curl/curl/actions/runs/18651134321/job/53169147048#step:3:2391

There is also no official mirror that I know of.

Ref: af8e1aa4b0 #18257

Closes #19162
2025-10-20 14:22:14 +02:00
Viktor Szakats
a041bf6ca2
Makefile.example: make default options more likely to work
- replace default libpaths with more common ones.
- drop Solaris network libs.

Closes #19161
2025-10-20 13:52:58 +02:00
Viktor Szakats
97dd1da8d0
Makefile.example: bump default example from FTP to HTTPS
To have a chance to work out of the box, securely. (assuming a TLS
backend with CA certs setup.)

Closes #19160
2025-10-20 13:22:17 +02:00
Daniel Stenberg
1876ed6296
cf-socket: make set_local_ip void, and remove failf()
No callers of this function checked the return code, meaning failures
are not lethal == using failf was wrong, and it can just as well return
void.

Closes #19137
2025-10-20 10:57:48 +02:00
Daniel Stenberg
d2af9c9a08
INSTALL.md: add another OS (Azure Sphere)
Closes #19155
2025-10-20 10:32:08 +02:00
Daniel Stenberg
104299195e
curl_get_line: the final return cannot be reached
Follow-up to 769ccb4d42

Pointed out by CodeSonar
Closes #19154
2025-10-20 10:30:36 +02:00
Daniel Stenberg
9596c4a258
http: return error for a second Location: header
Unless it is identical to the previous one.

Follow-up to dbcaa00657

Adjusted test 580, added test 772 and 773

Fixes #19130
Reported-by: Jakub Stasiak
Closes #19134
2025-10-20 09:35:23 +02:00
Daniel Stenberg
cbd7823fd1
RELEASE-NOTES: fix typo 2025-10-20 09:09:50 +02:00
Daniel Stenberg
f21d70e76c
HTTP3: clarify the status for "old" OpenSSL, not current
Closes #19153
2025-10-20 09:07:12 +02:00
Daniel Stenberg
b5cdfcf8e2
RELEASE-NOTES: synced 2025-10-20 08:53:49 +02:00
Daniel Stenberg
0bb25cdbb7
curl_easy_setopt.md: add missing CURLOPT_POSTFIELDS
It was mistakenly removed in 8dab7465a5 (shipped in 8.9.0)

Also fix test 1139 which should have detected this but didn't due to a
bad regex check.

Reported-by: Jonathan Cardoso
Fixes #19151
Closes #119152
2025-10-20 08:50:02 +02:00
Viktor Szakats
3986149c04
GHA/windows: delete remains of Perl Win32-Process* caching
Follow-up to c8d6643df2 #19083
2025-10-20 00:25:23 +02:00
Daniel Stenberg
c21655e7ff
tool_filetime: cap crazy filetimes instead of erroring
Also cap the minimum allowed timestamp now.

Closes #19147
2025-10-20 00:00:12 +02:00
Daniel Stenberg
8504c41e2c
tool_cb_rea: use poll instead of select if available
- poll doesn't have the FD_SETSIZE problem

- select: if socket >= FD_SETSIZE, skip the call

Closes #19143
2025-10-19 23:59:37 +02:00
Daniel Stenberg
00cb679c04
openssl: remove dead code
A condition in infof_certstack() would always equal true after a
previous change.

Follow-up to e2a4de8a60

Pointed out by Coverity
Closes #19142
2025-10-19 23:48:28 +02:00
Daniel Stenberg
d3b2ba92c7
rustls: exit on error
In init_config_builder_verifier() the call to
rustls_root_cert_store_builder_build() set result on failure but did not
return.

Pointed out by ZeroPath
Closes #19125
2025-10-19 23:47:47 +02:00
Daniel Stenberg
4c636b2dc1
tool_operate: return error on strdup() failure
In src/tool_operate.c inside the Windows safe-search branch (#ifdef
CURL_CA_SEARCH_SAFE), the code assigns config->cacert = strdup(cacert);
at line 2076 without checking whether strdup returned NULL.

This would allow the code to continue with the wrong value set, causing
possible confusion.

Pointed out by ZeroPath
Closes #19145
2025-10-19 23:47:00 +02:00
Daniel Stenberg
7f19fa9819
lib: add asserts that hostname has content
For all network related protocols there must be a non-blank hostname
used. This change adds a few asserts in some places to make debug/tests
catch mistakes if any such would slip in.

Closes #19146
2025-10-19 23:45:28 +02:00
Yedaya Katsman
55e0526566
openssl: fix unable do typo in failf() calls
Closes #19149
2025-10-19 23:42:54 +02:00
Viktor Szakats
d8a7aad061
GHA/windows: drop git config core.autocrlf input steps
CI works without it now. For an inexplicable reason, this single `git`
command took 9 seconds per job, making this patch save more than
2 minutes per workflow run. It was also the only step using PowerShell.

Closes #19150
2025-10-19 23:00:50 +02:00
Daniel Stenberg
976333dd40
curl_path: make sure just whitespace is illegal
This function could previously accidentally return true and a NULL path
if only whitespace was provided as argument.

Also, make it stricter and do not allow CR or LF within the string.

Use more strparse parsing.

Drop the comment saying this is from OpenSSH as it has now been
rewritten since then.

Closes #19141
2025-10-19 16:26:01 +02:00
Daniel Stenberg
769ccb4d42
curl_get_line: enhance the API
To make sure callers can properly differentiate between errors and know
cleanly when EOF happens. Updated all users and unit test 3200.

Triggered by a remark by ZeroPath

Closes #19140
2025-10-19 16:25:11 +02:00
Daniel Stenberg
990a23bb97
libssh: return the proper error for readdir problems
The code would return without setting sshc->actualcode or returning the
CURLcode error.

Reported by ZeroPath
Closes #19135
2025-10-19 14:28:55 +02:00
Viktor Szakats
026498df43
mod_curltest: tidy-ups and small fixes
- honor request id (`id=<number>`) in `curltest/put` and
  `curltest/sslinfo` handlers.
- do not truncate `max_upload` input parameter.
- delete unused variables.
- formatting.

Inspired by Joshua's report on tests.

Closes #19061
2025-10-19 13:46:59 +02:00
Daniel Stenberg
fffc16dd9c
smtp: return value ignored
Return value from Curl_client_write was overwritten by
smtp_perform_command making errors ignored.

Pointed out by ZeroPath

Closes #19136
2025-10-19 13:17:31 +02:00
Viktor Szakats
f6334f379d
examples: replace casts with curl_off_t printf masks
Follow-up to e4ec666a3d #19112

Closes #19133
2025-10-19 13:16:32 +02:00
Daniel Stenberg
8d302ec936
socks: avoid UAF risk in error path
The code obtained a pointer resp via Curl_bufq_peek(), but called
Curl_bufq_skip() before it would access them in the failf() call.

The Curl_bufq_skip() call can trigger prune_head which may free or
recycle the chunk that resp points into.

Pointed out by ZeroPath
Closes #19139
2025-10-19 13:13:15 +02:00
Jochen Sprickerhof
f03e7c1d64
openldap: fix limit max incoming size test logic
Use LDAP_OPT_SUCCESS for ldap_get_option, as done in the other calls.
ber_sockbuf_ctrl returns 1 on success so reverse the logic.

Follow-up to f91be14bfb
Closes #19138
2025-10-19 13:12:07 +02:00
Daniel Stenberg
6550dd0f3d
wolfssl: clear variable to avoid uninitialized use
Pointed out by ZeroPath
Closes #19126
2025-10-19 11:08:14 +02:00
Tatsuhiro Tsujikawa
e0798466a8
ngtcp2: adopt ngtcp2_conn_get_stream_user_data if available
Adopt ngtcp2_conn_get_stream_user_data which has been available since
ngtcp2 v1.17.0. This improves the time complexity of searching
h3_stream_ctx from O(n) to O(1) where n is the number of stream.

Closes #19132
2025-10-19 11:07:32 +02:00
Joshua Rogers
66e3ff5d0e schannel: fix memory leak
- Do not leak memory on failed setting algorithm cipher list.

Discovered by ZeroPath.


- Do not free backend->cred after failed AcquireCredentialsHandle.

backend->cred is always freed later, during cleanup.


Closes https://github.com/curl/curl/pull/19118
2025-10-19 02:23:36 -04:00
Viktor Szakats
e779650a86
GHA/curl-for-win: update container image envs
Follow-up to 1f31ff06ad

Closes #19129
2025-10-19 01:30:19 +02:00
JimFuller-RedHat
e4ec666a3d
examples/chkspeed: portable printing when outputting curl_off_t values
Closes #19112
2025-10-18 23:26:15 +02:00
Daniel Stenberg
0217aca9f3
lib: remove newlines from failf() calls
Closes #19124
2025-10-18 23:17:54 +02:00
Daniel Stenberg
ea1eaa6f7c
tool_paramhlp: remove outdated comment in str2tls_max()
The function does not take positive number as input. It takes TLS
version strings.

Pointed out by ZeroPath
Closes #19115
2025-10-18 23:17:16 +02:00
Joshua Rogers
023e453032
openldap: do not pass newline to infof()
Discovered by ZeroPath
Closes #19120
2025-10-18 22:30:55 +02:00
Joshua Rogers
c567b37548
src/var: remove dead code
Discovered by ZeroPath
Closes #19119
2025-10-18 22:19:47 +02:00
Joshua Rogers
9021e42c02
ldap: do not pass a \n to failf()
Discovered by ZeroPath
Closes #19122
2025-10-18 22:16:33 +02:00
Joshua Rogers
bff9679a01
schannel_verify: do not call infof with an appended \n
Discovered by ZeroPath
Closes #19123
2025-10-18 22:15:26 +02:00
Viktor Szakats
a000444cb0
cmake: fix Linux pre-fill HAVE_POSIX_STRERROR_R (when _CURL_PREFILL=ON)
It depends on C library.

Follow-up to f30f1307c1 #19116
2025-10-18 14:30:43 +02:00
Viktor Szakats
f30f1307c1
cmake: fix Linux pre-fills for non-glibc (when _CURL_PREFILL=ON)
- do not pre-fill `HAVE_LINUX_TCP_H` on Linux.
  `linux/tcp.h` is a Linux kernel userspace header. It's likely
  installed when using glibc and likely missing by default when using
  something else, e.g. MUSL (e.g. on Alpine).

  Therefore always detect it for Linux targets, and only pre-fill it for
  non-Linux ones.

- do not pre-fill `HAVE_GLIBC_STRERROR_R` on Linux.
  To fix it for non-glibc envs, e.g. MUSL (e.g. on Alpine).

Note, the pre-fill option is a disabled by default, internal option and
strongly not recommended outside of curl development.

Closes #19116
2025-10-18 13:53:30 +02:00
Daniel Stenberg
8de898414c
openssl: free UI_METHOD on exit path
In providercheck(), when failing to open the "store", the exit path
would not previously free the created UI_METHOD and instead leak this
resource.

Pointed out by ZeroPath

Closes #19114
2025-10-18 12:54:19 +02:00
Daniel Stenberg
f847d2ed02
tool_formparse: rewrite the headers file parser
The -F option allows users to provide a file with a set of headers for a
specific formpost section. This code used old handcrafted parsing logic
that potentially could do wrong.

Rewrite to use my_get_line() and dynbuf. Supports longer lines and
should be more solid parsing code.

Gets somewhat complicated by the (unwise) feature that allows "folding"
of header lines in the file: if a line starts with a space it should be
appended to the previous.

The previous code trimmed spurious CR characters wherever they would
occur in a line but this version does not. It does not seem like
something we want or that users would expect.

Test 646 uses this feature.
Closes #19113
2025-10-18 12:49:53 +02:00
Viktor Szakats
f32451c12b
curlx: promote Curl_fseeko() to curlx_fseek(), use it in src
- tool_formparse: replace truncated `fseek` with `curlx_fseek`.
- tool_operate: replace truncated `fseek` with `curlx_fseek`.
- tool_paramhlp: replace local duplicate `myfseek`, with `curlx_fseek`.

Follow-up to 4fb12f2891 #19100

Closes #19107
2025-10-18 02:25:10 +02:00
Daniel Stenberg
b9b8a7a5df
openssl: fix resource leak in provider error path
Pointed out by ZeroPath

Closes #19111
2025-10-18 00:40:13 +02:00
Daniel Stenberg
3087511b0f
RELEASE-NOTES: synced 2025-10-17 23:39:16 +02:00
Daniel Stenberg
c921f6d052
wolfssl: fix resource leak in verify_pinned error paths
Pointed out by ZeroPath

Closes #19110
2025-10-17 23:34:04 +02:00
Daniel Stenberg
e29706d6e2
mbedtls: move the crypto init into the vtls init function
Follow-up to 3a305831d1

Closes #19108
2025-10-17 23:33:12 +02:00
Daniel Stenberg
d6c39cd2cb
curl.h: remove incorrect comment about CURLOPT_PINNEDPUBLICKEY
Bug: https://curl.se/mail/lib-2025-10/0018.html
Reported-by: curl.stunt430
Closes #19105
2025-10-17 22:23:12 +02:00
Daniel Stenberg
480ff0cf58
INSTALL: update the list of known operating systems
curl has run on

Closes #19106
2025-10-17 22:19:38 +02:00
Viktor Szakats
87b72b8182
krb5: fix output_token allocators in the GSS debug stub (Windows)
Before this patch system `malloc()`/`free()` were used to allocate
the buffer returned in the `output_token` object from the debug stub
of `gss_init_sec_context()` when enabled via `CURL_STUB_GSS_CREDS` in
debug-enabled libcurl builds. This object is later released via stock
`gss_release_buffer()`, which, in the Windows builds of MIT Kerberos,
doesn't use the system `free()`, but the Win32 `HeapFree()`.

Fix it by using the GSS alloc/free macros: `gssalloc_malloc()` and
`gssalloc_free()` from `gssapi_alloc.h`.

To make this work without MIT Kerberos feature detection, use a canary
macro to detect a version which installs `gssapi_alloc.h` for Windows.
For <1.15 (2016-11-30) releases, that do not install it, disable the GSS
debug stub in libcurl.

Strictly speaking, non-Windows builds would also need to use GSS
allocators, but, detecting support for `gssapi_alloc.h` is impossible
without build-level logic. Built-level logic is complex and overkill,
and MIT Kerberos, as of 1.22.1, uses standard malloc/free on
non-Windows platforms anyway. (except in GSS debug builds.)

Follow-up to 73840836a5 #17752

Closes #19064
2025-10-17 17:47:22 +02:00
Daniel Stenberg
25eb34dd3e
KNOWN_BUGS: SOCKS-SSPI discards the security context
Also make the verbose log say it

Pointed out by ZeroPath

Closes #19103
2025-10-17 17:45:06 +02:00
Daniel Stenberg
e9455ea523
rustls: make read_file_into not reject good files
For files with sizes using an exact multiple of 256 bytes, the final
successful read(s) filled the buffer(s) and the subsequent fread
returned 0 for EOF, which caused read_file_into to fail.

Now, it needs to return 0 and not be EOF to be an error.

Follow-up to dd95a49d49

Pointed out by ZeroPath
Closes #19104
2025-10-17 17:44:14 +02:00
Viktor Szakats
373855a4da
GHA/curl-for-win: add minimal Linux build
A bit more minimal build than the one used for trurl. To stress test
a build with most features disabled.

Costs 40 seconds, of which 6 is the build, rest is installing tools.

Ref: 5b385001d5
Ref: 3ee10692c7

Follow-up to 5af2457848 #17818

Closes #17961
2025-10-17 17:27:12 +02:00
Stefan Eissing
5cefb455d4
quic: improve UDP GRO receives
Closes #19101
2025-10-17 17:23:46 +02:00
Stefan Eissing
1d01d4975f
socks_sspi: use the correct free function
When freeing buffers allocated by SSPI, use its own function, not free().

Reported-by: Joshua Rogers
Closes #19046
2025-10-17 16:59:11 +02:00
Viktor Szakats
14e4d9c3c7
setopt: fix unused variable warning in minimal build
Found via: #17961

Closes #19102
2025-10-17 16:19:42 +02:00
renovate[bot]
74147acd17
GHA: update dependency ruff to v0.14.1
Closes #19085
2025-10-17 16:19:42 +02:00
Daniel Stenberg
4fb12f2891
mime: fix use of fseek()
Avoid the possible 64-bit offset truncation when used on systems with
small 'long', like Windows.

bonus: make mime_open_file() return bool

Pointed out by ZeroPath
Closes #19100
2025-10-17 16:13:35 +02:00
Daniel Stenberg
c0564ceb3a
cf-socket: if FD_CLOEXEC fails on accepted socket, cleanup
Follow-up to 9d7b532404

Pointed out by ZeroPath

Closes #19098
2025-10-17 16:12:34 +02:00
Daniel Stenberg
fbff1d5b90
openssl: avoid overwriting 'result' after error
Follow-up to eefd03c572

Pointed out by ZeroPath https://zeropath.com/
Closes #19099
2025-10-17 15:48:47 +02:00
Daniel Stenberg
6296b9d383
tool_ipfs: simplify the ipfs gateway logic
- make sure memory allocated by libcurl is freed with curl_free()

- drop the ensure_trailing_slash complexity

Closes #19097
2025-10-17 15:47:36 +02:00
renovate[bot]
9568109f71
GHA: update ngtcp2/ngtcp2 to v1.17.0
Closes #19092
2025-10-17 14:25:09 +02:00
Daniel Stenberg
3df71e6dc2
openssl: fail if more than MAX_ALLOWED_CERT_AMOUNT certs
Detect and prevent abuse or mistakes. Limit set to 100.

Closes #19091
2025-10-17 13:36:57 +02:00
Stefan Eissing
f221cdeabe
ngtcp2: add a comment explaining write result handling
The choice to continue processing incoming data although the
writeout of the headers/data failed is not obvious. Add a comment
explaining why this is done.

Closes #19093
2025-10-17 13:36:21 +02:00
Stefan Eissing
2719aa36b5
test_16: adjust timing expectations
In MOST protocols and runs, the 'pretransfer' time is less than the
'starttransfer'. E.g. request being sent before response comes in.

However, when curl is starved of cpu a server response might start
streaming in before the multi-state transitioned to DID (and recorded
the 'pretransfer' time).

Do no longer check that 'pretransfer' is less or equal 'starttransfer'.
Check that is is less or equal to the total time instead.

Closes #19096
2025-10-17 13:35:35 +02:00
Daniel Stenberg
e2a4de8a60
openssl: better return code checks when logging cert data
Pointed out by ZeroPath

Closes #19094
2025-10-17 12:41:04 +02:00
Daniel Stenberg
c4db9eb491
rustls: limit snprintf proper in cr_keylog_log_cb()
It should limit the size to the size of the target array, not the
incoming data.

Pointed out by ZeroPath
Closes #19095
2025-10-17 12:38:36 +02:00
Viktor Szakats
3a305831d1
mbedtls: add support for 4.0.0
After this patch libcurl requires (as already documented)
the `curl_global_init()` call when using the `curl_formadd()` API with
mbedTLS.

Note: NTLM is not supported with mbedTLS 4+, because it lacks
the necessary crypto primitive: DES.

Also:
- lib: de-dupe mbedTLS minimum version checks into `curl_setup.h`.
- lib: initialize PSA Crypto as part of `curl_global_init()`.
  For MD5, SHA-256, `curl_formadd()`, and MultiSSL builds with mbedTLS
  but where mbedTLS isn't the default backend.
- lib1308: fix to call `curl_global_init()` (for the Form API).
- curl_ntlm_core: disable with mbedTLS 4+.
- md4: disable mbedTLS implementation when building against 4.x.
- md5: use mbedTLS PSA Crypto API when available, otherwise use
  the default local implementation.
- sha256: use mbedTLS PSA Crypto API when available, otherwise use
  the default local implementation.
- vtls/mbedtls: drop PSA Crypto initialization in favor of
  `curl_global_init()`.
- vtls/mbedtls: use PSA Crypto random API with all mbedTLS versions.
- vtls/mbedtls: do the same for the SHA-256 callback.
- autotools: detect mbedTLS 4+, and disable NTLM for 3.x.
- cmake: disable NTLM for mbedTLS 3.x.
- GHA/linux: keep building mbedTLS 3.x manually and use it in
  an existing job, while also enabling pytest in it.
- GHA/linux: bump to mbedTLS 4.0.0.
  Closes #19075
  Closes #19074

Refs:
https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-4.0.0
https://github.com/Mbed-TLS/mbedtls/blob/mbedtls-4.0.0/docs/4.0-migration-guide.md
https://github.com/Mbed-TLS/mbedtls/blob/mbedtls-4.0.0/tf-psa-crypto/docs/1.0-migration-guide.md [404]
https://github.com/Mbed-TLS/TF-PSA-Crypto/blob/tf-psa-crypto-1.0.0/docs/1.0-migration-guide.md
https://github.com/Mbed-TLS/TF-PSA-Crypto/blob/tf-psa-crypto-1.0.0/docs/psa-transition.md
627f727bbe/docs/4.0-migration-guide

Closes #19077
2025-10-17 11:50:48 +02:00
Daniel Stenberg
7e12139719
imap: treat capabilities case insensitively
Reported-by: Joshua Rogers
Fixes #19089
Closes #19090
2025-10-17 10:40:37 +02:00
Daniel Stenberg
f5f4710a26
examples/websocket: fix use of uninitialized rlen
Pointed out by ZeroPath

Closes #19088
2025-10-17 10:15:07 +02:00
Daniel Stenberg
f91be14bfb
openldap: limit max incoming size
Set the maximum allowed size of an incoming LDAP message, which to
OpenLDAP means that it allows malloc() up to this size. If not set,
there is no limit and we instead risk a malloc() failure.

The limit is arbitrarily set to 256K as I can't figure out what a
reasonable value should be.

OpenLDAP docs: https://openldap.org/software/man.cgi?query=lber-sockbuf&apropos=0&sektion=0&manpath=OpenLDAP+2.6-Release&arch=default&format=html

Bug: https://issues.oss-fuzz.com/issues/432441303
Closes #19087
2025-10-16 22:23:37 +02:00
Viktor Szakats
da06621d61
firefox-db2pem.sh: add macOS support, tidy-ups
Cherry-picked from #19076
Closes #19086
2025-10-16 20:53:28 +02:00
Viktor Szakats
c8aaa5d2f2
scripts: pass -- before passing xargs
Also:
- GHA/checkdocs: escape `.` in -E regex expression.

Closes #19076
2025-10-16 20:45:28 +02:00
Viktor Szakats
3c0604bba4
GHA: sync up curl -V step descriptions
Also to make it easier to recognize.

Also:
- GHA/linux-old: split steps to match other jobs.
- GHA: add `--disable` where missing.

Closes #19084
2025-10-16 20:18:25 +02:00
Viktor Szakats
c8d6643df2
GHA/windows: stop installing Perl Win32-Process* modules
It's complex and did not help stabilizing CI runs.

Hard to say, but I'm suspicious it's related to the CI errors
-1073741502, 0xC0000142, seen in the 'build examples' and
'disk space used' steps.

Ref: #18526
Reverts 52775a7fb4 #18296
Closes #19083
2025-10-16 18:53:44 +02:00
Viktor Szakats
800b0bec18
GHA: bump LibreSSL to 4.2.0
Also move back URLs to GitHub, sources are available there again.

Ref: https://github.com/libressl/portable/releases/tag/v4.2.0
Ref: https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-4.2.0-relnotes.txt
Ref: #19050
Ref: #19081

Closes #19082
2025-10-16 16:51:08 +02:00
Viktor Szakats
1a81a8e478
version: add GSS backend name and version
MIT Kerberos version detection is implemented for autotools and cmake.

Examples:
```
curl 8.17.0-DEV (x86_64-pc-linux-gnu) ... mbedTLS/3.6.4 libidn2/2.3.7 nghttp2/1.59.0 libgss/1.0.4 OpenLDAP/2.6.7
curl 8.17.0-DEV (x86_64-pc-linux-gnu) ... LibreSSL/4.1.1 libidn2/2.3.7 nghttp2/1.59.0 mit-krb5/1.20.1 OpenLDAP/2.6.7
curl 8.17.0-DEV (x86_64-pc-linux-gnu) ... LibreSSL/4.1.1 libidn2/2.3.7 nghttp2/1.59.0 mit-krb5 OpenLDAP/2.6.7
curl 8.17.0-DEV (x86_64-pc-linux-gnu) ... LibreSSL/4.1.1 nghttp2/1.59.0 mit-krb5/1.20.1 OpenLDAP/2.6.7
curl 8.17.0-DEV (aarch64e-apple-darwin24.6.0) ... GnuTLS/3.8.10 libidn2/2.3.8 libssh2/1.11.1 nghttp2/1.67.1 mit-krb5/1.22.1
```

Also:
- cmake/FindGSS: strip project name ("Kerberos 5 release") from
  the version string when detected via `krb5-config`.

Closes #19073
2025-10-16 16:19:05 +02:00
Viktor Szakats
9c36eace60
autotools: drop detection of ancient OpenSSL libs RSAglue and rsaref
Closes #19078
2025-10-16 16:19:05 +02:00
Stefan Eissing
c37ed9a11e
apple sectrust: add to features
It should be visible in the feature list that libcurl is build with
Apple SecTrust enabled.

Closes #19057
2025-10-16 10:58:45 +02:00
Daniel Stenberg
79553fb7c6
RELEASE-NOTES: synced 2025-10-16 09:01:17 +02:00
Daniel Stenberg
71d5525113
connect: remove redundant condition in shutdown start
Pointed out by CodeSonar

Closes #19079
2025-10-16 08:56:16 +02:00
Daniel Stenberg
f8cd64e3ab
urldata: make redirect counter 16 bit
Instead of long (up to 64-bit) as the maximum allowed value set since
b059f7deaf is 0x7fff. Saves 2 or 6 bytes.

Closes #19072
2025-10-15 12:34:33 +02:00
Daniel Stenberg
b7f2355b8b
urldata: make 'retrycount' a single byte
Since it only counts up to 5

Closes #19071
2025-10-15 12:33:03 +02:00
Daniel Stenberg
62961d6cc5
lib: stop NULL-checking conn->passwd and ->user
They always point to a string. The string might be zero length.

Closes #19059
2025-10-15 10:44:51 +02:00
Emre Çalışkan
5e46318414
transfer: reset retry count on each request
Reported-by: plv1313 on github
Fixes #18926
Closes #19066
2025-10-15 10:39:31 +02:00
Stefan Eissing
182a5a9aae
quic: remove data_idle handling
The transfer loop used to check the socket and if no poll events
were seen, triggered a "DATA_IDLE" event into the filters to let
them schedule times/do things anyway.

Since we no longer check the socket, the filters have been called
already and the DATA_IDLE event is unnecessary work. Remove it.

Closes #19060
2025-10-15 10:36:43 +02:00
Daniel Stenberg
be852e39b2
tftp: check for trailing ";mode=" in URL without strstr
RFC 3617 defines two specific modes, "netascii" and "octet". This code
now checks only for those trailing ones - and not in the hostname since
they can't be there anymore.

Assisted-by: Jay Satiro
Closes #19070
2025-10-15 09:59:57 +02:00
Daniel Stenberg
5ac3541cb4
ftp: replace strstr() in ;type= handling
Since it needs to be a trailing piece of the path avoiding strstr() is
faster and more reliable.

Also stopped checking the host name since it cannot actually be there
since quite a long while back. The URL parser doesn't allow such a
hostname.

Moved the check into its own subfunction too.

Closes #19069
2025-10-15 09:19:23 +02:00
Daniel Stenberg
ae5fb4188d
lib: reduce use of data->conn->
If there are more than two of them in a function, use a local 'conn'
variable instead.

Closes #19063
2025-10-15 08:03:29 +02:00
Daniel Stenberg
9441127394
http: look for trailing 'type=' in ftp:// without strstr
- it could find a wrong string
- this is faster

Closes #19065
2025-10-15 08:02:44 +02:00
Jay Satiro
97ae9ec8ef ws: fix type conversion check
- Fix logic that checks whether a size_t will fit in a curl_off_t.

Reported-by: Viktor Szakats

Fixes https://github.com/curl/curl/issues/19017
Closes https://github.com/curl/curl/pull/19036
2025-10-14 11:06:49 -04:00
Jay Satiro
fe06127ded tool_operate: retry on HTTP response codes 522 and 524
- Treat HTTP response codes 522 and 524 as a transient error since
  Cloudflare may use them instead of 504 to signal timeout.

For example here is a 522 error message from Cloudflare:

"The initial connection between Cloudflare's network and the origin web
server timed out. As a result, the web page can not be displayed."

Prior to this change the curl tool did not retry on HTTP response codes
522 and 524 when --retry was used.

Fixes https://github.com/curl/curl/discussions/16143
Closes https://github.com/curl/curl/pull/19011
2025-10-14 11:06:24 -04:00
Viktor Szakats
64ed2ea196
examples: check more errors, fix cleanups, scope variables
Inspired by Joshua's report on examples.

Closes #19055
2025-10-14 16:33:00 +02:00
Daniel Stenberg
61dcb56743
openldap: explain a const removing typecast
Closes #19056
2025-10-14 16:25:34 +02:00
Stefan Eissing
1ea99afdc7
scorecard: add perf support on linux
When calling scorecard with --flame to produce a flamegraph, use
"perf" on linux platforms to do the measurements. Update the scorecard
documentation about it.

Closes #19058
2025-10-14 16:24:35 +02:00
Viktor Szakats
4c7507daf9
examples: improve global init, error checks and returning errors
- add `curl_global_init()` and `curl_global_cleanup()` where missing.
- check the result of `curl_global_init()` where missing.
- return the last curl error from `main()`.
- drop Win32-specific socket initialization in favor of `curl_global_init()`.
- rename some outliers to `res` for curl result code.
- fix cleanup in some error cases.

Inspired by Joshua's report on examples.

Closes #19053
2025-10-13 23:02:05 +02:00
Viktor Szakats
3049c8e0a0
examples: return curl_easy_perform() results
Where missing. Or explicitly `(void)` it where we ignore it on purpose.

Reported-by: Joshua Rogers (for `sepheaders.c`)

Closes #19052
2025-10-13 17:58:30 +02:00
Viktor Szakats
5cf0a6789d
examples: call curl_global_cleanup() where missing
Reported-by: Joshua Rogers (for `sepheaders.c`)

Closes #19051
2025-10-13 17:52:06 +02:00
Viktor Szakats
497b3f022e
checksrc: allow disabling warnings on FIXME/TODO comments
Follow-up to 71ace9f3c1

Closes #19048
2025-10-13 16:11:10 +02:00
Daniel Stenberg
6deea19eb4
RELEASE-NOTES: synced 2025-10-13 16:03:46 +02:00
Daniel Stenberg
f1828b5404
libssh2: avoid risking using an uninitialized local struct field
Reported-by: Joshua Rogers
Closes #19043
2025-10-13 12:29:13 +02:00
Daniel Stenberg
6d0fcdf2ed
libssh: catch a resume point larger than the size
As it would otherwise trigger broken math

Reported-by: Joshua Rogers
Closes #19044
2025-10-13 12:27:39 +02:00
Viktor Szakats
5e74b2df34
REUSE: move copyright headers to .checksrc
To make it simpler to move them around, create and delete them without
syncing with `REUSE.toml`.

Also:
- checksrc: allow empty lines in `.checksrc`.
- comment on why curl printfs are disallowed in examples.

Closes #19024
2025-10-13 11:54:22 +02:00
Daniel Stenberg
dee72fe31e
libssh2: fix EAGAIN return in ssh_state_auth_agent
Reported-by: Joshua Rogers
Closes #19042
2025-10-13 10:46:42 +02:00
Daniel Stenberg
e003c0b259
socks_sspi: remove the enforced mode clearing
Reported-by: Joshua Rogers
Closes #19040
2025-10-13 10:41:42 +02:00
Daniel Stenberg
67c4256f7e
pop3: function could get the ->transfer field wrong
In pop3_perform(), pop3->transfer was derived from the old
data->req.no_body. Then, pop3_perform_command() re-computed
data->req.no_body.

Now we instead call pop3_perform_command() first.

Reported-by: Joshua Rogers
Closes #19039
2025-10-13 10:40:48 +02:00
Daniel Stenberg
27375ca364
tool_getparam: make --fail and --fail-with-body override each other
This allows users to put one of them in their .curlrc and still easily
use the other one at will in command lines.

The --no-* versions disable both of them.

Reported-by: Mitchell Blank Jr
Fixes #19029
Closes #19034
2025-10-13 10:38:10 +02:00
Daniel Stenberg
56450ce26f
tool_msgs: make errorf() show if --show-error
Assisted-by: Mitchell Blank Jr
Ref: #19029
Closes #19035
2025-10-13 08:56:14 +02:00
Daniel Stenberg
cde85412d0
KNOWN_BUGS: We do not support auth-int for Digest using PUT or POST
Closes #19038
2025-10-13 08:55:32 +02:00
Daniel Stenberg
e90b2aaa7e
tftp: error requests for blank filenames
Reported-by: Joshua Rogers
Closes #19033
2025-10-12 15:37:07 +02:00
Daniel Stenberg
1feeda422e
examples/synctime: fix null termination assumptions
bonus: dont parse argv[0] for options

Reported-by: Joshua Rogers
Closes #19032
2025-10-12 15:35:57 +02:00
Daniel Stenberg
1e90a63a49
sws: pass in socket reference to allow function to close it
The function service_connection() now passes in a reference to the
socket instead of by value since the sub function http_connect() might
close it and set *infdp = CURL_SOCKET_BAD. This would previously not be
detected when service_connection() returned and potentially cause a
double close of the socket.

Reported-by: Joshua Rogers

Closes #19031
2025-10-12 15:35:14 +02:00
Daniel Stenberg
578706adde
libssh/libssh2: reject quote command lines with too much data
If there is lingering letters left on the right side after the paths
have been parsed, they are syntactically incorrect so returning error is
the safe thing to do.

Reported-by: Harry Sintonen
Closes #19030
2025-10-12 15:34:27 +02:00
Daniel Stenberg
2b49d17cba
docs: expand on quoting rules for file names in SFTP quote
Reported-by: Harry Sintonen
Closes #19025
2025-10-12 15:33:21 +02:00
Stefan Eissing
6e35eb4879
lib: SSL connection reuse
Protocol handlers not flagging PROTOPT_SSL that allow reuse of existing
SSL connections now need to carry the flag PROTOPT_SSL_REUSE.

Add PROTOPT_SSL_REUSE to imap, ldap, pop3, smtp and ftp.

Add tests the http: urls do not reuse https: connections and vice versa.

Reported-by: Sakthi SK
Fixes #19006
Closes #19007
2025-10-12 15:30:12 +02:00
Stefan Eissing
dd7762c309
libssh2: use sockindex consistently
Although the protocol should only run on index 0, there was a mix of
looked up sockindex and using constant 0 in tls send/recv.

Reported-by: Joshua Rogers
Closes #19004
2025-10-12 15:28:04 +02:00
Stefan Eissing
44429da2e1
smb: transfer debugassert to real check
That also works for non-debug builds.

Reported-by: Joshua Rogers
Cloes #19003
2025-10-12 15:27:05 +02:00
Daniel Stenberg
d03a6b79b4
lib1514: fix return code mixup
Reported-by: Joshua Rogers
Closes #19027
2025-10-12 10:36:18 +02:00
Daniel Stenberg
1648f23ed3
socksd: remove --bindonly mention, there is no such option
Reported-by: Joshua Rogers
Closes #19026
2025-10-12 10:33:38 +02:00
Daniel Stenberg
b3f9c837d3
asyn-ares: remove wrong comment about the callback argument
Both the c-ares documentation and the c-ares source code contradict the
previous comment (and mentions/contains no such restriction).

Ref: #19001
Closes #19014
2025-10-12 10:30:54 +02:00
Daniel Stenberg
142d61a0ee
doswin: CloseHandle the thread on shutdown
As this is in the tool shutdown the impact of it was nothing.

Also, move two global variables to local.

Follow-up to 9a2663322c

Reported-by: Joshua Rogers
Closes #18996
2025-10-12 10:29:22 +02:00
Daniel Stenberg
66753bc120
RELEASE-NOTES: synced 2025-10-11 15:44:10 +02:00
Viktor Szakats
b419f1fd87
examples/log_failed_transfers: make it build for WinCE
- include `windows.h` after `winsock2.h` via `curl/curl.h`.
- avoid `errno` for WinCE.
- avoid `_vscprintf` for WinCE.

Ref: 4535532ed3 #18843
Follow-up to 0780de2625 #18668
Closes #19016
2025-10-11 01:04:24 +02:00
Viktor Szakats
16f0d4ae3a
curl_threads: delete WinCE fallback branch
Both WinCE and Windows use `CreateThread()` now, so the use of
`GetLastError()` works for both.

Follow-up to 03448f477a #18998
Follow-up to 1c49f2f26d #18451
Follow-up to af0216251b #1589

Closes #19015
2025-10-11 01:04:24 +02:00
Viktor Szakats
f04e7a7efa
cmake: pre-fill three more type sizes on Windows
Use `CMAKE_SIZEOF_VOID_P` to fill the size of three types that differ
on 32 and 64-bit Windows: `curl_socket_t`, `size_t`, and on mingw-w64:
`ssize_t`.

`time_t` remains the only type needing detection at configuration time,
with MSVC or mingw-w64.

Ref: https://cmake.org/cmake/help/v4.1/variable/CMAKE_SIZEOF_VOID_P.html

Closes #19013
2025-10-11 01:04:24 +02:00
Viktor Szakats
6e9246aeb3
cmake/FindGSS: simplify/de-dupe lib setup
- lib name is always `gss` with GNU GSS.
- move lib name assigments to the detection blocks.

Closes #19012
2025-10-11 01:04:23 +02:00
Patrick Monnerat
67c75b6712
os400: document threads handling in code.
This is to clarify threads unavaibility check and handling for security
bug busters unaware of OS400 specificities.

Fixes #18967
Closes #19009
2025-10-10 23:58:48 +02:00
Stefan Eissing
05fbe85e62
c-ares: when resolving failed, persist error
Repeated calls to `Curl_async_is_resolved()` after a failure
returned OK and not the error that was the result of the resolve
fail.

Reported-by: Joshua Rogers
Closes #18999
2025-10-10 23:49:27 +02:00
Stefan Eissing
03448f477a
thread: errno on thread creation
When thread creation fails, the code uses `errno` to remember the cause.
But pthread_create() never sets errno and gives the error as return value.
Fix that by setting the return value into errno on failure.

Windows: I think the ifdef was the wrong way around. Also set a generic
Windows Error code on CE systems.

Reported-by: Joshua Rogers
Closes #18998
2025-10-10 23:48:11 +02:00
Stefan Eissing
bf41be6292
conn: fix hostname move on connection reuse
When reusing a connection, the `host` and `conn_to_host` hostname
structs are moved from the template connection onto the existing one.

There was a NULLing of a tempplate member missing in `conn_to_host`
which could then lead to a double free.

Make this struct move into a static function, doing the correct
thing for both `struct hostname` in a connection.

Reported-by: Joshua Rogers
Closes #18995
2025-10-10 23:45:58 +02:00
Stefan Eissing
9d7b532404
cf-socket: set FD_CLOEXEC on all sockets opened
Removed TODO item

Reported-by: Joshua Rogers
Closes #18968
2025-10-10 23:44:43 +02:00
Stefan Eissing
a4d3c4e847
ws: fix some edge cases
Fix edge cases around handling of pending send frames and encoding
frames with size_t/curl_off_t possible flowy things.

Reported-by: Joshua Rogers
Closes #18965
2025-10-10 23:42:29 +02:00
Stefan Eissing
4cc476b37f
gnutls: check conversion of peer cert chain
Check the result when converting the peer certificate chain
into gnutls internal x590 data structure for errors.

Reported-by: Joshua Rogers
Closes #18964
2025-10-10 23:41:31 +02:00
Stefan Eissing
7fecc009ea
socks: advance iobuf instead of reset
During the SOCKS connect phase, the `iobuf` is used to receive repsonses
from the server. If the server sends more bytes than expected, the code
discarded them silently.

Fix this by advancing the iobuf only with the length consumed.

Reported-by: Joshua Rogers

Closes #18938
2025-10-10 23:40:12 +02:00
Viktor Szakats
aeacf9a3e8
cmake/FindGSS: dedupe pkg-config module strings
Closes #18994
2025-10-10 19:47:08 +02:00
Viktor Szakats
05aa61fb3d
cmake/FindGSS: drop wrong header check for GNU GSS
GNU GSS offers `gss.h`; do not check for `gssapi.h`. `gssapi.h`
was originally published by Heimdal, and later MIT Kerberos also added it
for Heimdal compatibility.

Closes #18993
2025-10-10 19:47:08 +02:00
Viktor Szakats
0855f30709
kerberos: bump minimum to 1.3 (2003-07-08), drop legacy logic
Previous minimum was: 1.2.4 (2002-02-28)

- assume `gssapi/gssapi.h` header for MIT Kerberos.

  Drop logic detecting this header, and drop alternate logic including
  a bare "gssapi.h". Bare `gssapi.h` is Heimdal-specific. MIT Kerberos
  added support for it for Heimdal compatibility on 2006-11-09,
  redirecting to `gssapi/gssapi.h`. MIT Kerberos supported the latter
  header in the 1990s already.

  Ref: 40e1a016f9 (2008-03-06)
  Ref: d119352001 (2006-11-09)

- configure.ac: stop using `HAVE_GSSAPI_GSSAPI_H`.

  Added in 2010 to support "ancient distros such as RHEL-3" where
  `gssapi/gssapi_krb5.h` did not include `gssapi/gssapi.h`.

  MIT Kerberos includes it since commit:
  d9e959edfa (2003-03-06)
  Released in 1.3 (2003-07-08).

  Bump minimum required version to avoid this issue.

  Reverts cca192e58f (2010-04-16)

Ref: https://web.mit.edu/kerberos/dist/historic.html
Ref: https://sources.debian.org/src/krb5/

Closes #18992
2025-10-10 19:47:08 +02:00
Viktor Szakats
fc9b215fde
CI.md: refresh
Closes #18973
2025-10-10 19:47:08 +02:00
Viktor Szakats
9442dd480e
GHA/linux: test GNU GSS with autotools, cmake, valgrind and scan-build
The cmake build is running runtests with valgrind. The autotools one is
running scan-build.

Also:
- ignore two memleaks with GNU GSS detected by valgrind.
- add comment on support status of `GSS_C_DELEG_POLICY_FLAG`.

Closes #19008
2025-10-10 17:33:17 +02:00
Viktor Szakats
e5950b2d37
kerberos: stop including gssapi/gssapi_generic.h
It's a legacy MIT Kerberos header that's no longer used by curl since:
355bf01c82 (2015-01-09)

There were still mentions of it after this patch, when using versions
<1.2.3, but those versions aren't supported since:
9918541795 (2008-06-12)

This header remains in use by autotools and cmake to detect MIT Kerberos
(vs. Heimdal, which doesn't have it.)

Ref: https://github.com/curl/curl/pull/18978#issuecomment-3387414995

Closes #18990
2025-10-10 13:59:19 +02:00
Daniel Stenberg
c049c37acd
libssh: make atime and mtime cap the timestamp instead of wrap
The libssh API uses a 32 bit type for datestamp, so instead of just
force-typecast it, make sure it gets capped at UINT_MAX if the value is
larger.

Reported-by: Joshua Rogers
Closes #18989
2025-10-10 08:26:00 +02:00
Daniel Stenberg
69efbcaa03
ldap: avoid null ptr deref on failure
ldap_get_dn() can return NULL on error

Reported-by: Joshua Rogers
Closes #18988
2025-10-10 08:24:45 +02:00
Viktor Szakats
0d560d00fa
kerberos: drop logic for MIT Kerberos <1.2.3 (pre-2002) versions
curl requires 1.2.4 or newer.

Also:
- vms: stop defining `gss_nt_service_name`. Added in
  f9cf3de70b, symbol not used in curl code
  since 355bf01c82.

Closes #18978
2025-10-10 02:07:45 +02:00
Daniel Stenberg
be5a5c10d4
openldap: fix memory-leak on oldap_do's exit path
On SSL sockbuf setup failure in `oldap_do`, the 'lud' data would not be
freed and instead leak.

Reported-by: Joshua Rogers
Closes #18986
2025-10-09 23:28:00 +02:00
Daniel Stenberg
d35bdfa8f2
openldap: fix memory-leak in error path
The 'ber' pointer could escape a free if an early error occurred.

Reported-by: Joshua Rogers
Closes #18985
2025-10-09 23:27:08 +02:00
Daniel Stenberg
6c0338115a
ftp: simplify the 150/126 size scanner
The file size is weirdly returned in a 150 or 126 response as "XXX
bytes" mentioned somewhere in the response string. This is a rewrite of
the size scanner to replace the strange strstr() + backwards search from
before with a plain forward search until '[number] + " bytes"' is a
match.

Triggered by a report by Joshua Rogers about the previous parser.

Closes #18984
2025-10-09 23:26:30 +02:00
Daniel Stenberg
eb3a4314fe
RELEASE-NOTES: synced 2025-10-09 22:10:32 +02:00
Daniel Stenberg
71585f9894
asyn-ares: use the duped hostname pointer for all calls
In one c-ares call the passed in pointer was used and not the new
duplicated one. This is probably fine but might as well use the new
pointer as all the other calls do, which will survive longer.

Reported-by: Joshua Rogers
Closes #18980
2025-10-09 22:03:59 +02:00
Daniel Stenberg
435da1f849
Curl_resolv: fix comment. 'entry' argument is not optional
Reported-by: Joshua Rogers
Closes #18979
2025-10-09 22:03:19 +02:00
Daniel Stenberg
2c6505e0ef
krb5_gssapi: fix memory leak on error path
If a non-compliant amount of bytes is received, the function would
return error without free.

Reported-by: Joshua Rogers
Closes #18976
2025-10-09 22:02:16 +02:00
Daniel Stenberg
2a2a2e5d10
vauth/digest: improve the digest parser
Previously, if for example the nonce would end with "realm=" etc it
would get the wrong piece, due to the naive parser.

Reported-by: Joshua Rogers
Closes #18975
2025-10-09 22:01:29 +02:00
Daniel Stenberg
1e6d507de7
schannel_verify: fix mem-leak in Curl_verify_host
Reported-by: Stanislav Fort
Closes #18972
2025-10-09 21:55:28 +02:00
Jay Satiro
0780de2625 examples: add an example for logging failed transfers
- Add an example that demonstrates per-transfer verbose logging to
  memory.

The transfer's log is written to disk only if the transfer fails.

Closes https://github.com/curl/curl/pull/18668
2025-10-09 14:40:09 -04:00
Jay Satiro
e7247d8697 tool_operate: keep failed partial download for retry auto-resume
- Keep data from a failed download instead of discarding it on retry in
  some limited cases when we know it's ok (currently only HTTP 200/206).

Prior to this change on failed transfer the tool truncated any outfile
data written before retrying the transfer. This change adds an exception
for HTTP downloads when the user requested auto-resume, because in that
case we can keep the outfile data and resume from the new position.

Reported-by: tkzv@users.noreply.github.com

Fixes https://github.com/curl/curl/issues/18035
Closes https://github.com/curl/curl/pull/18665
2025-10-09 14:39:27 -04:00
Stefan Eissing
d1d5855689
openssl: add comments regarding OCSP verification
To allow future reviewers of "security" reports to more easily find out
why code is this way.

Closes #18962
2025-10-09 14:44:28 +02:00
Stefan Eissing
9e2c582d6c
memdup0: handle edge case
When length is already SIZE_MAX, fail without allocating.

Reported-by: Joshua Rogers
Closes #18966
2025-10-09 14:43:56 +02:00
Stefan Eissing
83bed97ad8
rustls: pass the correct result to rustls_failf
Reported-by: Joshua Rogers
Closes #18961
2025-10-09 14:43:14 +02:00
Viktor Szakats
801ebf1e1a
GHA: rename config files to match pyspelling
To make it more obvious what needs to be looked at when pyspelling is
reporting an issue.

Follow-up to 95e50ad694 #18756
Closes #18974
2025-10-09 14:17:32 +02:00
Viktor Szakats
92ee917368
examples: update .gitignore
Follow-up to f6f62933e9 #18264
Closes #18971
2025-10-09 12:59:46 +02:00
Viktor Szakats
e78185625f
examples: allow vsnprintf again
Ref: https://github.com/curl/curl/pull/18668#issuecomment-3383422410
Follow-up to b12da22db1 #18866
Closes #18970
2025-10-09 12:59:46 +02:00
Viktor Szakats
56c892af1f
examples/sessioninfo: do not disable security
Also make it return the curl result code.

Follow-up to df70a68984 #18909
Closes #18969
2025-10-09 12:59:46 +02:00
Daniel Stenberg
b0db5f12b1
hostip: don't store negative resolves due unrelated errors
Like for:

- OOM
- resolver_start() returns error
- DoH has problems

Fixes #18953
Fixes #18954
Reported-by: Joshua Rogers
Closes #18958
2025-10-09 10:50:56 +02:00
Daniel Stenberg
7ab9018ea7
mk-lib1521: verify the setopt options that accept -1 2025-10-09 10:42:40 +02:00
Daniel Stenberg
29d0a308b4
setopt: allow CURLOPT_DNS_CACHE_TIMEOUT set to -1
It is documented as valid. Regression from commit b059f7deaf shipped in
8.16.0

Reported-by: Andrei Kurushin
Fixes #18959
Closes #18960
2025-10-09 10:42:35 +02:00
Daniel Stenberg
5d32c4fc7b
test1582: verify the TLS channel binding cert memory leak fix 2025-10-09 09:10:56 +02:00
Daniel Stenberg
1ce6dff01a
openssl: fix peer certificate leak in channel binding
Reported-by: Stanislav Fort
Bug: https://hackerone.com/reports/3373640
Closes #18917
2025-10-09 09:10:37 +02:00
Stefan Eissing
f609b57389
http2: ingress handling edge cases
Fix some edge cases around the `data_max_bytes` handling when
processing ingress.

Reported-by: Joshua Rogers
Closes #18933
2025-10-09 08:43:34 +02:00
Stefan Eissing
44a79d4f7a
http2: cleanup pushed newhandle on fail
When nghttp2_session_set_stream_user_data() fails, clean up the
new handle.

Reported-by: Joshua Rogers
Closes #18931
2025-10-09 08:42:49 +02:00
Stefan Eissing
93e91e965e
http2: check push header names by length first
Reported-by: Joshua Rogers
Closes #18930
2025-10-09 08:41:20 +02:00
Joshua Rogers
dae19dd94a
libssh2/sftp: fix resume corruption by avoiding O_APPEND with rresume
Opening the remote file with O_APPEND while attempting to resume causes
all writes to be forced to EOF on servers/implementations where O_APPEND
semantics override a prior seek(). As a result, sftp_seek64() is ignored
and the resumed data is appended, duplicating/corrupting the file.

Fix by:
- Using O_WRONLY (without O_APPEND) when resume_from > 0.
- Skipping the seek entirely if remote_append mode is requested.

Closes #18952
2025-10-09 08:30:23 +02:00
Joshua Rogers
391e3fbeec
libssh/sftp: fix resume corruption by avoiding O_APPEND with rresume
Opening the remote file with O_APPEND while attempting to resume causes
all writes to be forced to EOF on servers/implementations where O_APPEND
semantics override a prior seek(). As a result, sftp_seek64() is ignored
and the resumed data is appended, duplicating/corrupting the file.

Fix by:
- Using O_WRONLY (without O_APPEND) when resume_from > 0.
- Skipping the seek entirely if remote_append mode is requested.

Closes #18952
2025-10-09 08:30:09 +02:00
Stefan Eissing
c0a279a8e9
socks: deny server basic-auth if not configured
When the server proposes BASIC authentication and curl does
not have that configured, fail right away.

Reported-by: Joshua Rogers
Closes #18937
2025-10-09 08:28:42 +02:00
Stefan Eissing
0b4a704500
vquic: sending non-gso packets fix for EAGAIN
The function returned OK on EAGAIN and not the correct code.

Reported-by: Joshua Rogers
Closes #18936
2025-10-09 08:27:23 +02:00
Stefan Eissing
cc7b12347b
quiche: handle tls fail correctly
quiche receive may report a TLS failure after a verified handshake. That
needs to lead to a transfer receive error.

Reported-by: Joshua Rogers
Closes #18934
2025-10-09 08:26:39 +02:00
Viktor Szakats
8be9a26451
build: drop Heimdal support, update docs, replace with MIT Kerberos in CI
The kerberos5 library Heimdal is one of three GSS libraries curl support.
It has a memory leak triggered by the new test in #18917 and the project
seems mostly abandoned.

Drop support and steer users to the MIT krb5 or GNU GSS libraries.

Co-authored-by: Daniel Stenberg

Ref: #18928
Closes #18928
Closes #18932
2025-10-09 02:27:29 +02:00
Viktor Szakats
cd7b45a3bb
cmake/FindGSS: whitespace/formatting
Sync format more with the rest of the Find modules.

Cherry-picked from #18932
Closes #18957
2025-10-09 01:52:04 +02:00
Viktor Szakats
9fe8ba5c27
GHA/linux-old: sync terminology with other jobs [ci skip]
Cherry-picked from #18932
2025-10-09 01:21:05 +02:00
Viktor Szakats
7c021fd14a
cmake: minor Heimdal flavour detection fix
Do not detect Heimdal if a single `H` character appears in the vendor
string, require the full name: `Heimdal`.

Cherry-picked from #18932
Closes #18951
2025-10-09 01:15:04 +02:00
Daniel Stenberg
d58b6009df
RELEASE-NOTES: synced 2025-10-08 23:35:37 +02:00
Daniel Stenberg
e4645c86b5
CURLOPT_COOKIEFILE.md: clarify when the cookies are loaded
Closes #18924
2025-10-08 23:19:34 +02:00
Daniel Stenberg
008078fc38
http: make Content-Length parser more WHATWG
Return error if there is something after the number other than
whitespace and newline.

Allow comma separated numbers and repeated headers as long as the new value is
the same as was set before.

Add test 767 to 771 to verify.

Reported-by: Ignat Loskutov
Fixes #18921
Closes #18925
2025-10-08 23:18:38 +02:00
Stefan Eissing
0f02744c41
apple sectrust: check correct result on old OS versions
On ancient Apple OS versions where SecTrustEvaluateWithError() is not
available, the deprected SecTrustEvaluate() is used. In that code
branch, the code checked the wong variable for the verified result.

Closes #18929
2025-10-08 23:16:50 +02:00
Stefan Eissing
ca789e09b5
wolfssl: no double get_error() detail
Code was calling wolfSSL_get_error() on code that it had
already retrieved with the same function. Remove that.

Reported-by: Joshua Rogers
Closes #18940
2025-10-08 23:15:07 +02:00
Viktor Szakats
1f11224232
cmake/FindGSS: fix pkg-config fallback logic for CMake <3.16
The documented `<prefix>_<moduleName>_VERSION` variables are empty in
all tested versions since 3.7.2 to 4.1.2. Stop using it as a fallback
for <3.16 versions, and replace with the undocumented, but working,
`FindPkgConfig` internal variable `_pkg_check_modules_pkg_name`. It
contains the module name which was found.

In practice it caused that with CMake <3.16 + `pkg-config`, curl always
detected the Heimdal flavor of GSS.

Also: Delete a fallback version detection method, which was already
marked with a question mark in comments, and used the same, always
empty, CMake variables.

Ref: https://cmake.org/cmake/help/v4.1/module/FindPkgConfig.html
Bug: https://github.com/curl/curl/pull/18932#issuecomment-3381807070

Closes #18950
2025-10-08 19:59:12 +02:00
Viktor Szakats
bbce304c0b
GHA/linux-old: dump logs on configure failure
As done in other jobs, but here tailored to old cmake.

The logs generated by ancient CMake aren't super useful though.

Cherry-picked from #18932
Closes #18948
2025-10-08 16:10:40 +02:00
dependabot[bot]
29093f0ee8
GHA: bump dependencies
- cryptography from 44.0.1 to 46.0.2 in tests/http
- ruff from 0.13.2 to 0.14.0 in .github/scripts
- reuse from 6.0.0 to 6.1.2 in .github/scripts
- github/codeql-action from 3.30.5 to 4.30.7

Closes #18941
Closes #18942
Closes #18943
Closes #18945
Closes #18947
2025-10-08 16:07:58 +02:00
Viktor Szakats
c951fe7e6d
GHA/dependabot: tweak dir list to avoid a dupe, rename .txt file to avoid the bot
It correctly picked all pips, but also picked
`tests/http/requirements.txt` twice and also
`.github/scripts/codespell-ignore.txt`. Try avoid these issues with this
patch.

Follow-up to 6a31e3137a #18939

Closes #18946
2025-10-08 14:58:32 +02:00
Viktor Szakats
6a31e3137a
GHA/dependabot: find more pip deps, tweak commit prefix
Before this patch the Dependabot updater was only picking up
`tests/requirements.txt`:
https://github.com/curl/curl/network/updates/26616523/jobs

Also prefix commit messages with `GHA:`.

Bug: https://github.com/curl/curl/pull/18761#issuecomment-3381147189
Follow-up to b04137c1c6 #18761

Closes #18939
2025-10-08 14:46:00 +02:00
Viktor Szakats
3800a26582
GHA/checksrc: also run on .md file changes
To avoid missing e.g. codespell issue when updating Markdown files only,
as in 82fd9edb0e #18927

Follow-up to 0b54ce6ffc

Closes #18935
2025-10-08 14:33:57 +02:00
Viktor Szakats
0b54ce6ffc
INSTALL-CMAKE.md: fix typo in prev
Not caught in original PR. Fixing it in CI separately.

Follow-up 82fd9edb0e #18927
2025-10-08 13:40:40 +02:00
Viktor Szakats
82fd9edb0e
INSTALL-CMAKE.md: document useful build targets
Closes #18927
2025-10-08 12:53:49 +02:00
Viktor Szakats
ab761794c1
tests/server: drop pointless memory allocation overrides
The code was overriding system memory allocation functions to a local
jump table (declared in `curl_setup.h`). And setup that jump table
to call the original system allocation functions.

Also tested fine with cegcc/WinCE. The `_strdup` fallback was possibly
required for an MSVC WinCE toolchain.

Closes #18922
2025-10-08 12:53:49 +02:00
Joshua Rogers
38ab421f60
h3/ngtcp2: close just-opened QUIC stream when submit_request fails
Closes #18904
2025-10-07 23:59:06 +02:00
Joshua Rogers
4e77388a0b
h3/nghttp3: return NGHTTP3_ERR_CALLBACK_FAILURE from recv_header
Closes #18904
2025-10-07 23:59:00 +02:00
Joshua Rogers
4bfd7a9615
openssl: skip session resumption when verifystatus is set
Resumed TLS sessions skip OCSP stapled-response verification.
Force a full handshake so verifystatus() runs.

Closes #18902
2025-10-07 23:56:25 +02:00
Viktor Szakats
1103ccb73e
examples/sessioninfo: cast printf string mask length to int
Found via `-Wformat-signedness`:
```
docs/examples/sessioninfo.c: In function 'wrfu':
docs/examples/sessioninfo.c:75:53: error: field precision specifier '.*' expects argument of type 'int', but argument 4 has type 'unsigned int' [-Werror=format=]
  fprintf(stderr, "Certificate #%u: %.*s", i, dn.size, dn.data);
                                      ^
```
Ref: https://github.com/curl/curl/actions/runs/18320729052/job/52172864438?pr=18343#step:13:30
Ref: https://github.com/curl/curl/actions/runs/18320729095/job/52172886899?pr=18343#step:19:27

Also:
- drop unnecessary parenthesis.
- scope variables.

Ref: #18343
Closes #18918
2025-10-07 21:01:45 +02:00
Viktor Szakats
9f52458e7d
notify: use 'notify' in public header and docs
Closes #18915
2025-10-07 19:11:31 +02:00
Viktor Szakats
df70a68984
cmake: support building some complicated examples, build them in CI
Build these examples when the necessary dependencies are present:
- cacertinmem, usercertinmem (OpenSSL/fork)
- multi-uv (libuv)
- multithread, threaded-ssl (pthread)
- sessioninfo (GnuTLS)

Indicate the necessary dependency via a `Required:` comment placed in
the source file. A single dependency per source is supported as of now.
The name of the dependency should match the variable used within
the cmake scripts, which in turn matches the macro used in the config
header. E.g. for GnuTLS it's `USE_GNUTLS`.

Also:
- GHA/macos: build examples in two job to test GnuTLS and pthread ones.
- GHA/linux: enable libuv to test it with examples.

Follow-up to 6bb7714032 #18914
Closes #18909
2025-10-07 19:09:02 +02:00
Stefan Eissing
88a1ab511c
ngtcp2: fix handling of blocked stream data
The stream blocking might not be the one of the current easy handle.
Look up the stream to be marked as blocking via its stream_id in the
internal hash. Theoretically, this does not have to be one of the h3
streams, so not finding it is not an error.

Fixes #18905
Reported-by: Joshua Rogers
Closes #18906
2025-10-07 17:24:01 +02:00
Stefan Eissing
0d573969de
osslq: set out idle timeout to 0
Similar to our ngtcp2 backend, set our idle timeout for the connection
to 0, meaning we have no such timeout from our side. The effective idle
timeout is then the one announced by the peer.

Closes #18907
2025-10-07 17:23:24 +02:00
Daniel Stenberg
352d1dc6ab
CURLMOPT_NOTIFYFUNCTION.md: minor language polish
- mention the possibility of new types in the future
- s/a an/an

Closes #18913
2025-10-07 17:20:05 +02:00
Daniel Stenberg
496802fdcf
multi: use CURLMNOTIFY_ as notification id prefix
Since CURLM_ is already used as prefix for multi error codes, it makes
it easier to detect and understand the difference between identifiers -
and allows for scripts on the website and elsewhere to separate them
properly.

Follow-up to 53be8166b2
Closes #18912
2025-10-07 17:18:05 +02:00
Viktor Szakats
6bb7714032
examples: fix build issues in 'complicated' examples
- cacertinmem: build cleanly with BoringSSL/AWS-LC.
- cacertinmem: silence `-Wcast-function-type-strict`.
- multi-uv: fix callback prototypes.
- multithread, threaded-ssl: do not pass const as thread arg.
- sessioninfo: fix suppressing deprecated feature warning.
- usercertinmem: sync formatting with cacertinmem.

Follow-up to 4a6bdd5899 #18908
Cherry-picked from #18909
Closes #18914
2025-10-07 17:15:10 +02:00
Stefan Eissing
53be8166b2
multi: notify rename, remove the last stragglers
in the public API.

Follow-up to 357808f4ad

Closes #18910
2025-10-07 14:54:49 +02:00
Viktor Szakats
7ddbde4f73
cmake: build the "all" examples source list dynamically
To allow building conditional examples, and to simplify by avoiding
cmake-version dependent code.

Follow-up to fe5225b5ea #18209
Cherry-picked from #18909
Closes #18911
2025-10-07 14:37:20 +02:00
Stefan Eissing
089afd78cb
socks: handle premature close
When expecting to receive a number of bytes during socks connect,
treat an early connection close as error.

Reported-by: Joshua Rogers
Closes #18883
2025-10-07 13:14:50 +02:00
Viktor Szakats
4a6bdd5899
examples/usercertinmem: avoid stripping const
This API started accepting a const somewhere between OpenSSL 1.0.2b and
1.0.2t. It means this example, like the other similar one now works best
with those versions or newer:
```
docs/examples/usercertinmem.c💯33: error: cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual]
  100 |   bio = BIO_new_mem_buf((char *)mypem, -1);
      |                                 ^
docs/examples/usercertinmem.c:121:34: error: cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual]
  121 |   kbio = BIO_new_mem_buf((char *)mykey, -1);
      |                                  ^
```

Closes #18908
2025-10-07 13:12:24 +02:00
Joshua Rogers
783df22e59
vquic/ngtcp2: compare idle timeout in ms to avoid overflow
Closes #18903
2025-10-07 12:06:32 +02:00
Joshua Rogers
0061b2bfaa
vquic: fix idle-timeout checks (ngtcp2 ms<-->ns), 64-bit log & honor 0=no-timeout (osslquic)
Closes #18903
2025-10-07 12:06:26 +02:00
Stefan Eissing
357808f4ad
multi: add notifications API
Add infrastructure to colled and dispatch notifications for transfers
and the multi handle in general. Applications can register a callback
and en-/disable notification type the are interested in.

Without a callback installed, notifications are not collected. Same when
a notification type has not been enabled.

Memory allocation failures on adding notifications lead to a general
multi failure state and result in CURLM_OUT_OF_MEMORY returned from
curl_multi_perform() and curl_multi_socket*() invocations.

Closes #18432
2025-10-07 10:55:31 +02:00
Stefan Eissing
f4e83a0adc
ngtcp2: fix returns when TLS verify failed
In both send/recv functions of the ngtcp2 filter, when TLS verification
has failed, jump out by skipping ingress/egress handling.

Reported-by: Joshua Rogers
Closes #18881
2025-10-07 09:04:31 +02:00
Daniel Stenberg
752090b963
examples/synctime: make the sscanf not overflow the local buffer
If the incoming Date: header has a funky format.

Bonus: remove bad null terminator assumptions for header

Reported-by: Stanislav Fort

Closes #18890
2025-10-07 00:23:54 +02:00
Daniel Stenberg
5e3725a7af
RELEASE-NOTES: synced 2025-10-06 23:59:33 +02:00
Daniel Stenberg
33380fa214
telnet: ignore empty suboptions
To avoid printing from en empty buffer

Reported-by: Joshua Rogers
Closes #18899
2025-10-06 23:54:01 +02:00
Daniel Stenberg
3660e6da80
tftp: return error if it hits an illegal state
Reported-by: Joshua Rogers
Closes #18894
2025-10-06 23:52:57 +02:00
Daniel Stenberg
bc90f80556
tftp: default timeout per block is now 15 seconds
Down from the previous (rather ridiculous) 3600.

Reported-by: Joshua Rogers
Closes #18893
2025-10-06 23:51:43 +02:00
Daniel Stenberg
f1ed50a517
tftp: don't pin or check address if recvfrom returns error
Follow-up to c4f9977c66
Reported-by: Joshua Rogers
Closes #18892
2025-10-06 23:50:34 +02:00
Daniel Stenberg
1a3a5cb720
noproxy: fix the IPV6 network mask pattern match
It would mismatch if the network prefix length with was not divisible by
8.

Extended test 1614 to verify

Reported-by: Stanislav Fort

Closes #18891
2025-10-06 23:49:31 +02:00
Daniel Stenberg
71b5e02590
mdlinkcheck: reject URLs containing quotes
Those would be illegal anyway and would make the script misbehave

Reported-by: Stanislav Fort
Closes #18889
2025-10-06 23:38:41 +02:00
Daniel Stenberg
e214b14501
telnet: send failure logged but not returned
Return error correctly when sending fails.

Reported-by: Joshua Rogers
Closes #18887
2025-10-06 23:37:43 +02:00
Daniel Stenberg
6d9636abd1
telnet: return error if WSAEventSelect fails
Reported-by: Joshua Rogers
Closes #18886
2025-10-06 23:35:59 +02:00
Daniel Stenberg
3b18aeb8bd
managen: verify the options used in example lines
Also fix the --knownhosts typo

Follow-up to aae18c4bdc

Reported-by: Daniel Terhorst-North
URL: https://mas.to/@tastapod/115327102344617386
Closes #18884
2025-10-06 23:17:33 +02:00
Daniel Stenberg
6c7fc22f9d
pingpong: remove two old leftover debug infof() calls 2025-10-06 23:16:04 +02:00
Daniel Stenberg
66f4c5699e
test766: verify CURLOPT_SOCKOPTFUNCTION error on accept
This test does active FTP with a socketopt callback that returns error
for the CURLSOCKTYPE_ACCEPT "purpose" to make sure we test and exercise
this error path - without leaks.

Closes #18879
2025-10-06 23:16:04 +02:00
Daniel Stenberg
3517053cf7
curl_osslq: error out properly if BIO_ADDR_rawmake() fails
Reported-by: Joshua Rogers
Closes #18878
2025-10-06 23:14:55 +02:00
Daniel Stenberg
22ae8ac874
libssh2/sftp_realpath: change state consistently
Change the state in this function at a single spot independent of
success or not to simplify.

Reported-by: Joshua Rogers
Closes #18875
2025-10-06 23:13:53 +02:00
Daniel Stenberg
5090cce01c
libssh2: fix return code for EAGAIN
In disconnect

Closes #18874
2025-10-06 23:12:53 +02:00
Viktor Szakats
6f0e212f6e
tidy-up: miscellaneous (cont.)
- examples: replace magic numbers with `sizeof()`.
- typos: drop rules no longer needed after excluding tests/data.
- typos: move an exception inline.
- alpha-sort lists.
- fix indentation, whitespace.

Closes #18898
2025-10-06 22:33:38 +02:00
Viktor Szakats
b12da22db1
lib: stop overriding system printf symbols
After this patch, the codebase no longer overrides system printf
functions. Instead it explicitly calls either the curl printf functions
`curl_m*printf()` or the system ones using their original names.

Also:
- drop unused `curl_printf.h` includes.
- checksrc: ban system printf functions, allow where necessary.

Follow-up to db98daab05 #18844
Follow-up to 4deea9396b #18814

Closes #18866
2025-10-06 20:57:59 +02:00
Viktor Szakats
13f10add17
REUSE: bump reuse to v6, add more fences to fix issues
Closes #18895
Closes #18897
2025-10-06 20:54:26 +02:00
Viktor Szakats
beeb1ae762
GHA/configure-vs-cmake: reduce windows cross-toolchain apt installs
Download size: 277 MB -> 65 MB (installed: 1293 MB -> 401 MB)

Also as a workaround for Azure Ubuntu mirror slowdown issues:
https://github.com/curl/curl/actions/runs/18289326469/job/52072333582?pr=18866

Follow-up to 0455d8772a #18509

Closes #18896
2025-10-06 20:09:13 +02:00
Viktor Szakats
ef1794e50e
ldap: tidy-up types, fix error code confusion
- fix `CURLcode` vs. LDAP result code confusion.
  Return `LDAP_NO_MEMORY` when `Curl_create_sspi_identity()` fails,
  since it can only return `CURLE_OUT_OF_MEMORY` as error.
- use `ULONG` for result code on Windows. Drop casts.
- use portable `curl_ldap_num_t`. Drop casts.
- replace magic number 0 with `LDAP_SUCCESS`.
- compare with `LDAP_SUCCESS` instead of assuming non-zero.
  (where necessary.)
- add/fix `#endif` comments.
- fix indentation.

Closes #18888
2025-10-06 19:31:13 +02:00
Daniel Stenberg
92a2125684
telnet: make bad_option() consider NULL a bad option too
Follow-up to a72e1552f2
Closes #18873
2025-10-06 16:00:04 +02:00
Daniel Stenberg
2b0e7cb7c6
ftp: remove misleading comments
They indicated that sockets would not be closed but they are.

Reported-by: Joshua Rogers
Closes #18871
2025-10-06 15:58:14 +02:00
Daniel Stenberg
6ef4871f5d
ftp: improve fragile check for first digit > 3
In a case where rubbish would be sent in the line something that isn't a
digit could be first in line and treated as less than '3'. Prevent this
risk by first doing a check that the byte is a digit.

Reported-by: Joshua Rogers
Closes #18870
2025-10-06 15:56:23 +02:00
Daniel Stenberg
172e190c79
ftp: add extra buffer length check
This adds an extra check that the buffer really has data enough (at
least 4 bytes) to check for a status code before doing so. It *should*
not be necessary, but this was pointed out by an analyzer and it feels
better to make sure.

Reported-by: Joshua Rogers
Closes #18869
2025-10-06 15:48:00 +02:00
Daniel Stenberg
9e3c35a88e
ftp: fix the 213 scanner memchr buffer limit argument
Reported-by: Joshua Rogers
Closes #18867
2025-10-06 14:49:02 +02:00
Stefan Eissing
2f3cf17e33
cf-socket: check params and remove accept procondition
- creating a socket filter with NULL addrinfo fails with
  CURLE_BAD_FUNCTION_ARGUMENT
- remove getsockname use before accept call, serves no purpose
  and did not lead to proper error before

Reported-by: Joshua Rogers
Closes #18882
2025-10-06 14:48:01 +02:00
Daniel Stenberg
decd7e157c
cf-socket: always check Curl_cf_socket_peek() return code
Make it trigger a warning if not.

Reported-by: Joshua Rogers
Closes #18862
2025-10-06 14:45:53 +02:00
Viktor Szakats
51b85bdc6c
windows: use consistent format when showing error codes
For `GetLastError()` and `SECURITY_STATUS`:
0x-prefixed, 8-digit, lowercase, hex: 0x1234abcd

Also: say `GetLastError()` instead of `errno` in one message.

Closes #18877
2025-10-06 14:00:29 +02:00
Daniel Stenberg
0d68f48205
krb5_sspi: the chlg argument is NOT optional
Fix the comment, add assert.

Reported-by: Joshua Rogers
Closes #18865
2025-10-06 13:58:43 +02:00
Daniel Stenberg
d4c0332677
libssh2: clarify that sshp->path is always at least one byte
Reported-by: Joshua Rogers
Closes #18864
2025-10-06 13:57:19 +02:00
Daniel Stenberg
c3adf63ee7
libssh2: bail out on chgrp and chown number parsing errors
Reported-by: Joshua Rogers
Closes #18863
2025-10-06 13:46:06 +02:00
Daniel Stenberg
a80dcb04e3
test1711: send a >64K mail with SMTP
A failed attempt to reproduce #18798

Closes #18861
2025-10-06 13:42:30 +02:00
Daniel Stenberg
aae18c4bdc
tool_getparam: add --knownhosts
To allow users to specify a known hosts file that is not the default
one: ~/.ssh/known_hosts

URL: https://github.com/curl/curl/discussions/18784
Closes #18859
2025-10-06 13:41:22 +02:00
Stefan Eissing
762ce8801b
quiche: fix possible leaks on teardown
When the close of the quiche filter was never called, the destroy function
did not release all allicated resources.

When closing a quiche filter, set the connected flag to FALSE.

Reported-by: Joshua Rogers
Closes #18880
2025-10-06 13:37:21 +02:00
Viktor Szakats
e9ababe9aa
windows: use native error code types more
- curlx_get_winapi_error: accept DWORD (was: int), move casts one level
  up the callstack.

- sspi: bump some types to `SECURITY_STATUS` (int -> LONG).

- digest_sspi: drop unnecessary cast.

Closes #18868
2025-10-06 12:12:44 +02:00
Daniel Stenberg
e7a5184fa1
openssl: call SSL_get_error() with proper error
The error function should be called with the return code from the
previous call to SSL_shutdown() as argument.

Closes #18872
2025-10-06 11:31:54 +02:00
Viktor Szakats
db98daab05
src: stop overriding system printf symbols
Also:
- tool_operate: use the socket printf mask, drop cast.

Follow-up to 4deea9396b #18814

Closes #18844
2025-10-06 09:46:29 +02:00
Viktor Szakats
34ad78da89
curlx: move Curl_strerror, use in src and tests, ban strerror globally
Also:
- tests/server: replace local `sstrerror()` with `curlx_strerror()`.
- tests/server: show the error code next to the string, where missing.
- curlx: use `curl_msnprintf()` when building for src and tests.
  (units was already using it.)
- lib: drop unused includes found along the way.
- curlx_strerror(): avoid compiler warning (and another similar one):
  ```
  In file included from servers.c:14:
  ../../lib/../../lib/curlx/strerr.c: In function ‘curlx_strerror’:
  ../../lib/../../lib/curlx/strerr.c:328:32: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
    328 |       SNPRINTF(buf, buflen, "%s", msg);
        |                                ^
  ../../lib/../../lib/curlx/strerr.c:47:18: note: ‘snprintf’ output 1 or more bytes (assuming 2) into a destination of size 1
     47 | #define SNPRINTF snprintf
        |                  ^
  ../../lib/../../lib/curlx/strerr.c:328:7: note: in expansion of macro ‘SNPRINTF’
    328 |       SNPRINTF(buf, buflen, "%s", msg);
        |       ^~~~~~~~
  ```

Follow-up to 45438c8d6f #18823

Closes #18840
2025-10-06 09:44:23 +02:00
Viktor Szakats
eaf66f18b7
tests/server: replace banned functions with curlx_str_hex
Replace an `strtol()` and `strtoul()` call, both used in hex mode, with
`curlx_str_hex()`.

Follow-up to 45438c8d6f #18823

Closes #18837
2025-10-06 09:44:22 +02:00
Viktor Szakats
4116e1d802
unit1323: sync time types and printf masks, drop casts
Closes #18860
2025-10-06 03:27:57 +02:00
Viktor Szakats
c93457f1f6
tool_filetime: replace cast with the fitting printf mask (Windows)
Follow-up to d25b050379 #2204

Closes #18858
2025-10-06 03:26:43 +02:00
Daniel Stenberg
b54b4697ca
url: make Curl_init_userdefined return void
It cannot actually return an error, so the parent function does not need
to check for error and have an exit path that cannot be reached.

Pointed out by CodeSonar

Closes #18855
2025-10-05 22:58:20 +02:00
Viktor Szakats
1ae5e44eff
strerror: drop workaround for SalfordC win32 header bug
Follow-up to ccf43ce91d #15957

Closes #18857
2025-10-05 19:11:02 +02:00
Viktor Szakats
0833121305
GHA/http3-linux: cleanup cache entry name after prev
To avoid duplicate `no-deprecated` in the cache entry name.

Follow-up to c96bf36557 #18833

Closes #18853
2025-10-05 14:07:42 +02:00
Joshua Rogers
da8f7ae096
telnet: print DISPlay LOCation in printsub without mutating buffer
Closes #18852
2025-10-05 14:03:31 +02:00
Joshua Rogers
eb88092703
telnet: use pointer[0] for "unknown" option instead of pointer[i]
i is taken from pointer[length-2] (often the IAC byte) before we do
length -= 2, so using pointer[i] indexes an arbitrary/stale byte
unrelated to the option code. pointer[0] is the suboption’s option code
per the telnet SB format, so printing pointer[0] yields correct, stable
diagnostics.

Closes #18851
2025-10-05 14:02:41 +02:00
Joshua Rogers
c0febf6661
cpool: make bundle->dest an array; fix UB
Replace `char *dest[1]` with a proper `char dest[1]` array in
cpool_bundle. This removes undefined behavior from memcpy (writing past
the declared object) while keeping the same key semantics: dest_len is
strlen+1 (includes NUL), and hash add/delete calls remain unchanged.

Closes #18850
2025-10-05 14:02:07 +02:00
Daniel Stenberg
bb4326d72b
GHA: remove the hacktoberfest label action
No one cares about hacktoberfest anymore.

Closes #18849
2025-10-05 13:41:22 +02:00
Viktor Szakats
c7fb5858a5
checksrc: fix possible endless loops/errors in the banned function logic
By quoting the search expression to be replaced. This avoid the issue
when the code leading up to a banned function contained regex characters
that the script did not explicitly handle, e.g. `+`.

Assisted-by: Daniel Stenberg

Ref: https://perldoc.perl.org/functions/quotemeta
Follow-up to dd37d6970c #18775

Closes #18845
2025-10-04 17:49:21 +02:00
Viktor Szakats
455d41d460
unit1664: drop casts, expand masks to full values
Follow-up to 4deea9396b #18814

Closes #18838
2025-10-04 17:49:21 +02:00
Viktor Szakats
c96bf36557
GHA: drop quictls 3.3.0 builds in favor of openssl 3.5+
- http3-linux: move local nghttpx (nghttp2) build to openssl (from
  quictls). Also tried LibreSSL, but it made some HTTP/2 tests fails.

- http3-linux: drop quictls ngtcp2 build.

- http3-linux: build local openssl with `no-deprecated`.
  (previously tested in the quictls local build.)

- http3-linux: explicitly disable LDAP in cmake openssl jobs.
  cmake builds auto-detect OpenLDAP (autotools don't), and when enabled,
  linking curl fails because system `libsasl.so` requires MD5 openssl
  functions, which are missing from openssl no-deprecated builds.

- macos: move options tested in quictls jobs to other ones.

- linux: drop unused quictls local build. (it was used for msh3.)
  Follow-up to 91138b014d #17729

- renovate: drop quictls bump detection.

Closes #18833
2025-10-04 17:49:21 +02:00
Viktor Szakats
4535532ed3
examples: fix two build issues surfaced with WinCE
Both may apply to rare non-WinCE Windows builds too.

- fix gcc 4.4.0 preprocessor error:
  ```
  docs/examples/http2-upload.c:43:8: error: "_MSC_VER" is not defined
  ```
  Ref: https://github.com/curl/curl/actions/runs/18238150607/job/51935502616

- fix wrong header order:
  Inlcude `windows.h` after `winsock2.h` via `curl/curl.h`.

Regressions from 45438c8d6f #18823

Closes #18843
2025-10-04 11:35:44 +02:00
Viktor Szakats
ed1e72143a
examples: drop unused curl/mprintf.h includes
Follow-up to 45438c8d6f #18823

Closes #18842
2025-10-04 11:34:46 +02:00
Viktor Szakats
56026dae02
openssl: fix build for v1.0.2
```
lib/vtls/openssl.c: In function 'asn1_object_dump':
lib/vtls/openssl.c:299:42: error: passing argument 3 of 'i2t_ASN1_OBJECT' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  299 |   int i = i2t_ASN1_OBJECT(buf, (int)len, a);
      |                                          ^
In file included from /home/runner/djgpp/include/openssl/objects.h:965,
                 from /home/runner/djgpp/include/openssl/evp.h:94,
                 from /home/runner/djgpp/include/openssl/x509.h:73,
                 from /home/runner/djgpp/include/openssl/ssl.h:156,
                 from lib/curl_ntlm_core.c:71,
                 from bld/lib/CMakeFiles/libcurl_static.dir/Unity/unity_0_c.c:88:
/home/runner/djgpp/include/openssl/asn1.h:921:58: note: expected 'ASN1_OBJECT *' {aka 'struct asn1_object_st *'} but argument is of type 'const ASN1_OBJECT *' {aka 'const struct asn1_object_st *'}
  921 | int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a);
      |                                             ~~~~~~~~~~~~~^
```
Ref: https://github.com/curl/curl/actions/runs/18236773678/job/51931937131?pr=18039

Follow-up to bb46d42407 #18647

Closes #18841
2025-10-04 11:34:44 +02:00
Viktor Szakats
c9edc26afe
lib: drop unused include and duplicate guards
Closes #18839
2025-10-04 11:34:42 +02:00
Viktor Szakats
4deea9396b
tests: stop overriding system printf symbols
To make the source code match the functions called at runtime.
And to avoid the preprocessor trick that may introduces build issues.

Before this patch, libtests, tunits and units were calling a mixture
of curl and system printf calls, then transformed them all to curl
printf calls by including `curl_printf.h`.

Changes made:
- tests: stop including `curl_printf.h`.
- libtest: switch a couple of outlier system printf calls to curl
  printf.
- unit: use more curl printf to avoid casts and show whole values.
- unit: switch remaining calls to curl printf explicitly.
- tunit: switch to call curl printf explicitly.
- libtest, tunit, unit: ban system printf.
- unit1307, unit1607, unit1609, unit1652, unit1655, unit3214: bump
  types/masks to avoid casts.

After this patch:
- libtests, tunits, units: use exclusively curl printf.
  (as before, but explicitly, without relying on redefinitions.)
- servers: is unchanged (it can only use system printf).

Closes #18814
2025-10-04 00:51:06 +02:00
Viktor Szakats
45438c8d6f
checksrc: reduce directory-specific exceptions
By making them defaults, then fixing and/or reshuffling remaining
exceptions as necessary.

- checksrc: ban by default: `snprintf`, `vsnprintf`, `sscanf`, `strtol`.
- examples: replace `strtol` with `atoi` to avoid a checksrc exception.
- tests/libtest: replace `strtol` with `atol`.
- tests/server: replace most `strtol` with `atol`.
- tests/server: replace most `strtoul` with `atol`/`atoi`.
- tests/server: drop no longer used `util_ultous`.
- fix typo in checksrc rules: `vsnprint` -> `vsnprintf`.
- update local exceptions.

Also:
- examples: ban curl printf functions. They're discouraged in user code.
- examples: replace curl printf with system printf.
  Add `snprintf` workaround for <VS2015.
- examples/synctime: fix `-Wfloat-equal`.
- examples/synctime: exclude for non-Windows and non-UWP Windows.
- examples/synctime: build by default.

Closes #18823
2025-10-04 00:48:58 +02:00
Viktor Szakats
fff36a360e
checksrc: fix to handle ) predecing a banned function
Fixing:
```
Unmatched ) in regex; marked by <-- HERE in m/  \*buffer_len = \(ssize_t) <-- HERE
  strtol\(/ at /home/runner/work/curl/curl/scripts/checksrc.pl line 916, <$R> line 380.
```
Ref: https://github.com/curl/curl/actions/runs/18209824275/job/51848079550#step:3:5

Also add a test case.

Follow-up to 684f4cdd3e #18779
Cherry-picked from #18823
Closes #18836
2025-10-03 22:45:13 +02:00
renovate[bot]
99433d06e6
GHA: update dependency google/boringssl to v0.20251002.0
Closes #18834
2025-10-03 21:36:21 +02:00
Viktor Szakats
7468faffc1
Makefile.example: fix option order [ci skip]
The `ld` linker is sensitive to this, and did not find libcurl symbol
with the order before this patch. Seen with mingw-w64 gcc.

Follow-up to f6ddc1fc1e #18554

Closes #18835
2025-10-03 21:35:06 +02:00
Stefan Eissing
733c994b1e
doh: inherit new custom ssl flags
The new custom_* flags in the SSL config need to be inherited when
setting up the doh easy handle, so that defaults apply the same way as
for the original easy handle.

Closes #18831
2025-10-03 17:53:25 +02:00
Viktor Szakats
e73759f1a9
GHA: show full versions next to pinned actions
Also quotes to a configuration entry.

Follow-up to 2e5993ab08 #18827

Closes #18832
2025-10-03 16:34:44 +02:00
Daniel Stenberg
4b8278fb3d
progress: expand to use 6 characters per size
Previously the progress meter used a maximum of five digits+letter in
the progress meter output: up to 99999 bytes and then 9999k, 9999M etc.
The output then used two spaces after the size between the next field in
the display.

This new approach uses one letter more with only one space in between
the fields. It makes it possible to show up to 999999 bytes and then
99999k, 99999M etc. The function uses a single decimal when outputting a
value less than 1000 in any unit. Like 999.9M.

Closes #18828
2025-10-03 14:08:41 +02:00
renovate[bot]
2313696e96
GHA: update actions/upload-artifact action to v4.6.2
Closes #18830
2025-10-03 14:03:03 +02:00
Viktor Szakats
2e5993ab08
GHA/checksrc: pass zizmor a GH token, fix warnings found
For a complete, online, check.

After this patch the check takes 30s, up from a fraction of a second.

Also bump CodeQL actions to their latest version.

Closes #18827
2025-10-03 13:54:40 +02:00
Daniel Stenberg
4e2edde102
tool_progress: fix < 10000 output
Follow-up to e49698925c

Closes #18826
2025-10-03 13:47:49 +02:00
Daniel Stenberg
3b583ab7d7
docs/cmdline-opts: drop double quotes from GLOBBING and URL examples
It looks easier on the eye without them

Closes #18829
2025-10-03 13:47:16 +02:00
Stefan Eissing
9aa8e9a783
vquic: handling of io improvements
- better tracing of what system call is used and how often
- ngtcp2: combine vquic_send into larger chunks
- ngtcp2: define own PMTU values and enable MTU probing
- ngtcp2: trace interesting remote transport parameters

Closes #18812
2025-10-03 13:46:10 +02:00
Stefan Eissing
eefd03c572
ssl: support Apple SecTrust configurations
- configure/cmake support for enabling the option
- supported in OpenSSL and GnuTLS backends
- when configured, Apple SecTrust is the default trust store
  for peer verification. When one of the CURLOPT_* for adding
  certificates is used, that default does not apply.
- add documentation of build options and SSL use

Closes #18703
2025-10-03 12:02:23 +02:00
Daniel Stenberg
9cc1ee55a4
RELEASE-NOTES: synced
Add OpenSSL-QUIC as an item to get removed
2025-10-03 08:31:22 +02:00
Daniel Stenberg
2b1fda1fe6
RELEASE-NOTES: synced 2025-10-03 08:26:56 +02:00
Daniel Stenberg
0a3459ca51
DEPRECATE.md: remove OpenSSL 1.1.1 support already in December 2025
No sponsors == remove it

Closes #18822
2025-10-03 08:14:23 +02:00
Daniel Stenberg
06c0f8c5cd
DEPRECATE.md: We remove the OpenSSL-QUIC backend in March 2026
URL: https://curl.se/mail/lib-2025-10/0000.html

Closes #18820
2025-10-03 08:13:43 +02:00
Daniel Stenberg
84c4b485f3
time-cond.md: refer to the singular curl_getdate man page
Closes #18816
2025-10-02 23:25:36 +02:00
Daniel Stenberg
18e4fbad4c
tcp-nodelay.md: expand the documentation
Instead of referring to another document.

Closes #18811
2025-10-02 23:24:42 +02:00
Daniel Stenberg
06625975af
cmdline-opts/_PROGRESS.md: explain the suffixes
Closes #18817
2025-10-02 23:23:40 +02:00
Stefan Eissing
95ac33fc4f
ip-happy: prevent event-based stall on retry
When delaying an IP happy eyeball restart, set an actual timer or the
connection will stall when running event based.

Closes #18815
2025-10-02 22:53:58 +02:00
Viktor Szakats
e5316069f1
GHA/macos: drop macos-13 runner image from combo jobs
- replace with macos-14.
- refresh tables, exceptions.
- apply a pending TODO.

Closes #18818
2025-10-02 19:31:14 +02:00
Jay Satiro
2a25ebe958 vtls_scache: fix race condition
- Lock before counting the cache sessions.

Prior to this change when taking a session a trace command counted the
sessions but not under lock, which caused a race condition.

Reported by: Viktor Szakats

Fixes https://github.com/curl/curl/issues/18806
Closes https://github.com/curl/curl/pull/18813
2025-10-02 11:33:44 -04:00
Viktor Szakats
03fe446789
INTERNALS: specify minimum version for Heimdal: 7.1.0
Released on 2016-Dec-19, it's the first "revamped" stable version, and
the earliest available as a source tarball at the official repository:
https://github.com/heimdal/heimdal/releases/tag/heimdal-7.1.0

It's also the first version hosted by Homebrew. It builds fine locally
with curl, and also builds in CI with old linux: 7.1.0+dfsg-13+deb9u4.

Closes #18809
2025-10-02 15:21:09 +02:00
Viktor Szakats
b04137c1c6
renovate: adjust commit message prefixes, try making CodeQL and AWS-LC updates monthly
Also:
- enable pip bumps in Dependabot.
- reduce dependabot to check monthly (was: weekly)
  Dependabot acts as a backup for mend/renovate.

Closes #18761
2025-10-02 15:21:08 +02:00
Viktor Szakats
7682bd80e7
cmake: drop exclamation in comment looking like a name
Ref: https://github.com/curl/curl/pull/3316#issuecomment-442343555
Follow-up to ea4ba6d9ef #18803
Follow-up to 558814e16d

Closes #18810
2025-10-02 14:58:06 +02:00
Viktor Szakats
9ac3a9a670
INTERNALS: drop Winsock 2.2 from the dependency list
It's implied by the minimum requirement of Windows XP.
Also Windows CE is soon to be deleted via #17927.

Closes #18808
2025-10-02 14:58:06 +02:00
Viktor Szakats
af7900fb28
CI: move no-verbose build from Circle CI to existing GHA jobs, with tests
To test it in GHA and catch issues at PR time. Before this patch,
Circle CI caught them after pushing to master (or non-fork PR
branches.) GHA also run runtests, pytests and static analysis on
these builds, after this patch.

- GHA/linux: enable no-verbose in an existing job.
- GHA/linux: enable no-verbose in the H3 scan-build job too.
- GHA/macos: enable no-verbose in one build (= 3 jobs with different
  compilers).
- GHA/codeql: enable no-verbose in the MultiSSL Linux build.
- circleci: delete openssl no-verbose job in favor of the above.

Closes #18797
2025-10-02 14:58:06 +02:00
Stefan Eissing
dba87aea7d
multi_ev: remove unnecessary data check that confuses analysers
Closes #18804
2025-10-02 14:25:16 +02:00
Daniel Stenberg
ea4ba6d9ef
lib: remove personal names from comments
- it's just too random who got mentioned
- we can't mention all, so better consistently mention none
- make sure they all are mentioned in THANKS
- also remove some unnecessary comment ramblings

Closes #18803
2025-10-02 14:22:57 +02:00
Daniel Stenberg
7f0fd14d9f
tool_getparam: always disable "lib-ids" for tracing
Since the tool code itself adds the ids (controlled with "ids"), getting
them (also) added by the library adds nothing good. Always disable the
lib-ids even when "--trace-config all" is selected.

Also: change "== Info:" into just "* " to reduce output redundancy.

Ref: #18755
Reported-by: Alice Lee Poetics
Closes #18805
2025-10-02 14:22:13 +02:00
Daniel Stenberg
e49698925c
tool_progress: make max5data() use an algorithm
Instead of a list of conditions. Makes a unified decimal output when the
value is less than 100. Prepares for > 64 bit data type.

Closes #18807
2025-10-02 14:21:00 +02:00
Viktor Szakats
34dc762cef
pytest: skip specific tests for no-verbose builds
Detect via curlinfo if curl has verbose strings disabled, and skip
tests that require it.

Also:
- cmake: make pytests depend on curlinfo.

Cherry-picked from #18797
Closes #18801
2025-10-02 10:41:46 +02:00
Viktor Szakats
632c5ee897
runtests: tag tests that require curl verbose strings
To skip them when curl has verbose strings disabled, instead of failing.

Cherry-picked from #18797
Closes #18800
2025-10-02 10:41:46 +02:00
Viktor Szakats
e43aea3049
lib: fix build error and compiler warnings with verbose strings disabled
- asyn-ares: fix compiler warning:
  ```
  lib/asyn-ares.c:751:17: error: code will never be executed [clang-diagnostic-unreachable-code,-warnings-as-errors]
    751 |     char *csv = ares_get_servers_csv(ares->channel);
        |                 ^~~~~~~~~~~~~~~~~~~~
  ```

- curl_trc: fix missing symbol:
  ```
  /usr/bin/ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_trc_timer'
  collect2: error: ld returned 1 exit status
  ```
  Ref: https://app.circleci.com/pipelines/github/curl/curl/15446/workflows/67afa113-9c49-4249-9180-f6f01fc7dfdd/jobs/149177
  Ref: https://github.com/curl/curl/actions/runs/18174250400/job/51736249444#step:33:623
  Follow-up to b022389757 #18768

- multi: fix `-Wunreachable-code`:
  ```
  lib/multi.c:1107:28: error: code will never be executed [-Werror,-Wunreachable-code]
   1107 |     size_t timeout_count = Curl_llist_count(&data->state.timeoutlist);
        |                            ^~~~~~~~~~~~~~~~
  lib/multi.c:3054:35: error: code will never be executed [-Werror,-Wunreachable-code]
   3054 |       struct Curl_llist_node *e = Curl_llist_head(&data->state.timeoutlist);
        |                                   ^~~~~~~~~~~~~~~
  lib/multi.c:3380:7: error: code will never be executed [-Werror,-Wunreachable-code]
   3380 |       Curl_llist_head(&data->state.timeoutlist);
        |       ^~~~~~~~~~~~~~~
  ```

Cherry-picked from #18797
Closes #18799
2025-10-02 10:41:46 +02:00
Viktor Szakats
9ebf778e82
GHA/linux: add HTTP/3 c-ares scan-build and asan jobs
They use Linuxbrew instead of locally built components.

Linuxbrew limitations compared to the locally built components in
GHA/http3-linux:
- libngtcp2 currently supports OpenSSL only.
- wolfssl can't coexist with openssl.
- somewhat tricky configuration with autotools.

Upside is easy of use, always the latest versions (may be downside),
and availability of almost all packages.

Closes #18693
2025-10-02 10:41:45 +02:00
renovate[bot]
e234c09426
GHA: update dependency openssl/openssl to v3.6.0
Closes #18796
2025-10-01 22:37:20 +02:00
Viktor Szakats
285f64d3a0
GHA/macos: also update LibreSSL source tarball URL
Follow-up to 150567b0d2 #18792
2025-10-01 21:53:16 +02:00
Stefan Eissing
d71ec36d1b
openssl-quic: ignore unexpected streams opened by server
HTTP/3 defines "reserved stream types" that are intended to be ignored
by a receiver. This is part of the "greasing" effort that flexes parts
of the protocol that are needed for future extensions.

curl's OpenSSL-QUIC implementation treated all unexpected streams as
an error. Which seems the right thing to do *but* for these reserved types.
However OpenSSL does not expose this type and thus, curl needs to silently
discard all unexpected streams opened by the server to allow interop
with servers that flex the GREASE parts.

Fixes #18780
Reported-by: Pocs Norbert
Closes #18791
2025-10-01 15:56:58 +02:00
Daniel Stenberg
e891b4195f
cf-socket: tweak a memcpy() to read better
By checking the size of the actual buffer and using that as memcpy
target instead of another union member, this helps readers and static
code analyzers to determine that this is not a buffer overflow.

Ref: #18677
Closes #18787
2025-10-01 15:52:53 +02:00
Daniel Stenberg
bc37765466
form.md: drop reference to MANUAL
Since it isn't linked and users might not understand what it refers to.

Ref: #18755
Closes #18790
2025-10-01 15:51:21 +02:00
Daniel Stenberg
b2ae19eed4
tool_getparam: warn if provided header looks malformed
URL: https://fosstodon.org/@galdor/115298664084113519
Closes #18793
2025-10-01 15:50:43 +02:00
Viktor Szakats
150567b0d2
tidy-up: LibreSSL Git repository URLs and local CI builds
Also:
- point the source tarball to a working URL.
  The GitHub release page misses the official source tarball for 4.1.1.
- GHA/linux: switch LibreSSL build to cmake (syncing with http3-linux.)
- GHA/macos: drop no longer needed LibreSSL build workaround.

Closes #18792
2025-10-01 12:55:20 +02:00
renovate[bot]
0e67d97b83
GHA: update dependency libressl/portable to v4.1.1
Closes #18785
Closes #18786
2025-10-01 12:10:36 +02:00
Samuel Henrique
a5a17b8ddb
wcurl: import v2025.09.27
Closes #18754
2025-10-01 09:26:42 +02:00
Daniel Stenberg
205758d7ea
RELEASE-NOTES: synced 2025-10-01 09:12:10 +02:00
Daniel Stenberg
a2b7a4157c
typos.toml: exclude more from typo checks
- exclude visual studio project templates
- exclude test cases
- allow 'proxys' which is used for "secure proxy" in test code
- allow Tru64 and secur32

Closes #18789
2025-10-01 09:03:27 +02:00
Daniel Stenberg
f284222ffc
TODO: fix a typo
Closes #18788
2025-10-01 08:26:49 +02:00
Stefan Eissing
b022389757
ip-happy: do not set unnecessary timeout
When attempts on all addresses have been started, do no longer set any
EXPIRE_HAPPY_EYEBALLS timeouts.

Fixes #18767
Reported-by: Johannes Schindelin
Closes #18768
2025-10-01 08:01:47 +02:00
Stefan Eissing
d8823e855c
asyn-thrdd resolver: clear timeout when done
When the async threaded resolver thread returned, clear the
started EXPIRE_ASYNC_NAME timeout.

Closes #18769
2025-10-01 07:59:41 +02:00
Viktor Szakats
f97aa8d7ed
tidy-up: fcntl.h includes
- drop from source files without obvious users.
- include in `curlx/fopen.h` also for Windows.

Follow-up to 9678ff5b1b #18776

Closes #18782
2025-09-30 21:57:17 +02:00
renovate[bot]
583b1ad881
GHA: update dependency openssl/openssl to v3.5.4
Closes #18781
2025-09-30 21:57:17 +02:00
Viktor Szakats
9678ff5b1b
build: avoid overriding system open and stat symbols
Replace them by `curlx_open()` and `curlx_stat()`.

To make it obvious in the source code what is being executed.

Also:
- tests/server: stop overriding `open()` for test servers.
  This is critical for the call made from the signal handler.
  For other calls, it's an option to use `curlx_open()`, but
  doesn't look important enough to do it, following the path
  taken with `fopen()`.

Follow-up to 10bac43b87 #18774
Follow-up to 20142f5d06 #18634
Follow-up to bf7375ecc5 #18503

Closes #18776
2025-09-30 16:30:09 +02:00
Viktor Szakats
684f4cdd3e
checksrc: catch banned functions when preceded by (
Also add a test case.

Closes #18779
2025-09-30 13:16:47 +02:00
Viktor Szakats
c478c7efdf
examples: fix two more cases of stat() TOCTOU
Also:
- ftpupload: bump an intermediate variable size.

Follow-up to f13250edf1 #18605

Closes #18778
2025-09-30 12:28:43 +02:00
renovate[bot]
5b086ba188
Dockerfile: update debian:bookworm-slim digest to 7e49091
Closes #18777
2025-09-30 11:32:12 +02:00
Viktor Szakats
dd37d6970c
checksrc: fix possible endless loop when detecting BANNEDFUNC
If the source line had square brackets before the match, the stripping
of the banned function left the original line intact, and repeated the
check on it forever. E.g. with banned function `open` in `lib518.c`:
```c
t518_testfd[0] = open(DEV_NULL, O_RDONLY);
```

Closes #18775
2025-09-30 11:32:12 +02:00
Viktor Szakats
20142f5d06
build: avoid overriding system symbols for fopen functions
By introducing wrappers for them in the curlx namespace:
`curlx_fopen()`, `curlx_fdopen()`, `curlx_fclose()`.

The undefine/redefine/`(function)()` methods broke on systems
implementing these functions as macros. E.g. AIX 32-bit's `fopen()`.

Also:
- rename `lib/fopen.*` to `lib/curl_fopen.*` (for `Curl_fopen()`)
  to make room for the newly added `curlx/fopen.h`.
- curlx: move file-related functions from `multibyte.c` to `fopen.c`.
- tests/server: stop using the curl-specific `fopen()` implementation
  on Windows. Unicode isn't used by runtests, and it isn't critical to
  run tests on longs path. It can be re-enabled if this becomes
  necessary, or if the wrapper receives a feature that's critical for
  test servers.

Reported-by: Andrew Kirillov
Bug: https://github.com/curl/curl/issues/18510#issuecomment-3274393640

Follow-up to bf7375ecc5 #18503
Follow-up to 9863599d69 #18502
Follow-up to 3bb5e58c10 #17827

Closes #18634
2025-09-30 01:10:36 +02:00
Viktor Szakats
10bac43b87
tests/server: drop unsafe open() override in signal handler (Windows)
Turns out the signal handler on Windows still wasn't signal safe after
the previous round of fix. There is an `open()` call made from there,
and `open` happens to be unconditionally overridden via `curl_setup.h`
on Windows, to its local implementation (`curlx_win32_open()`), which
does memory allocations and potentially other things that are not signal
safe.

This is a temporary fix, till avoiding the override of system symbols
`open` and `stat` on Windows.

FTR this did not fix the CI 2304 errors, diskspace fail or job hangs due
to 0xC0000142 fork failure (it's rare all three occurs in the same run):
https://github.com/curl/curl/actions/runs/18110523584?pr=18774

Ref: #18634
Follow-up e95f509c66 #16852
Closes #18774
2025-09-30 01:10:35 +02:00
Viktor Szakats
e17aa98bfe
cmake: use more COMPILER_OPTIONS, LINK_OPTIONS / LINK_FLAGS
- replace `COMPILE_FLAGS` with `COMPILE_OPTIONS` that superceded it.

  Follow-up to 6140dfcf3e
  https://cmake.org/cmake/help/v4.1/prop_sf/COMPILE_FLAGS.html

- replace `target_link_libraries()` with `LINK_FLAGS` property for
  CMake <=3.12, because we are passing linker options (not libs).

  Follow-up to 91720b620e #18468
  Follow-up to 548873921c #17670
  Follow-up to 95aea798db #5843
  https://cmake.org/cmake/help/v3.7/command/target_link_libraries.html
  https://cmake.org/cmake/help/v3.7/prop_tgt/LINK_FLAGS.html

- replace `target_link_options()` with `LINK_OPTIONS` propery for
  CMake 3.13+, to use the modern style.

  Follow-up to 91720b620e #18468
  Follow-up to 548873921c #17670
  https://cmake.org/cmake/help/v3.13/command/target_link_options.html
  https://cmake.org/cmake/help/v3.13/prop_tgt/LINK_OPTIONS.html

Also:

- fix to append to, not override, previously set linker options when
  using `CURL_LIBCURL_VERSIONED_SYMBOLS=ON`. Before this patch, it was
  overwriting linker options when using `CURL_CODE_COVERAGE=ON`.

  Follow-up to 91720b620e #18468

Closes #18762
2025-09-29 13:07:14 +02:00
Viktor Szakats
81a9197102
GHA/linux-old: make one cmake v3.7.2 job verbose
To show the details in cmake builds using the oldest supported version.
Use a legacy method. `--verbose` became supported later, in 3.14.

Closes #18764
2025-09-28 12:33:06 +02:00
Viktor Szakats
a6182865d0
CI: make pip use tests/requirements.txt in Circle CI
Also sync `pip` options with those used in GHA.

Closes #18760
2025-09-28 00:43:24 +02:00
Viktor Szakats
660d915ebd
ci: use --enable-option-checking=fatal in autotools jobs
To avoid typos and non-existing options passed to `./configure` in CI
builds.

Also delete obsolete option `--enable-test-bundles` from Circle CI jobs.

Closes #18759
2025-09-28 00:20:12 +02:00
Viktor Szakats
75d5424979
GHA/windows: tidy up Cygwin jobs
- drop unnecessary installed packages.
- sync built type name with other jobs.

Closes #18758
2025-09-27 19:03:25 +02:00
renovate[bot]
b5c9c858d5
GHA: update dependency awslabs/aws-lc to v1.61.4
Closes #18752
2025-09-27 16:31:13 +02:00
Viktor Szakats
16f721443a
GHA/linux: tidy up AWS-LC local build
To sync with other builds and to use `-B` to avoid a cmake warning and
future breakage.

Closes #18757
2025-09-27 16:29:24 +02:00
Viktor Szakats
95e50ad694
tidy-up: miscellaneous
- GHA/checkdocs: rename `spellcheck` job to `pyspelling` to say
  the exact tool used.
- GHA/checkdocs: restore a comment.
- GHA/linux: add `-B .` to a cmake configure to avoid warning, and
  future breakage.
- autotools: use correct casing for `Schannel`.
- doh: update RFC URL.
- drop redundant parenthesis.
- fix indentation, whitespace.

Closes #18756
2025-09-27 12:59:07 +02:00
Viktor Szakats
8538856662
perlcheck: parallelize
Follow-up to 34b1e146e4 #18745

Closes #18750
2025-09-26 23:50:53 +02:00
Daniel Stenberg
b5ffe30e5b
cf-ip-happy: mention unix domain path, not port number
In the connect error message if a unix domain socket was used.

Reported-by: kuchara on github
Ref: #18748
Closes #18749
2025-09-26 17:29:12 +02:00
Viktor Szakats
34b1e146e4
perlcheck: add script, run in CI, fix fallouts
Add script to run all Perl sources through `perl -c` to ensure no
issues, and run this script via GHA/checksrc in CI.

Fallouts:
- fix two repeated declarations.
- move `shell_quote()` from `testutil.pm` to `pathhelp.pm`, to
  avoid circular dependency in `globalconfig.pm`.

Closes #18745
2025-09-26 14:47:33 +02:00
Daniel Stenberg
72f72f678d
openldap: check ber_sockbuf_add_io() return code
The man page says nothing about what the return code means but Howard
Chu tells me it is 0 on success, -1 on fail.

Help-by: Howard Chu

Closes #18747
2025-09-26 14:29:49 +02:00
Daniel Stenberg
84d9627531
tool_progress: handle possible integer overflows
The progress meters max out at 2^63 bytes.

Reported-by: BobodevMm on github
Fixes #18744
Closes #18746
2025-09-26 10:53:28 +02:00
Stefan Eissing
061e265502
http: handle user-defined connection headers
When there is more than one user-supplied 'Connection: ' header, add
values that curl needs internally to the first one and emit all
subsequent ones thereafter.

Fixes #18662
Reported-by: Evgeny Grin (Karlson2k)
Closes #18686
2025-09-26 09:27:50 +02:00
Daniel Stenberg
500ea90829
RELEASE-NOTES: synced 2025-09-25 23:35:31 +02:00
Daniel Stenberg
16e0a2098d
openssl: fail the transfer if ossl_certchain() fails
Since it would indicate errors to the degree that continuing would just
risk hiding the earlier errors or make things weird.

Inspired by a report in Joshua's sarif data

Closes #18646
2025-09-25 22:25:20 +02:00
renovate[bot]
e27853d36b
GHA: update dependency ruff and github/codeql-action
- update github/codeql-action digest to 303c0ae
- update dependency ruff to v0.13.2

Closes #18716
Closes #18734
2025-09-25 21:53:53 +02:00
Daniel Stenberg
b8f10be4f2
libssh: acknowledge SSH_AGAIN in the SFTP state machine
Reported in Joshua's sarif data

Closes #18740
2025-09-25 17:26:47 +02:00
Daniel Stenberg
9595921b06
libssh: clarify myssh_block2waitfor
Fixed misleading comment. Simplified the bit setup.

Reported in Joshua's sarif data

Closes #18739
2025-09-25 17:26:01 +02:00
Viktor Szakats
e48c1ea415
GHA: use pyspelling directly
To avoid depending on Docker Hub, an Docker image and a GitHub Action.
Also to simplify running this check on a local machine.

Pending question if Dependabot and Mend/Renovate will automatically pick
up `requirements-docs.txt`.

Also:
- enable parallel spellchecking. (also to win back the time lost with
  installing components directly from Debian and pip.)
- pin `pyspelling`.
- link to official `pyspelling` docs.

Closes #18736
2025-09-25 16:59:27 +02:00
Stefan Eissing
f5bae285f3
socks: handle error in verbose trace gracefully
Adjust the flow to always succeed in verbose trace of connect.

Reported in Joshua's sarif data

Closes #18722
2025-09-25 16:55:22 +02:00
Daniel Stenberg
9f75603d4f
tftp: only check address if it was stored
If recvfrom() fails, it might not have stored an address.

Follow-up to c4f9977c66

Pointed out by CodeSonar

Closes #18738
2025-09-25 16:54:19 +02:00
Daniel Stenberg
bebc8df0f7
schannel_verify: use more human friendly error messages
Closes #18737
2025-09-25 16:53:29 +02:00
Viktor Szakats
edbf610c6a
GHA: set HOMEBREW_NO_AUTO_UPDATE=1 for Linuxbrew
In an attempt to make `brew install` commands initialize faster.

Often this command started with 20-50 seconds of delay before this
patch. This is an attempt to make it launch faster.

Cherry-picked from #18736
2025-09-25 15:37:13 +02:00
Viktor Szakats
5b8c80684b
GHA/checksrc: drop no longer used DEBIAN_FRONTEND env
Follow-up to 7d5f8be532 #18708
Cherry-picked from #18736
2025-09-25 15:37:13 +02:00
Daniel Stenberg
882293cc81
KNOWN_BUGS: telnet code does not handle partial writes properly
Reported in Joshua's sarif data

Closes #18735
2025-09-25 14:42:04 +02:00
Viktor Szakats
e08211b1ca
GHA: bump pip cryptography, relax impacket version requirement
Bump `cryptography` to a newer version that fixes two known OpenSSL
vulnerabilities reported by Dependabot.

To make it work, also allow `impacket` 0.11.0, because it allows any
pyOpenSSL version, while 0.12.0 pinned it to a single version that
happens to be incompatible with the bugfixed `cryptography` version.

Also: drop spaces from `requirements.txt` files. Bots don't add them,
though they seem to be preferred in the official documentation:
https://pip.pypa.io/en/stable/reference/requirements-file-format/

https://github.com/fortra/impacket/blob/impacket_0_11_0/requirements.txt
https://github.com/fortra/impacket/blob/impacket_0_12_0/requirements.txt

Follow-up to 7d5f8be532 #18708

Closes #18731
2025-09-25 14:22:40 +02:00
Stefan Eissing
442943fb8e
openssl: set io_need always
When OpenSSL reports SSL_ERROR_WANT_READ, set the io_need explicitly.
It should have already been set by the BIO, but be safe.

Reported in Joshua's sarif data

Closes #18733
2025-09-25 14:19:50 +02:00
Stefan Eissing
221b7dda38
transfer: avoid busy loop with tiny speed limit
When a transfer has a speed limit less than 4, the receive loop early
exits without receiving anything, causing a busy loop for that transfer.

Perform that check only after the first receive has been done.

Reported in Joshua's sarif data

Closes #18732
2025-09-25 14:18:35 +02:00
Stefan Eissing
771dd9d9e7
quiche: when ingress processing fails, return that error code
Instead of a general CURLE_RECV_ERROR.

Reported in Joshua's sarif data

Closes #18730
2025-09-25 14:17:39 +02:00
Stefan Eissing
dec661c81c
wolfssl: fix error check in shutdown
When trying to send the TLS shutdown, use the return code
to check for the cause.

Reported in Joshua's sarif data

Closes #18729
2025-09-25 14:16:56 +02:00
Stefan Eissing
15b4b96188
rustls: fix comment describing cr_recv()
The comments on `cf_recv()` function were outdated and described
calling conventions that no longer are true.

Reported in Joshua's sarif data

Closes #18728
2025-09-25 14:14:02 +02:00
Stefan Eissing
e02cbe94ff
mbedtls: check result of setting ALPN
The result of setting the negotiated ALPN was not checked, leading
to reporting success when it should not have.

Reported in Joshua's sarif data

Closes #18727
2025-09-25 14:13:09 +02:00
Stefan Eissing
36eb26381c
quiche: fix verbose message when ip quadruple cannot be obtained.
Reported in Joshua's sarif data

Closes #18726
2025-09-25 14:12:11 +02:00
Stefan Eissing
ee2dd2d6cb
openssl-quic: handle error in SSL_get_stream_read_error_code
The return code of SSL_get_stream_read_error_code() was not checked
in one location, but others. Make that consistent.

Reported in Joshua's sarif data

Closes #18725
2025-09-25 14:11:25 +02:00
Stefan Eissing
887b863b00
openssl: clear retry flag on x509 error
When loading the trust anchors and encountering an error, clear
a possibly set retry flag.

Reported in Joshua's sarif data

Closes #18724
2025-09-25 14:10:00 +02:00
Stefan Eissing
5f4f70e06d
ngtcp2: fix early return
On a failed tls handshake, the receive function returned without
restoring the current data.

Reported in Joshua's sarif data

Closes #18723
2025-09-25 14:09:15 +02:00
Stefan Eissing
b0f6593219
openssl-quic: check results better
Fail on errors from SSL_handle_events().
Force quit Caddy test instance that is left hanging longer with
openssl-quic tests for unknown reasons.

Reported in Joshua's sarif data

Closes #18720
2025-09-25 14:07:56 +02:00
Stefan Eissing
9e8b05fb99
wolfssl: check BIO read parameters
Check parameters passed more thoroughly and assure that current 'data'
also exists.

Reported in Joshua's sarif data

Closes #18718
2025-09-25 14:05:50 +02:00
Stefan Eissing
cbc30d4ed2
vtls: alpn setting, check proto parameter
When setting the negotiated alpn protocol, either then length
must be 0 or a pointer must be passed.

Reported in Joshua's sarif data

Closes #18717
2025-09-25 14:04:14 +02:00
Stefan Eissing
ccd2b03b0d
socks: rewwork, cleaning up socks state handling
Restructured the code in the following ways:

* add terminal states SUCCESS and FAILED
* split SOCK4 and SOCK5 states to be more clear
* use `bufq` for send/recv of SOCK messages
* reduce SOCKS4 states, more speaking names
* for most states, move code into static function
* reduce SOCKS5 states, more speaking names
* add helpers for traversing to FAILED state
* add helper to flush bufq
* add hepler to read minimum amount into bufq

Closes #18401
2025-09-25 14:03:10 +02:00
Stefan Eissing
b3fc692568
lib: upgrade/multiplex handling
Improvements around HTTP Upgrade: and multiplex hanndling:

* add `Curl_conn_set_multiplex()` to set connection's multiplex
  bit and trigger "connchanged" events
* call `Curl_conn_set_multiplex()` in filters' `CF_CTRL_CONN_INFO_UPDATE`
  implementation where other connection properties are updated.
  This prevents connection updates before the final filter chain
  is chosen.
* rename enum `UPGR101_INIT` to `UPGR101_NONE`
* rename connection bit `asks_multiplex` to `upgrade_in_progress`
* trigger "connchanged" when `upgrade_in_progress` clears
* rename `WebSockets` to `WebSocket` as it is the common term
  used in documentation

Closes #18227
2025-09-25 14:00:37 +02:00
Daniel Stenberg
943166fed3
socks_sspi: bail out on too long fields
A probably unnecessary precaution but since the field sizes are 16 bit in the
protocol this makes sure to fail if they would ever be larger as that would go
wrong.

Reported in Joshua's sarif data

Closes #18719
2025-09-25 13:35:25 +02:00
Viktor Szakats
6796147910
GHA/checksrc: run reuse directly, merge into the linters workflow
To eliminate dependencies on an Action, Docker Hub and to simplify.

Closes #18721
2025-09-25 12:06:44 +02:00
renovate[bot]
8e13e42583
GHA: update dependency ruff to v0.13.1 2025-09-25 11:42:43 +02:00
Daniel Stenberg
20d1c6e92e
socks_gssapi: remove superfluous releases of the gss_recv_token
Reported in Joshua's sarif data

Closes #18714
2025-09-25 11:23:04 +02:00
Stefan Eissing
c9fce97dcb
cf-h2-proxy: break loop on edge case
nghttp2 always consumes the memory, but be safe in case it ever decideds
to not to.

Fixes J2
Reported in Joshua's sarif data
Closes #18715
2025-09-25 11:22:24 +02:00
Viktor Szakats
7d5f8be532
GHA: use pip requirements.txt with pins, and more venv
- requirements.txt: shorten copyright headers.

- requirements.txt: pin packages to versions.

- GHA/windows: use `tests/requirements.txt`.
  Pick a `cryptography` package version that satifies both `impacket`
  and pytests dependencies.

- GHA/checksrc: move pip deps into a new `requirements.txt`.
  To make Dependabot detect and bump them.

- GHA/checksrc: replace apt packages for python test deps with pip
  install `tests/**/requirements.txt` to a venv.

- GHA/checksrc: use venv and drop `--break-system-packages`.

- GHA/linux: fix to actually activate venvs.
  Follow-up to 2638570241 #15578

- GHA/linux: fixup (did not cause an issue)
  Follow-up to d75785c7de #18660

- GHA: create venvs later, simplify commands.

- GHA: sync pip command-line options, e.g. drop progress-bar,
  everywhere.

Assisted-by: Dan Fandrich

Closes #18708
2025-09-25 10:45:30 +02:00
Patrick Monnerat
7f38bf51ad
OS400: fix a use-after-free/double-free case
Closes #18713
2025-09-25 10:18:22 +02:00
Daniel Stenberg
98dae1d992
socks_gssapi: remove the forced "no protection"
If a protected connection is requested, don't claim to drop down to "no
protection".

Reported in Joshua's sarif data

Closes #18712
2025-09-25 10:11:28 +02:00
Daniel Stenberg
aaa39873ea
socks_gssapi: make the gss_context a local variable
Reported-by: Stanislav Fort
Closes #18711
2025-09-25 09:08:08 +02:00
Daniel Stenberg
0f1657ca75
mbedtls: handle WANT_WRITE from mbedtls_ssl_read()
The mbedtls_ssl_read() function is documented to be able to also return
MBEDTLS_ERR_SSL_WANT_WRITE, so act on that accordingly instead of
returning error for it.

Assisted-by: Stefan Eissing

Reported in Joshua's sarif data
Closes #18682
2025-09-25 09:07:09 +02:00
Daniel Stenberg
97e5a471e0
KNOWN_BUGS: Access violation sending client cert with SChannel
It seems we can select between crashing or leaking sensitive files
because Schannel is buggy.

Closes #17626
Closes #18679
2025-09-25 09:06:24 +02:00
renovate[bot]
9d3f878e59
GHA: update actions/cache digest to 0057852
Closes #18710
2025-09-25 00:54:15 +02:00
Viktor Szakats
977595772c
RELEASE-NOTES: codespell 2025-09-24 23:48:13 +02:00
Daniel Stenberg
9a5810f6c1
RELEASE-NOTES: synced 2025-09-24 23:03:03 +02:00
Daniel Stenberg
b011e3fcfb
vssh: drop support for wolfSSH
The implementation was incomplete and lesser than the other backends. No
one ever reported a bug or requested enhancements for this, indicating
that this backend was never used.

Closes #18700
2025-09-24 22:59:33 +02:00
Viktor Szakats
22b9f77e38
GHA/curl-for-win: use DOCKER_IMAGE_STABLE
Replacing the hard-wired stable image. After this patch, it
will automatically follow upstream updates.

Follow-up to 6870bc1b35
Follow-up to 5a25df253d

Closes #18709
2025-09-24 19:00:03 +02:00
Viktor Szakats
acd0aa2c9d
docs: fix/tidy code fences
- INSTALL.md: fence code to avoid wrong rendering.
  Reported-by: rinsuki on github
  Fixes: https://github.com/curl/curl-www/issues/480

- use `sh` instead of `bash` as fence language, for less visual noise.

- INSTALL.md: drop stray shebang.

- ECH.md: drop indent from fenced code.

- minor tidy-ups.

Ref: https://curl.se/docs/install.html

Closes #18707
2025-09-24 15:16:09 +02:00
Daniel Stenberg
470611d76c
hostip: remove unnecessary leftover INT_MAX check in Curl_dnscache_prune
The math already uses timediff_t so no need for the extra logic

Ref: #18678
Closes #18680
2025-09-24 14:11:36 +02:00
Daniel Stenberg
66c7e92ae4
Revert "cf_socket_recv: don't count reading zero bytes as first byte"
This reverts commit df60e8fe70.

The "first byte" checkpoint is not strictly the first byte received, but
the sign of first traffic from the server, which a closed connection
also is.

Closes #18676
2025-09-24 14:09:05 +02:00
Daniel Stenberg
7cb5e39f36
socks_gssapi: reject too long tokens
If GSS returns a token to use that is longer than 65535 bytes, it can't
be transmitted since the length field is an unisgned 16 bit field and
thus needs to trigger an error.

Reported in Joshua's sarif data

Closes #18681
2025-09-24 14:07:03 +02:00
Stefan Eissing
976a08985a
ares: fix leak in tracing
When DNS tracing is enabled, a string allocated by ares was not freed.

Reported-by: jmaggard10 on github
Bug: https://github.com/curl/curl/pull/18251#pullrequestreview-3255785083
Closes #18691
2025-09-24 14:06:24 +02:00
renovate[bot]
f8f84b40cc
GHA: Update ngtcp2/ngtcp2 to v1.16.0
Closes #18706
2025-09-24 14:03:44 +02:00
renovate[bot]
a99d79616b
GHA: update ngtcp2/nghttp3 to v1.12.0
Closes #18705
2025-09-24 14:03:08 +02:00
Viktor Szakats
cc157b4963
GHA/distcheck: bump timeout for the cmake integration
It may take 1.5 minutes to find the C compiler on macos with old cmake.
The build is also slow due to no unity and Ninja support.

```
Wed, 24 Sep 2025 04:56:51 GMT -- Using CMake version 3.11.4
Wed, 24 Sep 2025 04:58:01 GMT -- The C compiler identification is AppleClang 17.0.0.17000013
Wed, 24 Sep 2025 04:58:02 GMT -- Check for working C compiler: /Applications/Xcode_16.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
Wed, 24 Sep 2025 04:59:33 GMT -- Check for working C compiler: /Applications/Xcode_16.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- works
Wed, 24 Sep 2025 04:59:33 GMT -- Detecting C compiler ABI info
Wed, 24 Sep 2025 04:59:35 GMT -- Detecting C compiler ABI info - done
```
Ref: https://github.com/curl/curl/actions/runs/17966736478/job/51100678487?pr=18700#step:10:50

Closes #18702
2025-09-24 11:25:00 +02:00
Viktor Szakats
bdbb50a63e
GHA/dist: fix number of parallel jobs on macos runner
It was using the global parallel value in cmake integration tests, while
on macos runners, this should be lower by one, as used in other macos
jobs. Performance impact is minimal.

Follow-up to fb70812437 #16126
Closes #18701
2025-09-24 10:40:20 +02:00
renovate[bot]
135e4ec1dd
GHA: update dependency awslabs/aws-lc to v1.61.3
Closes #18690
2025-09-24 01:04:18 +02:00
Viktor Szakats
1acdf3bd64
GHA/macos: add macos-26, llvm20, gcc15, drop macos-14, gcc14
Number of combo jobs down to 22 from 24.

Also:
- update the version matrix.
- update exclusion matrix.
- include verbose compiler configuration dump.
  It makes the Apple-included, default `-I/usr/local/include` visible.
  Ref: #18683

Closes #18698
2025-09-23 20:24:21 +02:00
Viktor Szakats
67de9924eb
GHA/linux: enable libidn2 and libssh in asan job
Closes #18697
2025-09-23 13:02:52 +02:00
Viktor Szakats
b326293619
GHA/linux: fix address sanitizer error output
Same issue as seen earlier in the tsan job. Fix it the same way, by
switching to cmake to avoid autotools' libtool confusing the analyzer.
Ref: 2a46df31fd #18274

Configuration remains identical. I removed libssh2 from the installed
packages, because it was unused before, but cmake enabled it by default
and libssh2 has memory leaks:
Ref: https://github.com/curl/curl/actions/runs/17941312820/job/51018425159

Fixing:
```
/usr/bin/llvm-symbolizer-18: /home/runner/work/curl/curl/bld/lib/.libs/libcurl.so.4: no version information available (required by /usr/bin/llvm-symbolizer-18)
/usr/bin/llvm-symbolizer-18: symbol lookup error: /home/runner/work/curl/curl/bld/lib/.libs/libcurl.so.4: undefined symbol: __asan_option_detect_stack_use_after_return
==33900==WARNING: Can't read from symbolizer at fd 3
[..]
==33900==WARNING: Can't write to symbolizer at fd 6
==33900==WARNING: Failed to use and restart external symbolizer
```
Ref: https://github.com/curl/curl/actions/runs/17939949191/job/51013953675?pr=18693

Cherry-picked from #18693
Closes #18696
2025-09-23 12:39:48 +02:00
Viktor Szakats
71fc11e6bb
GHA/codeql: build units on Linux
Closes #18695
2025-09-23 11:48:02 +02:00
Viktor Szakats
051839eb8f
tidy-up: URLs
Closes #18689
2025-09-23 00:34:46 +02:00
Viktor Szakats
f833d5d1fb
cmake: use modern alternatives for get_filename_component()
- use `cmake_path()` to query filenames, with CMake 3.20 or upper.
  https://cmake.org/cmake/help/v4.1/command/cmake_path.html#query

- use `cmake_host_system_information()` to query the registry,
  with CMake 3.24 or upper.
  https://cmake.org/cmake/help/v4.1/command/cmake_host_system_information.html#query-windows-registry
  Replacing the undocumented method.

- also quote the value passed to `get_filename_component()` where
  missing. (Could not cause an actual issue as used in the code.)

Closes #18688
2025-09-22 20:01:08 +02:00
Viktor Szakats
d75785c7de
GHA: enable more options in static analyzer jobs
This is an effort to pass more code through clang-tidt and scan-build
static analyzers. Following CodeQL Linux jobs.

GHA/codeql:
- also build with libssh.
- disable verbose output in build steps.

GHA/linux:
- enable more build options for the clang-tidy and scan-build jobs:
  libidn2, nghttp2, ldap, kerberos, rtmp, gnutls, gsasl, rustls,
  mbedtls, wolfssl
  Use Linuxbrew where necessary.
- also enable ECH, gssapi in the scan-build job.
- fix 'scanbuild' to be 'scan-build' in the job name.

GHA/macos:
- build with Rustls in the clang-tidy job.
- add a new clang-tidy job to test HTTP/3 (with openssl + ngtcp2).
- build with libssh in one of the clang-tidy jobs.
- build with LibreSSL in the MultiSSL clang-tidy job.
- build with heimdal and kerberos in the clang-tidy jobs respectively.
- build with OpenLDAP in one clang-tidy job.
- add support for `skipall`, `skiprun` job options, and use it.

Closes #18660
2025-09-22 13:10:51 +02:00
Viktor Szakats
cd20f7b653
libssh: drop two unused assigments
Reported in macOS clang-tidy v21.1.1 build, after enabling libssh in it:
```
lib/vssh/libssh.c
lib/vssh/libssh.c:1342:9: error: Value stored to 'to_t' is never read [clang-analyzer-deadcode.DeadStores,-warnings-as-errors]
 1342 |         to_t = STRE_OK;
      |         ^
lib/vssh/libssh.c:1342:9: note: Value stored to 'to_t' is never read
lib/vssh/libssh.c:1349:9: error: Value stored to 'from_t' is never read [clang-analyzer-deadcode.DeadStores,-warnings-as-errors]
 1349 |         from_t = STRE_OK;
      |         ^
lib/vssh/libssh.c:1349:9: note: Value stored to 'from_t' is never read
2 warnings generated.
```
Ref: https://github.com/curl/curl/actions/runs/17909917954/job/50918955923?pr=18660#step:11:182

Cherry-picked from #18660
Closes #18684
2025-09-22 13:02:10 +02:00
Viktor Szakats
330129c836
GHA/linux: install zlib in all jobs by default
Cherry-picked from #18660
Closes #18672
2025-09-22 10:11:31 +02:00
Viktor Szakats
7f5ff8f276
autotools: capitalize 'Rustls' in the log output
To match the rest of the codebase.

Follow-up to 548d8a8421
Cherry-picked from #18660
Closes #18671
2025-09-22 10:11:31 +02:00
Viktor Szakats
aa9fa4d68e
rustls: fix clang-tidy warning
Seen with v21.1.1, non-debug-enabled build:
```
lib/vtls/rustls.c:415:23: error: File position of the stream might be 'indeterminate'
after a failed operation. Can cause undefined behavior [clang-analyzer-unix.Stream,-warnings-as-errors]
  415 |     const size_t rr = fread(buf, 1, sizeof(buf), f);
      |                       ^
```
Ref: https://github.com/curl/curl/actions/runs/17898248031/job/50887746633?pr=18660#step:11:174

Cherry-picked from #18660
Closes #18670
2025-09-22 10:11:31 +02:00
Viktor Szakats
c9eff26c17
tool_doswin: fix to use curl socket functions
Replace `WSASocketW()` with `CURL_SOCKET()`. Also replace a call
to `socketclose()` with `sclose()`. According to a comment,
`socketclose()` was chosen to silence test 1498 (and 2300) reporting
`MEMORY FAILURE`. These reports were accurate, and were caused by
calling `WSASocketW()` instead of `socket()` (now `CURL_SOCKET()`).

This also fixes the curl `sclose()` call on an error branch, which is
now correctly paired with a curl socket open. The mismatched open/close
calls caused an issue in TrackMemory-enabled (aka `CURLDEBUG`) builds.

Docs confirm that `socket()` is defaulting to overlapped I/O, matching
the replaced `WSASocketW()` call:
https://learn.microsoft.com/windows/win32/api/winsock2/nf-winsock2-socket#remarks

Also:
- checksrc: ban `WSASocket*()` functions.
- report `SOCKERRNO` instead of `GetLastError()` for socket calls,
  to match the rest of the codebase.

Follow-up to 9a2663322c #17572

Closes #18633
2025-09-22 10:11:30 +02:00
Daniel Stenberg
1f0f0bdb19
managen: strict protocol check
- protocols MUST match one in the accept-list
- protocols are typically all uppercase
- drop All
- use SCP and SFTP instead of SSH
- add Protocols: to some options previously missing one

Closes #18675
2025-09-22 09:06:00 +02:00
Daniel Stenberg
c4f9977c66
tftp: pin the first used address
Store the used remote address on the first receive call and then make
sure that it remains the same address on subsequent calls to reduce the
risk of tampering. Doesn't make the transfer secure because it is still
unauthenticated and clear text.

Reported in Joshua's sarif data

Closes #18658
2025-09-21 23:01:01 +02:00
Daniel Stenberg
a72e1552f2
telnet: refuse IAC codes in content
Ban the use of IAC (0xff) in telnet options set by the application. They
need to be escaped when sent but I can't see any valid reason for an
application to send them.

Of course, an application sending such data basically ask for trouble.

Reported in Joshua's sarif data

Closes #18657
2025-09-21 23:00:02 +02:00
Viktor Szakats
989a274e45
autotools: add support for libgsasl auto-detection via pkg-config
Enable with `--with-gsasl`, as before.

Cherry-picked from #18660
Closes #18669
2025-09-21 21:20:32 +02:00
Viktor Szakats
374c23c617
autotools: fix duplicate UNIX and BSD flags in buildinfo.txt
Follow-up to 2a292c3984 #15975

Closes #18667
2025-09-21 18:51:11 +02:00
Viktor Szakats
e21cc7844d
autotools: fix silly mistake in clang detection for buildinfo.txt
Follow-up to 0513f9f878 #18645

Closes #18666
2025-09-21 18:51:10 +02:00
Viktor Szakats
e5d9c871f0
tidy-up: assortment of small fixes
- examples/headerapi: fix wrong cast.
- curl_ngtcp2: delete stray character from error message.
- rustls: fix inline variable declaration.
- sendf: drop redundant `int` cast.
- libtest/cli_ws_data: drop cast with mismatched signedness.

Cherry-picked from #18343

Closes #18664
2025-09-21 16:50:14 +02:00
Viktor Szakats
06d00e3879
cmake: clang detection tidy-ups
Follow-up to 0513f9f878 #18645
Follow-up to fe5225b5ea #18209

Closes #18659
2025-09-21 15:26:49 +02:00
Viktor Szakats
c23d7e7a98
GHA/codeql: enable ECH and HTTPS-RR
Switch to Linuxbrew c-ares to hit the minimum version.
(Ubuntu offers 1.27.0, HTTPS-RR requires 1.28.0.)

Closes #18661
2025-09-21 14:36:25 +02:00
Daniel Stenberg
d57e7cf20d
ws: reject curl_ws_recv called with NULL buffer with a buflen
Arguably this is just a bad application.

Reported in Joshua's sarif data

Closes #18656
2025-09-21 11:15:19 +02:00
Daniel Stenberg
0c53a5e5dc
openldap: check ldap_get_option() return codes
Do not just assume that they always work.

Reported in Joshua's sarif data

Closes #18653
2025-09-21 09:50:23 +02:00
Daniel Stenberg
ab3a293fd0
libssh: fix range parsing error handling mistake
The range-parsing returned CURLE_RANGE_ERROR directly on one error
instead of calling myssh_to_ERROR() like it should and like it does for
all other errors.

Reported in Joshua's sarif data

Closes #18652
2025-09-21 09:49:38 +02:00
Daniel Stenberg
05930f304b
rustls: use %zu for size_t in failf() format string
Reported in Joshua's sarif data

Closes #18651
2025-09-21 09:48:47 +02:00
Daniel Stenberg
a9baf82a9b
ftp: fix ftp_do_more returning with *completep unset
Specifically, when ftpc->wait_data_conn was true and
Curl_conn_connect(...) returned with serv_conned == false the code
called ftp_check_ctrl_on_data_wait and returned without setting
*completep.

Now set it to 0 at function start to avoid this happening again.

Reported in Joshua's sarif data

Closes #18650
2025-09-21 09:47:01 +02:00
Daniel Stenberg
3b22ed999e
telnet: return error on crazy TTYPE or XDISPLOC lengths
Also use the packet size msnprintf() stores instead of calculating it
separately.

Reported in Joshua's sarif data

Closes #18648
2025-09-21 09:45:29 +02:00
Daniel Stenberg
3d8e15650c
vtls_int.h: clarify data_pending
Suggested-by: Joseph Birr-Pixton

Closes #18644
2025-09-21 09:43:28 +02:00
Daniel Stenberg
fd61ed062b
ws: clarify an error message
Instead of:

 "[WS] frame length longer than 64 signed not supported"

Use:

 "[WS] frame length longer than 63 bit not supported"

Closes #18654
2025-09-21 09:41:17 +02:00
Daniel Stenberg
4e8dfe2093
RELEASE-NOTES: spellcheck! 2025-09-21 09:41:17 +02:00
Viktor Szakats
0513f9f878
build: show llvm/clang in platform flags and buildinfo.txt
Show these flags:
- `LLVM-CLANG` for mainline llvm/clang.
- `APPLE-CLANG` for Apple clang.
- `CLANG-CL` for clang-cl. (cmake only)

Also:
- GHA/linux: fix a job to build with clang, to match its descriptions.

Closes #18645
2025-09-21 01:59:56 +02:00
Daniel Stenberg
4189c2c0fe
RELEASE-NOTES: synced 2025-09-21 00:05:55 +02:00
Daniel Stenberg
3dad0cfd77
write-out: make %header{} able to output *all* occurances of a header
By appending `:all:[separator]` to the header name. The `[separator]` string
is output between each header value if there are more than one to output.

Test 764 and 765 verify

Idea-by: kapsiR on github
Ref: #18449
Closes #18491
2025-09-21 00:00:29 +02:00
Daniel Stenberg
5ab120bc4e
krb5: drop support for Kerberos FTP
It was accidentally broken in commit 0f4c439fc7, shipped since
8.8.0 (May 2024) and yet not a single person has noticed or reported,
indicating that we might as well drop support for FTP Kerberos.

Krb5 support was added in 54967d2a3a (July 2007), and we have
been carrying the extra license information around since then for this
code. This commit removes the last traces of that code and thus we can
remove the extra copyright notices along with it.

Reported-by: Joshua Rogers
Closes #18577
2025-09-20 23:58:28 +02:00
Daniel Stenberg
bb46d42407
openssl: make the asn1_object_dump name null terminated
In case the buffer is too small.

Reported in Joshua's sarif data

Closes #18647
2025-09-20 23:12:15 +02:00
Daniel Stenberg
cf3b9657bc
libssh2: up the minimum requirement to 1.9.0
Released on June 20 2019
2025-09-20 22:39:07 +02:00
Daniel Stenberg
50968d0378
httpsrr: free old pointers when storing new
In case we get "funny" input and the same field is provided several
times, free the old pointer before stored a new memdup.

Reported in Joshua's sarif data

Closes #18631
2025-09-20 22:38:15 +02:00
Daniel Stenberg
979366a625
openldap: improve check for receiving blank data
It can't access the first byte either unless it has length.

Followup to 232d5a2ed9

Closes #18632
2025-09-20 22:37:10 +02:00
Daniel Stenberg
66d6075af9
tftp: return error when sendto() fails
The code just called failf() and then continued without returning error.

Reported in Joshua's sarif data

Closes #18643
2025-09-20 22:35:12 +02:00
Daniel Stenberg
e2d3b83244
libssh: return out of memory correctly if aprintf fails
The code called set sshc->nextstate and returned SSH_OK without setting
sshc->actualcode to an error code.

Reported in Joshua's sarif data

Closes #18637
2025-09-20 17:49:07 +02:00
Daniel Stenberg
d27d9c7ef1
cf-socket: use the right byte order for ports in bindlocal
Reported in Joshua's sarif data

Closes #18641
2025-09-20 17:34:18 +02:00
Daniel Stenberg
94eec0a788
schannel: assign result before using it
curl_easy_strerror(result) was called *before* result was assigned.

Reported in Joshua's sarif data

Closes #18642
2025-09-20 17:30:59 +02:00
Daniel Stenberg
82eeda1041
CURLOPT_HEADER/WRITEFUNCTION.md: drop '* size' since size is always 1
Closes #18640
2025-09-20 17:27:17 +02:00
Daniel Stenberg
df8244c30f
libssh: error on bad chown number and store the value
To avoid continuing with an unintended zero uid. Also actually use the
value, which was omitted before!

Reported in Joshua's sarif data

Closes #18639
2025-09-20 17:26:38 +02:00
Daniel Stenberg
ca8ec6e033
tftp: handle tftp_multi_statemach() return code
Previously just ignored.

Reported in Joshua's sarif data

Closes #18638
2025-09-20 17:25:35 +02:00
Daniel Stenberg
277ebca610
ftp: fix port number range loop for PORT commands
If the last port to test is 65535, the loop would previously wrongly
wrap the counter and start over at 0, which was not intended.

Reported in Joshua's sarif data

Closes #18636
2025-09-20 17:24:44 +02:00
Daniel Stenberg
2a5da01e42
socks: make Curl_blockread_all return CURLcode
Reported in Joshua's sarif data

Closes #18635
2025-09-20 15:15:13 +02:00
Viktor Szakats
ca75476a5c
GHA/codeql: drop winbuild references [ci skip]
Follow-up to 8d004781a5 #18040
2025-09-20 15:07:29 +02:00
Viktor Szakats
bf7375ecc5
build: avoid overriding system symbols for socket functions
Before this patch `accept4()`, `socket()`, `socketpair()`, `send()` and
`recv()` system symbols were remapped via macros, using the same name,
to local curl debug wrappers. This patch replaces these overrides by
introducing curl-namespaced macros that map either to the system symbols
or to their curl debug wrappers in `CURLDEBUG` (TrackMemory) builds.

This follows a patch that implemented the same for `accept()`.

The old method required tricks to make these redefines work in unity
builds, and avoid them interfering with system headers. These tricks
did not work for system symbols implemented as macros.

The new method allows to setup these mappings once, without interfering
with system headers, upstream macros, or unity builds. It makes builds
more robust.

Also:
- checksrc: ban all mapped functions.
- docs/examples: tidy up checksrc rules.

Follow-up to 9863599d69 #18502
Follow-up to 3bb5e58c10 #17827

Closes #18503
2025-09-20 13:44:59 +02:00
Daniel Stenberg
2fe95cb0e3
rustls: typecast variable for safer trace output
This is a variadic function call with a mismatched argument type; on
platforms where uintptr_t and size_t differ, this invokes undefined
behavior.

Reported in Joshua's sarif data

Closes #18628
2025-09-20 12:07:10 +02:00
Daniel Stenberg
0209e087c6
tool_cb_hdr: size is always 1
- add comment in the header that the argument 'size' is always 1,
  as guaranteed by the libcurl API

- then fix the call to fwrite() to avoid using "size, etag_length" which
  would be wrong if size was something else than 1, and use a fixed
  number there instead.

Reported in Joshua's sarif data

Closes #18630
2025-09-20 12:06:27 +02:00
Daniel Stenberg
335d16e944
libssh: error on bad chgrp number
To avoid it continuing with a zero gid.

Reported in Joshua's sarif data

Closes #18629
2025-09-20 12:05:31 +02:00
Daniel Stenberg
7a26304a95
curl_slist_append.md: clarify that a NULL pointer is not acceptable
Closes #18627
2025-09-20 12:04:47 +02:00
Viktor Szakats
1429858bce
tidy-up: update MS links, allow long URLs via checksrc
- update Microsoft documentation links.
  (also drop language designator where present.)

- checksrc: allow longer than 78 character lines if they
  contain a https URL. To make these links easier to use and parse.

- merge links that were split into two lines.

Closes #18626
2025-09-20 11:49:23 +02:00
Viktor Szakats
92f215fea1
build: address some -Weverything warnings, update picky warnings
`-Weverything` is not enabled by curl, and not recommended by LLVM,
because it may enable experimental options, and will result in new
fallouts after toolchain upgrades. This patch aims to fix/silence as much
as possible as found with llvm/clang 21.1.0. It also permanently enables
warnings that were fixed in source and deemed manageable in the future.
`-Wformat` warnings are addressed separately via #18343.

Fix/silence warnings in the source:
- typecheck-gcc.h: fix `-Wreserved-identifier`.
- lib: silence `-Wcast-function-type-strict`.
  For llvm 16+ or Apple clang 16+.
- asyn-ares: limit `HAPPY_EYEBALLS_DNS_TIMEOUT` to old c-ares versions.
- curl_trc: fix `-Wc++-hidden-decl`.
- doh: fix `-Wc++-keyword`.
- ftp: fix `-Wreserved-identifier`.
- ldap: fix `-Wreserved-identifier`.
- mqtt: comment unused macro to avoid warning.
- multi_ev: drop unused macros to avoid warnings.
- setopt: fix useless `break;` after `return;`.
- gtls, mbedtls, rustls: silence `-Wconditional-uninitialized`.
- socks_sspi, schannel, x509asn1: fix `-Wimplicit-int-enum-cast`.
- x509asn1: fix `-Wc++-keyword`.
- openssl: scope `OSSL_UI_METHOD_CAST` to avoid unused macro warning.
- libssh2, wolfssl: drop unused macros.
- curl_ngtcp2, curl_quiche, httpsrr, urlapi: drop/limit unused macros.
- tool_getparam: fix useless `break;` after `return;` or `break;`.
  Not normally enabled because it doesn't work with unity.
  https://github.com/llvm/llvm-project/issues/71046
- tool_operate: fix `-Wc++-keyword`.
- curlinfo: fix a `-Wunsafe-buffer-usage`.
- tests: silence `-Wformat-non-iso`.
- lib557: fix `-Wreserved-identifier`.
- lib1565: silence `-Wconditional-uninitialized`.

Enable the above clang warnings permanently in picky mode:
- `-Wc++-hidden-decl`
- `-Wc++-keyword` (except for Windows, where it collides with `wchar_t`)
- `-Wcast-function-type-strict`
- `-Wcast-function-type`
- `-Wconditional-uninitialized`
- `-Wformat-non-iso` (except for clang-cl)
- `-Wreserved-identifier`
- `-Wtentative-definition-compat`

Silence problematic `-Weverything` warnings globally (in picky mode):
- `-Wused-but-marked-unused` (88000+ hits) and
  `-Wdisabled-macro-expansion` (2600+ hits).
  Triggered by `typecheck-gcc.h` when building with clang 14+.
  Maybe there exists a way to fix within that header?
  Ref: https://discourse.llvm.org/t/removing-wused-but-marked-unused/55310
- `-Wunsafe-buffer-usage`. clang 16+. 7000+ hits.
  May be useful in theory, but such high volume of hits makes it
  impractical to review and possibly address. Meant for C++.
  Ref: https://clang.llvm.org/docs/SafeBuffers.html
  Ref: https://stackoverflow.com/questions/77017567/how-to-fix-code-to-avoid-warning-wunsafe-buffer-usage
  Ref: https://discourse.llvm.org/t/rfc-c-buffer-hardening/65734
  Ref: https://github.com/llvm/llvm-project/pull/111624
- `-Wimplicit-void-ptr-cast`. clang 21+. 1700+ hits.
  C++ warning, deemed pure noise.
  Ref: https://github.com/curl/curl/issues/18470#issuecomment-3253506266
- `-Wswitch-default` (180+ hits), `-Wswitch-enum` (190+ hits),
  `-Wcovered-switch-default` (20+ hits).
  Next to impossible to fix cleanly, esp. when the covered `case`
  branches depend on compile-time options.
- `-Wdocumentation-unknown-command` (8+ hits).
  Triggered in a few sources. Seems arbitrary and bogus.
- `-Wpadded` (550+ hits).
- `-Wc++-keyword` on Windows, where it collides with `wchar_t`.
  (100+ hits)
  Ref: https://github.com/llvm/llvm-project/issues/155988
- `-Wreserved-macro-identifier`. clang 13+. 5+ hits.
  Sometimes it's necessary to set external macros that use
  the reserved namespace. E.g. `_CRT_NONSTDC_NO_DEPRECATE`,
  `__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__`, `__NO_NET_API`,
  possibly `_REENTRANT`, and more.
  It's not worth trying to silence them individually.
- `-Wnonportable-system-include-path` with `clang-cl`.
  It'd be broken by doing what the warning suggests.
- `-Wformat-non-iso` for clang-cl.

CMake `PICKY_COMPILER=ON` (the default) or `./configure`
`--enable-warnings` (not the default) is required to enable these
silencing rules.

Also:
- autotools, cmake: fix Apple clang and mainline llvm version translations.
  Ref: https://en.wikipedia.org/wiki/Xcode#Toolchain_versions
- autotools, cmake: enable `-Warray-compare` for clang 20+.
  Follow-up to 4b7accda5a #17196
- cmake: fix to enable `-Wmissing-variable-declarations` at an earlier
  clang version.
- cmake: update internal logic to handle warning options with `+` in
  them.
- cmake: fix internal logic to match the whole option when looking
  into `CMAKE_C_FLAGS` for custom-disabled warnings.

Follow-up to b85cb8cb4e #18485

Closes #18477
2025-09-20 10:16:15 +02:00
Viktor Szakats
87cbeecee4
windows: stop passing unused, optional argument for Win9x compatibility
Expiry timestamp in `AcquireCredentialsHandle()` (SSPI) and
`InitializeSecurityContext()` (Schannel) calls. The argument is optional
in both. The returned value was never used in curl. The reason for
passing it was Windows 95 compatibility, according to comments in
the SSPI code. curl no longer supports Windows 95.

Ref: https://learn.microsoft.com/windows/win32/api/sspi/nf-sspi-acquirecredentialshandlea
Ref: https://learn.microsoft.com/windows/win32/secauthn/initializesecuritycontext--schannel

Ref: 3fe5311967
Ref: aaa42aa0d5

Closes #18490
2025-09-20 02:27:07 +02:00
Viktor Szakats
ad26a6cb99
tidy-up: avoid using the reserved macro namespace
To avoid hitting `-Wreserved-macro-identifier` where possible.

- amigaos: introduce local macro instead of reusing `__request()`.
- easy_lock: avoid redefining `__has_builtin()`.
  Follow-up to 33fd57b8ff #9062
- rand: drop interim macro `_random()`.
- windows: rename local macro `_tcsdup()` to `Curl_tcsdup()`.
  To avoid using the reserved macro namespace and to avoid
  colliding with `_tcsdup()` as defined by Windows headers.
- checksrc: ban `_tcsdup()` in favor of `Curl_tcsdup()`.
- tool_doswin: avoid redefining `_use_lfn()` (MS-DOS).
- tool_findfile: limit `__NO_NET_API` hack to AmigaOS.
  Syncing this pattern with `lib/netrc.c`.
  Follow-up to 784a8ec2c1 #16279
- examples/http2-upload: avoid reserved namespace for local macro.

More cases will be removed when dropping WinCE support via #17927.

Cases remain when defining external macros out of curl's control.

Ref: #18477
Closes #18482
2025-09-20 02:27:06 +02:00
Viktor Szakats
096fc4325b
digest_sspi: fix two memory leaks in error branches
Closes #18488
2025-09-20 01:28:35 +02:00
Viktor Szakats
91720b620e
cmake: add CURL_CODE_COVERAGE option
To sync up with the `--enable-code-coverage` `./configure` option.

Ref: https://gcc.gnu.org/onlinedocs/gcc/Invoking-Gcov.html
Ref: https://gcc.gnu.org/onlinedocs/gcc/Cross-profiling.html
Ref: https://clang.llvm.org/docs/SourceBasedCodeCoverage.html

Closes #18468
2025-09-20 01:28:35 +02:00
Viktor Szakats
dc3f4fd89b
autotools: make --enable-code-coverage support llvm/clang
Cherry-picked from #18468

Closes #18473
2025-09-20 01:28:35 +02:00
Viktor Szakats
1c49f2f26d
windows: replace _beginthreadex() with CreateThread()
Replace `_beginthreadex()` C runtime calls with native win32 API
`CreateThread()`. The latter was already used in `src/tool_doswin.c`
and in UWP and Windows CE builds before this patch. After this patch
all Windows flavors use it. To drop PP logic and simplify code.

While working on this it turned out that `src/tool_doswin.c` calls
`TerminateThread()`, which isn't recommended by the documentation,
except for "the most extreme cases". This patch makes no attempt
to change that code.
Ref: 9a2663322c #17572
Ref: https://learn.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminatethread

Also:
- use `WaitForSingleObjectEx()` on all desktop Windows.
  Ref: 4be80d5109
  Ref: https://sourceforge.net/p/curl/feature-requests/82/
  Ref: https://learn.microsoft.com/windows/win32/api/synchapi/nf-synchapi-waitforsingleobjectex
- tests: drop redundant casts.
- lib3207: fix to not rely on thread macros when building without thread
  support.

Assisted-by: Jay Satiro
Assisted-by: Marcel Raad
Assisted-by: Michał Petryka
Follow-up to 38029101e2 #11625

Closes #18451
2025-09-20 01:28:35 +02:00
Viktor Szakats
8d004781a5
build: drop the winbuild build system
In favor of CMake.

Closes #18040
2025-09-20 01:20:25 +02:00
Daniel Stenberg
5e2d4d7905
base64: accept zero length argument to base64_encode
We used to treat 0 as "call strlen() to get the length" for
curlx_base64_encode, but it turns out this is rather fragile as we
easily do the mistake of passing in zero when the data is actually not
there and then calling strlen() is wrong.

Force the caller to pass in the correct size. A zero length input string
now returns a zero length output and a NULL pointer.

Closes #18617
2025-09-19 22:57:20 +02:00
Daniel Stenberg
a0369e1705
gtls: avoid potential use of uninitialized variable in trace output
Reported in Joshua's sarif data

Closes #18620
2025-09-19 22:55:52 +02:00
Daniel Stenberg
58f071dbe4
tool_getparam/set_rate: skip the multiplication on overflow
The code detected the problem but didn't avoid the calculation
correctly.

Fixes #18624
Reported-by: BobodevMm on github
Closes #18625
2025-09-19 22:54:57 +02:00
Daniel Stenberg
b0c823b86f
RELEASE-NOTES: synced
and bump to 8.17.0
2025-09-19 16:47:01 +02:00
Daniel Stenberg
fd6eb8d6e7
cookie: avoid saving a cookie file if no transfer was done
Because parts of the cookie loading happens on transfer start the
in-memory cookie jar risks being incomplete and then a save might
wrongly truncate the target file.

Added test 1902 to verify.

Reported-by: divinity76 on github
Fixes #18621
Closes #18622
2025-09-19 16:40:20 +02:00
Daniel Stenberg
1055864b03
telnet: make printsub require another byte input
Reported in Joshua's sarif data

Closes #18618
2025-09-19 14:40:09 +02:00
Daniel Stenberg
df60e8fe70
cf_socket_recv: don't count reading zero bytes as first byte
Reported in Joshua's sarif data

Closes #18615
2025-09-19 14:39:15 +02:00
Daniel Stenberg
4f5528675a
libssh: react on errors from ssh_scp_read
Reported in Joshua's sarif data

Closes #18616
2025-09-19 14:38:20 +02:00
Viktor Szakats
b2356a3197
GHA: tidy up actions/checkout version in comments [ci skip] 2025-09-19 14:20:14 +02:00
Viktor Szakats
9618c337d1
GHA/codeql: try disabling the TRAP cache
The `cpp` CodeQL job is adding a cache entry for each run on the master
branch. One for Linux, another for Windows. Size: 68MB + 180MB = 248MB.
In one week we got 50+ such entries, almost filling the available cache
space.

Following the recommendation in an open issue thread, this patch tries
to disable this cache. Since it only affects master, the effect can only
be verified after merging.

The latest cache is picked up in PRs. The performance impact is also to
be seen after merge.

Bug: https://github.com/curl/curl/pull/18528#issuecomment-3288950880
Ref: https://github.com/github/codeql-action/pull/1172
Ref: https://github.com/github/codeql-action/issues/2030
Ref: https://github.com/github/codeql-action/issues/2885#issuecomment-2879069087

Follow-up to cc50f05370 #18528

Closes #18613
2025-09-19 11:30:39 +02:00
Viktor Szakats
0d9a07abb7
libssh2: drop two redundant null-terminations
The null-termination was first added in the initial SFTP commit in 2006:
a634f64400

At that time this was a reasonable concern because libssh2 started
null-terminating this string just one year prior, in 2005:
efc3841fd2

This fix was released in libssh2 v0.13 (2006-03-02).

curl requires libssh2 v1.2.8, making this workaround no longer necessary.

Follow-up to 9f18cb6544 #18598

Closes #18606
2025-09-19 09:46:45 +02:00
Daniel Stenberg
9fb8d567ca
tool_operate: keep the progress meter for --out-null
Fixes #18607
Closes #18609
2025-09-19 09:13:12 +02:00
Viktor Szakats
9f18cb6544
libssh2: error check and null-terminate in ssh_state_sftp_readdir_link()
- null-terminate the result to match the other getter
  `libssh2_sftp_symlink_ex()` call.

- check negative result and bail out early.

Reported-by: Joshua Rogers

Closes #18598
2025-09-18 22:01:27 +02:00
Viktor Szakats
cec6c1cd9c
GHA/codeql: make it run on docs updates, to verify examples
Follow-up to b4922b1295 #18564
2025-09-18 20:26:27 +02:00
Viktor Szakats
f13250edf1
examples: fix two issues found by CodeQL
- http2-upload: use `fstat()` to query file length to fix TOCTOU.

- ftpuploadresume: fix checking `sscanf()` return value.

Follow-up to b4922b1295 #18564
Closes #18605
2025-09-18 20:14:21 +02:00
Jay Satiro
ce354d0f4d tool_operate: Improve wording in retry message
- Use the plural 'seconds' for anything other than exactly 1 second.

Before: Will retry in 1.250 second.
After: Will retry in 1.250 seconds.

Follow-up to ca034e83.

Closes https://github.com/curl/curl/pull/18604
2025-09-18 12:09:02 -04:00
Daniel Stenberg
54aff4db3c
tftp: check and act on tftp_set_timeouts() returning error
Reported-by: Joshua Rogers
Ref: https://github.com/curl/curl/pull/18574#issuecomment-3300183302
Closes #18603
2025-09-18 17:54:13 +02:00
Joshua Rogers
ad147ec53d
tftp: propagate expired timer from tftp_state_timeout()
When Curl_timeleft() < 0 we used to return 0, masking the expiry and
skipping the caller’s (timeout_ms < 0) path. Now we set FIN and return
the negative value so tftp_multi_statemach() aborts with
CURLE_OPERATION_TIMEDOUT as intended.

Closes #18574
2025-09-18 17:34:31 +02:00
Jay Satiro
f8175b1536 socks_sspi: Fix some memory cleanup calls
- Ensure memory allocated by malloc() is freed by free().

Prior to this change SSPI's FreeContextBuffer() was sometimes used to
free malloc'd memory. I can only assume the reason we have no crash
reports about this is because the underlying heap free is probably the
same for both.

Reported-by: Joshua Rogers

Fixes https://github.com/curl/curl/issues/18587
Closes https://github.com/curl/curl/pull/18594
2025-09-18 11:29:15 -04:00
Joshua Rogers
a80abc45a5
sasl: clear canceled mechanism instead of toggling it
Use &= ~authused in SASL_CANCEL (was ^=) to actually remove the offending
mechanism and avoid re-enabling a disabled mech on retry.

Closes #18573
2025-09-18 17:27:29 +02:00
Daniel Stenberg
44a586472b
ldap: do not base64 encode zero length string
Reported-by: Joshua Rogers
Closes #18602
2025-09-18 17:15:30 +02:00
Viktor Szakats
b4922b1295
GHA/codeql: enable cares, debug, build curlinfo, examples
Also build examples, out of curiousity, as an experiment, possibly
temporary. It needs around 40 seconds.

Closes #18564
2025-09-18 16:48:17 +02:00
Daniel Stenberg
232d5a2ed9
openldap: avoid indexing the result at -1 for blank responses
Reported-by: Joshua Rogers

Closes #18600
2025-09-18 16:06:33 +02:00
Daniel Stenberg
5cc2b83446
smb: adjust buffer size checks
The checks did not account for the **two byte** 16bit read so risked
reading one more byte than what actually was received.

Reported-by: Joshua Rogers

Closes #18599
2025-09-18 16:05:33 +02:00
Stefan Eissing
0f08211330
cfilter: unlink and discard
Rewrite the code that removes a filter from the connection and discards
it. Always look at the connection, otherwise it will not work of the
filter is at the top of the chain.

Change QUIC filter setup code to always tear down the chain in
construction when an error occured.

HTTP proxy, do not remove the h1/h2 sub filter on close. Leave it to be
discarded with the connection. Avoids keeping an additional pointer that
might become dangling.

Triggered by a reported on a code bug in discard method.

Reported-by: Joshua Rogers
Closes #18596
2025-09-18 12:20:26 +02:00
Daniel Stenberg
ca034e839c
tool: fix exponential retry delay
Also, show retry delay with decimals since it might be not be integer
seconds.

Regression from da27db068f (shipped in 8.16.0)

Reported-by: Andrew Olsen
Fixes #18591
Assisted-by: Jay Satiro
Closes #18595
2025-09-18 10:15:54 +02:00
Joshua Rogers
4e74b9f592
socks_sspi: restore non-blocking socket on error paths
Closes #18592
2025-09-18 08:13:52 +02:00
Joshua Rogers
20f757ef14
tool_cb_hdr: fix fwrite check in header callback
Compare fwrite result to nmemb (items), not cb (bytes).

Closes #18593
2025-09-18 08:04:47 +02:00
Daniel Stenberg
a827e4294c
smtp: check EHLO responses case insensitively
Adjust test 980 to announce starttls in lowercase.

Fixes #18588
Reported-by: Joshua Rogers
Closes #18589
2025-09-18 08:02:12 +02:00
Christian Schmitz
3031fae3bd
multi.h: add CURLMINFO_LASTENTRY
For multiple enums, we use LASTENTRY values to do range checks when
receiving an option as integer. So I added LASTENTRY, so the check will
work, even if you add more options later.

Closes #18578
2025-09-17 23:14:38 +02:00
Michael Osipov
74fdc1185f
configure: add "-mt" for pthread support on HP-UX
HP-UX requires this compiler and linker flag to pass proper macros and
add required libraries.

Closes #18585
2025-09-17 23:12:43 +02:00
Christian Schmitz
0f067ba4aa
libcurl-multi.md: added curl_multi_get_offt mention
The multi interface page didn't mention the new curl_multi_get_offt
function.

Closes #18579
2025-09-17 23:11:38 +02:00
Daniel Stenberg
dbe4e28d57
managen: render better manpage references/links
- When an option name is used in text, this script no longer outputs the
  short plus long version in the manpage output. It makes the text much
  more readable.

  This always showing both verions was previously done primarily to make
  sure roffit would linkify it correctly, but since roffit 0.17 it
  should link both long or short names correctly.

- When managen outputs generic text about options at the end of the
  description it now highlights them properly so that they too get
  linkified correctly in the HTML version. For consistency.

Closes #18580
2025-09-17 15:49:15 +02:00
Daniel Stenberg
0a27a506b1
managen: ignore version mentions < 7.66.0
Only mention version specific details for versions from within the last
six years.

Closes #18583
2025-09-17 15:47:34 +02:00
Daniel Stenberg
04e08664a8
RELEASE-NOTES: synced 2025-09-17 10:30:31 +02:00
Daniel Stenberg
9236199908
setopt: make CURLOPT_MAXREDIRS accept -1 (again)
Regression from b059f7d (shipped in 8.16.0)

Reported-by: Adam Light
Fixes #18571
Closes #18576
2025-09-17 08:58:32 +02:00
Daniel Stenberg
3053a3e90f
docs/libcurl: use lowercase must
To shout less. Use bold in some places.

Closes #18570
2025-09-16 17:12:26 +02:00
renovate[bot]
22ac7f30ad
GHA: update openssl/openssl to v3.5.3
Closes #18566
2025-09-16 16:58:09 +02:00
Daniel Stenberg
cdb56c6666
docs/libcurl: clarify some timeout option behavior
Closes #18569
2025-09-16 16:57:28 +02:00
Stefan Eissing
ff8dfd315c
aws-lc: re-enable large read-ahead with v1.61.0 again
AWS-LC fixed a bug with large read ahead buffers in v1.61.0. Check a
define introduced in that version to enable the large read ahead again.

AWS-LC issue: https://github.com/aws/aws-lc/issues/2650

Closes #18568
2025-09-16 16:55:11 +02:00
Viktor Szakats
ea752b575c
sws: fix checking sscanf() return value
Closes #18565
2025-09-16 13:34:51 +02:00
Viktor Szakats
619307feb0
cmake: fix building docs when the base directory contains .3
Fixing:
```
ninja: error: '<...>/basedir.md/_bld/docs/libcurl/libcurl-symbols.md',
  needed by 'docs/libcurl/curl_easy_cleanup.3', missing and no known rule to make it
```

Reported-by: Nir Azkiel
Fixes #18560
Follow-up to 898b012a9b #1288
Closes #18563
2025-09-16 12:37:11 +02:00
Viktor Szakats
f6ddc1fc1e
Makefile.example: simplify and make it configurable
- build in a single step.

- allow overriding all variables:
  source, target, compiler, libpaths, libs, flags.

Example:
```shell
LIBS= LDFLAGS= SRC=altsvc.c make -f Makefile.example
```

Closes #18554
2025-09-16 11:25:55 +02:00
Viktor Szakats
a333fd4411
GHA/codeql: enable more build options, build servers and tunits
- add HTTP/3 build with OpenSSL 3.5, nghttp3 and ngtcp2.
- enable GSASL, Heimdal, rtmp, SSLS-export.
- make one build MultiSSL with GnuTLS, mbedTLS, Rustls, wolfSSL.
- build servers (also on Windows), and tunits.
- use Linuxbrew to install build dependencies missing from Ubuntu.

Coverage is now 466 C files. (was: 446)

Closes #18557
2025-09-16 11:23:26 +02:00
Daniel Stenberg
af7d67d3c0
krb5: return appropriate error on send failures
Closes #18561
2025-09-16 11:06:08 +02:00
renovate[bot]
98d5321530
GHA: Update nghttp2/nghttp2 to v1.67.1
Closes #18552
2025-09-15 23:16:32 +02:00
dependabot[bot]
56d3bb78be
GHA: bump actions/checkout from 4.2.2 to 5.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.2.2...08c6903cd8c0fde910a37f88322edcfb5dd907a8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Closes #18556
2025-09-15 23:15:19 +02:00
Viktor Szakats
ac24e0a80e
GHA/codeql: tidy up config names
Before this patch there was a single C config detected, named `build:`.

Closes #18555
2025-09-15 15:49:08 +02:00
Viktor Szakats
a4196e2249
tidy-up: whitespace
Closes #18553
2025-09-15 15:00:11 +02:00
Daniel Stenberg
61b79dee79
CURLOPT_TIMECONDITION.md: works for FILE and FTP as well
Closes #18551
2025-09-15 13:58:11 +02:00
Daniel Stenberg
8de37b8cda
cmdline-docs: extended, clarified, refreshed
Closes #18550
2025-09-15 11:56:36 +02:00
Viktor Szakats
e09f45fea4
dist: do not distribute CI.md
`CI.md` slipped into the 8.15.0, 8.16.0 tarballs by accident.
Remove it again and update the checker exception.

Follow-up to fa3f889752 #17463

Closes #18549
2025-09-15 11:15:31 +02:00
Stefan Eissing
de3fc1d7ad
asyn-thrdd: drop pthread_cancel
Remove use of pthread_cancel in asnyc threaded resolving. While there
are system where this works, others might leak to resource leakage
(memory, files, etc.). The popular nsswitch is one example where resolve
code can be dragged in that is not prepared.

The overall promise and mechanism of pthread_cancel() is just too
brittle and the historcal design of getaddrinfo() continues to haunt us.

Fixes #18532
Reported-by: Javier Blazquez
Closes #18540
2025-09-15 09:25:43 +02:00
Daniel Stenberg
f7cac7cc07
setopt: accept *_SSL_VERIFYHOST set to 2L
... without outputing a verbose message about it. In the early days we
had 2L and 1L have different functionalities.

Reported-by: Jicea
Bug: https://curl.se/mail/lib-2025-09/0031.html
Closes #18547
2025-09-14 23:54:22 +02:00
Daniel Stenberg
58bdfb4e1d
CURLOPT_SSL_VERIFYHOST.md: add see-also to two other VERIFYHOST options
Closes #18548
2025-09-14 23:53:40 +02:00
Daniel Stenberg
6434783168
tool_getparam: split opt_filestring into two sep functions
One for file name arguments and one for "strings".

Closes #18546
2025-09-14 23:41:21 +02:00
Viktor Szakats
c1be5459d9
GHA/codeql: analyse Windows Schannel WinIDN build
Follow-up to cc50f05370 #18528

Closes #18545
2025-09-14 14:55:30 +02:00
Viktor Szakats
07837204cd
GHA/distcheck: disable man-db/auto-update
Make sure to not rebuild man pages after purging system curl, to make
the job faster and avoid timeouts:
```
Sun, 14 Sep 2025 10:16:28 GMT Removing curl (8.5.0-2ubuntu10.6) ...
Sun, 14 Sep 2025 10:16:28 GMT Processing triggers for man-db (2.12.0-4build2) ...
Sun, 14 Sep 2025 10:21:22 GMT (Reading database ... 218629 files and directories currently installed.)
```
Ref: https://github.com/curl/curl/actions/runs/17709785947/job/50326910814?pr=18535#step:3:19

Closes #18544
2025-09-14 14:02:32 +02:00
Daniel Stenberg
6bb53f29ef
TODO: remove already implemented or bad items
- remove "connect to multiple IPs in parallel"
- remove "CURLOPT_RESOLVE for any port number", It can already be
  accomplished with CURLOPT_CONNECT_TO
- remove "dynamically load modules", we don't believe in this
- remove "netrc caching and sharing", we already cache it
- remove "Offer API to flush the connection pool", this is effectively
  what CURLMOPT_NETWORK_CHANGED now allows
- remove "WebSocket read callback", introduced in 8.16.0

Closes #18542
2025-09-14 13:46:59 +02:00
Viktor Szakats
d52af3c692
appveyor: bump to OpenSSL 3.5, adjust to dropped 1.1.1 on VS2019
- bump OpenSSL 3.4 to 3.5 on VS2022 runners.

- bump OpenSSL 1.1.1 to 3.0 on VS2019 runners.
  1.1.1 is documented to be present, but missing.
  Fixes:
  ```
  + cmake -G 'Visual Studio 16 2019' -A x64 [...] -DOPENSSL_ROOT_DIR=C:/OpenSSL-v111-Win64 [...]
  CMake Error at C:/Program Files/CMake/share/cmake-4.1/Modules/FindPackageHandleStandardArgs.cmake:227 (message):
    Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
    system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY
    OPENSSL_INCLUDE_DIR)
  Call Stack (most recent call first):
    CMakeLists.txt:757 (find_package)
  ```
  Ref: https://ci.appveyor.com/project/curlorg/curl/builds/52740431/job/tq6h4xhqpa3vgq47?fullLog=true
  Ref: https://www.appveyor.com/docs/windows-images-software/
  Ref: 9a739f7bce

Closes #18543
2025-09-14 12:10:29 +02:00
Daniel Stenberg
eb319bf6ea
RELEASE-NOTES: synced 2025-09-14 10:33:38 +02:00
Viktor Szakats
83c457f9f3
GHA: document permissions as required by zizmor 1.13.0
Ref: https://github.com/zizmorcore/zizmor/pull/1131
Ref: https://docs.zizmor.sh/audits/#undocumented-permissions

Bug: https://github.com/curl/curl/pull/18539#issuecomment-3288151910

Closes #18541
2025-09-13 18:11:53 +02:00
Viktor Szakats
cc50f05370
GHA/codeql: re-enable for C with the default query pack
Earlier we used `security-extended` and tried `security-and-quality`.
Try the default to see how it works.

CodeQL no longer uses the project's Actions cache, also fixing
the previously seen repeat cache entry issue.

- switch to `manual` build. It's 3x faster than the default `autobuild`.
- enable more dependencies to increase coverage.
- docs/tests/CI.md: re-add CodeQL.

Ref: https://docs.github.com/en/code-security/code-scanning/managing-your-code-scanning-configuration/codeql-query-suites
Ref: https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
Ref: #16263
Ref: 173805b2e7 #15798

Closes #18528
2025-09-12 11:03:44 +02:00
Dan Fandrich
bbdb869ec7 libcurl-security.md: mention long-running connections
Some applications may want to periodically recheck the remote server
certificate, which doesn't happen on a long-running connection.

Ref: #18527
Closes #18533
2025-09-12 00:20:19 -07:00
Daniel Stenberg
d7d32ad9b9
docs/libcurl: remove ancient version references
To make the texts easier on the eye.

- Remove most free text references to curl versions before 7.60.0 (May
  2018)
- Leave those present in a HISTORY section

Most of them are already documented in symbols-in-versions anyway.

Closes #18530
2025-09-12 08:27:38 +02:00
Daniel Stenberg
57b195bf51
CURLINFO_FTP_ENTRY_PATH.md: this is for SFTP as well
Closes #18531
2025-09-12 08:26:45 +02:00
Daniel Stenberg
16cd81ed69
urldata: FILE is not a list-only protocol
The struct field thus does not depend on the presence of it

Closes #18525
2025-09-11 22:46:42 +02:00
Daniel Stenberg
c184f464f7
CURLOPT_MAXLIFETIME_CONN: make default 24 hours
Set a default value to only reuse existing connections if less than 24
hours old. This makes the TLS certificate check get redone for the new
connection. An application can still set it to zero.

Closes #18527
2025-09-11 19:46:41 +02:00
Viktor Szakats
53f90cb3b5
GHA/http3-linux: fix nghttpx build and other tweaks
- fix `nghttp2` build to also build the `nghttpx` application.
  Restore required `libc-ares-dev`. Also confirm that `libev-dev` is
  required too. Document these requirements.
  Follow-up to 0455d8772a #18509

- explicitly enable `nghttpx` for the `nghttp2` build to make it fail if
  requirements aren't met:
  ```
  configure: error: applications were requested (--enable-app) but dependencies are not met.
  ```

- explicitly install brotli, zstd, zlib for the dependency builds.
  Of these, zstd and zlib are preinstalled. zlib is required for
  `nghttpx`. zstd and brotli doesn't seem to be used, but keep them
  there just in case and to match the test env.
  Follow-up to 0455d8772a #18509

- enable brotli for `nghttpx`. It doesn't change the tests, and also
  cost almost nothing, so I figure why not.

Closes #18522
2025-09-11 17:03:33 +02:00
Daniel Stenberg
839b22863e
ssl-sessions.md: mark option experimental
Also make managen output the experimental text with the correct
prefix/margin for the ascii version.

Closes #18523
2025-09-11 17:01:07 +02:00
Stefan Eissing
115fe808f2
ngtcp2: check error code on connect failure
Access the error codes of ngtcp2 when a connect attempt failes. Trace
the information for analysis. Treat errors as permanent failure by
default, trigger retrying only when the server refused without
indicating an error.

Closes #18521
2025-09-11 16:00:58 +02:00
Stefan Eissing
b178d58266
quic: fix min TLS version handling
When switching to TSLv1.2 as default in
9d8998c994, this led to an explicit
setting of 1.2 on QUIC connections when using quictls, overriding the
already set min version of 1.3.

This leads to a ClientHello with TLS 1.2+1.3 offered on a QUIC connect
which is rejected by the Caddy server. Using ngtcp2 with OpenSSL 3.5+,
GnuTLS or AWS-LC is not affected.

Fixes #18518
Reported-by: fds242 on github
Closes #18520
2025-09-11 15:59:00 +02:00
Viktor Szakats
bf6ae59ab1
GHA/windows: drop repeated word from comment 2025-09-11 15:02:57 +02:00
Viktor Szakats
aa8a44ecfa
GHA: fix and tweak installed packages for http3-linux and Windows-cross
- explicitly install `libldap-dev` to not rely on test-specific packages
  installing it implicitly, to have the same `curl -V` output for each
  TLS backend build pair.
  Follow-up to 0455d8772a #18509

- install `libev-dev` for tests. It's a runtime dependency for
  the local build of `nghttpx`. Missing it made pytest skip 178 tests.
  Also skewing the 'Gain' time. I estimate it to account for 3 minutes,
  making the total gain ~20 minutes.
  Follow-up to 0455d8772a #18509
  (It may be a better solution to disable libev for the local nghttp2
  build, to avoid this hidden dependency.)

- fix quiche jobs to use the local build of `libnghttp2`.

- stop installing the `clang` package for Windows-cross. `clang` and
  `clang-tidy` tools are preinstalled on the Ubuntu 24.04 runner.

Closes #18519
2025-09-11 12:53:54 +02:00
renovate[bot]
39c2d4b543
GHA: update github/codeql-action digest to 192325c
Closes #18516
2025-09-11 08:40:57 +02:00
renovate[bot]
7417f14b93
GHA: update rojopolis/spellcheck-github-actions digest to 739a1e3
Closes #18515
2025-09-11 08:40:09 +02:00
Viktor Szakats
0455d8772a
GHA: minimize installed packages in http3-linux and Windows cross-builds
In the last couple of months some jobs started taking a lot of time and
often timing out due to slow `apt install` from the Azure Ubuntu mirror.

The jobs affected were those that installed large packages:
GHA/http3-linux and the 3 cross-build jobs in GHA/windows.

This patch reduces the installed packaged to the minimum required
to complete the jobs. Saving a minute+ for each http3-linux job (a total
of 20+ minutes for the workflow.) Also saving bandwidth and reducing
the chance for long downloads or timeouts with slow Azure repos.

Details:
- http3: delete redundant packages from the `build-cache` job.
- http3: install gnutls dependencies for gnutls jobs only.
- http3: do not install test dependencies in jobs not running tests.
- http3: drop redundant packages from the curl jobs.
- Windows-cross: replace `mingw-w64` with `gcc-mingw-w64-x86-64-win32`
  for the 3 Windows cross-build job. Dropping C++, 32-bit, and 64-bit
  POSIX-threaded parts. Saving time and significant bandwidth for each
  of the 3 jobs:
  Download size: 277 MB -> 65 MB (installed: 1300 MB -> 400 MB)
- Windows-cross: restore previous job time limit of 15m (from 45m)
  Follow-up to ff5140a25f #18163

Before:
https://github.com/curl/curl/actions/runs/17611514207 (http3)
https://github.com/curl/curl/actions/runs/17611514185/job/50034354923 (Windows cross)

After:
https://github.com/curl/curl/actions/runs/17628406362?pr=18509 (http3)
https://github.com/curl/curl/actions/runs/17627562551/job/50088055529?pr=18509 (Windows cross)

http3 job           |    Bef. |    Aft. |
:------------------ | ------: | ------: |
Build caches (hot)  |     10s |     12s |
AM awslc            |  3m  0s |  1m 54s |
CM awslc            |  4m 32s |  3m  4s |
AM boringssl        |  3m  9s |  1m 48s |
CM boringssl        |  3m 43s |  3m  2s |
AM gnutls           |  3m  9s |  2m 18s |
CM gnutls           |  4m 19s |  2m 55s |
AM libressl         |  2m 14s |  1m 24s |
CM libressl         |  5m 30s |  2m 57s |
AM openssl          |  5m 16s |  4m 17s |
CM openssl          |  1m 50s |  1m 47s |
AM openssl-quic     |  2m 58s |  1m  7s |
CM openssl-quic     |  4m 16s |  2m 43s |
AM quiche           |  2m 54s |  1m 34s |
CM quiche           |  5m  0s |  3m 15s |
AM quictls          |  2m 34s |  1m 13s |
CM quictls          |  4m 20s |  3m 17s |
AM wolfssl          |  2m 48s |  1m 30s |
CM wolfssl          |  4m 49s |  3m 22s |
Total:              | 66m 21s | 43m 27s |
Gain:               |         | 22m 54s |

Out of curiousity, build times as seen in the http3 build-cache job:
- TLS backends:
  - openssl: 2m25s
  - libressl: 27s
  - aws-lc: 41s
  - boringssl: 1m8s
  - quictls: 1m46s
  - gnutls: 6m30s
  - wolfssl: 51s
  - quiche + boringssl: 1m9s
- ng* libs (not yet optimized for build speed):
  - nghttp3: 13s
  - ngtcp2: 52s (with 6 backends, 3 runs)
  - ngtcp2: 19s (boringssl)
  - nghttp2: 21s
Ref: https://github.com/curl/curl/actions/runs/17626120054/job/50083344805

A similar effort in curl-for-win, affecting 2 GHA/curl-for-win Windows
jobs (though they use the default Debian repo, with no issues):
- with llvm/clang:
  Download size: 648 MB -> 430 MB (installed: 3344 MB -> 2333 MB)
- with gcc:
  Download size: 550 MB -> 328 MB (installed: 2815 MB -> 1804 MB)
Ref: e19665d948
Ref: 6b14c3946a

Bug: https://github.com/curl/curl/pull/18502#issuecomment-3270259744

Closes #18509
2025-09-11 03:07:19 +02:00
Viktor Szakats
3ba74c4395
curl_mem_undef.h: limit to CURLDEBUG for non-memalloc overrides
To fix non-`CURLDEBUG` builds on 32-bit AIX, where `fopen` is a system
macro.

Ref: #18502
Ref: https://github.com/curl/curl/pull/18502/commits/793a375ce3002454599ffe2d7b561b6340103306

Follow-up to 3bb5e58c10 #17827
Reported-by: Andrew Kirillov
Fixes #18510
Closes #18514
2025-09-10 13:08:54 +02:00
Daniel Stenberg
31f0f0a060
RELEASE-NOTES: synced
and bump include/curl/curlver.h
2025-09-10 12:54:59 +02:00
Stefan Eissing
a782867c9f
curl_easy_getinfo: error code on NULL arg
When passing an address to curl_easy_getinfo to retrieve a value and the
address is NULL, return CURLE_BAD_FUNCTION_ARGUMENT instead of
CURLE_UNKNOWN_OPTION.

Closes #18512
2025-09-10 12:44:25 +02:00
Stefan Eissing
80ac5fb2ec
easy_getinfo: check magic, Curl_close safety
Check the easy handles magic in calls to curl_easy_getinfo().
In Curl_close() clear the magic after DNS shutdown since we'd
like to see tracing for this.
When clearing the magic, also clear the verbose flag so we
no longer call DEBUGFUNCTION on such a handle.

Closes #18511
2025-09-10 12:06:16 +02:00
Ethan Everett
f4758cd524
quic: ignore EMSGSIZE on receive
Some OSes (Linux, macOS, more?) will generate an EMSGSIZE socket error
on the next recv all after receiving an ICMP Packet Too Big on an
unconnected UDP socket.

These can be safely ignored as QUIC's DPLPMTUD uses MTU probes that do
not rely on receiving ICMP packets.

Closes #18505
2025-09-10 11:51:25 +02:00
3908 changed files with 125282 additions and 120404 deletions

View file

@ -38,67 +38,32 @@ commands:
steps:
- run:
command: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update && sudo apt-get install -y libssh-dev
install-deps:
steps:
- run:
command: |
sudo apt-get update && sudo apt-get install -y libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev python3-pip libpsl-dev
sudo python3 -m pip install impacket
install-wolfssl:
steps:
- run:
command: |
# renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?<version>.+)-stable$ registryUrl=https://github.com
WOLFSSL_VERSION=5.8.0
echo "Installing wolfSSL $WOLFSSL_VERSION"
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/wolfSSL/wolfssl/archive/v$WOLFSSL_VERSION-stable.tar.gz" | tar -xz
cd wolfssl-$WOLFSSL_VERSION-stable
./autogen.sh
./configure --disable-dependency-tracking --enable-tls13 --enable-all --enable-harden --prefix=$HOME/wssl
make install
install-wolfssh:
steps:
- run:
command: |
# renovate: datasource=github-tags depName=wolfSSL/wolfssh versioning=semver extractVersion=^v?(?<version>.+)-stable$ registryUrl=https://github.com
WOLFSSH_VERSION=1.4.19
echo "Installing wolfSSH $WOLFSSH_VERSION"
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/wolfSSL/wolfssh/archive/v$WOLFSSH_VERSION-stable.tar.gz" | tar -xz
cd wolfssh-$WOLFSSH_VERSION-stable
./autogen.sh
./configure --disable-dependency-tracking --with-wolfssl=$HOME/wssl --prefix=$HOME/wssh --enable-scp --enable-sftp --disable-term --disable-examples
make install
sudo apt-get update && sudo apt-get install -y libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev python3-pip
python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt
configure:
steps:
- run:
command: |
autoreconf -fi
./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror --enable-warnings \
./configure --disable-dependency-tracking --enable-option-checking=fatal --enable-unity --enable-werror --enable-warnings \
--with-openssl \
|| { tail -1000 config.log; false; }
configure-openssl-no-verbose:
steps:
- run:
command: |
autoreconf -fi
./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror \
--with-openssl --disable-verbose \
|| { tail -1000 config.log; false; }
configure-no-proxy:
steps:
- run:
command: |
autoreconf -fi
./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror \
./configure --disable-dependency-tracking --enable-option-checking=fatal --enable-unity --enable-werror \
--with-openssl --disable-proxy \
|| { tail -1000 config.log; false; }
@ -107,7 +72,7 @@ commands:
- run:
command: |
autoreconf -fi
./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror --enable-warnings \
./configure --disable-dependency-tracking --enable-option-checking=fatal --enable-unity --enable-werror --enable-warnings \
--with-openssl --with-libssh \
|| { tail -1000 config.log; false; }
@ -116,42 +81,40 @@ commands:
- run:
command: |
autoreconf -fi
./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror --enable-warnings \
./configure --disable-dependency-tracking --enable-option-checking=fatal --enable-unity --enable-werror --enable-warnings \
--with-openssl --enable-ares \
|| { tail -1000 config.log; false; }
configure-wolfssh:
steps:
- run:
command: |
autoreconf -fi
LDFLAGS="-Wl,-rpath,$HOME/wssh/lib" \
./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror --enable-warnings \
--with-wolfssl=$HOME/wssl --with-wolfssh=$HOME/wssh \
|| { tail -1000 config.log; false; }
configure-cares-debug:
steps:
- run:
command: |
autoreconf -fi
./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror --enable-debug \
./configure --disable-dependency-tracking --enable-option-checking=fatal --enable-unity --enable-werror --enable-debug \
--with-openssl --enable-ares \
|| { tail -1000 config.log; false; }
build:
steps:
- run: make -j3 V=1
- run: src/curl --disable --version
- run: make -j3 V=1 examples
test:
steps:
- run: make -j3 V=1 test-ci TFLAGS='-j14'
- run:
command: |
source ~/venv/bin/activate
# Revert a CircleCI-specific local setting that makes test 1459
# return 67 (CURLE_LOGIN_DENIED) instead of the
# expected 60 (CURLE_PEER_FAILED_VERIFICATION).
echo 'StrictHostKeyChecking yes' >> ~/.ssh/config
make -j3 V=1 test-ci TFLAGS='-j14'
executors:
ubuntu:
machine:
image: ubuntu-2004:2024.01.1
image: ubuntu-2204:2025.09.1
jobs:
basic:
@ -163,24 +126,6 @@ jobs:
- build
- test
no-verbose:
executor: ubuntu
steps:
- checkout
- install-deps
- configure-openssl-no-verbose
- build
wolfssh:
executor: ubuntu
steps:
- checkout
- install-deps
- install-wolfssl
- install-wolfssh
- configure-wolfssh
- build
no-proxy:
executor: ubuntu
steps:
@ -212,7 +157,7 @@ jobs:
arm:
machine:
image: ubuntu-2004:2024.01.1
image: ubuntu-2204:2025.09.1
resource_class: arm.medium
steps:
- checkout
@ -223,7 +168,7 @@ jobs:
arm-cares:
machine:
image: ubuntu-2004:2024.01.1
image: ubuntu-2204:2025.09.1
resource_class: arm.medium
steps:
- checkout
@ -250,14 +195,6 @@ workflows:
jobs:
- no-proxy
openssl-no-verbose:
jobs:
- no-verbose
wolfssl-wolfssh:
jobs:
- wolfssh
arm-openssl:
jobs:
- arm

59
.clang-tidy.yml Normal file
View file

@ -0,0 +1,59 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
---
# https://clang.llvm.org/extra/clang-tidy/
# https://clang.llvm.org/extra/clang-tidy/checks/list.html
Checks:
- clang-analyzer-*
- -clang-analyzer-optin.performance.Padding
- -clang-analyzer-security.ArrayBound # due to false positives with clang-tidy v21.1.0+
- -clang-analyzer-security.insecureAPI.bzero # for FD_ZERO() (seen on macOS)
- -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling
- -clang-diagnostic-nullability-extension
- bugprone-assert-side-effect
- bugprone-assignment-in-if-condition
- bugprone-chained-comparison
- bugprone-dynamic-static-initializers
- bugprone-invalid-enum-default-initialization
- bugprone-macro-parentheses
- bugprone-macro-repeated-side-effects
- bugprone-misplaced-operator-in-strlen-in-alloc
- bugprone-misplaced-pointer-arithmetic-in-alloc
- bugprone-not-null-terminated-result
- bugprone-posix-return
- bugprone-redundant-branch-condition
- bugprone-signed-char-misuse
- bugprone-sizeof-expression
- bugprone-suspicious-enum-usage
- bugprone-suspicious-memset-usage
- bugprone-suspicious-missing-comma
- bugprone-suspicious-realloc-usage
- bugprone-suspicious-semicolon
# bugprone-unchecked-string-to-number-conversion # needs converting sscanf to strtol or curlx_str_*
- misc-const-correctness
- misc-header-include-cycle
# misc-redundant-expression # undesired hits due to system macros, e.g. due to POLLIN == POLLRDNORM | POLLRDBAND, then or-ing all three
- portability-*
- readability-duplicate-include
# readability-else-after-return
# readability-enum-initial-value
# readability-function-cognitive-complexity
- readability-inconsistent-declaration-parameter-name
# readability-misleading-indentation # too many false positives and oddball/conditional source
- readability-named-parameter
# readability-redundant-casting # false positives in types that change from platform to platform, even with IgnoreTypeAliases: true
- readability-redundant-control-flow
- readability-redundant-declaration
- readability-redundant-function-ptr-dereference
- readability-redundant-parentheses
- readability-redundant-preprocessor
- readability-suspicious-call-argument
- readability-uppercase-literal-suffix
CheckOptions:
misc-header-include-cycle.IgnoredFilesList: 'curl/curl.h'
readability-inconsistent-declaration-parameter-name.Strict: true
HeaderFilterRegex: '.*' # Default in v22.1.0+

1
.gitattributes vendored
View file

@ -2,7 +2,6 @@
#
# SPDX-License-Identifier: curl
buildconf eol=lf
configure.ac eol=lf
*.m4 eol=lf
*.in eol=lf

View file

@ -4,26 +4,19 @@ Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
How to contribute to curl
=========================
# How to contribute to curl
Join the community
------------------
## Join the community
1. Click 'watch' on the GitHub repo
1. Click 'watch' on the GitHub repo
2. Subscribe to the suitable [mailing lists](https://curl.se/mail/)
2. Subscribe to the suitable [mailing lists](https://curl.se/mail/)
## Read [CONTRIBUTE](/docs/CONTRIBUTE.md)
Read [CONTRIBUTE](/docs/CONTRIBUTE.md)
---------------------------------------
## Send your suggestions using one of these methods:
Send your suggestions using one of these methods:
-------------------------------------------------
1. in a mail to the mailing list
2. as a [pull request](https://github.com/curl/curl/pulls)
3. as an [issue](https://github.com/curl/curl/issues)
1. in a mail to the mailing list
2. as a [pull request](https://github.com/curl/curl/pulls)
3. as an [issue](https://github.com/curl/curl/issues)
/ The curl team

View file

@ -13,12 +13,7 @@ body:
Only file bugs here! Ask questions on the mailing lists https://curl.se/mail/
**SECURITY RELATED?** Post it here: https://hackerone.com/curl
There are collections of known issues to be aware of:
- https://curl.se/docs/knownbugs.html
- https://curl.se/docs/todo.html
**SECURITY RELATED?** Submit here: https://hackerone.com/curl
- type: textarea
id: reproducer
@ -40,7 +35,7 @@ body:
label: curl/libcurl version
description: |
Please paste the output of `curl -V` here.
placeholder: 'curl 8.2.0'
placeholder: 'curl 8.18.0'
validations:
required: true

View file

@ -2,9 +2,37 @@
#
# SPDX-License-Identifier: curl
# https://docs.github.com/code-security/dependabot/working-with-dependabot/dependabot-options-reference
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
interval: 'monthly'
cooldown:
default-days: 7
groups:
gha-dependencies:
patterns:
- '*'
commit-message:
prefix: 'GHA:'
- package-ecosystem: 'pip'
directories:
- '.github/scripts'
- 'tests'
schedule:
interval: 'monthly'
cooldown:
default-days: 7
semver-major-days: 15
semver-minor-days: 7
semver-patch-days: 3
groups:
pip-dependencies:
patterns:
- '*'
commit-message:
prefix: 'GHA:'

119
.github/labeler.yml vendored
View file

@ -11,7 +11,7 @@
# the files fit into the category, and the any-glob-to-any-file ones are added
# as long as any file matches. The first ones are for "major" categories (the
# PR is all about that one topic, like HTTP/3), while the second ones are
# "addendums" that give useful information about a PR that's really mostly
# "addendums" that give useful information about a PR that is really mostly
# something else (e.g. CI if the PR also touches CI jobs).
#
# N.B. any-glob-to-all-files is misnamed; it acts like one-glob-to-all-files.
@ -28,14 +28,17 @@ appleOS:
- any-glob-to-all-files: "{\
.github/workflows/macos.yml,\
lib/config-mac.h,\
lib/macos*\
lib/macos*,\
lib/vtls/apple.*,\
m4/curl-apple-sectrust.m4\
}"
authentication:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/mk-ca-bundle.1,\
CMake/FindGSS.cmake,\
CMake/FindLibgsasl.cmake,\
docs/libcurl/opts/CURLINFO_HTTPAUTH*,\
docs/libcurl/opts/CURLINFO_PROXYAUTH*,\
docs/libcurl/opts/CURLOPT_KRB*,\
@ -45,7 +48,6 @@ authentication:
docs/libcurl/opts/CURLOPT_USERPWD*,\
docs/libcurl/opts/CURLOPT_XOAUTH*,\
lib/*gssapi*,\
lib/*krb5*,\
lib/*ntlm*,\
lib/curl_sasl.*,\
lib/http_aws*,\
@ -62,20 +64,16 @@ build:
**/Makefile.am,\
**/Makefile.inc,\
**/*.m4,\
**/*.mk,\
*.m4,\
docs/INSTALL-CMAKE.md,\
lib/curl_config.h.cmake,\
lib/curl_config-cmake.h.in,\
lib/libcurl*.in,\
CMake/**,\
CMakeLists.txt,\
configure.ac,\
m4/**,\
Makefile.*,\
packages/**,\
plan9/**,\
projects/**,\
winbuild/**,\
lib/libcurl.def,\
tests/cmake/**\
}"
@ -99,7 +97,7 @@ cmake:
**/CMakeLists.txt,\
CMake/**,\
docs/INSTALL-CMAKE.md,\
lib/curl_config.h.cmake,\
lib/curl_config-cmake.h.in,\
tests/cmake/**\
}"
@ -114,6 +112,9 @@ connecting & proxies:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/cmdline-opts/happy-eyeballs*,\
docs/cmdline-opts/ipv*,\
docs/cmdline-opts/*proxy*,\
docs/internals/CONNECTION-FILTERS.md,\
docs/examples/ipv6.c,\
docs/libcurl/opts/CURLINFO_CONNECT*,\
@ -137,6 +138,8 @@ connecting & proxies:
lib/if2ip.*,\
lib/noproxy.*,\
lib/socks.*,\
src/tool_cb_soc.*,\
tests/http/*socks*,\
tests/server/socksd.c\
}"
@ -144,6 +147,7 @@ cookies:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindLibpsl.cmake,\
docs/HTTP-COOKIES.md,\
docs/cmdline-opts/cookie*,\
docs/cmdline-opts/junk-session-cookies.md,\
@ -163,9 +167,9 @@ cryptography:
docs/libcurl/opts/CURLOPT_EGDSOCKET*,\
lib/*sha256*,\
lib/*sha512*,\
lib/curl_des.*,\
lib/curl_hmac.*,\
lib/curl_md?.*,\
lib/curl_ntlm_core.*,\
lib/md?.*,\
lib/rand.*\
}"
@ -183,11 +187,10 @@ documentation:
- changed-files:
- any-glob-to-all-files: "{\
.github/workflows/checkdocs.yml,\
.github/scripts/badwords.*,\
.github/scripts/cd2cd,\
.github/scripts/cd2nroff,\
.github/scripts/cdall.pl,\
.github/scripts/nroff2cd,\
.github/scripts/pyspelling*,\
.github/scripts/requirements-docs.txt,\
.github/scripts/requirements-proselint.txt,\
.github/scripts/typos*,\
.github/scripts/verify-examples.pl,\
.github/scripts/verify-synopsis.pl,\
**/*.md,\
@ -198,7 +201,11 @@ documentation:
LICENSES/**,\
README,\
RELEASE-NOTES,\
scripts/cd*\
scripts/badwords.*,\
scripts/cd*,\
scripts/mdlinkcheck,\
scripts/nroff2cd,\
scripts/release-notes.pl\
}"
- all-globs-to-all-files:
# negative matches
@ -209,6 +216,7 @@ FTP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/cmdline-opts/ftp*,\
docs/libcurl/opts/CURLINFO_FTP*,\
docs/libcurl/opts/CURLOPT_FTP*,\
docs/libcurl/opts/CURLOPT_WILDCARDMATCH*,\
@ -216,7 +224,10 @@ FTP:
lib/curl_fnmatch.*,\
lib/curl_range.*,\
lib/ftp*,\
tests/ftp*\
tests/ftp*,\
tests/http/*ftpd*,\
tests/http/testenv/*ftpd*,\
tests/libtest/*_ftp_*\
}"
GOPHER:
@ -230,6 +241,8 @@ HTTP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/HTTPSRR.md,\
docs/HSTS.md,\
docs/examples/hsts*,\
docs/examples/http-*,\
docs/examples/httpput*,\
@ -237,10 +250,10 @@ HTTP:
docs/examples/*post*,\
docs/HTTP-COOKIES.md,\
docs/libcurl/opts/CURLINFO_COOKIE*,\
docs/libcurl/opts/CURLOPT_COOKIE*,\
docs/libcurl/opts/CURLINFO_HTTP_**,\
docs/libcurl/opts/CURLINFO_HTTP*,\
docs/libcurl/opts/CURLINFO_REDIRECT*,\
docs/libcurl/opts/CURLINFO_REFER*,\
docs/libcurl/opts/CURLOPT_COOKIE*,\
docs/libcurl/opts/CURLOPT_FOLLOWLOCATION*,\
docs/libcurl/opts/CURLOPT_HSTS*,\
docs/libcurl/opts/CURLOPT_HTTP*,\
@ -279,9 +292,7 @@ HTTP/3:
- all:
- changed-files:
- any-glob-to-all-files: "{\
.github/workflows/ngtcp2*,\
.github/workflows/quiche*,\
.github/workflows/osslq*,\
.github/workflows/http3-linux.yml,\
CMake/FindNGHTTP3.cmake,\
CMake/FindNGTCP2.cmake,\
docs/HTTP3.md,\
@ -341,6 +352,7 @@ MQTT:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/internals/MQTT.md,\
lib/mqtt*,\
tests/server/mqttd.c\
}"
@ -349,18 +361,28 @@ name lookup:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindLibidn2.cmake,\
docs/cmdline-opts/doh*,\
docs/cmdline-opts/dns*,\
docs/examples/resolve.c,\
docs/internals/THRDPOOL-AND-QUEUE.md,\
docs/libcurl/opts/CURLINFO_NAMELOOKUP*,\
docs/libcurl/opts/CURLOPT_DNS*,\
docs/libcurl/opts/CURLOPT_DOH*,\
docs/libcurl/opts/CURLOPT_RESOLVE*,\
lib/*addrinfo*,\
lib/asyn*,\
lib/cf-dns.*,\
lib/curl_gethostname.*,\
lib/dns*,\
lib/doh*,\
lib/host*,\
lib/idn*,\
lib/inet_pton.*,\
lib/socketpair*,\
lib/thrdpool.*,\
lib/thrdqueue.*,\
tests/http/*resolve.py,\
tests/server/dnsd.c,\
tests/server/resolve.c\
}"
@ -372,14 +394,6 @@ POP3:
lib/pop3.*\
}"
RTMP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindLibrtmp.cmake,\
lib/curl_rtmp.*\
}"
RTSP:
- all:
- changed-files:
@ -395,12 +409,17 @@ SCP/SFTP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindLibssh.cmake,\
CMake/FindLibssh2.cmake,\
docs/cmdline-opts/knownhosts.md,\
docs/libcurl/opts/CURLOPT_SSH*,\
docs/examples/sftp*,\
lib/vssh/**,\
tests/sshhelp.pm,\
tests/sshserver.pl\
tests/sshserver.pl,\
tests/http/*scp*,\
tests/http/*sftp*,\
tests/http/testenv/sshd.py\
}"
script:
@ -410,8 +429,9 @@ script:
**/*.pl,\
**/*.sh,\
curl-config.in,\
docs/curl-config.1,\
docs/mk-ca-bundle.1,\
docs/curl-config.md,\
docs/mk-ca-bundle.md,\
docs/wcurl.md,\
docs/THANKS-filter,\
scripts/**\
}"
@ -428,6 +448,7 @@ SMTP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/cmdline-opts/mail*,\
docs/examples/smtp-*,\
docs/libcurl/opts/CURLOPT_MAIL*,\
lib/smtp.*\
@ -452,16 +473,25 @@ TLS:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindGnuTLS.cmake,\
CMake/FindMbedTLS.cmake,\
CMake/FindWolfSSL.cmake,\
CMake/FindRustls.cmake,\
docs/CIPHERS-TLS12.md,\
docs/SSL*,\
docs/cmdline-opts/dump-ca-embed.md,\
docs/cmdline-opts/*cert*,\
docs/cmdline-opts/*ssl*,\
docs/cmdline-opts/*tls*,\
docs/examples/ssl*,\
docs/examples/*ssl.*,\
docs/examples/*tls.*,\
docs/SSL*,\
docs/internals/TLS-SESSIONS.md,\
docs/libcurl/curl_global_sslset*,\
docs/libcurl/curl_easy_ssls*,\
docs/libcurl/opts/CURLINFO_CA*,\
docs/libcurl/opts/CURLINFO_CERT*,\
docs/libcurl/opts/CURLINFO_EARLYDATA*,\
docs/libcurl/opts/CURLINFO_SSL*,\
docs/libcurl/opts/CURLINFO_TLS*,\
docs/libcurl/opts/CURLOPT_CA*,\
@ -476,7 +506,8 @@ TLS:
m4/curl-openssl.m4,\
m4/curl-rustls.m4,\
m4/curl-schannel.m4,\
m4/curl-wolfssl.m4\
m4/curl-wolfssl.m4,\
src/tool_ssls.*\
}"
URL:
@ -494,32 +525,32 @@ WebSocket:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/internals/WEBSOCKET.md*,\
docs/internals/WEBSOCKET.md,\
docs/examples/websocket*,\
docs/libcurl/curl_ws_*,\
docs/libcurl/libcurl-ws*,\
docs/libcurl/opts/CURLOPT_WS_*,\
include/curl/websockets.h,\
lib/ws.*,\
tests/http/clients/ws*,\
tests/http/test_20_websockets.py,\
tests/http/testenv/ws*\
tests/http/testenv/ws*,\
tests/libtest/cli_ws*\
}"
Windows:
- all:
- changed-files:
- any-glob-to-all-files: "{\
appveyor.*,\
.github/workflows/windows.yml,\
appveyor.*,\
CMake/win32-cache.cmake,\
lib/*win32*,\
lib/curlx/fopen.*,\
lib/curlx/multibyte.*,\
lib/rename.*,\
lib/curlx/winapi.*,\
lib/vtls/schannel*,\
m4/curl-schannel.m4,\
projects/**,\
projects/Windows/**,\
src/tool_doswin.c,\
winbuild/**,\
lib/libcurl.def\
}"

View file

@ -1,87 +0,0 @@
#!/usr/bin/env perl
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
#
# bad[:=]correct
#
# If separator is '=', the string will be compared case sensitively.
# If separator is ':', the check is done case insensitively.
#
# To add white listed uses of bad words that are removed before checking for
# the bad ones:
#
# ---(accepted word)
#
use strict;
use warnings;
my @whitelist;
my %alt;
my %exactcase;
my @w;
while(<STDIN>) {
chomp;
if($_ =~ /^#/) {
next;
}
if($_ =~ /^---(.*)/) {
push @whitelist, $1;
}
elsif($_ =~ /^([^:=]*)([:=])(.*)/) {
my ($bad, $sep, $better)=($1, $2, $3);
push @w, $bad;
$alt{$bad} = $better;
if($sep eq "=") {
$exactcase{$bad} = 1;
}
}
}
my $errors = 0;
sub file {
my ($f) = @_;
my $l = 0;
open(F, "<$f");
while(<F>) {
my $in = $_;
$l++;
chomp $in;
if($in =~ /^ /) {
next;
}
# remove the link part
$in =~ s/(\[.*\])\(.*\)/$1/g;
# remove backticked texts
$in =~ s/\`.*\`//g;
# remove whitelisted patterns
for my $p (@whitelist) {
$in =~ s/$p//g;
}
foreach my $w (@w) {
my $case = $exactcase{$w};
if(($in =~ /^(.*)$w/i && !$case) ||
($in =~ /^(.*)$w/ && $case) ) {
my $p = $1;
my $c = length($p)+1;
print STDERR "$f:$l:$c: error: found bad word \"$w\"\n";
printf STDERR " %4d | $in\n", $l;
printf STDERR " | %*s^%s\n", length($p), " ",
"~" x (length($w)-1);
printf STDERR " maybe use \"%s\" instead?\n", $alt{$w};
$errors++;
}
}
}
close(F);
}
my @files = @ARGV;
foreach my $each (@files) {
file($each);
}
exit $errors;

View file

@ -1,75 +0,0 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
#
back-end:backend
e-mail:email
run-time:runtime
set-up:setup
tool chain:toolchain
tool-chain:toolchain
wild-card:wildcard
wild card:wildcard
i'm:I am
you've:You have
we've:we have
we're:we are
we'll:we will
we'd:we would
they've:They have
they're:They are
they'll:They will
they'd:They would
you've:you have
you'd:you would
you'll:you will
you're:you are
should've:should have
don't=do not
could've:could have
doesn't:does not
isn't:is not
aren't:are not
a html: an html
a http: an http
a ftp: an ftp
a IPv4: an IPv4
a IPv6: an IPv6
url =URL
internet\b=Internet
isation:ization
\bit's:it is
it'd:it would
there's:there is
[^.]\. And: Rewrite it somehow?
^(And|So|But) = Rewrite it somehow?
\. But: Rewrite it somehow?
\. So : Rewrite without "so" ?
dir :directory
can't:cannot
that's:that is
web page:webpage
host name\b:hostname
host names\b:hostnames
file name\b:filename
file names\b:filenames
\buser name\b:username
\buser names\b:usernames
\bpass phrase:passphrase
didn't:did not
doesn't:does not
won't:will not
couldn't:could not
\bwill\b:rewrite to present tense
\b32bit=32-bit
\b64bit=64-bit
32 bit\b=32-bit
64 bit\b=64-bit
64-bits:64 bits or 64-bit
32-bits:32 bits or 32-bit
\bvery\b:rephrase using an alternative word
\bCurl\b=curl
\bLibcurl\b=libcurl
---WWW::Curl
---NET::Curl
---Curl Corporation

View file

@ -16,7 +16,7 @@ use warnings;
my @asyms;
open(S, "<./docs/libcurl/symbols-in-versions")
|| die "can't find symbols-in-versions";
|| die "cannot find symbols-in-versions";
while(<S>) {
if(/^([^ ]*) /) {
push @asyms, $1;
@ -30,7 +30,7 @@ my @aopts = (
);
open(O, "<./docs/options-in-versions")
|| die "can't find options-in-versions";
|| die "cannot find options-in-versions";
while(<O>) {
chomp;
if(/^([^ ]+)/) {
@ -50,7 +50,7 @@ while(<O>) {
close(O);
open(C, "<./.github/scripts/spellcheck.curl")
|| die "can't find spellcheck.curl";
|| die "cannot find spellcheck.curl";
while(<C>) {
if(/^\#/) {
next;
@ -99,9 +99,11 @@ sub process {
# *italics*
$l =~ s/\*(\S.*?)\*//g;
# strip out https URLs, we don't want them spellchecked
# strip out https URLs, we do not want them spellchecked
$l =~ s!https://[a-z0-9\#_/.-]+!!gi;
# strip links, both name and target
$l =~ s/(\[.*?\])\(.*?\)//g;
$out .= $l;
}
close(F);
@ -119,6 +121,10 @@ sub process {
}
}
for my $f (@ARGV) {
my @filemasks = @ARGV;
open(my $git_ls_files, '-|', 'git', 'ls-files', '--', @filemasks) or die "Failed running git ls-files: $!";
while(my $f = <$git_ls_files>) {
chomp $f;
process($f);
}
close $git_ls_files;

View file

@ -45,18 +45,18 @@ my %remove = (
'#define HAVE_BROTLI 1' => 1,
'#define HAVE_BROTLI_DECODE_H 1' => 1,
'#define HAVE_DLFCN_H 1' => 1,
'#define HAVE_GSSAPI_GSSAPI_GENERIC_H 1' => 1,
'#define HAVE_GSSAPI_GSSAPI_H 1' => 1,
'#define HAVE_GSSAPI_GSSAPI_KRB5_H 1' => 1,
'#define HAVE_INTTYPES_H 1' => 1,
'#define HAVE_LDAP_H 1' => 1,
'#define HAVE_LDAP_SSL 1' => 1,
'#define HAVE_LIBBROTLIDEC 1' => 1,
'#define HAVE_LIBPSL_H 1' => 1,
'#define HAVE_LIBRTMP_RTMP_H 1' => 1,
'#define HAVE_LIBSOCKET 1' => 1,
'#define HAVE_LIBSSH' => 1,
'#define HAVE_LIBSSH2 1' => 1,
'#define HAVE_LIBSSL 1' => 1,
'#define HAVE_LIBWOLFSSH' => 1,
'#define HAVE_LIBZSTD 1' => 1,
'#define HAVE_NGHTTP2_NGHTTP2_H 1' => 1,
'#define HAVE_NGHTTP3_NGHTTP3_H 1' => 1,
@ -67,7 +67,6 @@ my %remove = (
'#define HAVE_OPENSSL_PEM_H 1' => 1,
'#define HAVE_OPENSSL_RSA_H 1' => 1,
'#define HAVE_OPENSSL_SSL_H 1' => 1,
'#define HAVE_OPENSSL_X509_H 1' => 1,
'#define HAVE_QUICHE_H 1' => 1,
'#define HAVE_SSL_SET_QUIC_TLS_CBS 1' => 1,
'#define HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT 1' => 1,
@ -78,7 +77,6 @@ my %remove = (
'#define HAVE_SYS_STAT_H 1' => 1,
'#define HAVE_SYS_XATTR_H 1' => 1,
'#define HAVE_UNICODE_UIDNA_H 1' => 1,
'#define HAVE_WOLFSSH_SSH_H 1' => 1,
'#define HAVE_WOLFSSL_SET_QUIC_USE_LEGACY_CODEPOINT 1' => 1,
'#define HAVE_ZSTD 1' => 1,
'#define HAVE_ZSTD_H 1' => 1,
@ -91,7 +89,6 @@ my %remove = (
'#define PACKAGE_TARNAME "curl"' => 1,
'#define PACKAGE_URL ""' => 1,
'#define PACKAGE_VERSION "-"' => 1,
'#define SIZEOF_LONG_LONG 8' => 1,
'#define VERSION "-"' => 1,
'#define _FILE_OFFSET_BITS 64' => 1,
);
@ -136,6 +133,5 @@ foreach my $v (keys %remove) {
}
}
# return the exit code from diff
exit system("diff -u /tmp/autotools /tmp/cmake") >> 8;
exit system('diff', ('-u', '/tmp/autotools', '/tmp/cmake')) >> 8;

View file

@ -7,7 +7,7 @@ bu
clen
CNA
hel
htpt
htpts
inout
PASE
passwor

View file

@ -7,14 +7,16 @@ set -eu
cd "$(dirname "${0}")"/../..
# shellcheck disable=SC2046
git ls-files -z | xargs -0 -r \
codespell \
--skip '.github/scripts/spellcheck.words' \
--skip '.github/scripts/pyspelling.words' \
--skip '.github/scripts/typos.toml' \
--skip 'docs/THANKS' \
--skip 'packages/*' \
--skip 'projects/OS400/*' \
--skip 'projects/vms/*' \
--skip 'RELEASE-NOTES' \
--skip 'scripts/wcurl' \
--skip 'winbuild/*' \
--skip 'tests/unit/unit1625.c' \
--ignore-regex '.*spellchecker:disable-line' \
--ignore-words '.github/scripts/codespell-ignore.txt' \
$(git ls-files)
--ignore-words '.github/scripts/codespell-ignore.words' \
--

View file

@ -11,7 +11,6 @@ set -eu
gitonly=".git*
^.*
^appveyor.*
^buildconf
^GIT-INFO.md
^README.md
^renovate.json
@ -19,17 +18,15 @@ gitonly=".git*
^SECURITY.md
^LICENSES/*
^docs/examples/adddocsref.pl
^docs/tests/CI.md
^docs/THANKS-filter
^projects/Windows/*
^scripts/ciconfig.pl
^scripts/cijobs.pl
^scripts/contributors.sh
^scripts/contrithanks.sh
^scripts/delta
^scripts/installcheck.sh
^scripts/release-notes.pl
^scripts/singleuse.pl
^tests/CI.md"
^scripts/singleuse.pl"
tarfiles="$(mktemp)"
gitfiles="$(mktemp)"

View file

@ -53,6 +53,7 @@ axTLS
backend
backends
backoff
backtick
backticks
balancers
Baratov
@ -97,6 +98,7 @@ changeset
CharConv
charset
charsets
checkdocs
checksrc
checksums
chgrp
@ -122,6 +124,7 @@ CMakeLists
CNA
CNAME
CNAMEs
CodeQL
CODESET
codeset
CodeSonar
@ -147,7 +150,6 @@ CSeq
csh
cshrc
CTRL
cURL
CURLcode
curldown
CURLE
@ -170,8 +172,10 @@ dbg
Debian
DEBUGBUILD
decrypt
decrypted
decrypting
deepcode
defacto
DELE
DER
dereference
@ -200,6 +204,7 @@ DLLs
DNS
dns
dnsop
DNSSEC
DoH
DoT
doxygen
@ -213,6 +218,7 @@ dynbuf
EAGAIN
EBCDIC
ECC
ECCN
ECDHE
ECH
ECHConfig
@ -230,9 +236,9 @@ else's
encodings
enctype
endianness
enums
Engler
enum
enums
epoll
EPRT
EPSV
@ -243,6 +249,7 @@ et
etag
ETag
ETags
exa
exe
executables
EXPN
@ -256,6 +263,7 @@ Fedora
Feltzing
ffi
filesize
filesystem
FindCURL
FLOSS
fnmatch
@ -292,9 +300,12 @@ getinfo
GETing
getpwuid
ggcov
GHA
Ghedini
giga
Gisle
Glesys
glibc
globbed
globbing
gmail
@ -355,7 +366,6 @@ HTTPS
https
HTTPSRR
hyper's
Högskolan
IANA
Icecast
ICONV
@ -377,6 +387,7 @@ imap
IMAPS
imaps
impacket
implementers
init
initializer
inlined
@ -415,6 +426,7 @@ kerberos
Keychain
keychain
KiB
kibibyte
kickstart
Kirei
Knauf
@ -423,14 +435,15 @@ Krb
krb
Kubernetes
Kuhrt
Kungliga
Largefile
LDAP
ldap
LDAPS
ldaps
LF
LGPL
LGTM
libbacktrace
libbrotlidec
libc
libcurl
@ -460,6 +473,7 @@ libWebSocket
libz
libzstd
LineageOS
linter
linux
lldb
ln
@ -490,6 +504,7 @@ Mavrogiannopoulos
Mbed
mbedTLS
md
mebibyte
Meglio
memdebug
MesaLink
@ -562,6 +577,7 @@ Necko
NetBSD
netrc
netstat
NetWare
Netware
NFS
nghttp
@ -618,6 +634,7 @@ PEM
pem
perl
permafailing
peta
PINGs
pipelining
PKCS
@ -704,6 +721,7 @@ ROADMAP
Roadmap
Rockbox
roffit
RPC
RPG
RR
RRs
@ -742,6 +760,7 @@ scp
SDK
se
SEB
SecTrust
SEK
selectable
Serv
@ -759,6 +778,7 @@ singlecwd
SINIX
Sintonen
sizeof
Slowloris
SLE
slist
sln
@ -790,6 +810,7 @@ sprintf
src
SRP
SRWLOCK
SSI
SSL
ssl
SSLeay
@ -806,6 +827,7 @@ stateful
statvfs
stderr
stdin
stdint
stdout
Steinar
Stenberg
@ -847,7 +869,7 @@ Tatsuhiro
TBD
TCP
tcpdump
Tekniska
tera
testability
testcurl
TFTP
@ -884,7 +906,9 @@ UDP
UI
UID
UIDL
uint
Ultrix
umask
Unary
unassign
UNC
@ -929,6 +953,7 @@ VC
vcpkg
vexxhost
Viktor
virtualized
Virtuozzo
VLAN
VM
@ -949,12 +974,13 @@ watchOS
WAV
WB
wcurl
web page
WebDAV
WebOS
webpage
webpages
WebSocket
WEBSOCKET
Wget
WHATWG
whitespace
Whitespaces
@ -973,7 +999,9 @@ www
Xbox
XDG
xdigit
XHTML
Xilinx
xmllint
XP
Xtensa
XYZ

View file

@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: curl
#
# Docs: https://facelessuser.github.io/pyspelling/configuration/
# Docs: https://github.com/UnicornGlobal/spellcheck-github-actions
matrix:
- name: Markdown
@ -29,4 +30,4 @@ matrix:
- 'strong'
- 'em'
sources:
- '**/*.md|!docs/BINDINGS.md|!docs/DISTROS.md|!docs/CIPHERS-TLS12.md|!docs/wcurl.md'
- '**/*.md|!docs/BINDINGS.md|!docs/DISTROS.md|!docs/CIPHERS-TLS12.md|!docs/wcurl.md|!tests/data/data*.md'

View file

@ -116,7 +116,6 @@ my %commonrc = (
'26' => 1,
);
sub runone {
my $a;
my $nargs = getnum(60) + 1;

5
.github/scripts/requirements-docs.txt vendored Normal file
View file

@ -0,0 +1,5 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
pyspelling==2.12.1

View file

@ -2,5 +2,4 @@
#
# SPDX-License-Identifier: curl
*.idb
*.inc
proselint==0.16.0

9
.github/scripts/requirements.txt vendored Normal file
View file

@ -0,0 +1,9 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
cmakelang==0.6.13
codespell==2.4.2
pytype==2024.10.11
reuse==6.2.0
ruff==0.15.10

View file

@ -3,7 +3,11 @@
#
# SPDX-License-Identifier: curl
# shellcheck disable=SC2046
shellcheck --exclude=1091 \
set -eu
cd "$(dirname "${0}")"/../..
git grep -z -l -E '^#!(/usr/bin/env bash|/bin/sh|/bin/bash)' | xargs -0 -r \
shellcheck --exclude=1091,2248 \
--enable=avoid-nullary-conditions,deprecate-which \
$(grep -l -E '^#!(/usr/bin/env bash|/bin/sh|/bin/bash)' $(git ls-files))
--

View file

@ -1,195 +0,0 @@
#!/usr/bin/env perl
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Viktor Szakats
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
use strict;
use warnings;
my @tabs = (
"^m4/zz40-xc-ovr.m4",
"Makefile\\.(am|example)\$",
"/mkfile",
"\\.(sln|vc)\$",
"^tests/data/test",
);
my @mixed_eol = (
"^tests/data/test",
);
my @need_crlf = (
"\\.(bat|sln)\$",
"^winbuild/.+\\.md\$",
);
my @space_at_eol = (
"^tests/data/test",
);
my @non_ascii_allowed = (
'\xC3\xB6', # UTF-8 for https://codepoints.net/U+00F6 LATIN SMALL LETTER O WITH DIAERESIS
);
my $non_ascii_allowed = join(', ', @non_ascii_allowed);
my @non_ascii = (
".github/scripts/spellcheck.words",
".mailmap",
"RELEASE-NOTES",
"docs/BINDINGS.md",
"docs/THANKS",
"docs/THANKS-filter",
);
sub fn_match {
my ($filename, @masklist) = @_;
foreach my $mask (@masklist) {
if($filename =~ $mask) {
return 1;
}
}
return 0;
}
sub eol_detect {
my ($content) = @_;
my $cr = () = $content =~ /\r/g;
my $lf = () = $content =~ /\n/g;
if($cr > 0 && $lf == 0) {
return "cr";
}
elsif($cr == 0 && $lf > 0) {
return "lf";
}
elsif($cr == 0 && $lf == 0) {
return "bin";
}
elsif($cr == $lf) {
return "crlf";
}
return "";
}
my $issues = 0;
open my $git_ls_files, '-|', 'git ls-files' or die "Failed running git ls-files: $!";
while(my $filename = <$git_ls_files>) {
chomp $filename;
open my $fh, '<', $filename or die "Cannot open '$filename': $!";
my $content = do { local $/; <$fh> };
close $fh;
my @err = ();
if(!fn_match($filename, @tabs) &&
$content =~ /\t/) {
push @err, "content: has tab";
}
my $eol = eol_detect($content);
if($eol eq "" &&
!fn_match($filename, @mixed_eol)) {
push @err, "content: has mixed EOL types";
}
if($eol ne "crlf" &&
fn_match($filename, @need_crlf)) {
push @err, "content: must use CRLF EOL for this file type";
}
if($eol ne "lf" && $content ne "" &&
!fn_match($filename, @need_crlf) &&
!fn_match($filename, @mixed_eol)) {
push @err, "content: must use LF EOL for this file type";
}
if(!fn_match($filename, @space_at_eol) &&
$content =~ /[ \t]\n/) {
my $line;
for my $l (split(/\n/, $content)) {
$line++;
if($l =~ /[ \t]$/) {
push @err, "line $line: trailing whitespace";
}
}
}
if($content ne "" &&
$content !~ /\n\z/) {
push @err, "content: has no EOL at EOF";
}
if($content =~ /\n\n\z/ ||
$content =~ /\r\n\r\n\z/) {
push @err, "content: has multiple EOL at EOF";
}
if($content =~ /\n\n\n\n/ ||
$content =~ /\r\n\r\n\r\n\r\n/) {
push @err, "content: has 3 or more consecutive empty lines";
}
if($content =~ /([\x00-\x08\x0b\x0c\x0e-\x1f\x7f])/) {
push @err, "content: has binary contents";
}
if($filename !~ /tests\/data/) {
# the tests have no allowed UTF bytes
$content =~ s/[$non_ascii_allowed]//g;
}
if(!fn_match($filename, @non_ascii) &&
($content =~ /([\x80-\xff]+)/)) {
my $non = $1;
my $hex;
for my $e (split(//, $non)) {
$hex .= sprintf("%s%02x", $hex ? " ": "", ord($e));
}
my $line;
for my $l (split(/\n/, $content)) {
$line++;
if($l =~ /([\x80-\xff]+)/) {
push @err, "line $line: has non-ASCII: '$non' ($hex)";
}
}
}
if(@err) {
$issues++;
foreach my $err (@err) {
print "$filename: $err\n";
}
}
}
close $git_ls_files;
if($issues) {
exit 1;
}

View file

@ -133,9 +133,10 @@ curl_multi_setopt
curl_multi_assign
curl_multi_get_handles
curl_multi_get_offt
curl_multi_notify_disable
curl_multi_notify_enable
curl_pushheader_bynum
curl_pushheader_byname
curl_multi_waitfds
curl_easy_option_by_name
curl_easy_option_by_id
curl_easy_option_next

View file

@ -4,14 +4,16 @@
[default]
extend-ignore-identifiers-re = [
"^(ba|pn|PN|UE)$",
"^(CNA|ser)$",
"^(ECT0|ECT1|HELO|htpt|PASE)$",
"^(ba|fo|pn|PN|UE)$",
"^(CNA|cpy|ser)$",
"^(ECT0|ECT1|HELO|htpts|PASE)$",
"^[A-Za-z0-9_-]*(EDE|GOST)[A-Z0-9_-]*$", # ciphers
"^0x[0-9a-fA-F]+FUL$", # unsigned long hex literals ending with 'F'
"^[0-9a-zA-Z+]{64,}$", # possibly base64
"^(Januar|eyeballers|HELO_smtp|kno22|MkTypLibCompatible|optin|passin|perfec|__SecURE|SMTP_HELO|v_alue)$",
"^(clen|req_clen|smtp_perform_helo|smtp_state_helo_resp|_stati64)$",
"^[0-9a-zA-Z+]{64,}$", # possibly base64
"^(eyeballers|HELO_smtp|Januar|optin|passin|perfec|SMTP_HELO)$",
"^(clen|req_clen|smtp_perform_helo|smtp_state_helo_resp|Tru64|_stati64)$",
"(_ccontains|_controllen|O_WRONLY|secur32)",
"proxys", # this should be limited to tests/http/*. Short for secure proxy.
]
extend-ignore-re = [
@ -20,10 +22,15 @@ extend-ignore-re = [
[files]
extend-exclude = [
".github/scripts/codespell-ignore.txt",
".github/scripts/spellcheck.words",
".github/scripts/codespell-ignore.words",
".github/scripts/pyspelling.words",
"docs/THANKS",
"packages/*",
"projects/OS400/*",
"projects/vms/*",
"projects/Windows/tmpl/curl.vcxproj",
"projects/Windows/tmpl/libcurl.vcxproj",
"RELEASE-NOTES",
"scripts/wcurl",
"winbuild/*",
"tests/data/test*",
"tests/unit/unit1625.c",
]

View file

@ -37,12 +37,14 @@ if(!@files || $files[0] eq "-h") {
}
sub testcompile {
my $rc = system("gcc -c test.c -DCURL_ALLOW_OLD_MULTI_SOCKET -DCURL_DISABLE_DEPRECATION -Wunused -Werror -Wall -Wno-unused-but-set-variable -I include") >> 8;
my $rc = system('gcc -c test.c -I include -W -Wall -pedantic -Werror ' .
'-Wno-unused-parameter -Wno-unused-but-set-variable ' .
'-DCURL_ALLOW_OLD_MULTI_SOCKET -DCURL_DISABLE_DEPRECATION') >> 8;
return $rc;
}
sub checksrc {
my $rc = system("$check test.c") >> 8;
my $rc = system($check, ('test.c')) >> 8;
return $rc;
}
@ -63,9 +65,9 @@ sub extract {
elsif($syn == 1) {
if(/^~~~/) {
$syn++;
print O "/* !checksrc! disable UNUSEDIGNORE all */\n";
print O "/* !checksrc! disable BANNEDFUNC all */\n"; # for fopen()
print O "/* !checksrc! disable COPYRIGHT all */\n";
print O "/* !checksrc! disable FOPENMODE all */\n";
print O "/* !checksrc! disable UNUSEDIGNORE all */\n";
printf O "#line %d \"$f\"\n", $iline+1;
}
}

View file

@ -35,11 +35,11 @@ if(!@files || $files[0] eq "-h") {
}
sub testcompile {
my $rc = system("gcc -c test.c -DCURL_DISABLE_TYPECHECK -DCURL_ALLOW_OLD_MULTI_SOCKET -I include") >> 8;
my $rc = system('gcc -c test.c -I include -W -Wall -pedantic -Werror ' .
'-DCURL_ALLOW_OLD_MULTI_SOCKET -DCURL_DISABLE_TYPECHECK') >> 8;
return $rc;
}
sub extract {
my($f) = @_;
my $syn = 0;

View file

@ -5,9 +5,11 @@
set -eu
# shellcheck disable=SC2046
cd "$(dirname "${0}")"/../..
git ls-files '*.yaml' '*.yml' -z | xargs -0 -r \
yamllint \
--format standard \
--strict \
--config-data "$(dirname "$0")/yamlcheck.yaml" \
$(git ls-files '*.yaml' '*.yml')
--config-data .github/scripts/yamlcheck.yaml \
--

2
.github/stale.yml vendored
View file

@ -6,7 +6,7 @@
daysUntilStale: 180
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 14
# Issues with these labels will never be considered stale
# Issues with these labels are never considered stale
exemptLabels:
- pinned
- security

View file

@ -16,10 +16,10 @@ permissions: {}
jobs:
split:
name: 'split'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm
if: ${{ github.event.sender.login == 'appveyor[bot]' }}
permissions:
statuses: write
statuses: write # To update build statuses
steps:
- name: 'Create individual AppVeyor build statuses'
if: ${{ github.event.sha && github.event.target_url }}
@ -29,7 +29,7 @@ jobs:
APPVEYOR_REPOSITORY: ${{ github.event.repository.full_name }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "${APPVEYOR_TARGET_URL}" | sed 's/\/project\//\/api\/projects\//' | xargs -t -n1 curl -s | \
echo "${APPVEYOR_TARGET_URL}" | sed 's/\/project\//\/api\/projects\//' | xargs -t -n1 curl -s -- | \
jq -c '.build.jobs[] | {target_url: ($target_url + "/job/" + .jobId),
context: (.name | sub("^(Environment: )?"; "AppVeyor / ")),
state: (.status | sub("queued"; "pending")

View file

@ -14,8 +14,8 @@ name: 'Docs'
- '*/ci'
paths:
- '.github/workflows/checkdocs.yml'
- '.github/scripts/mdlinkcheck'
- '/scripts/**'
- '.github/scripts/**'
- 'scripts/**'
- '**.md'
- 'docs/*'
pull_request:
@ -24,7 +24,7 @@ name: 'Docs'
paths:
- '.github/workflows/checkdocs.yml'
- '.github/scripts/**'
- '.github/scripts/mdlinkcheck'
- 'scripts/**'
- '**.md'
- 'docs/*'
@ -35,127 +35,96 @@ concurrency:
permissions: {}
jobs:
# proselint:
# name: 'proselint'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
# with:
# persist-credentials: false
#
# - name: 'install prereqs'
# run: |
# sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
# sudo apt-get -o Dpkg::Use-Pty=0 update
# sudo rm -f /var/lib/man-db/auto-update
# sudo apt-get -o Dpkg::Use-Pty=0 install python3-proselint
#
# # config file help: https://github.com/amperser/proselint/
# - name: 'create proselint config'
# run: |
# cat <<JSON > ~/.proselintrc.json
# {
# "checks": {
# "typography.diacritical_marks": false,
# "typography.symbols": false,
# "annotations.misc": false,
# "security.password": false,
# "misc.annotations": false
# }
# }
# JSON
#
# - name: 'trim headers off all *.md files'
# run: git ls-files -z '*.md' | xargs -0 -n1 .github/scripts/trimmarkdownheader.pl
#
# - name: 'check prose'
# run: git ls-files -z '*.md' | grep -Evz 'CHECKSRC.md|DISTROS.md|curl_mprintf.md|CURLOPT_INTERFACE.md|interface.md' | xargs -0 proselint README
#
# # This is for CHECKSRC and files with aggressive exclamation mark needs
# - name: 'create second proselint config'
# run: |
# cat <<JSON > ~/.proselintrc.json
# {
# "checks": {
# "typography.diacritical_marks": false,
# "typography.symbols": false,
# "typography.exclamation": false,
# "lexical_illusions.misc": false,
# "annotations.misc": false
# }
# }
# JSON
#
# - name: 'check special prose'
# run: proselint docs/internals/CHECKSRC.md docs/libcurl/curl_mprintf.md docs/libcurl/opts/CURLOPT_INTERFACE.md docs/cmdline-opts/interface.md
linkcheck:
name: 'linkcheck'
runs-on: ubuntu-latest
# config file help: https://github.com/amperser/proselint/
proselint:
name: 'proselint'
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'mdlinkcheck'
run: ./scripts/mdlinkcheck
- name: 'install prereqs'
run: |
python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r .github/scripts/requirements-proselint.txt
spellcheck:
name: 'spellcheck'
- name: 'trim headers off all *.md files'
run: git ls-files '*.md' -z | xargs -0 -n1 .github/scripts/trimmarkdownheader.pl
- name: 'check prose'
run: |
cat <<JSON > ~/.proselintrc.json
{
"checks": {
"annotations.misc": false,
"lexical_illusions": false,
"misc.annotations": false,
"redundancy.misc.garner": false,
"security.password": false,
"spelling.ve_of": false,
"typography.diacritical_marks": false,
"typography.symbols": false
}
}
JSON
source ~/venv/bin/activate
git ls-files README '*.md' -z | grep -Evz '(CHECKSRC|DISTROS|CURLOPT_INTERFACE|interface)\.md' | xargs -0 proselint check --
- name: 'check special prose' # For CHECKSRC and files with aggressive exclamation mark needs
run: |
cat <<JSON > ~/.proselintrc.json
{
"checks": {
"annotations.misc": false,
"lexical_illusions": false,
"typography.diacritical_marks": false,
"typography.punctuation.exclamation": false,
"typography.symbols": false
}
}
JSON
source ~/venv/bin/activate
proselint check docs/internals/CHECKSRC.md docs/libcurl/opts/CURLOPT_INTERFACE.md docs/cmdline-opts/interface.md
pyspelling:
name: 'pyspelling'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'trim all *.md files in docs/'
run: .github/scripts/cleancmd.pl 'docs/*.md'
- name: 'install'
run: |
# shellcheck disable=SC2046
.github/scripts/cleancmd.pl $(find docs -name '*.md')
sudo rm -f /etc/apt/sources.list.d/{azure-cli.sources,microsoft-prod.list,ondrej-ubuntu-php-noble.sources}
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install aspell aspell-en
python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r .github/scripts/requirements-docs.txt
- name: 'setup the custom wordlist'
run: grep -v '^#' .github/scripts/spellcheck.words > wordlist.txt
- name: 'check spelling'
run: |
source ~/venv/bin/activate
# setup the custom wordlist
grep -v '^#' .github/scripts/pyspelling.words > wordlist.txt
aspell --version
pyspelling --version
pyspelling --verbose --jobs 5 --config .github/scripts/pyspelling.yaml
- name: 'check Spelling'
uses: rojopolis/spellcheck-github-actions@35a02bae020e6999c5c37fabaf447f2eb8822ca7 # v0
with:
config_path: .github/scripts/spellcheck.yaml
badwords-synopsis:
name: 'badwords, synopsis'
runs-on: ubuntu-latest
synopsis-man-examples:
name: 'synopsis, man-examples'
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'badwords'
run: |
# shellcheck disable=SC2046
.github/scripts/badwords.pl < .github/scripts/badwords.txt $(git ls-files '**.md') docs/TODO docs/KNOWN_BUGS packages/OS400/README.OS400
- name: 'verify synopsis'
run: .github/scripts/verify-synopsis.pl docs/libcurl/curl*.md
man-examples:
name: 'man-examples'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'verify examples'
run: .github/scripts/verify-examples.pl docs/libcurl/curl*.md docs/libcurl/opts/*.md
miscchecks:
name: 'spacecheck'
runs-on: ubuntu-24.04-arm
timeout-minutes: 5
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'spacecheck'
run: .github/scripts/spacecheck.pl

View file

@ -12,129 +12,153 @@ name: 'Source'
- master
- '*/ci'
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'plan9/**'
- 'tests/data/**'
- 'winbuild/**'
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'plan9/**'
- 'tests/data/**'
- 'winbuild/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
jobs:
checksrc:
name: 'checksrc'
runs-on: ubuntu-latest
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'check'
run: scripts/checksrc-all.pl
spellcheck-cmakelint-pytype-ruff:
name: 'spellcheck, cmakelint, pytype, ruff'
runs-on: ubuntu-latest
linters:
name: 'spellcheck, linters, REUSE'
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'install'
env:
DEBIAN_FRONTEND: noninteractive
- name: 'install prereqs'
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Dpkg::Use-Pty=0 install \
python3-pip python3-networkx python3-pydot python3-yaml \
python3-toml python3-markupsafe python3-jinja2 python3-tabulate \
python3-typing-extensions python3-libcst python3-impacket \
python3-websockets python3-pytest python3-filelock python3-pytest-xdist
python3 -m pip install --break-system-packages cmakelang==0.6.13 pytype==2024.10.11 ruff==0.11.9 codespell==2.4.1
python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary \
-r .github/scripts/requirements.txt \
-r tests/http/requirements.txt \
-r tests/requirements.txt
- name: 'REUSE check'
run: |
source ~/venv/bin/activate
reuse lint
- name: 'codespell'
run: |
source ~/venv/bin/activate
codespell --version
.github/scripts/codespell.sh
- name: 'typos'
timeout-minutes: 2
run: |
/home/linuxbrew/.linuxbrew/bin/brew install typos-cli
HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install typos-cli
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
typos --version
.github/scripts/typos.sh
- name: 'cmakelint'
run: scripts/cmakelint.sh
run: |
source ~/venv/bin/activate
scripts/cmakelint.sh
- name: 'perlcheck'
run: |
scripts/perlcheck.sh
- name: 'pytype'
run: find . -name '*.py' -exec pytype -j auto -k {} +
run: |
source ~/venv/bin/activate
find . -name '*.py' -exec pytype -j auto -k -- {} +
- name: 'ruff'
run: scripts/pythonlint.sh
reuse:
name: 'REUSE'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'check'
uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5
run: |
source ~/venv/bin/activate
scripts/pythonlint.sh
complexity:
name: 'complexity'
runs-on: ubuntu-latest
runs-on: ubuntu-slim
timeout-minutes: 3
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'install pmccabe'
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo rm -f /etc/apt/sources.list.d/{azure-cli.sources,microsoft-prod.list,ondrej-ubuntu-php-noble.sources}
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Dpkg::Use-Pty=0 install \
pmccabe
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'check scores'
run: ./scripts/top-complexity
xmllint:
name: 'xmllint'
runs-on: ubuntu-slim
timeout-minutes: 3
steps:
- name: 'install prereqs'
run: |
sudo rm -f /etc/apt/sources.list.d/{azure-cli.sources,microsoft-prod.list,ondrej-ubuntu-php-noble.sources}
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install \
libxml2-utils
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'check'
run: git grep -z -i -l -E '^<\?xml' | xargs -0 -r xmllint --output /dev/null
miscchecks:
name: 'misc checks'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm
timeout-minutes: 5
steps:
- name: 'install prereqs'
run: /home/linuxbrew/.linuxbrew/bin/brew install shellcheck zizmor
timeout-minutes: 2
run: HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install actionlint shellcheck zizmor
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'zizmor GHA'
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
zizmor --pedantic .github/workflows/*.yml
zizmor --pedantic .github/workflows/*.yml .github/dependabot.yml
- name: 'actionlint'
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
export SHELLCHECK_OPTS='--exclude=1090,1091,2086,2153 --enable=avoid-nullary-conditions,deprecate-which'
actionlint --version
actionlint --ignore matrix .github/workflows/*.yml
- name: 'shellcheck CI'
run: |
@ -149,14 +173,10 @@ jobs:
.github/scripts/shellcheck.sh
- name: 'spacecheck'
run: .github/scripts/spacecheck.pl
run: scripts/spacecheck.pl
- name: 'yamlcheck'
run: .github/scripts/yamlcheck.sh
# we allow some extra in source code
- name: 'badwords'
run: |
# shellcheck disable=SC2046
grep -Ev '(\\bwill| url | dir )' .github/scripts/badwords.txt | \
.github/scripts/badwords.pl $(git ls-files -- src lib include)
run: scripts/badwords-all

40
.github/workflows/checkurls.yml vendored Normal file
View file

@ -0,0 +1,40 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: 'URLs'
'on':
push:
branches:
- master
- '*/ci'
pull_request:
branches:
- master
schedule:
- cron: '10 5 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
jobs:
linkcheck:
if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }}
name: 'linkcheck'
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'mdlinkcheck (dry run)'
if: ${{ github.event_name != 'schedule' }}
run: ./scripts/mdlinkcheck --dry-run
- name: 'mdlinkcheck'
if: ${{ github.event_name == 'schedule' }}
run: ./scripts/mdlinkcheck

View file

@ -13,12 +13,8 @@ name: 'CodeQL'
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'docs/**'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'tests/data/**'
- 'winbuild/**'
pull_request:
branches:
- master
@ -26,36 +22,120 @@ name: 'CodeQL'
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'docs/**'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'tests/data/**'
- 'winbuild/**'
schedule:
- cron: '0 0 * * 4'
concurrency:
group: ${{ github.workflow }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
jobs:
codeql:
gha_python:
if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }}
name: 'GHA and Python'
runs-on: ubuntu-latest
permissions:
security-events: write
security-events: write # To create/update security events
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'initialize'
uses: github/codeql-action/init@d3678e237b9c32a6c9bffb3315c335f976f3549f # v3
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
with:
languages: actions, python
queries: security-extended
- name: 'perform analysis'
uses: github/codeql-action/analyze@d3678e237b9c32a6c9bffb3315c335f976f3549f # v3
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
c:
if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }}
name: 'C'
runs-on: ${{ matrix.platform == 'Linux' && 'ubuntu-latest' || 'windows-2022' }}
permissions:
security-events: write # To create/update security events
strategy:
fail-fast: false
matrix:
platform: [Linux, Windows]
env:
MATRIX_PLATFORM: '${{ matrix.platform }}'
steps:
- name: 'install prereqs'
if: ${{ matrix.platform == 'Linux' }}
timeout-minutes: 5
run: |
sudo rm -f /etc/apt/sources.list.d/{azure-cli.sources,microsoft-prod.list,ondrej-ubuntu-php-noble.sources}
sudo apt-get -o Dpkg::Use-Pty=0 update
printf "#!/bin/sh
while [ \$? = 0 ]; do for i in 1 2 3; do timeout 60 \"\$@\" && break 2; echo \"Error: slow server, retry \$i\"; sleep 1
dpkg --configure -a; done; false; done" > "$HOME"/my-apt; chmod +x "$HOME"/my-apt
sudo "$HOME"/my-apt apt-get -o Dpkg::Use-Pty=0 install \
libpsl-dev libbrotli-dev libidn2-dev libssh2-1-dev libssh-dev \
libnghttp2-dev libldap-dev libkrb5-dev libgnutls28-dev libwolfssl-dev
HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install c-ares gsasl libnghttp3 libngtcp2 mbedtls rustls-ffi
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'delete test input C files'
shell: bash
run: find tests/data -name '*.c' -delete
- name: 'initialize'
# https://github.com/github/codeql-action/blob/main/init/action.yml
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
with:
languages: cpp
build-mode: manual
trap-caching: false
- name: 'build'
timeout-minutes: 10
shell: bash
run: |
if [ "${MATRIX_PLATFORM}" = 'Windows' ]; then
cmake -B . -DBUILD_SHARED_LIBS=OFF -DCURL_DROP_UNUSED=ON -DCURL_WERROR=ON \
-DCMAKE_VS_GLOBALS=TrackFileAccess=false \
-DCURL_USE_SCHANNEL=ON -DCURL_USE_LIBPSL=OFF -DUSE_WIN32_IDN=ON
cmake --build . --verbose
src/Debug/curl.exe --disable --version
else
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
export PKG_CONFIG_PATH
# MultiSSL
PKG_CONFIG_PATH="$(brew --prefix c-ares)/lib/pkgconfig:$(brew --prefix mbedtls)/lib/pkgconfig:$(brew --prefix rustls-ffi)/lib/pkgconfig:$(brew --prefix gsasl)/lib/pkgconfig"
cmake -B _bld1 -G Ninja -DCURL_DISABLE_TYPECHECK=ON -DCURL_WERROR=ON -DENABLE_DEBUG=ON \
-DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_RUSTLS=ON -DCURL_USE_WOLFSSL=ON \
-DCURL_USE_GSASL=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON -DUSE_ECH=ON -DENABLE_ARES=ON \
-DCURL_DISABLE_VERBOSE_STRINGS=ON
cmake --build _bld1
cmake --build _bld1 --target testdeps
cmake --build _bld1 --target curl-examples-build
# HTTP/3
PKG_CONFIG_PATH="$(brew --prefix libnghttp3)/lib/pkgconfig:$(brew --prefix libngtcp2)/lib/pkgconfig:$(brew --prefix gsasl)/lib/pkgconfig"
cmake -B _bld2 -G Ninja -DCURL_DISABLE_TYPECHECK=ON -DCURL_WERROR=ON \
-DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR="$(brew --prefix openssl)" -DUSE_NGTCP2=ON \
-DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON \
-DCURL_USE_GSASL=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON
cmake --build _bld2
cmake --build _bld2 --target testdeps
cmake --build _bld2 --target curl-examples-build
_bld1/src/curl --disable --version
_bld2/src/curl --disable --version
fi
- name: 'perform analysis'
# https://github.com/github/codeql-action/blob/main/analyze/action.yml
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4

View file

@ -12,7 +12,7 @@ name: 'configure-vs-cmake'
- '**/*.m4'
- '**/CMakeLists.txt'
- 'CMake/**'
- 'lib/curl_config.h.cmake'
- 'lib/curl_config-cmake.h.in'
- 'tests/cmake/**'
- '.github/scripts/cmp-config.pl'
- '.github/workflows/configure-vs-cmake.yml'
@ -25,11 +25,15 @@ name: 'configure-vs-cmake'
- '**/*.m4'
- '**/CMakeLists.txt'
- 'CMake/**'
- 'lib/curl_config.h.cmake'
- 'lib/curl_config-cmake.h.in'
- 'tests/cmake/**'
- '.github/scripts/cmp-config.pl'
- '.github/workflows/configure-vs-cmake.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
jobs:
@ -37,7 +41,7 @@ jobs:
name: 'Linux'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
@ -48,7 +52,7 @@ jobs:
mkdir bld-am && cd bld-am && ../configure --enable-static=no --with-openssl --without-libpsl
- name: 'run cmake'
run: cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF
run: cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_CMAKECONFIG=OFF -DCURL_USE_LIBPSL=OFF
- name: 'configure log'
run: cat bld-am/config.log 2>/dev/null || true
@ -77,14 +81,25 @@ jobs:
runs-on: macos-latest
steps:
- name: 'install packages'
timeout-minutes: 2
run: |
# shellcheck disable=SC2181,SC2034
while [[ $? == 0 ]]; do for i in 1 2 3; do if brew update && brew install automake libtool; then break 2; else echo Error: wait to try again; sleep 10; fi; done; false Too many retries; done
# shellcheck disable=SC2181
while [[ $? == 0 ]]; do
for i in 1 2 3; do
if brew update && brew install automake libtool; then
break 2
else
echo "Error: wait to try again: $i"
sleep 10
fi
done
false Too many retries
done
- name: 'toolchain versions'
run: echo '::group::brew packages installed'; ls -l /opt/homebrew/opt; echo '::endgroup::'
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
@ -92,13 +107,13 @@ jobs:
run: |
autoreconf -fi
export PKG_CONFIG_DEBUG_SPEW=1
mkdir bld-am && cd bld-am && ../configure --enable-static=no --with-openssl --without-libpsl --disable-ldap --with-brotli --with-zstd
mkdir bld-am && cd bld-am && ../configure --enable-static=no --with-openssl --without-libpsl --disable-ldap --with-brotli --with-zstd --with-apple-sectrust
- name: 'run cmake'
run: |
cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF -DCURL_DISABLE_LDAP=ON \
cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_CMAKECONFIG=OFF -DCURL_USE_LIBPSL=OFF -DCURL_DISABLE_LDAP=ON \
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \
-DCURL_USE_LIBSSH2=OFF
-DCURL_USE_LIBSSH2=OFF -DUSE_APPLE_SECTRUST=ON
- name: 'configure log'
run: cat bld-am/config.log 2>/dev/null || true
@ -130,10 +145,12 @@ jobs:
steps:
- name: 'install packages'
run: |
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Dpkg::Use-Pty=0 install mingw-w64
printf "#!/bin/sh
while [ \$? = 0 ]; do for i in 1 2 3; do timeout 30 \"\$@\" && break 2; echo \"Error: slow server, retry \$i\"; sleep 1
dpkg --configure -a; done; false; done" > "$HOME"/my-apt; chmod +x "$HOME"/my-apt
sudo "$HOME"/my-apt apt-get -o Dpkg::Use-Pty=0 install gcc-mingw-w64-x86-64-win32
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
@ -145,7 +162,7 @@ jobs:
- name: 'run cmake'
run: |
cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_SCHANNEL=ON -DCURL_USE_LIBPSL=OFF \
cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_CMAKECONFIG=OFF -DCURL_USE_SCHANNEL=ON -DCURL_USE_LIBPSL=OFF \
-DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_C_COMPILER_TARGET="${TRIPLET}" \
-DCMAKE_C_COMPILER="${TRIPLET}-gcc"

View file

@ -14,10 +14,7 @@ name: 'curl-for-win'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
pull_request:
branches:
- master
@ -26,10 +23,7 @@ name: 'curl-for-win'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
@ -49,7 +43,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
path: 'curl'
@ -58,19 +52,46 @@ jobs:
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-linux-a64-x64-gcc'
export CW_CONFIG='-main-werror-unitybatch-nocertdata-linux-a64-x64-gcc'
export CW_REVISION="${GITHUB_SHA}"
DOCKER_IMAGE='debian:bookworm-slim'
. ./_versions.sh
export CW_CCSUFFIX='-15'
export CW_GCCSUFFIX='-12'
sudo podman image trust set --type reject default
sudo podman image trust set --type accept docker.io/library
time podman pull "${DOCKER_IMAGE}"
time podman pull "${OCI_IMAGE_DEBIAN_STABLE}"
podman images --digests
time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \
--env-file <(env | grep -a -E \
'^(CW_|GITHUB_)') \
"${DOCKER_IMAGE}" \
"${OCI_IMAGE_DEBIAN_STABLE}" \
sh -c ./_ci-linux-debian.sh
linux-glibc-gcc-minimal: # use gcc to minimize installed packages
name: 'Linux gcc glibc minimal (amd64)'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
path: 'curl'
fetch-depth: 8
- name: 'build'
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-nocertdata-prefill-zero-osnotls-osnoidn-nohttp-nocurltool-linux-x64-gcc'
export CW_REVISION="${GITHUB_SHA}"
. ./_versions.sh
sudo podman image trust set --type reject default
sudo podman image trust set --type accept docker.io/library
time podman pull "${OCI_IMAGE_DEBIAN}"
podman images --digests
time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \
--env-file <(env | grep -a -E \
'^(CW_|GITHUB_)') \
"${OCI_IMAGE_DEBIAN}" \
sh -c ./_ci-linux-debian.sh
linux-musl-llvm:
@ -78,7 +99,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
path: 'curl'
@ -87,27 +108,27 @@ jobs:
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-linux-musl-r64-x64'
export CW_CONFIG='-main-werror-unitybatch-nocertdata-linux-musl-r64-x64'
export CW_REVISION="${GITHUB_SHA}"
. ./_versions.sh
sudo podman image trust set --type reject default
sudo podman image trust set --type accept docker.io/library
time podman pull "${DOCKER_IMAGE}"
time podman pull "${OCI_IMAGE_DEBIAN}"
podman images --digests
time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \
--env-file <(env | grep -a -E \
'^(CW_|GITHUB_)') \
"${DOCKER_IMAGE}" \
"${OCI_IMAGE_DEBIAN}" \
sh -c ./_ci-linux-debian.sh
mac-clang:
name: 'macOS clang (x86_64)'
name: 'macOS clang cares (x86_64)'
runs-on: macos-latest
timeout-minutes: 10
env:
CW_JOBS: '4'
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
path: 'curl'
@ -116,7 +137,7 @@ jobs:
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-mac-x64'
export CW_CONFIG='-main-werror-unitybatch-nocertdata-mac-x64-cares'
export CW_REVISION="${GITHUB_SHA}"
sh -c ./_ci-mac-homebrew.sh
@ -125,7 +146,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
path: 'curl'
@ -134,25 +155,25 @@ jobs:
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-win-x64'
export CW_CONFIG='-main-werror-unitybatch-nocertdata-win-x64-noWINE'
export CW_REVISION="${GITHUB_SHA}"
. ./_versions.sh
sudo podman image trust set --type reject default
sudo podman image trust set --type accept docker.io/library
time podman pull "${DOCKER_IMAGE}"
time podman pull "${OCI_IMAGE_DEBIAN}"
podman images --digests
time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \
--env-file <(env | grep -a -E \
'^(CW_|GITHUB_)') \
"${DOCKER_IMAGE}" \
"${OCI_IMAGE_DEBIAN}" \
sh -c ./_ci-linux-debian.sh
win-gcc-libssh-zlibold-x64:
name: 'Windows gcc libssh zlib-classic (x64)'
win-gcc-zlibold-x64:
name: 'Windows gcc zlib-classic (x64)'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
path: 'curl'
@ -161,15 +182,15 @@ jobs:
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-win-x64-gcc-libssh1-zlibold'
export CW_CONFIG='-main-werror-unitybatch-nocertdata-win-x64-gcc-zlibold-noWINE'
export CW_REVISION="${GITHUB_SHA}"
. ./_versions.sh
sudo podman image trust set --type reject default
sudo podman image trust set --type accept docker.io/library
time podman pull "${DOCKER_IMAGE}"
time podman pull "${OCI_IMAGE_DEBIAN}"
podman images --digests
time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \
--env-file <(env | grep -a -E \
'^(CW_|GITHUB_)') \
"${DOCKER_IMAGE}" \
"${OCI_IMAGE_DEBIAN}" \
sh -c ./_ci-linux-debian.sh

View file

@ -20,6 +20,7 @@ concurrency:
permissions: {}
env:
CURL_TEST_MIN: 1450
MAKEFLAGS: -j 5
jobs:
@ -28,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
@ -47,7 +48,7 @@ jobs:
- name: 'maketgz'
run: SOURCE_DATE_EPOCH=1711526400 ./scripts/maketgz 99.98.97
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: 'release-tgz'
path: 'curl-99.98.97.tar.gz'
@ -58,7 +59,7 @@ jobs:
echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97
./configure --prefix="$HOME"/temp --enable-werror --without-ssl --without-libpsl
./configure --prefix="$HOME"/temp --enable-option-checking=fatal --enable-werror --without-ssl --without-libpsl
make
make test-ci
make install
@ -73,7 +74,7 @@ jobs:
timeout-minutes: 10
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: 'release-tgz'
@ -84,7 +85,7 @@ jobs:
touch curl-99.98.97/docs/{cmdline-opts,libcurl}/Makefile.inc
mkdir build
pushd build
../curl-99.98.97/configure --enable-werror --without-ssl --without-libpsl
../curl-99.98.97/configure --enable-option-checking=fatal --enable-werror --without-ssl --without-libpsl
make
make test-ci
popd
@ -97,7 +98,7 @@ jobs:
timeout-minutes: 10
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: 'release-tgz'
@ -108,7 +109,7 @@ jobs:
pushd curl-99.98.97
mkdir build
pushd build
../configure --prefix="$PWD"/curl-install --enable-werror --without-ssl --enable-debug --without-libpsl
../configure --prefix="$PWD"/curl-install --enable-option-checking=fatal --enable-werror --without-ssl --enable-debug --without-libpsl
make
make test-ci
make install
@ -123,7 +124,7 @@ jobs:
timeout-minutes: 10
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: 'release-tgz'
@ -134,7 +135,7 @@ jobs:
pushd curl-99.98.97
mkdir build
pushd build
../configure --prefix="$PWD"/curl-install --enable-werror --without-ssl --without-libpsl ac_cv_path_PERL=
../configure --prefix="$PWD"/curl-install --enable-option-checking=fatal --enable-werror --without-ssl --without-libpsl ac_cv_path_PERL=
make
make install
curl-install/bin/curl --disable --version
@ -147,7 +148,7 @@ jobs:
timeout-minutes: 10
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: 'release-tgz'
@ -156,7 +157,7 @@ jobs:
echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97
./configure --prefix="$PWD"/curl-install --enable-werror --without-ssl --without-libpsl ac_cv_path_PERL=
./configure --prefix="$PWD"/curl-install --enable-option-checking=fatal --enable-werror --without-ssl --without-libpsl ac_cv_path_PERL=
make
make install
curl-install/bin/curl --disable --version
@ -168,7 +169,7 @@ jobs:
timeout-minutes: 5
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: 'release-tgz'
@ -190,7 +191,7 @@ jobs:
timeout-minutes: 5
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: 'release-tgz'
@ -208,15 +209,15 @@ jobs:
missing-files:
name: 'missing files'
runs-on: ubuntu-latest
runs-on: ubuntu-slim
timeout-minutes: 5
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: 'release-tgz'
@ -228,7 +229,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
@ -248,21 +249,25 @@ jobs:
cmake-integration:
name: 'CM integration ${{ matrix.image }}'
runs-on: ${{ matrix.image }}
timeout-minutes: 10
timeout-minutes: 15
defaults:
run:
shell: ${{ contains(matrix.image, 'windows') && 'msys2 {0}' || 'bash' }}
env:
CC: ${{ !contains(matrix.image, 'windows') && 'clang' || '' }}
MAKEFLAGS: ${{ contains(matrix.image, 'macos') && '-j 4' || '-j 5' }}
MATRIX_IMAGE: '${{ matrix.image }}'
TESTOPTS: ${{ contains(matrix.image, 'macos') && '-D_CURL_PREFILL=ON' || '' }} ${{ contains(matrix.image, 'windows') && '-DCMAKE_UNITY_BUILD_BATCH_SIZE=30' || '' }}
OLD_CMAKE_VERSION: 3.11.4
OLD_CMAKE_VERSION: 3.19.8
OLD_CMAKE_SHA256_LINUX_ARM: 807f5afb2a560e00af9640e496d5673afefc2888bf0ed076412884a5ebb547a1
OLD_CMAKE_SHA256_MACOS_UNI: 0976d23d982af05dcbfb3aa34fcb62ead43bea27f0e3bb95222f2a78161423f2
OLD_CMAKE_SHA256_WIN_INTEL: 2a30877a3d6b50da305b289f4d1c03befdfaeb2edba02a563c681e883d810380
strategy:
fail-fast: false
matrix:
image: [ubuntu-latest, macos-latest, windows-2022]
image: [ubuntu-24.04-arm, macos-latest, windows-2022]
steps:
- uses: msys2/setup-msys2@fb197b72ce45fb24f17bf3f807a388985654d1f2 # v2
- uses: msys2/setup-msys2@cafece8e6baf9247cf9b1bf95097b0b983cc558d # v2.31.0
if: ${{ contains(matrix.image, 'windows') }}
with:
msystem: mingw64
@ -274,30 +279,34 @@ jobs:
mingw-w64-x86_64-zlib mingw-w64-x86_64-zstd mingw-w64-x86_64-libpsl mingw-w64-x86_64-libssh2 mingw-w64-x86_64-nghttp2 mingw-w64-x86_64-openssl
- name: 'install prereqs'
timeout-minutes: 3
run: |
if [[ "${MATRIX_IMAGE}" = *'windows'* ]]; then
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-win64-x64.zip" --output bin.zip
unzip -q bin.zip
rm -f bin.zip
--location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-win64-x64.zip" --output pkg.bin
sha256sum pkg.bin && sha256sum pkg.bin | grep -qwF -- "${OLD_CMAKE_SHA256_WIN_INTEL}" && unzip -q pkg.bin && rm -f pkg.bin
printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-win64-x64/bin/cmake.exe > ~/old-cmake-path.txt
elif [[ "${MATRIX_IMAGE}" = *'ubuntu'* ]]; then
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Dpkg::Use-Pty=0 install libpsl-dev libssl-dev
printf "#!/bin/sh
while [ \$? = 0 ]; do for i in 1 2 3; do timeout 30 \"\$@\" && break 2; echo \"Error: slow server, retry \$i\"; sleep 1
dpkg --configure -a; done; false; done" > "$HOME"/my-apt; chmod +x "$HOME"/my-apt
sudo "$HOME"/my-apt apt-get -o Dpkg::Use-Pty=0 install libpsl-dev libssl-dev
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-Linux-x86_64.tar.gz" | tar -xz
printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-Linux-x86_64/bin/cmake > ~/old-cmake-path.txt
--location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-Linux-aarch64.tar.gz" --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${OLD_CMAKE_SHA256_LINUX_ARM}" && tar -xzf pkg.bin && rm -f pkg.bin
printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-Linux-aarch64/bin/cmake > ~/old-cmake-path.txt
else
brew install libpsl openssl
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-Darwin-x86_64.tar.gz" | tar -xz
printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-Darwin-x86_64/CMake.app/Contents/bin/cmake > ~/old-cmake-path.txt
--location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-macos-universal.tar.gz" --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${OLD_CMAKE_SHA256_MACOS_UNI}" && tar -xzf pkg.bin && rm -f pkg.bin
printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-macos-universal/CMake.app/Contents/bin/cmake > ~/old-cmake-path.txt
fi
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
@ -310,6 +319,16 @@ jobs:
run: ./tests/cmake/test.sh add_subdirectory ${TESTOPTS} -DCURL_USE_OPENSSL=ON
- name: 'via find_package'
run: ./tests/cmake/test.sh find_package ${TESTOPTS} -DCURL_USE_OPENSSL=ON
- name: 'via find_package (C++)'
if: ${{ contains(matrix.image, 'ubuntu') }}
run: TEST_CMAKE_FLAGS=-DTEST_CPP=ON ./tests/cmake/test.sh find_package ${TESTOPTS} -DCURL_USE_OPENSSL=ON
- name: 'via find_package (PREFER_CONFIG=ON)'
if: ${{ contains(matrix.image, 'windows') }}
run: |
export TEST_CMAKE_FLAGS_PROVIDER='-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON -DCURL_ZSTD=OFF'
TEST_CMAKE_FLAGS_PROVIDER+=' -DNGHTTP2_INCLUDE_DIR=C:/msys64/mingw64/include -DNGHTTP2_LIBRARY=C:/msys64/mingw64/lib/libnghttp2.dll.a'
export TEST_CMAKE_FLAGS_CONSUMER="${TEST_CMAKE_FLAGS_PROVIDER}"
./tests/cmake/test.sh find_package ${TESTOPTS} -DCURL_USE_OPENSSL=ON
- name: 'via ExternalProject (old cmake)'
if: ${{ contains(matrix.image, 'ubuntu') }}

View file

@ -16,11 +16,8 @@ name: 'Fuzzer'
- 'appveyor.*'
- 'CMake/**'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'tests/data/**'
- 'winbuild/**'
pull_request:
branches:
- master
@ -31,14 +28,16 @@ name: 'Fuzzer'
- 'appveyor.*'
- 'CMake/**'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'tests/data/**'
- 'winbuild/**'
concurrency:
# Hard-coded workflow name to avoid colliding with curl-fuzzer's group
group: curl-fuzz-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
jobs:
Fuzzing:
uses: curl/curl-fuzzer/.github/workflows/ci.yml@master
uses: curl/curl-fuzzer/.github/workflows/ci.yml@master # zizmor: ignore[unpinned-uses]

View file

@ -1,72 +0,0 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: 'Hacktoberfest'
'on':
# this must not ever run on any other branch than master
push:
branches:
- master
concurrency:
# this should not run in parallel, so just run one at a time
group: ${{ github.workflow }}
permissions: {}
jobs:
# add hacktoberfest-accepted label to PRs opened starting from September 30th
# till November 1st which are closed via commit reference from master branch.
merged:
name: 'Add hacktoberfest-accepted label'
runs-on: ubuntu-latest
permissions:
# requires issues AND pull-requests write permissions to edit labels on PRs!
issues: write
pull-requests: write
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
fetch-depth: 100
- name: 'Check whether repo participates in Hacktoberfest'
id: check
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
gh config set prompt disabled && echo "label=$(
gh repo view --json repositoryTopics --jq '.repositoryTopics[].name' | grep '^hacktoberfest$')" >> "$GITHUB_OUTPUT"
- name: 'Search relevant commit message lines starting with Closes/Merges'
if: ${{ steps.check.outputs.label == 'hacktoberfest' }}
env:
GITHUB_EVENT_BEFORE: '${{ github.event.before }}'
GITHUB_EVENT_AFTER: '${{ github.event.after }}'
run: |
git log --format=email "${GITHUB_EVENT_BEFORE}..${GITHUB_EVENT_AFTER}" | \
grep -Ei '^Close[sd]? ' | sort | uniq | tee log
- name: 'Search for number-based PR references'
if: ${{ steps.check.outputs.label == 'hacktoberfest' }}
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
grep -Eo '#([0-9]+)' log | cut -d# -f2 | sort | uniq | xargs -t -n1 -I{} \
gh pr view {} --json number,createdAt \
--jq '{number, opened: .createdAt} | [.number, .opened] | join(":")' | tee /dev/stderr | \
grep -Eo '^([0-9]+):[0-9]{4}-(09-30T|10-|11-01T)' | cut -d: -f1 | sort | uniq | xargs -t -n1 -I {} \
gh pr edit {} --add-label 'hacktoberfest-accepted'
- name: 'Search for URL-based PR references'
if: ${{ steps.check.outputs.label == 'hacktoberfest' }}
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
grep -Eo 'github.com/(.+)/(.+)/pull/([0-9]+)' log | sort | uniq | xargs -t -n1 -I{} \
gh pr view 'https://{}' --json number,createdAt \
--jq '{number, opened: .createdAt} | [.number, .opened] | join(":")' | tee /dev/stderr | \
grep -Eo '^([0-9]+):[0-9]{4}-(09-30T|10-|11-01T)' | cut -d: -f1 | sort | uniq | xargs -t -n1 -I {} \
gh pr edit {} --add-label 'hacktoberfest-accepted'

View file

@ -14,10 +14,7 @@ name: 'Linux HTTP/3'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
pull_request:
branches:
- master
@ -26,14 +23,10 @@ name: 'Linux HTTP/3'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
concurrency:
# Hardcoded workflow filename as workflow name above is just Linux again
group: http3-${{ github.event.pull_request.number || github.sha }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
@ -41,28 +34,31 @@ permissions: {}
env:
MAKEFLAGS: -j 5
CURL_CI: github
CURL_TEST_MIN: 1600
# handled in renovate.json
OPENSSL_VERSION: 3.5.2
# handled in renovate.json
QUICTLS_VERSION: 3.3.0
OPENSSL_VERSION: 3.6.2
# manually bumped
OPENSSL4_VERSION: 4.0.0
# renovate: datasource=github-tags depName=libressl/portable versioning=semver registryUrl=https://github.com
LIBRESSL_VERSION: 4.1.0
LIBRESSL_VERSION: 4.2.1
# renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com
AWSLC_VERSION: 1.60.0
AWSLC_VERSION: 1.71.0
# renovate: datasource=github-tags depName=google/boringssl versioning=semver registryUrl=https://github.com
BORINGSSL_VERSION: 0.20250818.0
# renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver registryUrl=https://github.com
GNUTLS_VERSION: 3.8.10
BORINGSSL_VERSION: 0.20260413.0
# renovate: datasource=github-tags depName=gnutls/nettle versioning=semver registryUrl=https://github.com
NETTLE_VERSION: 3.10.2
# renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver extractVersion=^nettle_?(?<version>.+)_release_.+$ registryUrl=https://github.com
GNUTLS_VERSION: 3.8.11
# renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?<version>.+)-stable$ registryUrl=https://github.com
WOLFSSL_VERSION: 5.8.2
WOLFSSL_VERSION: 5.9.1
# renovate: datasource=github-tags depName=ngtcp2/nghttp3 versioning=semver registryUrl=https://github.com
NGHTTP3_VERSION: 1.11.0
NGHTTP3_VERSION: 1.15.0
# renovate: datasource=github-tags depName=ngtcp2/ngtcp2 versioning=semver registryUrl=https://github.com
NGTCP2_VERSION: 1.15.1
NGTCP2_VERSION: 1.22.0
# renovate: datasource=github-tags depName=nghttp2/nghttp2 versioning=semver registryUrl=https://github.com
NGHTTP2_VERSION: 1.67.0
NGHTTP2_VERSION: 1.68.1
# renovate: datasource=github-tags depName=cloudflare/quiche versioning=semver registryUrl=https://github.com
QUICHE_VERSION: 0.24.6
QUICHE_VERSION: 0.24.7
jobs:
build-cache:
@ -71,16 +67,25 @@ jobs:
steps:
- name: 'cache openssl'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-openssl-http3
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-openssl-http3-no-deprecated
env:
cache-name: cache-openssl-http3
cache-name: cache-openssl-http3-no-deprecated
with:
path: ~/openssl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.OPENSSL_VERSION }}
- name: 'cache openssl4'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-openssl4-http3-no-deprecated
env:
cache-name: cache-openssl4-http3-no-deprecated
with:
path: ~/openssl4/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.OPENSSL4_VERSION }}
- name: 'cache libressl'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-libressl
env:
cache-name: cache-libressl
@ -89,7 +94,7 @@ jobs:
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.LIBRESSL_VERSION }}
- name: 'cache awslc'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-awslc
env:
cache-name: cache-awslc
@ -98,7 +103,7 @@ jobs:
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.AWSLC_VERSION }}
- name: 'cache boringssl'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-boringssl
env:
cache-name: cache-boringssl
@ -106,26 +111,26 @@ jobs:
path: ~/boringssl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.BORINGSSL_VERSION }}
- name: 'cache quictls'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-quictls-no-deprecated
- name: 'cache nettle'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-nettle
env:
cache-name: cache-quictls-no-deprecated
cache-name: cache-nettle
with:
path: ~/quictls/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.QUICTLS_VERSION }}-quic1
path: ~/nettle/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NETTLE_VERSION }}
- name: 'cache gnutls'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-gnutls
env:
cache-name: cache-gnutls
with:
path: ~/gnutls/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.GNUTLS_VERSION }}
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.GNUTLS_VERSION }}-${{ env.NETTLE_VERSION }}
- name: 'cache wolfssl'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-wolfssl
env:
cache-name: cache-wolfssl
@ -134,7 +139,7 @@ jobs:
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.WOLFSSL_VERSION }}
- name: 'cache nghttp3'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-nghttp3
env:
cache-name: cache-nghttp3
@ -143,16 +148,26 @@ jobs:
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGHTTP3_VERSION }}
- name: 'cache ngtcp2'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-ngtcp2
env:
cache-name: cache-ngtcp2
with:
path: ~/ngtcp2/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL_VERSION }}-${{ env.LIBRESSL_VERSION }}-${{ env.AWSLC_VERSION }}-${{ env.QUICTLS_VERSION }}-${{ env.GNUTLS_VERSION }}-${{ env.WOLFSSL_VERSION }}
key: "${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL_VERSION }}-\
${{ env.LIBRESSL_VERSION }}-${{ env.AWSLC_VERSION }}-${{ env.NETTLE_VERSION }}-${{ env.GNUTLS_VERSION }}-${{ env.WOLFSSL_VERSION }}"
- name: 'cache ngtcp2 openssl4'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-ngtcp2-openssl4
env:
cache-name: cache-ngtcp2-openssl4
with:
path: ~/ngtcp2-openssl4/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL4_VERSION }}
- name: 'cache ngtcp2 boringssl'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-ngtcp2-boringssl
env:
cache-name: cache-ngtcp2-boringssl
@ -161,25 +176,28 @@ jobs:
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.BORINGSSL_VERSION }}
- name: 'cache nghttp2'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-nghttp2
env:
cache-name: cache-nghttp2
with:
path: ~/nghttp2/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGHTTP2_VERSION }}-${{ env.QUICTLS_VERSION }}-${{ env.NGTCP2_VERSION }}-${{ env.NGHTTP3_VERSION }}
key: "${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGHTTP2_VERSION }}-${{ env.OPENSSL_VERSION }}-\
${{ env.NGTCP2_VERSION }}-${{ env.NGHTTP3_VERSION }}"
- id: settings
if: >-
${{ steps.cache-openssl-http3.outputs.cache-hit != 'true' ||
${{ steps.cache-openssl-http3-no-deprecated.outputs.cache-hit != 'true' ||
steps.cache-openssl4-http3-no-deprecated.outputs.cache-hit != 'true' ||
steps.cache-libressl.outputs.cache-hit != 'true' ||
steps.cache-awslc.outputs.cache-hit != 'true' ||
steps.cache-boringssl.outputs.cache-hit != 'true' ||
steps.cache-quictls-no-deprecated.outputs.cache-hit != 'true' ||
steps.cache-nettle.outputs.cache-hit != 'true' ||
steps.cache-gnutls.outputs.cache-hit != 'true' ||
steps.cache-wolfssl.outputs.cache-hit != 'true' ||
steps.cache-nghttp3.outputs.cache-hit != 'true' ||
steps.cache-ngtcp2.outputs.cache-hit != 'true' ||
steps.cache-ngtcp2-openssl4.outputs.cache-hit != 'true' ||
steps.cache-ngtcp2-boringssl.outputs.cache-hit != 'true' ||
steps.cache-nghttp2.outputs.cache-hit != 'true' }}
@ -188,26 +206,37 @@ jobs:
- name: 'install build prereqs'
if: ${{ steps.settings.outputs.needs-build == 'true' }}
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo rm -f /etc/apt/sources.list.d/{azure-cli.sources,microsoft-prod.list,ondrej-ubuntu-php-noble.sources}
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Dpkg::Use-Pty=0 install \
libtool autoconf automake pkgconf stunnel4 \
libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libev-dev libc-ares-dev \
nettle-dev libp11-kit-dev libtspi-dev libunistring-dev guile-2.2-dev libtasn1-bin \
libtasn1-6-dev libidn2-0-dev gawk gperf libtss2-dev dns-root-data bison gtk-doc-tools \
texinfo texlive texlive-extra-utils autopoint libev-dev \
apache2 apache2-dev libnghttp2-dev dante-server
printf "#!/bin/sh
while [ \$? = 0 ]; do for i in 1 2 3; do timeout 60 \"\$@\" && break 2; echo \"Error: slow server, retry \$i\"; sleep 1
dpkg --configure -a; done; false; done" > "$HOME"/my-apt; chmod +x "$HOME"/my-apt
sudo "$HOME"/my-apt apt-get -o Dpkg::Use-Pty=0 install \
libtool autoconf automake pkgconf \
libbrotli-dev libzstd-dev zlib1g-dev \
libev-dev \
libc-ares-dev \
libp11-kit-dev autopoint bison gperf gtk-doc-tools libtasn1-bin # for GnuTLS
echo 'CC=gcc-12' >> "$GITHUB_ENV"
echo 'CXX=g++-12' >> "$GITHUB_ENV"
- name: 'build openssl'
if: ${{ steps.cache-openssl-http3.outputs.cache-hit != 'true' }}
if: ${{ steps.cache-openssl-http3-no-deprecated.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth=1 -b "openssl-${OPENSSL_VERSION}" https://github.com/openssl/openssl
git clone --quiet --depth 1 -b "openssl-${OPENSSL_VERSION}" https://github.com/openssl/openssl
cd openssl
./config --prefix="$PWD"/build --libdir=lib no-makedepend no-apps no-docs no-tests
./config --prefix="$PWD"/build --libdir=lib no-makedepend no-apps no-docs no-tests no-deprecated
make
make -j1 install_sw
- name: 'build openssl4'
if: ${{ steps.cache-openssl4-http3-no-deprecated.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth 1 -b "openssl-${OPENSSL4_VERSION}" https://github.com/openssl/openssl openssl4
cd openssl4
./config --prefix="$PWD"/build --libdir=lib no-makedepend no-apps no-docs no-tests no-deprecated
make
make -j1 install_sw
@ -216,7 +245,8 @@ jobs:
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/libressl/portable/releases/download/v${LIBRESSL_VERSION}/libressl-${LIBRESSL_VERSION}.tar.gz" | tar -xz
--location "https://github.com/libressl/portable/releases/download/v${LIBRESSL_VERSION}/libressl-${LIBRESSL_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cd "libressl-${LIBRESSL_VERSION}"
cmake -B . -G Ninja -DLIBRESSL_APPS=OFF -DLIBRESSL_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/home/runner/libressl/build
cmake --build .
@ -227,7 +257,8 @@ jobs:
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/awslabs/aws-lc/archive/refs/tags/v${AWSLC_VERSION}.tar.gz" | tar -xz
--location "https://github.com/awslabs/aws-lc/archive/refs/tags/v${AWSLC_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cd "aws-lc-${AWSLC_VERSION}"
cmake -B . -G Ninja -DBUILD_SHARED_LIBS=ON -DBUILD_TOOL=OFF -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/home/runner/awslc/build
cmake --build .
@ -239,44 +270,51 @@ jobs:
mkdir boringssl-src
cd boringssl-src
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
"https://boringssl.googlesource.com/boringssl/+archive/${BORINGSSL_VERSION}.tar.gz" | tar -xz
"https://boringssl.googlesource.com/boringssl/+archive/${BORINGSSL_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cmake -B . -G Ninja -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/home/runner/boringssl/build
cmake --build .
cmake --install .
- name: 'build quictls'
if: ${{ steps.cache-quictls-no-deprecated.outputs.cache-hit != 'true' }}
- name: 'build nettle'
if: ${{ steps.cache-nettle.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth=1 -b "openssl-${QUICTLS_VERSION}-quic1" https://github.com/quictls/openssl quictls
cd quictls
./config no-deprecated --prefix="$PWD"/build --libdir=lib no-makedepend no-apps no-docs no-tests
make
make -j1 install_sw
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://ftpmirror.gnu.org/nettle/nettle-${NETTLE_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cd "nettle-${NETTLE_VERSION}"
autoreconf -fi
./configure --disable-dependency-tracking --prefix=/home/runner/nettle/build \
--disable-static --disable-openssl --disable-documentation
make install
- name: 'build gnutls'
if: ${{ steps.cache-gnutls.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth=1 -b "${GNUTLS_VERSION}" https://github.com/gnutls/gnutls.git
cd gnutls
./bootstrap
./configure --disable-dependency-tracking --prefix="$PWD"/build \
LDFLAGS="-Wl,-rpath,$PWD/build/lib -L$PWD/build/lib" \
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
"https://www.gnupg.org/ftp/gcrypt/gnutls/v${GNUTLS_VERSION%.*}/gnutls-${GNUTLS_VERSION}.tar.xz" --output pkg.bin
sha256sum pkg.bin && tar -xJf pkg.bin && rm -f pkg.bin
cd "gnutls-${GNUTLS_VERSION}"
autoreconf -fi
# required: libp11-kit-dev libev-dev autopoint bison gperf gtk-doc-tools libtasn1-bin
./configure --disable-dependency-tracking --prefix=/home/runner/gnutls/build \
PKG_CONFIG_PATH=/home/runner/nettle/build/lib64/pkgconfig \
LDFLAGS=-Wl,-rpath,/home/runner/nettle/build/lib64 \
--with-included-libtasn1 --with-included-unistring \
--disable-guile --disable-doc --disable-tests --disable-tools
make
make install
- name: 'build wolfssl'
if: ${{ steps.cache-wolfssl.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth=1 -b "v${WOLFSSL_VERSION}-stable" https://github.com/wolfSSL/wolfssl.git
git clone --quiet --depth 1 -b "v${WOLFSSL_VERSION}-stable" https://github.com/wolfSSL/wolfssl
cd wolfssl
./autogen.sh
./configure --disable-dependency-tracking --enable-all --enable-quic \
--disable-benchmark --disable-crypttests --disable-examples --prefix="$PWD"/build
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-all --enable-quic \
--disable-benchmark --disable-crypttests --disable-examples
make
make install
@ -284,9 +322,9 @@ jobs:
if: ${{ steps.cache-nghttp3.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth=1 -b "v${NGHTTP3_VERSION}" https://github.com/ngtcp2/nghttp3
git clone --quiet --depth 1 -b "v${NGHTTP3_VERSION}" https://github.com/ngtcp2/nghttp3
cd nghttp3
git submodule update --init --depth=1
git submodule update --init --depth 1
autoreconf -fi
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-lib-only
make
@ -294,36 +332,48 @@ jobs:
- name: 'build ngtcp2'
if: ${{ steps.cache-ngtcp2.outputs.cache-hit != 'true' }}
# building 3 times to get crypto libs for ossl, libressl, quictls and awslc installed
# building twice to get crypto libs for ossl, libressl and awslc installed
run: |
cd ~
git clone --quiet --depth=1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2
git clone --quiet --depth 1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2
cd ngtcp2
autoreconf -fi
./configure --disable-dependency-tracking --prefix="$PWD"/build \
PKG_CONFIG_PATH=/home/runner/libressl/build/lib/pkgconfig --enable-lib-only --with-openssl
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-lib-only \
PKG_CONFIG_PATH=/home/runner/libressl/build/lib/pkgconfig \
--with-openssl
make install
make clean
./configure --disable-dependency-tracking --prefix="$PWD"/build \
PKG_CONFIG_PATH=/home/runner/quictls/build/lib/pkgconfig --enable-lib-only --with-openssl
make install
make clean
./configure --disable-dependency-tracking --prefix="$PWD"/build \
PKG_CONFIG_PATH=/home/runner/openssl/build/lib/pkgconfig:/home/runner/gnutls/build/lib/pkgconfig:/home/runner/wolfssl/build/lib/pkgconfig \
--enable-lib-only --with-openssl --with-gnutls --with-wolfssl --with-boringssl \
export PKG_CONFIG_PATH=/home/runner/openssl/build/lib/pkgconfig
PKG_CONFIG_PATH+=:/home/runner/nettle/build/lib64/pkgconfig
PKG_CONFIG_PATH+=:/home/runner/gnutls/build/lib/pkgconfig
PKG_CONFIG_PATH+=:/home/runner/wolfssl/build/lib/pkgconfig
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-lib-only \
--with-openssl --with-gnutls --with-wolfssl --with-boringssl \
BORINGSSL_LIBS='-L/home/runner/awslc/build/lib -lssl -lcrypto' \
BORINGSSL_CFLAGS='-I/home/runner/awslc/build/include'
make install
- name: 'build ngtcp2 openssl4'
if: ${{ steps.cache-ngtcp2-openssl4.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth 1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2 ngtcp2-openssl4
cd ngtcp2-openssl4
autoreconf -fi
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-lib-only \
PKG_CONFIG_PATH=/home/runner/openssl4/build/lib/pkgconfig \
--with-openssl
make install
- name: 'build ngtcp2 boringssl'
if: ${{ steps.cache-ngtcp2-boringssl.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth=1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2 ngtcp2-boringssl
git clone --quiet --depth 1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2 ngtcp2-boringssl
cd ngtcp2-boringssl
autoreconf -fi
./configure --disable-dependency-tracking --prefix="$PWD"/build \
--enable-lib-only --with-openssl=no --with-boringssl \
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-lib-only \
--with-openssl=no --with-boringssl \
BORINGSSL_LIBS='-L/home/runner/boringssl/build/lib -lssl -lcrypto' \
BORINGSSL_CFLAGS='-I/home/runner/boringssl/build/include'
make install
@ -332,160 +382,170 @@ jobs:
if: ${{ steps.cache-nghttp2.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth=1 -b "v${NGHTTP2_VERSION}" https://github.com/nghttp2/nghttp2
git clone --quiet --depth 1 -b "v${NGHTTP2_VERSION}" https://github.com/nghttp2/nghttp2
cd nghttp2
git submodule update --init --depth=1
git submodule update --init --depth 1
autoreconf -fi
./configure --disable-dependency-tracking --prefix="$PWD"/build \
PKG_CONFIG_PATH=/home/runner/quictls/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig \
LDFLAGS=-Wl,-rpath,/home/runner/quictls/build/lib \
--enable-http3
# required (for nghttpx application): libc-ares-dev libev-dev zlib1g-dev
# optional (for nghttpx application): libbrotli-dev
export PKG_CONFIG_PATH=/home/runner/openssl/build/lib/pkgconfig
PKG_CONFIG_PATH+=:/home/runner/nghttp3/build/lib/pkgconfig
PKG_CONFIG_PATH+=:/home/runner/ngtcp2/build/lib/pkgconfig
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-app --enable-http3 \
LDFLAGS=-Wl,-rpath,/home/runner/openssl/build/lib \
--with-libbrotlienc --with-libbrotlidec
make install
linux:
name: ${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.build.name }}
needs:
- build-cache
runs-on: 'ubuntu-latest'
timeout-minutes: 45
needs: build-cache
runs-on: ubuntu-latest
timeout-minutes: 10
env:
CURL_TRACE_PKG_CONFIG: '1'
MATRIX_BUILD: ${{ matrix.build.generate && 'cmake' || 'autotools' }}
MATRIX_INSTALL_PACKAGES: '${{ matrix.build.install_packages }}'
strategy:
fail-fast: false
matrix:
build:
- name: 'openssl'
PKG_CONFIG_PATH: /home/runner/openssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
tflags: '--min=1640'
LDFLAGS: -Wl,-rpath,/home/runner/openssl/build/lib
PKG_CONFIG_PATH: /home/runner/openssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
LDFLAGS=-Wl,-rpath,/home/runner/openssl/build/lib
--with-ngtcp2 --disable-ntlm
--with-openssl=/home/runner/openssl/build --enable-ssls-export
--with-openssl=/home/runner/openssl/build --with-ngtcp2=/home/runner/ngtcp2/build --enable-ssls-export
- name: 'openssl'
install_steps: skipall
PKG_CONFIG_PATH: /home/runner/openssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/openssl/build
-DUSE_NGTCP2=ON -DCURL_DISABLE_NTLM=ON
-DOPENSSL_ROOT_DIR=/home/runner/openssl/build -DUSE_NGTCP2=ON
-DCURL_DISABLE_LDAP=ON
-DCMAKE_UNITY_BUILD=ON
- name: 'openssl4'
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/openssl4/build/lib
PKG_CONFIG_PATH: "\
/home/runner/openssl4/build/lib/pkgconfig:\
/home/runner/nghttp3/build/lib/pkgconfig:\
/home/runner/nghttp2-openssl4/build/lib/pkgconfig"
configure: >-
--with-openssl=/home/runner/openssl4/build --with-ngtcp2=/home/runner/ngtcp2-openssl4/build --enable-ech --enable-ssls-export
- name: 'openssl4'
tflags: '--min=1640'
PKG_CONFIG_PATH: "\
/home/runner/openssl4/build/lib/pkgconfig:\
/home/runner/nghttp3/build/lib/pkgconfig:\
/home/runner/ngtcp2-openssl4/build/lib/pkgconfig:\
/home/runner/nghttp2/build/lib/pkgconfig"
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/openssl4/build -DUSE_NGTCP2=ON
-DCURL_DISABLE_LDAP=ON
-DUSE_ECH=ON
- name: 'libressl'
install_steps: skipall
PKG_CONFIG_PATH: /home/runner/libressl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
LDFLAGS: -Wl,-rpath,/home/runner/libressl/build/lib
PKG_CONFIG_PATH: /home/runner/libressl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
# Intentionally using '--with-ngtcp2=<path>' to test this way of configuration, in addition to bare '--with-ngtcp2' + 'PKG_CONFIG_PATH' in other jobs.
configure: >-
LDFLAGS=-Wl,-rpath,/home/runner/libressl/build/lib
--with-ngtcp2 --disable-ntlm
--with-openssl=/home/runner/libressl/build --enable-ssls-export
--with-openssl=/home/runner/libressl/build --with-ngtcp2=/home/runner/ngtcp2/build --enable-ssls-export
--enable-unity
- name: 'libressl'
tflags: '--min=1790'
PKG_CONFIG_PATH: /home/runner/libressl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/libressl/build
-DUSE_NGTCP2=ON -DCURL_DISABLE_NTLM=ON
-DOPENSSL_ROOT_DIR=/home/runner/libressl/build -DUSE_NGTCP2=ON
- name: 'awslc'
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/awslc/build/lib
PKG_CONFIG_PATH: /home/runner/awslc/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
# Intentionally using bare '--with-ngtcp2' + 'PKG_CONFIG_PATH' to test this way of configuration, in addition to '--with-ngtcp2=<path>' in other jobs.
configure: >-
LDFLAGS=-Wl,-rpath,/home/runner/awslc/build/lib
--with-ngtcp2 --disable-ntlm
--with-openssl=/home/runner/awslc/build --enable-ssls-export
--with-openssl=/home/runner/awslc/build --with-ngtcp2 --enable-ssls-export
- name: 'awslc'
tflags: '--min=1790'
PKG_CONFIG_PATH: /home/runner/awslc/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/awslc/build -DBUILD_SHARED_LIBS=OFF
-DUSE_NGTCP2=ON -DCURL_DISABLE_NTLM=ON
-DCMAKE_UNITY_BUILD=ON
-DOPENSSL_ROOT_DIR=/home/runner/awslc/build -DUSE_NGTCP2=ON -DBUILD_SHARED_LIBS=OFF
-DCMAKE_UNITY_BUILD=ON -DCURL_DROP_UNUSED=ON
- name: 'boringssl'
install_steps: skipall
PKG_CONFIG_PATH: /home/runner/boringssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2-boringssl/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
LDFLAGS: -Wl,-rpath,/home/runner/boringssl/build/lib
PKG_CONFIG_PATH: /home/runner/boringssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
LDFLAGS=-Wl,-rpath,/home/runner/boringssl/build/lib
--with-ngtcp2 --disable-ntlm
--with-openssl=/home/runner/boringssl/build --enable-ssls-export
--with-openssl=/home/runner/boringssl/build --with-ngtcp2=/home/runner/ngtcp2-boringssl/build --enable-ssls-export
- name: 'boringssl'
PKG_CONFIG_PATH: /home/runner/boringssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2-boringssl/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
tflags: '--min=1790'
PKG_CONFIG_PATH: "\
/home/runner/boringssl/build/lib/pkgconfig:\
/home/runner/nghttp3/build/lib/pkgconfig:\
/home/runner/ngtcp2-boringssl/build/lib/pkgconfig:\
/home/runner/nghttp2/build/lib/pkgconfig"
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/boringssl/build -DBUILD_SHARED_LIBS=OFF
-DUSE_NGTCP2=ON -DCURL_DISABLE_NTLM=ON
-DOPENSSL_ROOT_DIR=/home/runner/boringssl/build -DUSE_NGTCP2=ON -DBUILD_SHARED_LIBS=OFF
-DCMAKE_UNITY_BUILD=ON
- name: 'quictls'
- name: 'gnutls'
install_packages: libp11-kit-dev libssh-dev
install_steps: skipall
PKG_CONFIG_PATH: /home/runner/quictls/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
LDFLAGS: -Wl,-rpath,/home/runner/gnutls/build/lib -Wl,-rpath,/home/runner/nettle/build/lib64 -Wl,-rpath,/home/runner/ngtcp2/build/lib
PKG_CONFIG_PATH: /home/runner/nettle/build/lib64/pkgconfig:/home/runner/gnutls/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
LDFLAGS=-Wl,-rpath,/home/runner/quictls/build/lib
--with-ngtcp2 --disable-ntlm
--with-openssl=/home/runner/quictls/build --enable-ssls-export
--enable-unity
- name: 'quictls'
PKG_CONFIG_PATH: /home/runner/quictls/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/quictls/build
-DUSE_NGTCP2=ON -DCURL_DISABLE_NTLM=ON
--with-gnutls=/home/runner/gnutls/build --with-ngtcp2=/home/runner/ngtcp2/build --with-libssh --enable-ssls-export
- name: 'gnutls'
install_steps: skipall
PKG_CONFIG_PATH: /home/runner/gnutls/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
LDFLAGS=-Wl,-rpath,/home/runner/gnutls/build/lib
--with-ngtcp2
--with-gnutls=/home/runner/gnutls/build --enable-ssls-export
- name: 'gnutls'
PKG_CONFIG_PATH: /home/runner/gnutls/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
install_packages: libp11-kit-dev libssh-dev
tflags: '--min=1840'
LDFLAGS: -Wl,-rpath,/home/runner/gnutls/build/lib
PKG_CONFIG_PATH: "\
/home/runner/nettle/build/lib64/pkgconfig:\
/home/runner/gnutls/build/lib/pkgconfig:\
/home/runner/nghttp3/build/lib/pkgconfig:\
/home/runner/ngtcp2/build/lib/pkgconfig:\
/home/runner/nghttp2/build/lib/pkgconfig"
generate: >-
-DCURL_USE_GNUTLS=ON
-DUSE_NGTCP2=ON -DCURL_DISABLE_NTLM=ON
-DCURL_USE_GNUTLS=ON -DUSE_NGTCP2=ON -DCURL_USE_LIBSSH=ON
-DCMAKE_UNITY_BUILD=ON
- name: 'wolfssl'
install_packages: libssh2-1-dev
install_steps: skipall
PKG_CONFIG_PATH: /home/runner/wolfssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
LDFLAGS: -Wl,-rpath,/home/runner/wolfssl/build/lib
PKG_CONFIG_PATH: /home/runner/wolfssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
LDFLAGS=-Wl,-rpath,/home/runner/wolfssl/build/lib
--with-ngtcp2
--with-wolfssl=/home/runner/wolfssl/build
--enable-ech --enable-ssls-export
--with-wolfssl=/home/runner/wolfssl/build --with-ngtcp2=/home/runner/ngtcp2/build --enable-ech --with-libssh2 --enable-ssls-export
--enable-unity
- name: 'wolfssl'
install_packages: libssh2-1-dev
tflags: '--min=1840'
PKG_CONFIG_PATH: /home/runner/wolfssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DCURL_USE_WOLFSSL=ON -DUSE_NGTCP2=ON
-DUSE_ECH=ON
- name: 'openssl-quic'
install_steps: skipall
PKG_CONFIG_PATH: /home/runner/openssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
LDFLAGS=-Wl,-rpath,/home/runner/openssl/build/lib
--disable-ntlm
--with-openssl=/home/runner/openssl/build --with-openssl-quic
- name: 'openssl-quic'
PKG_CONFIG_PATH: /home/runner/openssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/openssl/build -DUSE_OPENSSL_QUIC=ON
-DCURL_DISABLE_NTLM=ON
-DCMAKE_UNITY_BUILD=ON
- name: 'quiche'
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/quiche/target/release
PKG_CONFIG_PATH: /home/runner/nghttp2/build/lib/pkgconfig
configure: >-
LDFLAGS=-Wl,-rpath,/home/runner/quiche/target/release
--with-openssl=/home/runner/quiche/quiche/deps/boringssl/src
--with-quiche=/home/runner/quiche/target/release
--with-ca-fallback
--enable-unity
- name: 'quiche'
PKG_CONFIG_PATH: /home/runner/quiche/target/release
tflags: '--min=1790'
PKG_CONFIG_PATH: /home/runner/nghttp2/build/lib/pkgconfig:/home/runner/quiche/target/release
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/quiche/quiche/deps/boringssl/src
-DUSE_QUICHE=ON
@ -493,34 +553,50 @@ jobs:
steps:
- name: 'install prereqs'
env:
INSTALL_PACKAGES: >-
${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') && 'stunnel4 ' || '' }}
${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') &&
'apache2 apache2-dev libnghttp2-dev vsftpd dante-server libev-dev' || '' }}
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo rm -f /etc/apt/sources.list.d/{azure-cli.sources,microsoft-prod.list,ondrej-ubuntu-php-noble.sources}
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Dpkg::Use-Pty=0 install \
libtool autoconf automake pkgconf stunnel4 \
libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libev-dev libc-ares-dev \
nettle-dev libp11-kit-dev libtspi-dev libunistring-dev guile-2.2-dev libtasn1-bin \
libtasn1-6-dev libidn2-0-dev gawk gperf libtss2-dev dns-root-data bison gtk-doc-tools \
texinfo texlive texlive-extra-utils autopoint libev-dev libuv1-dev \
apache2 apache2-dev libnghttp2-dev vsftpd dante-server
python3 -m venv ~/venv
printf "#!/bin/sh
while [ \$? = 0 ]; do for i in 1 2 3; do timeout 45 \"\$@\" && break 2; echo \"Error: slow server, retry \$i\"; sleep 1
dpkg --configure -a; done; false; done" > "$HOME"/my-apt; chmod +x "$HOME"/my-apt
sudo "$HOME"/my-apt apt-get -o Dpkg::Use-Pty=0 install \
libtool autoconf automake pkgconf \
libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libidn2-0-dev libldap-dev libuv1-dev valgrind \
${INSTALL_PACKAGES} \
${MATRIX_INSTALL_PACKAGES}
echo 'CC=gcc-12' >> "$GITHUB_ENV"
echo 'CXX=g++-12' >> "$GITHUB_ENV"
- name: 'cache openssl'
if: ${{ matrix.build.name == 'openssl' || matrix.build.name == 'openssl-quic' }}
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-openssl-http3
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-openssl-http3-no-deprecated
env:
cache-name: cache-openssl-http3
cache-name: cache-openssl-http3-no-deprecated
with:
path: ~/openssl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.OPENSSL_VERSION }}
fail-on-cache-miss: true
- name: 'cache openssl4'
if: ${{ contains(matrix.build.name, 'openssl4') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-openssl4-http3-no-deprecated
env:
cache-name: cache-openssl4-http3-no-deprecated
with:
path: ~/openssl4/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.OPENSSL4_VERSION }}
fail-on-cache-miss: true
- name: 'cache libressl'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
if: ${{ contains(matrix.build.name, 'libressl') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-libressl
env:
cache-name: cache-libressl
@ -530,7 +606,8 @@ jobs:
fail-on-cache-miss: true
- name: 'cache awslc'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
if: ${{ contains(matrix.build.name, 'awslc') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-awslc
env:
cache-name: cache-awslc
@ -540,7 +617,8 @@ jobs:
fail-on-cache-miss: true
- name: 'cache boringssl'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
if: ${{ contains(matrix.build.name, 'boringssl') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-boringssl
env:
cache-name: cache-boringssl
@ -549,30 +627,31 @@ jobs:
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.BORINGSSL_VERSION }}
fail-on-cache-miss: true
- name: 'cache quictls'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-quictls-no-deprecated
- name: 'cache nettle'
if: ${{ contains(matrix.build.name, 'gnutls') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-nettle
env:
cache-name: cache-quictls-no-deprecated
cache-name: cache-nettle
with:
path: ~/quictls/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.QUICTLS_VERSION }}-quic1
path: ~/nettle/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NETTLE_VERSION }}
fail-on-cache-miss: true
- name: 'cache gnutls'
if: ${{ matrix.build.name == 'gnutls' }}
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
if: ${{ contains(matrix.build.name, 'gnutls') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-gnutls
env:
cache-name: cache-gnutls
with:
path: ~/gnutls/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.GNUTLS_VERSION }}
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.GNUTLS_VERSION }}-${{ env.NETTLE_VERSION }}
fail-on-cache-miss: true
- name: 'cache wolfssl'
if: ${{ matrix.build.name == 'wolfssl' }}
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
if: ${{ contains(matrix.build.name, 'wolfssl') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-wolfssl
env:
cache-name: cache-wolfssl
@ -582,7 +661,7 @@ jobs:
fail-on-cache-miss: true
- name: 'cache nghttp3'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-nghttp3
env:
cache-name: cache-nghttp3
@ -592,17 +671,30 @@ jobs:
fail-on-cache-miss: true
- name: 'cache ngtcp2'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-ngtcp2
env:
cache-name: cache-ngtcp2
with:
path: ~/ngtcp2/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL_VERSION }}-${{ env.LIBRESSL_VERSION }}-${{ env.AWSLC_VERSION }}-${{ env.QUICTLS_VERSION }}-${{ env.GNUTLS_VERSION }}-${{ env.WOLFSSL_VERSION }}
key: "${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL_VERSION }}-\
${{ env.LIBRESSL_VERSION }}-${{ env.AWSLC_VERSION }}-${{ env.NETTLE_VERSION }}-${{ env.GNUTLS_VERSION }}-${{ env.WOLFSSL_VERSION }}"
fail-on-cache-miss: true
- name: 'cache ngtcp2 openssl4'
if: ${{ contains(matrix.build.name, 'openssl4') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-ngtcp2-openssl4
env:
cache-name: cache-ngtcp2-openssl4
with:
path: ~/ngtcp2-openssl4/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL4_VERSION }}
fail-on-cache-miss: true
- name: 'cache ngtcp2 boringssl'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
if: ${{ contains(matrix.build.name, 'boringssl') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-ngtcp2-boringssl
env:
cache-name: cache-ngtcp2-boringssl
@ -612,18 +704,18 @@ jobs:
fail-on-cache-miss: true
- name: 'cache nghttp2'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-nghttp2
env:
cache-name: cache-nghttp2
with:
path: ~/nghttp2/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGHTTP2_VERSION }}-${{ env.QUICTLS_VERSION }}-${{ env.NGTCP2_VERSION }}-${{ env.NGHTTP3_VERSION }}
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGHTTP2_VERSION }}-${{ env.OPENSSL_VERSION }}-${{ env.NGTCP2_VERSION }}-${{ env.NGHTTP3_VERSION }}
fail-on-cache-miss: true
- name: 'cache quiche'
if: ${{ matrix.build.name == 'quiche' }}
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
if: ${{ contains(matrix.build.name, 'quiche') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-quiche
env:
cache-name: cache-quiche
@ -632,10 +724,10 @@ jobs:
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.QUICHE_VERSION }}
- name: 'build quiche and boringssl'
if: ${{ matrix.build.name == 'quiche' && steps.cache-quiche.outputs.cache-hit != 'true' }}
if: ${{ contains(matrix.build.name, 'quiche') && steps.cache-quiche.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth=1 -b "${QUICHE_VERSION}" --recursive https://github.com/cloudflare/quiche.git
git clone --quiet --depth 1 -b "${QUICHE_VERSION}" --recursive https://github.com/cloudflare/quiche
cd quiche
#### Work-around https://github.com/curl/curl/issues/7927 #######
#### See https://github.com/alexcrichton/cmake-rs/issues/131 ####
@ -644,15 +736,14 @@ jobs:
cargo build -v --package quiche --release --features ffi,pkg-config-meta,qlog --verbose
ln -s libquiche.so target/release/libquiche.so.0
mkdir -v quiche/deps/boringssl/src/lib
# shellcheck disable=SC2046
ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) quiche/deps/boringssl/src/lib/
find target/release \( -name libcrypto.a -o -name libssl.a \) -exec ln -vnf -- '{}' quiche/deps/boringssl/src/lib \;
# include dir
# /home/runner/quiche/quiche/deps/boringssl/src/include
# lib dir
# /home/runner/quiche/quiche/deps/boringssl/src/lib
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
@ -662,24 +753,27 @@ jobs:
- name: 'configure'
env:
LDFLAGS: '${{ matrix.build.LDFLAGS }}'
MATRIX_CONFIGURE: '${{ matrix.build.configure }}'
MATRIX_GENERATE: '${{ matrix.build.generate }}'
MATRIX_PKG_CONFIG_PATH: '${{ matrix.build.PKG_CONFIG_PATH }}'
run: |
[ -n "${MATRIX_PKG_CONFIG_PATH}" ] && export PKG_CONFIG_PATH="${MATRIX_PKG_CONFIG_PATH}"
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
[[ "${MATRIX_GENERATE}" = *'boringssl'* ]] && options=" -DBORINGSSL_VERSION=${BORINGSSL_VERSION}"
cmake -B bld -G Ninja \
-DCMAKE_C_COMPILER_TARGET="$(uname -m)-pc-linux-gnu" -DBUILD_STATIC_LIBS=ON \
-DCURL_WERROR=ON -DENABLE_DEBUG=ON \
-DCURL_USE_LIBUV=ON \
-DCURL_USE_LIBUV=ON -DCURL_ENABLE_NTLM=ON \
-DTEST_NGHTTPX=/home/runner/nghttp2/build/bin/nghttpx \
-DHTTPD_NGHTTPX=/home/runner/nghttp2/build/bin/nghttpx \
${MATRIX_GENERATE}
${MATRIX_GENERATE} ${options}
else
mkdir bld && cd bld && ../configure --enable-warnings --enable-werror --enable-debug \
--with-libuv \
[[ "${MATRIX_CONFIGURE}" = *'boringssl'* ]] && export CPPFLAGS="-DCURL_BORINGSSL_VERSION=\\\"${BORINGSSL_VERSION}\\\""
mkdir bld && cd bld && ../configure --enable-warnings --enable-werror --enable-debug --disable-static \
--disable-dependency-tracking --enable-option-checking=fatal \
--with-libuv --enable-ntlm \
--with-test-nghttpx=/home/runner/nghttp2/build/bin/nghttpx \
--disable-dependency-tracking \
${MATRIX_CONFIGURE}
fi
@ -703,8 +797,11 @@ jobs:
make -C bld V=1
fi
- name: 'check curl -V output'
run: bld/src/curl -V
- name: 'curl -V'
run: |
find . -type f \( -name curl -o -name '*.so.*' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.so.*' -o -name '*.a' \) -print0 | xargs -0 stat -c '%10s bytes: %n' --
bld/src/curl --disable -V
- name: 'build tests'
if: ${{ !contains(matrix.build.install_steps, 'skipall') }}
@ -718,14 +815,28 @@ jobs:
- name: 'install test prereqs'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
run: |
source ~/venv/bin/activate
python3 -m pip install -r tests/requirements.txt
python3 -m venv ~/venv
if bld/src/curl --disable -V 2>/dev/null | grep smb; then
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt
fi
- name: 'run tests'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
env:
TFLAGS: '${{ matrix.build.tflags }}'
run: |
TFLAGS+=' -n'
source ~/venv/bin/activate
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target test-ci
else
make -C bld V=1 test-ci
fi
- name: 'run tests (valgrind)'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
run: |
export TFLAGS='-j6 --min=4 HTTP/3'
source ~/venv/bin/activate
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target test-ci
@ -736,10 +847,10 @@ jobs:
- name: 'install pytest prereqs'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
run: |
source ~/venv/bin/activate
python3 -m pip install -r tests/http/requirements.txt
[ -d ~/venv ] || python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/http/requirements.txt
- name: 'run pytest event based'
- name: 'run pytest (event based)'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
env:
CURL_TEST_EVENT: 1

View file

@ -10,19 +10,24 @@
# https://github.com/actions/labeler
name: 'Labeler'
'on': [pull_request_target] # zizmor: ignore[dangerous-triggers]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
jobs:
label:
name: 'Labeler'
runs-on: ubuntu-latest
runs-on: ubuntu-slim
permissions:
contents: read
pull-requests: write
contents: read # To comply with https://github.com/actions/labeler documentation
pull-requests: write # To edit labels on PRs
steps:
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'

View file

@ -11,12 +11,12 @@
# is still supported (as of this writing).
# stretch has ELTS support from Freexian until 2027-06-30
# For ELTS info see https://www.freexian.com/lts/extended/docs/how-to-use-extended-lts/
# The Debian key will expire 2025-05-20, after which package signature
# The Debian key expires 2025-05-20, after which package signature
# verification may need to be disabled.
# httrack is one of the smallest downloaders, needed to bootstrap ELTS,
# and won't conflict with the curl we're building.
# and doesn not conflict with the curl we are building.
name: 'Old Linux'
name: 'Linux Old'
'on':
push:
@ -28,10 +28,7 @@ name: 'Old Linux'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
pull_request:
branches:
- master
@ -40,22 +37,24 @@ name: 'Old Linux'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
env:
MAKEFLAGS: -j 5
CURL_CI: github
CURL_TEST_MIN: 1500
DEBIAN_FRONTEND: noninteractive
jobs:
cmake-autotools:
name: 'cmake & autotools'
runs-on: 'ubuntu-latest'
name: 'autotools & cmake'
runs-on: ubuntu-latest
container: 'debian:stretch'
steps:
@ -67,90 +66,121 @@ jobs:
# See comment above if this fails after 2025-05-20
apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends httrack
httrack --get https://deb.freexian.com/extended-lts/pool/main/f/freexian-archive-keyring/freexian-archive-keyring_2022.06.08_all.deb
dpkg -i freexian-archive-keyring_2022.06.08_all.deb
sha256sum freexian-archive-keyring_2022.06.08_all.deb && dpkg -i freexian-archive-keyring_2022.06.08_all.deb
echo 'deb http://deb.freexian.com/extended-lts stretch-lts main contrib non-free' | tee /etc/apt/sources.list.d/extended-lts.list
apt-get -o Dpkg::Use-Pty=0 update
apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends cmake make automake autoconf libtool gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libgnutls28-dev libssh-dev libssh2-1-dev libc-ares-dev heimdal-dev libldap2-dev librtmp-dev stunnel4 groff
apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends \
make automake autoconf libtool ninja-build gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libkrb5-dev libldap2-dev stunnel4
# GitHub's actions/checkout needs newer glibc and libstdc++. The latter also depends on
# gcc-8-base, but it doesn't actually seem used in our situation and isn't available in
# gcc-8-base, but it does not actually seem used in our situation and is not available in
# the main repo, so force the install.
httrack --get https://deb.freexian.com/extended-lts/pool/main/g/glibc/libc6_2.28-10+deb10u5_amd64.deb
httrack --get https://deb.freexian.com/extended-lts/pool/main/g/gcc-8/libstdc++6_8.3.0-6_amd64.deb
dpkg -i --force-depends libc6_*_amd64.deb libstdc++6_*_amd64.deb
sha256sum libc6_*_amd64.deb libstdc++6_*_amd64.deb && dpkg -i --force-depends libc6_*_amd64.deb libstdc++6_*_amd64.deb
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: 'install prereqs (cmake)'
env:
CMAKE_VERSION: 3.18.0 # Earliest version supported by curl
CMAKE_SHA256: 4d9a9d3351161073a67e49366d701b6fa4b0343781982dc5eef08a02a750d403
run: |
cd ~
fn="cmake-${CMAKE_VERSION}-linux-x86_64"
httrack --get "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${fn}.tar.gz"
sha256sum "${fn}".tar*.gz | tee /dev/stderr | grep -qwF -- "${CMAKE_SHA256}" && tar -xf "${fn}".tar*.gz && rm -f "${fn}".tar*.gz
mv "cmake-${CMAKE_VERSION}-Linux-x86_64" cmake
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'cmake build-only (out-of-tree, libssh2)'
- name: 'CM build-only configure (out-of-tree)'
run: |
mkdir bld-1
cd bld-1
cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
-DCURL_USE_GNUTLS=ON -DENABLE_ARES=OFF -DCURL_ZSTD=OFF -DCURL_USE_GSSAPI=OFF -DCURL_USE_LIBSSH2=ON -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON
make install
src/curl --disable --version
~/cmake/bin/cmake -B bld-1 -G Ninja -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
-DCURL_ENABLE_SSL=OFF -DENABLE_ARES=OFF -DCURL_ZSTD=OFF -DCURL_USE_GSSAPI=OFF -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF
- name: 'cmake build-only curl_config.h'
- name: 'CM build-only build'
run: |
~/cmake/bin/cmake --build bld-1 --verbose
~/cmake/bin/cmake --install bld-1 --verbose
- name: 'CM build-only curl -V'
run: bld-1/src/curl --disable --version
- name: 'CM build-only configure log'
if: ${{ !cancelled() }}
run: cat bld-1/CMakeFiles/CMake*.log 2>/dev/null || true
- name: 'CM build-only curl_config.h'
run: |
echo '::group::raw'; cat bld-1/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld-1/lib/curl_config.h | sort || true
# when this job can get a libssh version 0.9.0 or later, this should get
# that enabled again
- name: 'cmake generate (out-of-tree, c-ares, zstd, gssapi)'
# when this job can get c-ares 1.16.0 or later, we can enable that
# again
- name: 'CM configure (out-of-tree, zstd, gssapi)'
run: |
mkdir bld-cares
cd bld-cares
cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
-DCURL_USE_GNUTLS=ON -DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON \
~/cmake/bin/cmake -B bld-oldie -G Ninja -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
-DCURL_ENABLE_SSL=OFF -DENABLE_ARES=OFF -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF \
-DCURL_LIBCURL_VERSIONED_SYMBOLS=ON
- name: 'cmake curl_config.h'
- name: 'CM configure log'
if: ${{ !cancelled() }}
run: cat bld-oldie/CMakeFiles/CMake*.log 2>/dev/null || true
- name: 'CM curl_config.h'
run: |
echo '::group::raw'; cat bld-cares/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld-cares/lib/curl_config.h | sort || true
echo '::group::raw'; cat bld-oldie/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld-oldie/lib/curl_config.h | sort || true
- name: 'cmake build'
run: |
make -C bld-cares
bld-cares/src/curl --disable --version
- name: 'CM build'
run: ~/cmake/bin/cmake --build bld-oldie
- name: 'cmake install'
run: make -C bld-cares install
- name: 'CM curl -V'
run: bld-oldie/src/curl --disable --version
- name: 'cmake build tests'
run: make -C bld-cares testdeps
- name: 'CM install'
run: ~/cmake/bin/cmake --install bld-oldie
- name: 'cmake run tests'
run: make -C bld-cares test-ci
- name: 'CM build tests'
run: ~/cmake/bin/cmake --build bld-oldie --target testdeps
- name: 'cmake build examples'
run: make -C bld-cares curl-examples-build
- name: 'CM run tests'
run: ~/cmake/bin/cmake --build bld-oldie --target test-ci
- name: 'autoreconf'
run: autoreconf -if
- name: 'CM build examples'
run: ~/cmake/bin/cmake --build bld-oldie --target curl-examples-build
- name: 'configure (out-of-tree, c-ares, libssh2, zstd, gssapi)'
- name: 'AM autoreconf'
run: autoreconf -fi
- name: 'AM configure (out-of-tree, zstd, gssapi)'
run: |
mkdir bld-am
cd bld-am
../configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror \
--with-gnutls --enable-ares --with-libssh2 --with-zstd --with-gssapi --with-librtmp \
--prefix="$PWD"/../curl-install-am
../configure --prefix="$PWD"/../curl-install-am --enable-unity --enable-warnings --enable-werror --disable-shared \
--disable-dependency-tracking --enable-option-checking=fatal \
--without-ssl --disable-ares --without-libssh2 --with-zstd --with-gssapi
- name: 'autotools curl_config.h'
- name: 'AM configure log'
if: ${{ !cancelled() }}
run: cat bld-am/config.log 2>/dev/null || true
- name: 'AM curl_config.h'
run: |
echo '::group::raw'; cat bld-am/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld-am/lib/curl_config.h | sort || true
- name: 'autotools build'
run: |
make -C bld-am
bld-am/src/curl --disable --version
- name: 'AM build'
run: make -C bld-am
- name: 'autotools install'
- name: 'AM curl -V'
run: bld-am/src/curl --disable --version
- name: 'AM install'
run: make -C bld-am install
- name: 'autotools build tests'
- name: 'AM build tests'
run: make -C bld-am/tests all

File diff suppressed because it is too large Load diff

View file

@ -14,10 +14,7 @@ name: 'macOS'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
pull_request:
branches:
- master
@ -26,10 +23,7 @@ name: 'macOS'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
@ -37,31 +31,35 @@ concurrency:
permissions: {}
# Deprecated Apple APIs and the macos-version-min value required to avoid
# deprecation warnings with llvm/clang:
#
# - 10.7 Lion (2011) - GSS
# - 10.9 Mavericks (2013) - LDAP
# Apple APIs and the macos-version-min value required to avoid deprecation
# warnings with llvm/clang, and/or the feature getting enabled at build-time
# or runtime:
#
# - 10.7 Lion (2011) - GSS (build-time, deprecated MIT Kerberos shim)
# - 10.9 Mavericks (2013) - LDAP (build-time, deprecated), OCSP (runtime)
# - 10.11 El Capitan (2015) - connectx() (runtime)
# - 10.12 Sierra (2016) - clock_gettime() (build-time, runtime)
# - 10.14 Mojave (2018) - SecTrustEvaluateWithError() (runtime)
env:
CURL_CI: github
CURL_TEST_MIN: 1700
MAKEFLAGS: -j 4
LDFLAGS: -w # suppress 'object file was built for newer macOS version than being linked' warnings
jobs:
ios:
name: "iOS, ${{ (matrix.build.generator && format('CM-{0}', matrix.build.generator)) || (matrix.build.generate && 'CM' || 'AM' )}} ${{ matrix.build.name }} arm64"
runs-on: 'macos-latest'
runs-on: macos-latest
timeout-minutes: 10
env:
DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer"
CC: ${{ matrix.build.compiler || 'clang' }}
CC: 'clang'
LDFLAGS: ''
MATRIX_BUILD: ${{ matrix.build.generate && 'cmake' || 'autotools' }}
MATRIX_OPTIONS: ${{ matrix.build.options }}
# renovate: datasource=github-tags depName=libressl-portable/portable versioning=semver registryUrl=https://github.com
LIBRESSL_VERSION: 4.1.0
# renovate: datasource=github-tags depName=libressl/portable versioning=semver registryUrl=https://github.com
LIBRESSL_VERSION: 4.2.1
strategy:
fail-fast: false
matrix:
@ -73,16 +71,8 @@ jobs:
- name: 'libressl'
install_steps: libressl
# FIXME: Could not make OPENSSL_ROOT_DIR work. CMake seems to prepend sysroot to it.
generate: >-
-DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD_BATCH_SIZE=50
-DOPENSSL_INCLUDE_DIR=/Users/runner/libressl/include
-DOPENSSL_SSL_LIBRARY=/Users/runner/libressl/lib/libssl.a
-DOPENSSL_CRYPTO_LIBRARY=/Users/runner/libressl/lib/libcrypto.a
-DCURL_USE_LIBPSL=OFF
- name: 'libressl'
install_steps: libressl
generator: Xcode
xcode: '' # default Xcode. Set it once to silence actionlint.
options: --config Debug
generate: >-
-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=OFF
@ -90,14 +80,25 @@ jobs:
-DOPENSSL_INCLUDE_DIR=/Users/runner/libressl/include
-DOPENSSL_SSL_LIBRARY=/Users/runner/libressl/lib/libssl.a
-DOPENSSL_CRYPTO_LIBRARY=/Users/runner/libressl/lib/libcrypto.a
-DCURL_USE_LIBPSL=OFF
-DCURL_USE_LIBPSL=OFF -DCURL_ENABLE_NTLM=ON
steps:
- name: 'brew install'
if: ${{ matrix.build.configure }}
timeout-minutes: 5
run: |
# shellcheck disable=SC2181,SC2034
while [[ $? == 0 ]]; do for i in 1 2 3; do if brew update && brew install automake libtool; then break 2; else echo Error: wait to try again; sleep 10; fi; done; false Too many retries; done
# shellcheck disable=SC2181
while [[ $? == 0 ]]; do
for i in 1 2 3; do
if brew update && brew install automake libtool; then
break 2
else
echo "Error: wait to try again: $i"
sleep 10
fi
done
false Too many retries
done
- name: 'toolchain versions'
run: |
@ -106,12 +107,13 @@ jobs:
xcodebuild -sdk -version | grep '^Path:' || true
xcrun --sdk iphoneos --show-sdk-path 2>/dev/null || true
xcrun --sdk iphoneos --show-sdk-version || true
echo '::group::compiler defaults'; echo 'int main(void) {}' | "${CC}" -v -x c -; echo '::endgroup::'
echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::'
echo '::group::brew packages installed'; ls -l /opt/homebrew/opt; echo '::endgroup::'
echo '::group::brew packages installed'; ls -l "$(brew --prefix)"/opt; echo '::endgroup::'
- name: 'cache libressl'
if: ${{ contains(matrix.build.install_steps, 'libressl') }}
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-libressl
env:
cache-name: cache-libressl
@ -123,11 +125,10 @@ jobs:
if: ${{ contains(matrix.build.install_steps, 'libressl') && steps.cache-libressl.outputs.cache-hit != 'true' }}
run: |
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location "https://github.com/libressl/portable/releases/download/v${LIBRESSL_VERSION}/libressl-${LIBRESSL_VERSION}.tar.gz" | tar -x
--location "https://github.com/libressl/portable/releases/download/v${LIBRESSL_VERSION}/libressl-${LIBRESSL_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cd "libressl-${LIBRESSL_VERSION}"
# FIXME: on the 4.0.1 release, delete '-DHAVE_ENDIAN_H=0'
cmake -B . -G Ninja \
-DHAVE_ENDIAN_H=0 \
-DCMAKE_INSTALL_PREFIX=/Users/runner/libressl \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
@ -137,7 +138,7 @@ jobs:
cmake --build .
cmake --install . --verbose
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
@ -155,13 +156,13 @@ jobs:
# https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-ios-tvos-visionos-or-watchos
[ -n "${MATRIX_GENERATOR}" ] && options="-G ${MATRIX_GENERATOR}"
cmake -B bld -G Ninja -D_CURL_PREFILL=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_DROP_UNUSED=ON -DCURL_WERROR=ON \
-DCMAKE_SYSTEM_NAME=iOS \
-DUSE_APPLE_IDN=ON \
${MATRIX_GENERATE} ${options}
else
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking \
--disable-dependency-tracking --enable-option-checking=fatal \
CFLAGS="-isysroot $(xcrun --sdk iphoneos --show-sdk-path 2>/dev/null)" \
--host=aarch64-apple-darwin \
--with-apple-idn \
@ -186,9 +187,12 @@ jobs:
fi
- name: 'curl info'
run: find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -exec file '{}' \;
run: |
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 stat -f '%10z bytes: %N' --
- name: 'build tests'
if: ${{ matrix.build.generate }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld ${MATRIX_OPTIONS} --parallel 4 --target testdeps --verbose
@ -197,6 +201,7 @@ jobs:
fi
- name: 'build examples'
if: ${{ matrix.build.generate }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld ${MATRIX_OPTIONS} --parallel 4 --target curl-examples-build --verbose
@ -205,155 +210,215 @@ jobs:
fi
macos:
name: "${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.compiler }} ${{ matrix.build.name }}"
runs-on: 'macos-15'
timeout-minutes: 45
name: "${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.build.compiler }} ${{ matrix.build.name }}"
runs-on: ${{ matrix.build.image || 'macos-15' }}
timeout-minutes: 15
env:
DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer"
CC: '${{ matrix.compiler }}'
CC: '${{ matrix.build.compiler }}'
MATRIX_BUILD: ${{ matrix.build.generate && 'cmake' || 'autotools' }}
MATRIX_COMPILER: '${{ matrix.compiler }}'
MATRIX_COMPILER: '${{ matrix.build.compiler }}'
MATRIX_INSTALL: '${{ matrix.build.install }}'
MATRIX_INSTALL_STEPS: '${{ matrix.build.install_steps }}'
MATRIX_MACOS_VERSION_MIN: '${{ matrix.build.macos-version-min }}'
strategy:
fail-fast: false
matrix:
compiler: [clang, llvm@18, gcc-12]
build:
# autotools
- name: '!ssl !debug brotli zstd'
compiler: clang
install: brotli zstd
configure: --without-ssl --with-brotli --with-zstd
- name: '!ssl !debug'
compiler: gcc-12
configure: --without-ssl
- name: '!ssl'
compiler: clang
configure: --enable-debug --without-ssl
compiler: gcc-13
configure: --without-ssl --with-brotli --with-zstd --with-apple-idn
tflags: '--min=1450'
xcode: '' # default Xcode. Set it once to silence actionlint.
- name: '!ssl libssh2 AppleIDN'
compiler: clang
configure: --enable-debug --with-libssh2=/opt/homebrew/opt/libssh2 --without-ssl --with-apple-idn
generate: -DENABLE_DEBUG=ON -DCURL_USE_LIBSSH2=ON -DUSE_APPLE_IDN=ON -DCURL_ENABLE_SSL=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF
tflags: '--min=1550'
- name: 'OpenSSL libssh c-ares'
compiler: clang
install: libssh
configure: --enable-debug --with-libssh --with-openssl=/opt/homebrew/opt/openssl --enable-ares --with-fish-functions-dir --with-zsh-functions-dir
- name: 'OpenSSL libssh'
compiler: llvm@18
install: libssh libnghttp3
configure: --enable-debug --with-libssh --with-openssl=/opt/homebrew/opt/openssl --with-openssl-quic
- name: '!ssl c-ares'
compiler: clang
configure: --enable-debug --enable-ares --without-ssl
- name: '!ssl HTTP-only'
compiler: clang
configure: >-
--enable-debug
--disable-alt-svc --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap
--disable-ldap --disable-pop3 --without-librtmp --disable-rtsp
--disable-shared --disable-smb --disable-smtp --disable-telnet --disable-tftp --disable-unix-sockets
--without-brotli --without-gssapi --without-libidn2 --without-libpsl --without-librtmp
--without-libssh2 --without-libssh --without-wolfssh
--without-nghttp2 --disable-ntlm --without-ssl --without-zlib --without-zstd
generate: -DENABLE_DEBUG=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF
- name: '!ssl HTTP-only c-ares'
macos-version-min: '10.15' # Catalina (2019)
- name: 'LibreSSL +examples'
compiler: clang
tflags: '--min=930'
generate: >-
-DENABLE_DEBUG=ON -DENABLE_ARES=ON
-DCURL_ENABLE_SSL=OFF -DHTTP_ONLY=ON
-DCURL_DISABLE_ALTSVC=ON -DENABLE_UNIX_SOCKETS=OFF
-DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_NGHTTP2=OFF
-DCURL_USE_GSSAPI=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF
-DCURL_BROTLI=OFF -DCURL_ZLIB=OFF -DCURL_ZSTD=OFF
-DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF
- name: 'LibreSSL !ldap +examples'
compiler: clang
install: libressl
install_steps: pytest
configure: --enable-debug --with-openssl=/opt/homebrew/opt/libressl
- name: 'OpenSSL'
generate: >-
-DENABLE_DEBUG=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/libressl -DCURL_DISABLE_LDAP=ON -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF
-DCURL_USE_LIBSSH2=OFF -DCURL_ENABLE_NTLM=ON
- name: 'OpenSSL 10.15 C89'
macos-version-min: '10.15'
compiler: clang
install: libnghttp3 libngtcp2
install_steps: pytest
configure: --enable-debug --with-openssl=/opt/homebrew/opt/openssl --with-ngtcp2
generate: >-
-DENABLE_DEBUG=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DUSE_NGTCP2=ON -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_USE_LIBSSH2=OFF
-DCMAKE_C_STANDARD=90 -DCURL_ENABLE_NTLM=ON
- name: 'OpenSSL SecTrust'
compiler: clang
install: libnghttp3 libngtcp2
install_steps: pytest
configure: --enable-debug --with-openssl=/opt/homebrew/opt/openssl --with-ngtcp2 --with-apple-sectrust --enable-ntlm
- name: 'OpenSSL event-based'
compiler: clang
configure: --enable-debug --with-openssl=/opt/homebrew/opt/openssl
tflags: --test-event
- name: 'quictls libssh2 !ldap 10.15'
generate: -DENABLE_DEBUG=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_USE_LIBSSH2=OFF -DCURL_ENABLE_NTLM=ON
tflags: '--test-event --min=1300'
- name: 'OpenSSL gsasl AppleIDN SecTrust +examples'
compiler: clang
install: quictls
configure: --enable-debug --disable-ldap --with-openssl=/opt/homebrew/opt/quictls LDFLAGS=-L/opt/homebrew/opt/quictls/lib
macos-version-min: '10.15'
# cmake
- name: 'OpenSSL gsasl rtmp AppleIDN'
install: libnghttp3 libngtcp2 gsasl rtmpdump
generate: -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_USE_GSASL=ON -DUSE_LIBRTMP=ON -DUSE_APPLE_IDN=ON -DUSE_NGTCP2=ON
install: libnghttp3 libngtcp2 gsasl
generate: >-
-DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_USE_GSASL=ON -DUSE_APPLE_IDN=ON -DUSE_NGTCP2=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON
-DUSE_APPLE_SECTRUST=ON -DCURL_ENABLE_NTLM=ON
- name: 'MultiSSL AppleIDN clang-tidy +examples'
image: macos-26
compiler: clang
install: llvm brotli zstd gnutls nettle mbedtls gsasl rtmpdump fish
install_steps: clang-tidy
generate: -DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_DEFAULT_SSL_BACKEND=openssl -DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DENABLE_ARES=ON -DCURL_USE_GSASL=ON -DUSE_LIBRTMP=ON -DUSE_APPLE_IDN=ON -DUSE_SSLS_EXPORT=ON -DCURL_CLANG_TIDY=ON -DCLANG_TIDY=/opt/homebrew/opt/llvm/bin/clang-tidy -DCURL_COMPLETION_FISH=ON -DCURL_COMPLETION_ZSH=ON
install: llvm gnutls nettle libressl krb5 mbedtls gsasl rustls-ffi libssh fish
install_steps: skiprun
chkprefill: _chkprefill
- name: 'quictls +static libssh +examples'
install: quictls libssh
generate: -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/quictls -DBUILD_STATIC_LIBS=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON
- name: 'LibreSSL openldap heimdal c-ares +examples'
install: libressl heimdal openldap
generate: -DENABLE_DEBUG=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/libressl -DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=/opt/homebrew/opt/heimdal -DLDAP_INCLUDE_DIR=/opt/homebrew/opt/openldap/include -DLDAP_LIBRARY=/opt/homebrew/opt/openldap/lib/libldap.dylib -DLDAP_LBER_LIBRARY=/opt/homebrew/opt/openldap/lib/liblber.dylib
generate: >-
-DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/libressl -DCURL_DEFAULT_SSL_BACKEND=openssl
-DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_RUSTLS=ON -DENABLE_ARES=ON -DCURL_USE_GSASL=ON
-DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON -DUSE_APPLE_IDN=ON -DUSE_SSLS_EXPORT=ON
-DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=/opt/homebrew/opt/krb5
-DCURL_BROTLI=ON -DCURL_ZSTD=ON
-DCURL_CLANG_TIDY=ON -DCLANG_TIDY=/opt/homebrew/opt/llvm/bin/clang-tidy
-DCURL_COMPLETION_FISH=ON -DCURL_COMPLETION_ZSH=ON
-DCURL_ENABLE_NTLM=ON
- name: 'HTTP/3 clang-tidy'
image: macos-26
compiler: clang
install: llvm libnghttp3 libngtcp2 openldap krb5
install_steps: skipall
generate: >-
-DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DUSE_NGTCP2=ON
-DLDAP_INCLUDE_DIR=/opt/homebrew/opt/openldap/include
-DLDAP_LIBRARY=/opt/homebrew/opt/openldap/lib/libldap.dylib
-DLDAP_LBER_LIBRARY=/opt/homebrew/opt/openldap/lib/liblber.dylib
-DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=/opt/homebrew/opt/krb5
-DCURL_BROTLI=ON -DCURL_ZSTD=ON
-DCURL_CLANG_TIDY=ON -DCLANG_TIDY=/opt/homebrew/opt/llvm/bin/clang-tidy
-DCURL_ENABLE_NTLM=ON
- name: 'LibreSSL openldap krb5 c-ares +examples'
compiler: clang
install: libressl krb5 openldap
generate: >-
-DENABLE_DEBUG=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/libressl -DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON
-DGSS_ROOT_DIR=/opt/homebrew/opt/krb5
-DLDAP_INCLUDE_DIR=/opt/homebrew/opt/openldap/include
-DLDAP_LIBRARY=/opt/homebrew/opt/openldap/lib/libldap.dylib
-DLDAP_LBER_LIBRARY=/opt/homebrew/opt/openldap/lib/liblber.dylib
- name: 'wolfSSL !ldap brotli zstd'
compiler: clang
install: brotli wolfssl zstd
install_steps: pytest
generate: -DCURL_USE_WOLFSSL=ON -DCURL_DISABLE_LDAP=ON -DUSE_ECH=ON
generate: -DCURL_USE_WOLFSSL=ON -DCURL_DISABLE_LDAP=ON -DUSE_ECH=ON -DCURL_ENABLE_NTLM=ON
- name: 'mbedTLS !ldap brotli zstd MultiSSL AppleIDN'
compiler: llvm@18
install: brotli mbedtls zstd
install_steps: codeset-test
generate: -DCURL_USE_MBEDTLS=ON -DCURL_DISABLE_LDAP=ON -DCURL_DEFAULT_SSL_BACKEND=mbedtls -DCURL_USE_OPENSSL=ON -DUSE_APPLE_IDN=ON
- name: 'GnuTLS !ldap krb5'
generate: -DCURL_USE_MBEDTLS=ON -DCURL_DISABLE_LDAP=ON -DCURL_DEFAULT_SSL_BACKEND=mbedtls -DCURL_USE_OPENSSL=ON -DUSE_APPLE_IDN=ON -DCURL_ENABLE_NTLM=ON
- name: 'GnuTLS !ldap krb5 +examples'
compiler: clang
install: gnutls nettle krb5
generate: -DENABLE_DEBUG=ON -DCURL_USE_GNUTLS=ON -DCURL_USE_OPENSSL=OFF -DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=/opt/homebrew/opt/krb5 -DCURL_DISABLE_LDAP=ON -DUSE_SSLS_EXPORT=ON
- name: 'aws-lc'
compiler: gcc-12
generate: >-
-DENABLE_DEBUG=ON -DCURL_USE_GNUTLS=ON -DCURL_USE_OPENSSL=OFF
-DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=/opt/homebrew/opt/krb5
-DCURL_DISABLE_LDAP=ON -DUSE_SSLS_EXPORT=ON -DCURL_ENABLE_NTLM=ON
- name: 'aws-lc +analyzer'
compiler: gcc-15
install: aws-lc
generate: -DENABLE_DEBUG=ON -DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/aws-lc -DUSE_ECH=ON -DCURL_DISABLE_LDAP=ON -DUSE_SSLS_EXPORT=ON
generate: >-
-DENABLE_DEBUG=ON -DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/aws-lc -DUSE_ECH=ON
-DCURL_DISABLE_LDAP=ON -DUSE_SSLS_EXPORT=ON -DCURL_GCC_ANALYZER=ON
- name: 'Rustls'
compiler: clang
install: rustls-ffi
generate: -DENABLE_DEBUG=ON -DCURL_USE_RUSTLS=ON -DUSE_ECH=ON -DCURL_DISABLE_LDAP=ON
- name: 'OpenSSL torture !FTP'
generate: -DENABLE_DEBUG=ON -DCURL_USE_RUSTLS=ON -DUSE_ECH=ON -DCURL_DISABLE_LDAP=ON -DCURL_ENABLE_NTLM=ON
tflags: '--min=1650'
- name: 'OpenSSL torture 1'
compiler: clang
install: libnghttp3
install_steps: torture
generate: -DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_THREADED_RESOLVER=OFF -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DUSE_OPENSSL_QUIC=ON
tflags: -t --shallow=25 !FTP
- name: 'OpenSSL torture FTP'
generate: -DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_THREADED_RESOLVER=OFF -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_ENABLE_NTLM=ON
tflags: '-t --shallow=25 --min=480 1 to 500'
- name: 'OpenSSL torture 2'
compiler: clang
install: libnghttp3
install_steps: torture
generate: -DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_THREADED_RESOLVER=OFF -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DUSE_OPENSSL_QUIC=ON
tflags: -t --shallow=20 FTP
exclude:
# opt out jobs from combinations that have the compiler set manually
- { compiler: llvm@18, build: { compiler: 'clang' } }
- { compiler: llvm@18, build: { compiler: 'gcc-12' } }
- { compiler: gcc-12, build: { compiler: 'clang' } }
- { compiler: gcc-12, build: { compiler: 'llvm@18' } }
- { compiler: clang, build: { compiler: 'gcc-12' } }
- { compiler: clang, build: { compiler: 'llvm@18' } }
generate: -DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_THREADED_RESOLVER=OFF -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_ENABLE_NTLM=ON
tflags: '-t --shallow=25 --min=730 501 to 1250'
- name: 'OpenSSL torture 3'
compiler: clang
install: libnghttp3
install_steps: torture
generate: -DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_THREADED_RESOLVER=OFF -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_ENABLE_NTLM=ON
tflags: '-t --shallow=25 --min=628 1251 to 9999'
steps:
- name: 'brew install'
timeout-minutes: 5
# Run this command with retries because of spurious failures seen
# while running the tests, for example
# https://github.com/curl/curl/runs/4095721123?check_suite_focus=true
env:
INSTALL_PACKAGES: >-
${{ matrix.build.generate && 'ninja' || 'automake libtool' }}
${{ !contains(matrix.build.install_steps, 'clang-tidy') && 'nghttp2 stunnel' || '' }}
${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') && 'nghttp2 stunnel' || '' }}
${{ contains(matrix.build.install_steps, 'pytest') && 'caddy httpd vsftpd' || '' }}
run: |
echo pkgconf libpsl libssh2 ${INSTALL_PACKAGES} ${MATRIX_INSTALL} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
# shellcheck disable=SC2181,SC2034
while [[ $? == 0 ]]; do for i in 1 2 3; do if brew update && brew bundle install --file /tmp/Brewfile; then break 2; else echo Error: wait to try again; sleep 10; fi; done; false Too many retries; done
# shellcheck disable=SC2181
while [[ $? == 0 ]]; do
for i in 1 2 3; do
if brew update && brew install pkgconf libpsl libssh2 ${INSTALL_PACKAGES} ${MATRIX_INSTALL}; then
break 2
else
echo "Error: wait to try again: $i"
sleep 10
fi
done
false Too many retries
done
- name: 'brew unlink openssl'
if: ${{ contains(matrix.build.install, 'aws-lc') || contains(matrix.build.install, 'libressl') || contains(matrix.build.install, 'quictls') }}
if: ${{ contains(matrix.build.install, 'aws-lc') || contains(matrix.build.install, 'libressl') }}
run: |
if [ -d /opt/homebrew/include/openssl ]; then
if [ -d "$(brew --prefix)"/include/openssl ]; then
brew unlink openssl
fi
@ -367,9 +432,9 @@ jobs:
xcrun --sdk macosx --show-sdk-version || true
ls -l /Library/Developer/CommandLineTools/SDKs || true
echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::'
echo '::group::brew packages installed'; ls -l /opt/homebrew/opt; echo '::endgroup::'
echo '::group::brew packages installed'; ls -l "$(brew --prefix)"/opt; echo '::endgroup::'
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
@ -403,7 +468,7 @@ jobs:
[ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF'
cmake -B "bld${_chkprefill}" -G Ninja -D_CURL_PREFILL=ON \
-DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_DROP_UNUSED=ON -DCURL_WERROR=ON \
-DCMAKE_OSX_SYSROOT="${sysroot}" \
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64e/')-apple-darwin$(uname -r)" \
${MATRIX_GENERATE} ${options}
@ -423,9 +488,9 @@ jobs:
fi
[ -n "${MATRIX_MACOS_VERSION_MIN}" ] && CFLAGS+=" -mmacosx-version-min=${MATRIX_MACOS_VERSION_MIN}"
[[ "${MATRIX_INSTALL_STEPS}" = *'pytest'* ]] && options+=' --with-test-vsftpd=no' # Skip ~20 tests that stretch run time by 7x on macOS
mkdir bld && cd bld && ../configure --prefix="$PWD"/curl-install --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking \
--with-libpsl=/opt/homebrew/opt/libpsl \
mkdir bld && cd bld && ../configure --prefix="$PWD"/curl-install --enable-unity --enable-warnings --enable-werror --disable-static \
--disable-dependency-tracking --enable-option-checking=fatal \
--with-libpsl="$(brew --prefix libpsl)" \
${MATRIX_CONFIGURE} ${options}
fi
@ -449,8 +514,11 @@ jobs:
make -C bld V=1
fi
- name: 'curl version'
run: bld/src/curl --disable --version
- name: 'curl -V'
run: |
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 stat -f '%10z bytes: %N' --
bld/src/curl --disable --version
- name: 'curl install'
run: |
@ -461,6 +529,7 @@ jobs:
fi
- name: 'build tests'
if: ${{ !contains(matrix.build.install_steps, 'skipall') }}
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target testdeps
@ -469,20 +538,24 @@ jobs:
fi
- name: 'install test prereqs'
if: ${{ !contains(matrix.build.install_steps, 'clang-tidy') }}
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
run: |
python3 -m venv ~/venv
source ~/venv/bin/activate
python3 -m pip install -r tests/requirements.txt
if bld/src/curl --disable -V 2>/dev/null | grep smb; then
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt
fi
- name: 'run tests'
if: ${{ !contains(matrix.build.install_steps, 'clang-tidy') }}
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
timeout-minutes: ${{ contains(matrix.build.install_steps, 'torture') && 20 || 10 }}
env:
TEST_TARGET: ${{ contains(matrix.build.install_steps, 'torture') && 'test-torture' || 'test-ci' }}
TFLAGS: '${{ matrix.build.tflags }}'
run: |
TFLAGS="-j20 ${TFLAGS}"
if [ "${TEST_TARGET}" != 'test-ci' ]; then
TFLAGS+=' --buildinfo' # only test-ci sets this by default, set it manually for test-torture
fi
source ~/venv/bin/activate
if [[ "${MATRIX_INSTALL_STEPS}" = *'codeset-test'* ]]; then
locale || true
@ -498,13 +571,13 @@ jobs:
fi
- name: 'install pytest prereqs'
if: ${{ !contains(matrix.build.install_steps, 'clang-tidy') && contains(matrix.build.install_steps, 'pytest') }}
if: ${{ contains(matrix.build.install_steps, 'pytest') }}
run: |
source ~/venv/bin/activate
python3 -m pip install -r tests/http/requirements.txt
[ -d ~/venv ] || python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/http/requirements.txt
- name: 'run pytest'
if: ${{ !contains(matrix.build.install_steps, 'clang-tidy') && contains(matrix.build.install_steps, 'pytest') }}
if: ${{ contains(matrix.build.install_steps, 'pytest') }}
env:
PYTEST_ADDOPTS: '--color=yes'
PYTEST_XDIST_AUTO_NUM_WORKERS: 4
@ -526,7 +599,7 @@ jobs:
fi
combinations: # Test buildability with host OS, Xcode / SDK, compiler, target-OS, built tool, combinations
name: "${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }} ${{ matrix.image }} ${{ matrix.xcode }} ${{ matrix.config }}"
name: "${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }} ${{ matrix.image }} ${{ matrix.xcode }}"
runs-on: ${{ matrix.image }}
timeout-minutes: 10
env:
@ -539,58 +612,64 @@ jobs:
strategy:
fail-fast: false
matrix:
compiler: [gcc-12, gcc-13, gcc-14, llvm@15, llvm@18, clang]
# Xcode support matrix as of 2024-07, with default macOS SDK versions and OS names, years:
# Sources:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
# https://github.com/actions/runner-images/blob/main/images/macos/macos-15-arm64-Readme.md
# https://github.com/actions/runner-images/blob/main/images/macos/macos-26-arm64-Readme.md
compiler: [gcc-13, gcc-14, gcc-15, llvm@15, llvm@18, llvm@20, clang]
# Xcode support matrix as of 2025-10, with default macOS SDK versions and OS names, years:
# * = default Xcode on the runner.
# macos-13: 14.1, 14.2, 14.3.1, 15.0.1, 15.1,*15.2
# macos-14: 15.0.1, 15.1, 15.2, 15.3,*15.4
# macos-15: *16.0, 16.1
# macOSSDK: 13.0, 13.1, 13.3, 14.0, 14.2, 14.2, 14.4, 14.5, 15.0, 15.1
# Ventura (2022) Sonoma (2023) Sequoia (2024)
# macos-14: 15.0.1, 15.1, 15.2, 15.3,*15.4
# macos-15: 16.0, 16.1, 16.2, 16.3,*16.4, 26.0
# macos-26: 16.4 *26.0
# macOSSDK: 14.0, 14.2, 14.2, 14.4, 14.5, 15.0, 15.1, 15.2, 15.4, 15.5, 26.0
# Sonoma (2023) Sequoia (2024) Tahoe (2025)
# https://github.com/actions/runner-images/tree/main/images/macos
# https://en.wikipedia.org/wiki/MacOS_version_history
# TODO when dropping macos-13: replace '$(brew --prefix ...' with /opt/homebrew
image: [macos-13, macos-14, macos-15]
# Can skip these to reduce jobs:
# 15.1 has the same default macOS SDK as 15.2 and identical test results.
# 14.1, 15.4 not revealing new fallouts.
#xcode: ['14.1', '14.2', '14.3.1', '15.0.1', '15.1', '15.2', '15.3', '15.4', '16.0', '16.1'] # all Xcode
#xcode: ['14.1', '14.2', '14.3.1', '15.0.1' , '15.2', '15.3', '15.4', '16.0', '16.1'] # all SDK
#xcode: [ '14.2', '14.3.1', '15.0.1' , '15.2', '15.3' , '16.0' ] # coverage
image: [macos-14, macos-15, macos-26]
xcode: [''] # default Xcodes
macos-version-min: ['']
build: [autotools, cmake]
exclude:
# Combinations not covered by runner images:
- { image: macos-13, xcode: '15.3' }
- { image: macos-13, xcode: '15.4' }
- { image: macos-13, xcode: '16.0' }
- { image: macos-13, xcode: '16.1' }
- { image: macos-14, xcode: '14.1' }
- { image: macos-14, xcode: '14.2' }
- { image: macos-14, xcode: '14.3.1' }
- { image: macos-14, xcode: '16.0' }
- { image: macos-14, xcode: '16.1' }
- { image: macos-15, xcode: '14.1' }
- { image: macos-15, xcode: '14.2' }
- { image: macos-15, xcode: '14.3.1' }
- { image: macos-15, xcode: '15.0.1' }
- { image: macos-15, xcode: '15.1' }
- { image: macos-15, xcode: '15.2' }
- { image: macos-15, xcode: '15.3' }
- { image: macos-15, xcode: '15.4' }
- { image: macos-13, compiler: 'llvm@18' }
- { image: macos-14, compiler: 'llvm@18' }
- { image: macos-14, compiler: 'llvm@20' }
- { image: macos-15, compiler: 'llvm@15' }
- { image: macos-15, compiler: 'llvm@20' }
- { image: macos-26, compiler: 'llvm@15' }
- { image: macos-26, compiler: 'llvm@18' }
# Covered by the main workflow
- { image: macos-15, compiler: 'gcc-13' }
- { image: macos-15, compiler: 'llvm@18' }
- { image: macos-15, compiler: 'clang' }
# Reduce build combinations, by dropping less interesting ones
- { compiler: gcc-13, build: cmake }
- { compiler: gcc-14, build: autotools }
- { image: macos-26, compiler: 'gcc-13' }
- { compiler: 'gcc-14' , build: cmake }
# Reduce autotools to just one job that is also build with cmake
- { compiler: 'gcc-13' , build: autotools }
- { compiler: 'gcc-14' , build: autotools }
- { compiler: 'gcc-15' , build: autotools }
- { compiler: 'llvm@15', build: autotools }
- { compiler: 'llvm@18', build: autotools }
- { compiler: 'llvm@20', build: autotools }
- { image: macos-14, build: autotools }
- { image: macos-15, build: autotools }
steps:
- name: 'install autotools'
if: ${{ matrix.build == 'autotools' }}
run: |
# shellcheck disable=SC2181,SC2034
while [[ $? == 0 ]]; do for i in 1 2 3; do if brew update && brew install automake libtool; then break 2; else echo Error: wait to try again; sleep 10; fi; done; false Too many retries; done
# shellcheck disable=SC2181
while [[ $? == 0 ]]; do
for i in 1 2 3; do
if brew update && brew install automake libtool; then
break 2
else
echo "Error: wait to try again: $i"
sleep 10
fi
done
false Too many retries
done
- name: 'toolchain versions'
run: |
@ -601,10 +680,11 @@ jobs:
xcrun --sdk macosx --show-sdk-path 2>/dev/null || true
xcrun --sdk macosx --show-sdk-version || true
ls -l /Library/Developer/CommandLineTools/SDKs || true
echo '::group::compiler defaults'; echo 'int main(void) {}' | "${CC}" -v -x c -; echo '::endgroup::'
echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::'
echo '::group::brew packages preinstalled'; ls -l "$(brew --prefix)/opt"; echo '::endgroup::'
echo '::group::brew packages preinstalled'; ls -l "$(brew --prefix)"/opt; echo '::endgroup::'
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
@ -614,9 +694,9 @@ jobs:
- name: 'configure / ${{ matrix.build }}'
run: |
if [ "${MATRIX_COMPILER}" = 'gcc-13' ] && [ "${MATRIX_IMAGE}" = 'macos-15' ] ; then
if [ "${MATRIX_COMPILER}" = 'gcc-13' ] && [ "${MATRIX_IMAGE}" = 'macos-15' ]; then
# Ref: https://github.com/Homebrew/homebrew-core/issues/194778#issuecomment-2793243409
/opt/homebrew/opt/gcc@13/libexec/gcc/aarch64-apple-darwin24/13/install-tools/mkheaders
"$(brew --prefix gcc@13)"/libexec/gcc/aarch64-apple-darwin24/13/install-tools/mkheaders
fi
if [[ "${MATRIX_COMPILER}" = 'gcc'* ]]; then
@ -635,7 +715,7 @@ jobs:
[ -n "${MATRIX_MACOS_VERSION_MIN}" ] && options+=" -DCMAKE_OSX_DEPLOYMENT_TARGET=${MATRIX_MACOS_VERSION_MIN}"
# would pick up nghttp2, libidn2, and libssh2
cmake -B bld -G Ninja -D_CURL_PREFILL=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_DROP_UNUSED=ON -DCURL_WERROR=ON \
-DCMAKE_OSX_SYSROOT="${sysroot}" \
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64e/')-apple-darwin$(uname -r)" \
-DCMAKE_IGNORE_PREFIX_PATH="$(brew --prefix)" \
@ -643,6 +723,7 @@ jobs:
-DCURL_USE_OPENSSL=ON \
-DUSE_NGHTTP2=OFF -DUSE_LIBIDN2=OFF \
-DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF \
-DUSE_APPLE_IDN=ON -DUSE_APPLE_SECTRUST=ON \
${options}
else
export CFLAGS
@ -655,12 +736,13 @@ jobs:
fi
[ -n "${MATRIX_MACOS_VERSION_MIN}" ] && CFLAGS+=" -mmacosx-version-min=${MATRIX_MACOS_VERSION_MIN}"
# would pick up nghttp2, libidn2, but libssh2 is disabled by default
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking \
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror --disable-static \
--disable-dependency-tracking --enable-option-checking=fatal \
--disable-docs --disable-manual \
--with-openssl="$(brew --prefix openssl)" \
--without-nghttp2 --without-libidn2 \
--without-libpsl \
--with-apple-idn --with-apple-sectrust \
${options}
fi
@ -681,5 +763,8 @@ jobs:
make -C bld V=1
fi
- name: 'curl version'
run: bld/src/curl --disable --version
- name: 'curl -V'
run: |
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 stat -f '%10z bytes: %N' --
bld/src/curl --disable --version

View file

@ -14,10 +14,7 @@ name: 'non-native'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
pull_request:
branches:
- master
@ -26,10 +23,7 @@ name: 'non-native'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
@ -39,6 +33,7 @@ permissions: {}
env:
CURL_CI: github
CURL_TEST_MIN: 1750
jobs:
netbsd:
@ -49,21 +44,21 @@ jobs:
matrix:
arch: ['x86_64']
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'cmake'
uses: cross-platform-actions/action@e8a7b572196ff79ded1979dc2bb9ee67d1ddb252 # v0.29.0
uses: cross-platform-actions/action@492b0c80085400348c599edace11141a4ee73524 # v0.32.0
env:
MATRIX_ARCH: '${{ matrix.arch }}'
with:
environment_variables: MATRIX_ARCH
environment_variables: CURL_CI CURL_TEST_MIN MATRIX_ARCH
operating_system: 'netbsd'
version: '10.1'
architecture: ${{ matrix.arch }}
run: |
# https://pkgsrc.se/
time sudo pkgin -y install cmake ninja-build pkg-config perl brotli heimdal openldap-client libssh2 libidn2 libpsl nghttp2 py311-impacket
time sudo pkgin -y install cmake ninja-build pkg-config perl brotli mit-krb5 openldap-client libssh2 libidn2 libpsl nghttp2 py311-impacket
time cmake -B bld -G Ninja \
-DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \
-DCMAKE_UNITY_BUILD=ON \
@ -71,6 +66,7 @@ jobs:
-DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_USE_OPENSSL=ON \
-DCURL_USE_GSSAPI=ON \
-DCURL_ENABLE_NTLM=ON \
|| { cat bld/CMakeFiles/CMake*.yaml; false; }
echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
@ -94,15 +90,15 @@ jobs:
matrix:
arch: ['x86_64']
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'cmake'
uses: cross-platform-actions/action@e8a7b572196ff79ded1979dc2bb9ee67d1ddb252 # v0.29.0
uses: cross-platform-actions/action@492b0c80085400348c599edace11141a4ee73524 # v0.32.0
env:
MATRIX_ARCH: '${{ matrix.arch }}'
with:
environment_variables: MATRIX_ARCH
environment_variables: CURL_CI CURL_TEST_MIN MATRIX_ARCH
operating_system: 'openbsd'
version: '7.7'
architecture: ${{ matrix.arch }}
@ -116,6 +112,7 @@ jobs:
-DCURL_WERROR=ON \
-DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_USE_OPENSSL=ON \
-DCURL_ENABLE_NTLM=ON \
|| { cat bld/CMakeFiles/CMake*.yaml; false; }
echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
@ -134,29 +131,30 @@ jobs:
freebsd:
name: "FreeBSD, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }} openssl${{ matrix.desc }} ${{ matrix.arch }}"
runs-on: ubuntu-latest
timeout-minutes: 20
timeout-minutes: 15
strategy:
matrix:
include:
- { build: 'autotools', arch: 'x86_64', compiler: 'clang' }
- { build: 'cmake' , arch: 'x86_64', compiler: 'clang', options: '-DCMAKE_UNITY_BUILD=OFF', desc: ' !unity !runtests !examples' }
- { build: 'autotools', arch: 'arm64', compiler: 'clang' }
- { build: 'cmake' , arch: 'arm64', compiler: 'clang' }
- { build: 'autotools', arch: 'arm64' , compiler: 'clang', desc: ' !examples' }
- { build: 'cmake' , arch: 'arm64' , compiler: 'clang' }
fail-fast: false
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: '${{ matrix.build }}'
uses: cross-platform-actions/action@e8a7b572196ff79ded1979dc2bb9ee67d1ddb252 # v0.29.0
uses: cross-platform-actions/action@492b0c80085400348c599edace11141a4ee73524 # v0.32.0
env:
CC: '${{ matrix.compiler }}'
CURL_TEST_MIN: 1800
MATRIX_ARCH: '${{ matrix.arch }}'
MATRIX_BUILD: '${{ matrix.build }}'
MATRIX_DESC: '${{ matrix.desc }}'
MATRIX_OPTIONS: '${{ matrix.options }}'
with:
environment_variables: CC MATRIX_ARCH MATRIX_BUILD MATRIX_DESC MATRIX_OPTIONS
environment_variables: CC CURL_CI CURL_TEST_MIN MATRIX_ARCH MATRIX_BUILD MATRIX_DESC MATRIX_OPTIONS
operating_system: 'freebsd'
version: '14.3'
architecture: ${{ matrix.arch }}
@ -166,10 +164,10 @@ jobs:
# https://ports.freebsd.org/
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
time sudo pkg install -y cmake-core ninja perl5 \
pkgconf brotli openldap26-client libidn2 libnghttp2 stunnel py311-impacket
pkgconf brotli krb5-devel openldap26-client libidn2 libnghttp2 stunnel py311-impacket
else
time sudo pkg install -y autoconf automake libtool \
pkgconf brotli openldap26-client libidn2 libnghttp2 stunnel py311-impacket
pkgconf brotli krb5-devel openldap26-client libidn2 libnghttp2 stunnel py311-impacket
export MAKEFLAGS=-j3
fi
@ -190,11 +188,10 @@ jobs:
options='--disable-manual --disable-docs' # Slow with autotools, skip on emulated CPU
fi
mkdir bld && cd bld
time ../configure --enable-unity --enable-debug --enable-warnings --enable-werror \
--prefix="$HOME"/curl-install \
time ../configure --prefix="$HOME"/curl-install --enable-unity --enable-debug --enable-warnings --enable-werror --disable-static \
--disable-dependency-tracking --enable-option-checking=fatal \
--with-openssl \
--with-brotli --enable-ldap --enable-ldaps --with-libidn2 --with-libssh2 --with-nghttp2 --with-gssapi \
--disable-dependency-tracking \
${options} \
${MATRIX_OPTIONS} \
|| { tail -n 1000 config.log; false; }
@ -241,9 +238,10 @@ jobs:
android:
name: "Android ${{ matrix.platform }}, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.name }} arm64"
runs-on: 'ubuntu-latest'
timeout-minutes: 25
runs-on: ubuntu-latest
timeout-minutes: 5
env:
LDFLAGS: -s
MAKEFLAGS: -j 5
MATRIX_BUILD: '${{ matrix.build }}'
strategy:
@ -263,7 +261,7 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
@ -286,7 +284,8 @@ jobs:
${MATRIX_OPTIONS}
else
TOOLCHAIN="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64"
mkdir bld && cd bld && ../configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror \
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror --disable-shared \
--disable-dependency-tracking --enable-option-checking=fatal \
CC="$TOOLCHAIN/bin/aarch64-linux-android${MATRIX_PLATFORM}-clang" \
AR="$TOOLCHAIN/bin/llvm-ar" \
RANLIB="$TOOLCHAIN/bin/llvm-ranlib" \
@ -312,7 +311,9 @@ jobs:
fi
- name: 'curl info'
run: find . -type f \( -name curl -o -name '*.so' -o -name '*.a' \) -exec file '{}' \;
run: |
find . -type f \( -name curl -o -name '*.so' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.so' -o -name '*.a' \) -print0 | xargs -0 stat -c '%10s bytes: %n' --
- name: 'build tests'
run: |
@ -329,3 +330,119 @@ jobs:
else
make -C bld examples
fi
msdos:
name: "MS-DOS, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} djgpp !ssl i586"
runs-on: ubuntu-latest
timeout-minutes: 5
env:
LDFLAGS: -s
MAKEFLAGS: -j 5
MATRIX_BUILD: '${{ matrix.build }}'
# renovate: datasource=github-releases depName=andrewwutw/build-djgpp versioning=semver-coerced registryUrl=https://github.com
TOOLCHAIN_VERSION: 3.4
TOOLCHAIN_SHA256: 8464f17017d6ab1b2bb2df4ed82357b5bf692e6e2b7fee37e315638f3d505f00
strategy:
matrix:
build: [autotools, cmake]
fail-fast: false
steps:
- name: 'install packages'
run: |
printf "#!/bin/sh
while [ \$? = 0 ]; do for i in 1 2 3; do timeout 30 \"\$@\" && break 2; echo \"Error: slow server, retry \$i\"; sleep 1
dpkg --configure -a; done; false; done" > "$HOME"/my-apt; chmod +x "$HOME"/my-apt
sudo "$HOME"/my-apt apt-get -o Dpkg::Use-Pty=0 install libfl2
- name: 'cache compiler (djgpp)'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-compiler
with:
path: ~/djgpp
key: ${{ runner.os }}-djgpp-${{ env.TOOLCHAIN_VERSION }}-amd64
- name: 'install compiler (djgpp)'
if: ${{ steps.cache-compiler.outputs.cache-hit != 'true' }}
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 3 --retry-connrefused \
--location "https://github.com/andrewwutw/build-djgpp/releases/download/v${TOOLCHAIN_VERSION}/djgpp-linux64-gcc1220.tar.bz2" --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${TOOLCHAIN_SHA256}" && tar -xjf pkg.bin && rm -f pkg.bin
cd djgpp
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
https://www.delorie.com/pub/djgpp/current/v2tk/wat3211b.zip --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF faa2222ab5deb2c2aac229c760bf4d45aca5379f5af97865c308a0467046b67a && unzip -q pkg.bin && rm -f pkg.bin
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
https://www.delorie.com/pub/djgpp/current/v2tk/zlb13b.zip --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF f3d2fa8129e7591c7e79074306d8ab91a70ec172cc01baedeae74992285dd3a3 && unzip -q pkg.bin && rm -f pkg.bin
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'configure'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake -B bld -G Ninja \
-DCMAKE_SYSTEM_NAME=DOS \
-DCMAKE_SYSTEM_PROCESSOR=x86 \
-DCMAKE_C_COMPILER_TARGET=i586-pc-msdosdjgpp \
-DCMAKE_C_COMPILER="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-gcc \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DCURL_ENABLE_SSL=OFF -DCURL_USE_LIBPSL=OFF \
-DZLIB_INCLUDE_DIR="$HOME"/djgpp/include \
-DZLIB_LIBRARY="$HOME"/djgpp/lib/libz.a \
-DWATT_ROOT="$HOME"/djgpp/net/watt
else
autoreconf -fi
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror --disable-shared \
--disable-dependency-tracking --enable-option-checking=fatal \
CC="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-gcc \
AR="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-ar \
RANLIB="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-ranlib \
WATT_ROOT="$HOME"/djgpp/net/watt \
--host=i586-pc-msdosdjgpp \
--without-ssl --without-libpsl \
--with-zlib="$HOME"/djgpp
fi
- name: 'configure log'
if: ${{ !cancelled() }}
run: cat bld/config.log bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
- name: 'curl_config.h'
run: |
echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld/lib/curl_config.h | sort || true
- name: 'build'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld
else
make -C bld
fi
- name: 'curl info'
run: |
find . \( -name '*.exe' -o -name '*.a' \) -print0 | xargs -0 file --
find . \( -name '*.exe' -o -name '*.a' \) -print0 | xargs -0 stat -c '%10s bytes: %n' --
- name: 'build tests'
if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target testdeps
else
make -C bld -C tests
fi
- name: 'build examples'
if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target curl-examples-build
else
make -C bld examples
fi

File diff suppressed because it is too large Load diff

1
.gitignore vendored
View file

@ -28,7 +28,6 @@
/.vs
/bld/
/build/
/builds/
/stats/
__pycache__
Debug

View file

@ -1,3 +1,7 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
Guenter Knauf <lists@gknw.net> <gk@gknw.de>
Gisle Vanem <gvanem@yahoo.no> <gisle.vanem@gmail.com>
Gisle Vanem <gvanem@yahoo.no> <gvanem@broadpark.no>
@ -116,3 +120,5 @@ Sinkevich Artem <artsin666@gmail.com>
Andrew Kirillov <akirillo@uk.ibm.com>
Stephen Farrell <stephen.farrell@cs.tcd.ie>
Calvin Ruocco <calvin.ruocco@vector.com>
Hamza Bensliman <benslimanhamza99@gmail.com>
Kaixuan Li <kaixuan.li@ntu.edu.sg>

View file

@ -4,7 +4,7 @@ Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
In a release tarball, check the RELEASES-NOTES file for what was done in the
In a release tarball, check the RELEASE-NOTES file for what was done in the
most recent release. In a git check-out, that file mentions changes that have
been done since the previous release.

View file

@ -1,24 +0,0 @@
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
@CMAKE_CONFIGURABLE_FILE_CONTENT@

View file

@ -24,12 +24,12 @@
option(CURL_HIDDEN_SYMBOLS "Hide libcurl internal symbols (=hide all symbols that are not officially external)" ON)
mark_as_advanced(CURL_HIDDEN_SYMBOLS)
if(WIN32 AND (ENABLE_DEBUG OR ENABLE_CURLDEBUG))
if(WIN32 AND ENABLE_DEBUG)
# We need to export internal debug functions,
# e.g. curl_easy_perform_ev() or curl_dbg_*(),
# so disable symbol hiding for debug builds and for memory tracking.
set(CURL_HIDDEN_SYMBOLS OFF)
elseif(DOS OR AMIGA OR MINGW32CE)
elseif(DOS OR AMIGA)
set(CURL_HIDDEN_SYMBOLS OFF)
endif()

View file

@ -27,9 +27,9 @@
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
/* */
#if defined(sun) || defined(__sun__) || \
defined(__SUNPRO_C) || defined(__SUNPRO_CC)
defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# if defined(__SVR4) || defined(__srv4__)
# define PLATFORM_SOLARIS
# else
@ -39,7 +39,7 @@
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41)
# define PLATFORM_AIX_V3
#endif
/* */
#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3)
#error "O_NONBLOCK does not work on this platform"
#endif
@ -119,16 +119,19 @@ int main(void)
#include <stdarg.h>
#include <string.h>
#include <float.h>
int main(void) { return 0; }
int main(void)
{
return 0;
}
#endif
#ifdef HAVE_FILE_OFFSET_BITS
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We cannot simply define LARGE_OFF_T to be 9223372036854775807,
We cannot define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T (((off_t)1 << 62) - 1 + ((off_t)1 << 62))
static int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 &&
LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@ -272,7 +275,10 @@ int main(void)
#include <string.h>
#include <errno.h>
static void check(char c) { (void)c; }
static void check(char c)
{
(void)c;
}
int main(void)
{
@ -289,7 +295,10 @@ int main(void)
#include <errno.h>
/* Float, because a pointer cannot be implicitly cast to float */
static void check(float f) { (void)f; }
static void check(float f)
{
(void)f;
}
int main(void)
{

View file

@ -25,39 +25,47 @@
#
# Input variables:
#
# - `BROTLI_INCLUDE_DIR`: The brotli include directory.
# - `BROTLICOMMON_LIBRARY`: Path to `brotlicommon` library.
# - `BROTLIDEC_LIBRARY`: Path to `brotlidec` library.
# - `BROTLI_INCLUDE_DIR`: Absolute path to brotli include directory.
# - `BROTLICOMMON_LIBRARY`: Absolute path to `brotlicommon` library.
# - `BROTLIDEC_LIBRARY`: Absolute path to `brotlidec` library.
# - `BROTLI_USE_STATIC_LIBS`: Configure for static brotli libraries.
#
# Result variables:
# Defines:
#
# - `BROTLI_FOUND`: System has brotli.
# - `BROTLI_INCLUDE_DIRS`: The brotli include directories.
# - `BROTLI_LIBRARIES`: The brotli library names.
# - `BROTLI_LIBRARY_DIRS`: The brotli library directories.
# - `BROTLI_PC_REQUIRES`: The brotli pkg-config packages.
# - `BROTLI_CFLAGS`: Required compiler flags.
# - `BROTLI_VERSION`: Version of brotli.
# - `BROTLI_FOUND`: System has brotli.
# - `BROTLI_VERSION`: Version of brotli.
# - `CURL::brotli`: brotli library target.
set(BROTLI_PC_REQUIRES "libbrotlidec" "libbrotlicommon") # order is significant: brotlidec then brotlicommon
set(_brotli_pc_requires "libbrotlidec" "libbrotlicommon") # order is significant: brotlidec then brotlicommon
if(CURL_USE_PKGCONFIG AND
NOT DEFINED BROTLI_INCLUDE_DIR AND
NOT DEFINED BROTLICOMMON_LIBRARY AND
NOT DEFINED BROTLIDEC_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(BROTLI ${BROTLI_PC_REQUIRES})
pkg_check_modules(_brotli ${_brotli_pc_requires})
endif()
if(BROTLI_FOUND)
if(_brotli_FOUND)
set(Brotli_FOUND TRUE)
set(BROTLI_VERSION "${BROTLI_libbrotlicommon_VERSION}")
string(REPLACE ";" " " BROTLI_CFLAGS "${BROTLI_CFLAGS}")
message(STATUS "Found Brotli (via pkg-config): ${BROTLI_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")")
set(BROTLI_FOUND TRUE)
set(BROTLI_VERSION ${_brotli_libbrotlicommon_VERSION})
if(BROTLI_USE_STATIC_LIBS)
set(_brotli_CFLAGS "${_brotli_STATIC_CFLAGS}")
set(_brotli_INCLUDE_DIRS "${_brotli_STATIC_INCLUDE_DIRS}")
set(_brotli_LIBRARY_DIRS "${_brotli_STATIC_LIBRARY_DIRS}")
set(_brotli_LIBRARIES "${_brotli_STATIC_LIBRARIES}")
endif()
message(STATUS "Found Brotli (via pkg-config): ${_brotli_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")")
else()
find_path(BROTLI_INCLUDE_DIR "brotli/decode.h")
find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon")
find_library(BROTLIDEC_LIBRARY NAMES "brotlidec")
if(BROTLI_USE_STATIC_LIBS)
find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon-static" "brotlicommon")
find_library(BROTLIDEC_LIBRARY NAMES "brotlidec-static" "brotlidec")
else()
find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon")
find_library(BROTLIDEC_LIBRARY NAMES "brotlidec")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Brotli
@ -68,9 +76,21 @@ else()
)
if(BROTLI_FOUND)
set(BROTLI_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR})
set(BROTLI_LIBRARIES ${BROTLIDEC_LIBRARY} ${BROTLICOMMON_LIBRARY})
set(_brotli_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR})
set(_brotli_LIBRARIES ${BROTLIDEC_LIBRARY} ${BROTLICOMMON_LIBRARY})
endif()
mark_as_advanced(BROTLI_INCLUDE_DIR BROTLIDEC_LIBRARY BROTLICOMMON_LIBRARY)
endif()
if(BROTLI_FOUND)
if(NOT TARGET CURL::brotli)
add_library(CURL::brotli INTERFACE IMPORTED)
set_target_properties(CURL::brotli PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_brotli_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_brotli_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_brotli_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_brotli_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_brotli_LIBRARIES}")
endif()
endif()

View file

@ -25,35 +25,58 @@
#
# Input variables:
#
# - `CARES_INCLUDE_DIR`: The c-ares include directory.
# - `CARES_LIBRARY`: Path to `cares` library.
# - `CARES_INCLUDE_DIR`: Absolute path to c-ares include directory.
# - `CARES_LIBRARY`: Absolute path to `cares` library.
# - `CARES_USE_STATIC_LIBS`: Configure for static c-ares libraries.
#
# Result variables:
# Defines:
#
# - `CARES_FOUND`: System has c-ares.
# - `CARES_INCLUDE_DIRS`: The c-ares include directories.
# - `CARES_LIBRARIES`: The c-ares library names.
# - `CARES_LIBRARY_DIRS`: The c-ares library directories.
# - `CARES_PC_REQUIRES`: The c-ares pkg-config packages.
# - `CARES_CFLAGS`: Required compiler flags.
# - `CARES_VERSION`: Version of c-ares.
# - `CARES_FOUND`: System has c-ares.
# - `CARES_VERSION`: Version of c-ares.
# - `CURL::cares`: c-ares library target.
set(CARES_PC_REQUIRES "libcares")
set(_cares_pc_requires "libcares")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED CARES_INCLUDE_DIR AND
if(NOT DEFINED CARES_INCLUDE_DIR AND
NOT DEFINED CARES_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(CARES ${CARES_PC_REQUIRES})
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_cares ${_cares_pc_requires})
endif()
if(NOT _cares_FOUND AND CURL_USE_CMAKECONFIG)
find_package(c-ares CONFIG QUIET)
endif()
endif()
if(CARES_FOUND)
if(_cares_FOUND)
set(Cares_FOUND TRUE)
string(REPLACE ";" " " CARES_CFLAGS "${CARES_CFLAGS}")
message(STATUS "Found Cares (via pkg-config): ${CARES_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")")
set(CARES_FOUND TRUE)
set(CARES_VERSION ${_cares_VERSION})
if(CARES_USE_STATIC_LIBS)
set(_cares_CFLAGS "${_cares_STATIC_CFLAGS}")
set(_cares_INCLUDE_DIRS "${_cares_STATIC_INCLUDE_DIRS}")
set(_cares_LIBRARY_DIRS "${_cares_STATIC_LIBRARY_DIRS}")
set(_cares_LIBRARIES "${_cares_STATIC_LIBRARIES}")
endif()
message(STATUS "Found Cares (via pkg-config): ${_cares_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")")
elseif(c-ares_CONFIG)
set(Cares_FOUND TRUE)
set(CARES_FOUND TRUE)
set(CARES_VERSION ${c-ares_VERSION})
if(CARES_USE_STATIC_LIBS)
set(_cares_LIBRARIES c-ares::cares_static)
else()
set(_cares_LIBRARIES c-ares::cares)
endif()
message(STATUS "Found Cares (via CMake Config): ${c-ares_CONFIG} (found version \"${CARES_VERSION}\")")
else()
find_path(CARES_INCLUDE_DIR NAMES "ares.h")
find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares")
if(CARES_USE_STATIC_LIBS)
set(_cares_CFLAGS "-DCARES_STATICLIB")
find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares_static" "cares")
else()
find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares")
endif()
unset(CARES_VERSION CACHE)
if(CARES_INCLUDE_DIR AND EXISTS "${CARES_INCLUDE_DIR}/ares_version.h")
@ -85,13 +108,25 @@ else()
)
if(CARES_FOUND)
set(CARES_INCLUDE_DIRS ${CARES_INCLUDE_DIR})
set(CARES_LIBRARIES ${CARES_LIBRARY})
set(_cares_INCLUDE_DIRS ${CARES_INCLUDE_DIR})
set(_cares_LIBRARIES ${CARES_LIBRARY})
endif()
mark_as_advanced(CARES_INCLUDE_DIR CARES_LIBRARY)
endif()
if(CARES_FOUND AND WIN32)
list(APPEND CARES_LIBRARIES "iphlpapi") # for if_indextoname and others
if(CARES_FOUND)
if(WIN32)
list(APPEND _cares_LIBRARIES "iphlpapi") # for if_indextoname and others
endif()
if(NOT TARGET CURL::cares)
add_library(CURL::cares INTERFACE IMPORTED)
set_target_properties(CURL::cares PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_cares_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_cares_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_cares_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_cares_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_cares_LIBRARIES}")
endif()
endif()

View file

@ -25,32 +25,24 @@
#
# Input variables:
#
# - `GSS_ROOT_DIR`: Set this variable to the root installation of GSS. (also supported as environment)
# - `GSS_ROOT_DIR`: Absolute path to the root installation of GSS. (also supported as environment)
#
# Result variables:
# Defines:
#
# - `GSS_FOUND`: System has the Heimdal library.
# - `GSS_FLAVOUR`: "GNU", "MIT" or "Heimdal" if anything found.
# - `GSS_INCLUDE_DIRS`: The GSS include directories.
# - `GSS_LIBRARIES`: The GSS library names.
# - `GSS_LIBRARY_DIRS`: The GSS library directories.
# - `GSS_PC_REQUIRES`: The GSS pkg-config packages.
# - `GSS_CFLAGS`: Required compiler flags.
# - `GSS_VERSION`: This is set to version advertised by pkg-config or read from manifest.
# In case the library is found but no version info available it is set to "unknown"
# - `GSS_FOUND`: System has a GSS library.
# - `GSS_VERSION`: This is set to version advertised by pkg-config or read from manifest.
# In case the library is found but no version info available it is set to "unknown"
# - `CURL::gss`: GSS library target.
# - `CURL_GSS_FLAVOUR`: Custom property. "GNU" or "MIT" if detected.
set(_gnu_modname "gss")
set(_mit_modname "mit-krb5-gssapi")
set(_heimdal_modname "heimdal-gssapi")
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckTypeSize)
set(_gss_root_hints
"${GSS_ROOT_DIR}"
"$ENV{GSS_ROOT_DIR}"
)
set(_gss_root_hints "${GSS_ROOT_DIR}" "$ENV{GSS_ROOT_DIR}")
set(_gss_CFLAGS "")
set(_gss_LIBRARY_DIRS "")
@ -59,7 +51,7 @@ set(_gss_LIBRARY_DIRS "")
if(NOT GSS_ROOT_DIR AND NOT "$ENV{GSS_ROOT_DIR}")
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_search_module(_gss ${_gnu_modname} ${_mit_modname} ${_heimdal_modname})
pkg_search_module(_gss ${_gnu_modname} ${_mit_modname})
list(APPEND _gss_root_hints "${_gss_PREFIX}")
set(_gss_version "${_gss_VERSION}")
endif()
@ -69,37 +61,22 @@ if(NOT GSS_ROOT_DIR AND NOT "$ENV{GSS_ROOT_DIR}")
endif()
if(NOT _gss_FOUND) # Not found by pkg-config. Let us take more traditional approach.
find_file(_gss_configure_script
NAMES
"krb5-config"
HINTS
${_gss_root_hints}
PATH_SUFFIXES
"bin"
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
)
find_file(_gss_configure_script NAMES "krb5-config" PATH_SUFFIXES "bin" HINTS ${_gss_root_hints}
NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH)
# If not found in user-supplied directories, maybe system knows better
find_file(_gss_configure_script
NAMES
"krb5-config"
PATH_SUFFIXES
"bin"
)
find_file(_gss_configure_script NAMES "krb5-config" PATH_SUFFIXES "bin")
if(_gss_configure_script)
set(_gss_INCLUDE_DIRS "")
set(_gss_LIBRARIES "")
execute_process(
COMMAND ${_gss_configure_script} "--cflags" "gssapi"
execute_process(COMMAND ${_gss_configure_script} "--cflags" "gssapi"
OUTPUT_VARIABLE _gss_cflags_raw
RESULT_VARIABLE _gss_configure_failed
OUTPUT_STRIP_TRAILING_WHITESPACE
)
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "FindGSS krb5-config --cflags: ${_gss_cflags_raw}")
if(NOT _gss_configure_failed) # 0 means success
# Should also work in an odd case when multiple directories are given.
string(STRIP "${_gss_cflags_raw}" _gss_cflags_raw)
@ -116,12 +93,10 @@ if(NOT _gss_FOUND) # Not found by pkg-config. Let us take more traditional appr
endforeach()
endif()
execute_process(
COMMAND ${_gss_configure_script} "--libs" "gssapi"
execute_process(COMMAND ${_gss_configure_script} "--libs" "gssapi"
OUTPUT_VARIABLE _gss_lib_flags
RESULT_VARIABLE _gss_configure_failed
OUTPUT_STRIP_TRAILING_WHITESPACE
)
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "FindGSS krb5-config --libs: ${_gss_lib_flags}")
if(NOT _gss_configure_failed) # 0 means success
@ -141,199 +116,117 @@ if(NOT _gss_FOUND) # Not found by pkg-config. Let us take more traditional appr
endforeach()
endif()
execute_process(
COMMAND ${_gss_configure_script} "--version"
execute_process(COMMAND ${_gss_configure_script} "--version"
OUTPUT_VARIABLE _gss_version
RESULT_VARIABLE _gss_configure_failed
OUTPUT_STRIP_TRAILING_WHITESPACE
)
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Older versions may not have the "--version" parameter. In this case we just do not care.
if(_gss_configure_failed)
set(_gss_version 0)
else()
# Strip prefix string to leave the version number only
string(REPLACE "Kerberos 5 release " "" _gss_version "${_gss_version}")
endif()
execute_process(
COMMAND ${_gss_configure_script} "--vendor"
execute_process(COMMAND ${_gss_configure_script} "--vendor"
OUTPUT_VARIABLE _gss_vendor
RESULT_VARIABLE _gss_configure_failed
OUTPUT_STRIP_TRAILING_WHITESPACE
)
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Older versions may not have the "--vendor" parameter. In this case we just do not care.
if(_gss_configure_failed)
set(GSS_FLAVOUR "Heimdal") # most probably, should not really matter
else()
if(_gss_vendor MATCHES "H|heimdal")
set(GSS_FLAVOUR "Heimdal")
else()
set(GSS_FLAVOUR "MIT")
endif()
if(NOT _gss_configure_failed AND NOT _gss_vendor MATCHES "Heimdal|heimdal")
set(_gss_flavour "MIT") # assume a default, should not really matter
endif()
else() # Either there is no config script or we are on a platform that does not provide one (Windows?)
find_path(_gss_INCLUDE_DIRS NAMES "gssapi/gssapi.h"
HINTS
${_gss_root_hints}
PATH_SUFFIXES
"include"
"inc"
)
find_path(_gss_INCLUDE_DIRS NAMES "gssapi/gssapi.h" HINTS ${_gss_root_hints} PATH_SUFFIXES "include" "inc")
if(_gss_INCLUDE_DIRS) # We have found something
set(_gss_libdir_suffixes "")
if(_gss_INCLUDE_DIRS) # jay, we have found something
cmake_push_check_state()
list(APPEND CMAKE_REQUIRED_INCLUDES "${_gss_INCLUDE_DIRS}")
check_include_files("gssapi/gssapi_generic.h;gssapi/gssapi_krb5.h" _gss_have_mit_headers)
cmake_pop_check_state()
if(_gss_have_mit_headers)
set(GSS_FLAVOUR "MIT")
else()
# Prevent compiling the header - just check if we can include it
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D__ROKEN_H__")
check_include_file("roken.h" _gss_have_roken_h)
check_include_file("heimdal/roken.h" _gss_have_heimdal_roken_h)
if(_gss_have_roken_h OR _gss_have_heimdal_roken_h)
set(GSS_FLAVOUR "Heimdal")
endif()
endif()
cmake_pop_check_state()
else()
# I am not convinced if this is the right way but this is what autotools do at the moment
find_path(_gss_INCLUDE_DIRS NAMES "gssapi.h"
HINTS
${_gss_root_hints}
PATH_SUFFIXES
"include"
"inc"
)
if(_gss_INCLUDE_DIRS)
set(GSS_FLAVOUR "Heimdal")
else()
find_path(_gss_INCLUDE_DIRS NAMES "gss.h"
HINTS
${_gss_root_hints}
PATH_SUFFIXES
"include"
)
if(_gss_INCLUDE_DIRS)
set(GSS_FLAVOUR "GNU")
set(GSS_PC_REQUIRES "gss")
endif()
endif()
endif()
# If we have headers, check if we can link libraries
if(GSS_FLAVOUR)
set(_gss_libdir_suffixes "")
set(_gss_libdir_hints ${_gss_root_hints})
get_filename_component(_gss_calculated_potential_root "${_gss_INCLUDE_DIRS}" DIRECTORY)
list(APPEND _gss_libdir_hints ${_gss_calculated_potential_root})
if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND _gss_libdir_suffixes "lib/AMD64")
if(GSS_FLAVOUR STREQUAL "GNU")
set(_gss_libname "gss")
elseif(GSS_FLAVOUR STREQUAL "MIT")
set(_gss_flavour "MIT")
if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND _gss_libdir_suffixes "lib/AMD64")
set(_gss_libname "gssapi64")
else()
set(_gss_libname "libgssapi")
endif()
else()
list(APPEND _gss_libdir_suffixes "lib/i386")
if(GSS_FLAVOUR STREQUAL "GNU")
set(_gss_libname "gss")
elseif(GSS_FLAVOUR STREQUAL "MIT")
list(APPEND _gss_libdir_suffixes "lib/i386")
set(_gss_libname "gssapi32")
else()
set(_gss_libname "libgssapi")
endif()
endif()
else()
list(APPEND _gss_libdir_suffixes "lib;lib64") # those suffixes are not checked for HINTS
if(GSS_FLAVOUR STREQUAL "GNU")
set(_gss_libname "gss")
elseif(GSS_FLAVOUR STREQUAL "MIT")
set(_gss_libname "gssapi_krb5")
else()
set(_gss_libname "gssapi")
list(APPEND _gss_libdir_suffixes "lib" "lib64") # those suffixes are not checked for HINTS
set(_gss_libname "gssapi_krb5")
endif()
endif()
else()
find_path(_gss_INCLUDE_DIRS NAMES "gss.h" HINTS ${_gss_root_hints} PATH_SUFFIXES "include")
find_library(_gss_LIBRARIES NAMES ${_gss_libname}
HINTS
${_gss_libdir_hints}
PATH_SUFFIXES
${_gss_libdir_suffixes}
)
if(_gss_INCLUDE_DIRS)
set(_gss_flavour "GNU")
set(_gss_pc_requires ${_gnu_modname})
set(_gss_libname "gss")
endif()
endif()
# If we have headers, look up libraries
if(_gss_flavour)
set(_gss_libdir_hints ${_gss_root_hints})
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20)
cmake_path(GET _gss_INCLUDE_DIRS PARENT_PATH _gss_calculated_potential_root)
else()
get_filename_component(_gss_calculated_potential_root "${_gss_INCLUDE_DIRS}" DIRECTORY)
endif()
list(APPEND _gss_libdir_hints ${_gss_calculated_potential_root})
find_library(_gss_LIBRARIES NAMES ${_gss_libname} HINTS ${_gss_libdir_hints} PATH_SUFFIXES ${_gss_libdir_suffixes})
endif()
endif()
if(NOT _gss_flavour)
message(FATAL_ERROR "GNU or MIT GSS is required")
endif()
else()
# _gss_MODULE_NAME set since CMake 3.16
if(_gss_MODULE_NAME STREQUAL _gnu_modname OR _gss_${_gnu_modname}_VERSION)
set(GSS_FLAVOUR "GNU")
set(GSS_PC_REQUIRES "gss")
if(NOT _gss_version) # for old CMake versions?
set(_gss_version ${_gss_${_gnu_modname}_VERSION})
endif()
elseif(_gss_MODULE_NAME STREQUAL _mit_modname OR _gss_${_mit_modname}_VERSION)
set(GSS_FLAVOUR "MIT")
set(GSS_PC_REQUIRES "mit-krb5-gssapi")
if(NOT _gss_version) # for old CMake versions?
set(_gss_version ${_gss_${_mit_modname}_VERSION})
endif()
# _gss_MODULE_NAME set since CMake 3.16.
# _pkg_check_modules_pkg_name is undocumented and used as a fallback for CMake <3.16 versions.
if(_gss_MODULE_NAME STREQUAL _gnu_modname OR _pkg_check_modules_pkg_name STREQUAL _gnu_modname)
set(_gss_flavour "GNU")
set(_gss_pc_requires ${_gnu_modname})
elseif(_gss_MODULE_NAME STREQUAL _mit_modname OR _pkg_check_modules_pkg_name STREQUAL _mit_modname)
set(_gss_flavour "MIT")
set(_gss_pc_requires ${_mit_modname})
else()
set(GSS_FLAVOUR "Heimdal")
set(GSS_PC_REQUIRES "heimdal-gssapi")
if(NOT _gss_version) # for old CMake versions?
set(_gss_version ${_gss_${_heimdal_modname}_VERSION})
endif()
message(FATAL_ERROR "GNU or MIT GSS is required")
endif()
message(STATUS "Found GSS/${GSS_FLAVOUR} (via pkg-config): ${_gss_INCLUDE_DIRS} (found version \"${_gss_version}\")")
message(STATUS "Found GSS/${_gss_flavour} (via pkg-config): ${_gss_INCLUDE_DIRS} (found version \"${_gss_version}\")")
endif()
string(REPLACE ";" " " _gss_CFLAGS "${_gss_CFLAGS}")
set(GSS_INCLUDE_DIRS ${_gss_INCLUDE_DIRS})
set(GSS_LIBRARIES ${_gss_LIBRARIES})
set(GSS_LIBRARY_DIRS ${_gss_LIBRARY_DIRS})
set(GSS_CFLAGS ${_gss_CFLAGS})
set(GSS_VERSION ${_gss_version})
if(GSS_FLAVOUR)
if(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "Heimdal")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_heimdal_manifest_file "Heimdal.Application.amd64.manifest")
if(NOT GSS_VERSION)
if(_gss_flavour STREQUAL "MIT")
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
cmake_host_system_information(RESULT _mit_version QUERY WINDOWS_REGISTRY
"HKLM/SOFTWARE/MIT/Kerberos/SDK/CurrentVersion" VALUE "VersionString")
else()
set(_heimdal_manifest_file "Heimdal.Application.x86.manifest")
get_filename_component(_mit_version
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos\\SDK\\CurrentVersion;VersionString]" NAME CACHE)
endif()
if(EXISTS "${GSS_INCLUDE_DIRS}/${_heimdal_manifest_file}")
file(STRINGS "${GSS_INCLUDE_DIRS}/${_heimdal_manifest_file}" _heimdal_version_str
REGEX "^.*version=\"[0-9]\\.[^\"]+\".*$")
string(REGEX MATCH "[0-9]\\.[^\"]+" GSS_VERSION "${_heimdal_version_str}")
endif()
if(NOT GSS_VERSION)
set(GSS_VERSION "Heimdal Unknown")
endif()
elseif(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "MIT")
get_filename_component(_mit_version "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos\\SDK\\CurrentVersion;VersionString]" NAME
CACHE)
if(WIN32 AND _mit_version)
set(GSS_VERSION "${_mit_version}")
else()
set(GSS_VERSION "MIT Unknown")
endif()
elseif(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "GNU")
if(GSS_INCLUDE_DIRS AND EXISTS "${GSS_INCLUDE_DIRS}/gss.h")
else() # GNU
if(_gss_INCLUDE_DIRS AND EXISTS "${_gss_INCLUDE_DIRS}/gss.h")
set(_version_regex "#[\t ]*define[\t ]+GSS_VERSION[\t ]+\"([^\"]*)\"")
file(STRINGS "${GSS_INCLUDE_DIRS}/gss.h" _version_str REGEX "${_version_regex}")
file(STRINGS "${_gss_INCLUDE_DIRS}/gss.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(GSS_VERSION "${_version_str}")
unset(_version_regex)
@ -345,12 +238,12 @@ endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GSS
REQUIRED_VARS
GSS_FLAVOUR
GSS_LIBRARIES
_gss_flavour
_gss_LIBRARIES
VERSION_VAR
GSS_VERSION
FAIL_MESSAGE
"Could NOT find GSS, try to set the path to GSS root folder in the system variable GSS_ROOT_DIR"
"Could NOT find GSS, try to set the absolute path to GSS installation root directory in the environment variable GSS_ROOT_DIR"
)
mark_as_advanced(
@ -363,3 +256,16 @@ mark_as_advanced(
_gss_PREFIX
_gss_version
)
if(GSS_FOUND)
if(NOT TARGET CURL::gss)
add_library(CURL::gss INTERFACE IMPORTED)
set_target_properties(CURL::gss PROPERTIES
INTERFACE_CURL_GSS_FLAVOUR "${_gss_flavour}"
INTERFACE_LIBCURL_PC_MODULES "${_gss_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_gss_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_gss_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_gss_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_gss_LIBRARIES}")
endif()
endif()

92
CMake/FindGnuTLS.cmake Normal file
View file

@ -0,0 +1,92 @@
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
# Find the GnuTLS library
#
# Input variables:
#
# - `GNUTLS_INCLUDE_DIR`: Absolute path to GnuTLS include directory.
# - `GNUTLS_LIBRARY`: Absolute path to `gnutls` library.
#
# Defines:
#
# - `GNUTLS_FOUND`: System has GnuTLS.
# - `GNUTLS_VERSION`: Version of GnuTLS.
# - `CURL::gnutls`: GnuTLS library target.
set(_gnutls_pc_requires "gnutls")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED GNUTLS_INCLUDE_DIR AND
NOT DEFINED GNUTLS_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_gnutls ${_gnutls_pc_requires})
endif()
if(_gnutls_FOUND)
set(GnuTLS_FOUND TRUE)
set(GNUTLS_FOUND TRUE)
set(GNUTLS_VERSION ${_gnutls_VERSION})
message(STATUS "Found GnuTLS (via pkg-config): ${_gnutls_INCLUDE_DIRS} (found version \"${GNUTLS_VERSION}\")")
else()
find_path(GNUTLS_INCLUDE_DIR NAMES "gnutls/gnutls.h")
find_library(GNUTLS_LIBRARY NAMES "gnutls" "libgnutls")
unset(GNUTLS_VERSION CACHE)
if(GNUTLS_INCLUDE_DIR AND EXISTS "${GNUTLS_INCLUDE_DIR}/gnutls/gnutls.h")
set(_version_regex "#[\t ]*define[\t ]+GNUTLS_VERSION[\t ]+\"([^\"]*)\"")
file(STRINGS "${GNUTLS_INCLUDE_DIR}/gnutls/gnutls.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(GNUTLS_VERSION "${_version_str}")
unset(_version_regex)
unset(_version_str)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GnuTLS
REQUIRED_VARS
GNUTLS_INCLUDE_DIR
GNUTLS_LIBRARY
VERSION_VAR
GNUTLS_VERSION
)
if(GNUTLS_FOUND)
set(_gnutls_INCLUDE_DIRS ${GNUTLS_INCLUDE_DIR})
set(_gnutls_LIBRARIES ${GNUTLS_LIBRARY})
endif()
mark_as_advanced(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY)
endif()
if(GNUTLS_FOUND)
if(NOT TARGET CURL::gnutls)
add_library(CURL::gnutls INTERFACE IMPORTED)
set_target_properties(CURL::gnutls PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_gnutls_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_gnutls_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_gnutls_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_gnutls_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_gnutls_LIBRARIES}")
endif()
endif()

View file

@ -25,36 +25,32 @@
#
# Input variables:
#
# - `LDAP_INCLUDE_DIR`: The ldap include directory.
# - `LDAP_LIBRARY`: Path to `ldap` library.
# - `LDAP_LBER_LIBRARY`: Path to `lber` library.
# - `LDAP_INCLUDE_DIR`: Absolute path to ldap include directory.
# - `LDAP_LIBRARY`: Absolute path to `ldap` library.
# - `LDAP_LBER_LIBRARY`: Absolute path to `lber` library.
#
# Result variables:
# Defines:
#
# - `LDAP_FOUND`: System has ldap.
# - `LDAP_INCLUDE_DIRS`: The ldap include directories.
# - `LDAP_LIBRARIES`: The ldap library names.
# - `LDAP_LIBRARY_DIRS`: The ldap library directories.
# - `LDAP_PC_REQUIRES`: The ldap pkg-config packages.
# - `LDAP_CFLAGS`: Required compiler flags.
# - `LDAP_VERSION`: Version of ldap.
# - `CURL::ldap`: ldap library target.
set(LDAP_PC_REQUIRES "ldap" "lber")
set(_ldap_pc_requires "ldap" "lber")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LDAP_INCLUDE_DIR AND
NOT DEFINED LDAP_LIBRARY AND
NOT DEFINED LDAP_LBER_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(LDAP ${LDAP_PC_REQUIRES})
pkg_check_modules(_ldap ${_ldap_pc_requires})
endif()
if(LDAP_FOUND)
set(LDAP_VERSION "${LDAP_ldap_VERSION}")
string(REPLACE ";" " " LDAP_CFLAGS "${LDAP_CFLAGS}")
message(STATUS "Found LDAP (via pkg-config): ${LDAP_INCLUDE_DIRS} (found version \"${LDAP_VERSION}\")")
if(_ldap_FOUND)
set(LDAP_FOUND TRUE)
set(LDAP_VERSION ${_ldap_ldap_VERSION})
message(STATUS "Found LDAP (via pkg-config): ${_ldap_INCLUDE_DIRS} (found version \"${LDAP_VERSION}\")")
else()
set(LDAP_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config
set(_ldap_pc_requires "") # Depend on pkg-config only when found via pkg-config
# On Apple the SDK LDAP gets picked up from
# 'MacOSX.sdk/System/Library/Frameworks/LDAP.framework/Headers', which contains
@ -99,9 +95,21 @@ else()
)
if(LDAP_FOUND)
set(LDAP_INCLUDE_DIRS ${LDAP_INCLUDE_DIR})
set(LDAP_LIBRARIES ${LDAP_LIBRARY} ${LDAP_LBER_LIBRARY})
set(_ldap_INCLUDE_DIRS ${LDAP_INCLUDE_DIR})
set(_ldap_LIBRARIES ${LDAP_LIBRARY} ${LDAP_LBER_LIBRARY})
endif()
mark_as_advanced(LDAP_INCLUDE_DIR LDAP_LIBRARY LDAP_LBER_LIBRARY)
endif()
if(LDAP_FOUND)
if(NOT TARGET CURL::ldap)
add_library(CURL::ldap INTERFACE IMPORTED)
set_target_properties(CURL::ldap PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_ldap_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_ldap_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_ldap_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_ldap_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_ldap_LIBRARIES}")
endif()
endif()

View file

@ -0,0 +1,61 @@
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
# Find the libbacktrace library
#
# Input variables:
#
# - `LIBBACKTRACE_INCLUDE_DIR`: Absolute path to libbacktrace include directory.
# - `LIBBACKTRACE_LIBRARY`: Absolute path to `libbacktrace` library.
#
# Defines:
#
# - `LIBBACKTRACE_FOUND`: System has libbacktrace.
# - `CURL::libbacktrace`: libbacktrace library target.
find_path(LIBBACKTRACE_INCLUDE_DIR NAMES "backtrace.h")
find_library(LIBBACKTRACE_LIBRARY NAMES "backtrace" "libbacktrace")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libbacktrace
REQUIRED_VARS
LIBBACKTRACE_INCLUDE_DIR
LIBBACKTRACE_LIBRARY
)
if(LIBBACKTRACE_FOUND)
set(_libbacktrace_INCLUDE_DIRS ${LIBBACKTRACE_INCLUDE_DIR})
set(_libbacktrace_LIBRARIES ${LIBBACKTRACE_LIBRARY})
if(NOT TARGET CURL::libbacktrace)
add_library(CURL::libbacktrace INTERFACE IMPORTED)
set_target_properties(CURL::libbacktrace PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libbacktrace_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libbacktrace_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libbacktrace_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libbacktrace_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libbacktrace_LIBRARIES}")
endif()
endif()
mark_as_advanced(LIBBACKTRACE_INCLUDE_DIR LIBBACKTRACE_LIBRARY)

View file

@ -25,32 +25,28 @@
#
# Input variables:
#
# - `LIBGSASL_INCLUDE_DIR`: The libgsasl include directory.
# - `LIBGSASL_LIBRARY`: Path to `libgsasl` library.
# - `LIBGSASL_INCLUDE_DIR`: Absolute path to libgsasl include directory.
# - `LIBGSASL_LIBRARY`: Absolute path to `libgsasl` library.
#
# Result variables:
# Defines:
#
# - `LIBGSASL_FOUND`: System has libgsasl.
# - `LIBGSASL_INCLUDE_DIRS`: The libgsasl include directories.
# - `LIBGSASL_LIBRARIES`: The libgsasl library names.
# - `LIBGSASL_LIBRARY_DIRS`: The libgsasl library directories.
# - `LIBGSASL_PC_REQUIRES`: The libgsasl pkg-config packages.
# - `LIBGSASL_CFLAGS`: Required compiler flags.
# - `LIBGSASL_VERSION`: Version of libgsasl.
# - `LIBGSASL_FOUND`: System has libgsasl.
# - `LIBGSASL_VERSION`: Version of libgsasl.
# - `CURL::libgsasl`: libgsasl library target.
set(LIBGSASL_PC_REQUIRES "libgsasl")
set(_libgsasl_pc_requires "libgsasl")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBGSASL_INCLUDE_DIR AND
NOT DEFINED LIBGSASL_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(LIBGSASL ${LIBGSASL_PC_REQUIRES})
pkg_check_modules(_libgsasl ${_libgsasl_pc_requires})
endif()
if(LIBGSASL_FOUND)
if(_libgsasl_FOUND)
set(Libgsasl_FOUND TRUE)
string(REPLACE ";" " " LIBGSASL_CFLAGS "${LIBGSASL_CFLAGS}")
message(STATUS "Found Libgsasl (via pkg-config): ${LIBGSASL_INCLUDE_DIRS} (found version \"${LIBGSASL_VERSION}\")")
set(LIBGSASL_FOUND TRUE)
message(STATUS "Found Libgsasl (via pkg-config): ${_libgsasl_INCLUDE_DIRS} (found version \"${LIBGSASL_VERSION}\")")
else()
find_path(LIBGSASL_INCLUDE_DIR NAMES "gsasl.h")
find_library(LIBGSASL_LIBRARY NAMES "gsasl" "libgsasl")
@ -75,9 +71,21 @@ else()
)
if(LIBGSASL_FOUND)
set(LIBGSASL_INCLUDE_DIRS ${LIBGSASL_INCLUDE_DIR})
set(LIBGSASL_LIBRARIES ${LIBGSASL_LIBRARY})
set(_libgsasl_INCLUDE_DIRS ${LIBGSASL_INCLUDE_DIR})
set(_libgsasl_LIBRARIES ${LIBGSASL_LIBRARY})
endif()
mark_as_advanced(LIBGSASL_INCLUDE_DIR LIBGSASL_LIBRARY)
endif()
if(LIBGSASL_FOUND)
if(NOT TARGET CURL::libgsasl)
add_library(CURL::libgsasl INTERFACE IMPORTED)
set_target_properties(CURL::libgsasl PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libgsasl_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libgsasl_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libgsasl_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libgsasl_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libgsasl_LIBRARIES}")
endif()
endif()

View file

@ -25,32 +25,29 @@
#
# Input variables:
#
# - `LIBIDN2_INCLUDE_DIR`: The libidn2 include directory.
# - `LIBIDN2_LIBRARY`: Path to `libidn2` library.
# - `LIBIDN2_INCLUDE_DIR`: Absolute path to libidn2 include directory.
# - `LIBIDN2_LIBRARY`: Absolute path to `libidn2` library.
#
# Result variables:
# Defines:
#
# - `LIBIDN2_FOUND`: System has libidn2.
# - `LIBIDN2_INCLUDE_DIRS`: The libidn2 include directories.
# - `LIBIDN2_LIBRARIES`: The libidn2 library names.
# - `LIBIDN2_LIBRARY_DIRS`: The libidn2 library directories.
# - `LIBIDN2_PC_REQUIRES`: The libidn2 pkg-config packages.
# - `LIBIDN2_CFLAGS`: Required compiler flags.
# - `LIBIDN2_VERSION`: Version of libidn2.
# - `LIBIDN2_FOUND`: System has libidn2.
# - `LIBIDN2_VERSION`: Version of libidn2.
# - `CURL::libidn2`: libidn2 library target.
set(LIBIDN2_PC_REQUIRES "libidn2")
set(_libidn2_pc_requires "libidn2")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBIDN2_INCLUDE_DIR AND
NOT DEFINED LIBIDN2_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(LIBIDN2 ${LIBIDN2_PC_REQUIRES})
pkg_check_modules(_libidn2 ${_libidn2_pc_requires})
endif()
if(LIBIDN2_FOUND)
if(_libidn2_FOUND)
set(Libidn2_FOUND TRUE)
string(REPLACE ";" " " LIBIDN2_CFLAGS "${LIBIDN2_CFLAGS}")
message(STATUS "Found Libidn2 (via pkg-config): ${LIBIDN2_INCLUDE_DIRS} (found version \"${LIBIDN2_VERSION}\")")
set(LIBIDN2_FOUND TRUE)
set(LIBIDN2_VERSION ${_libidn2_VERSION})
message(STATUS "Found Libidn2 (via pkg-config): ${_libidn2_INCLUDE_DIRS} (found version \"${LIBIDN2_VERSION}\")")
else()
find_path(LIBIDN2_INCLUDE_DIR NAMES "idn2.h")
find_library(LIBIDN2_LIBRARY NAMES "idn2" "libidn2")
@ -75,9 +72,21 @@ else()
)
if(LIBIDN2_FOUND)
set(LIBIDN2_INCLUDE_DIRS ${LIBIDN2_INCLUDE_DIR})
set(LIBIDN2_LIBRARIES ${LIBIDN2_LIBRARY})
set(_libidn2_INCLUDE_DIRS ${LIBIDN2_INCLUDE_DIR})
set(_libidn2_LIBRARIES ${LIBIDN2_LIBRARY})
endif()
mark_as_advanced(LIBIDN2_INCLUDE_DIR LIBIDN2_LIBRARY)
endif()
if(LIBIDN2_FOUND)
if(NOT TARGET CURL::libidn2)
add_library(CURL::libidn2 INTERFACE IMPORTED)
set_target_properties(CURL::libidn2 PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libidn2_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libidn2_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libidn2_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libidn2_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libidn2_LIBRARIES}")
endif()
endif()

View file

@ -25,32 +25,29 @@
#
# Input variables:
#
# - `LIBPSL_INCLUDE_DIR`: The libpsl include directory.
# - `LIBPSL_LIBRARY`: Path to `libpsl` library.
# - `LIBPSL_INCLUDE_DIR`: Absolute path to libpsl include directory.
# - `LIBPSL_LIBRARY`: Absolute path to `libpsl` library.
#
# Result variables:
# Defines:
#
# - `LIBPSL_FOUND`: System has libpsl.
# - `LIBPSL_INCLUDE_DIRS`: The libpsl include directories.
# - `LIBPSL_LIBRARIES`: The libpsl library names.
# - `LIBPSL_LIBRARY_DIRS`: The libpsl library directories.
# - `LIBPSL_PC_REQUIRES`: The libpsl pkg-config packages.
# - `LIBPSL_CFLAGS`: Required compiler flags.
# - `LIBPSL_VERSION`: Version of libpsl.
# - `LIBPSL_FOUND`: System has libpsl.
# - `LIBPSL_VERSION`: Version of libpsl.
# - `CURL::libpsl`: libpsl library target.
set(LIBPSL_PC_REQUIRES "libpsl")
set(_libpsl_pc_requires "libpsl")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBPSL_INCLUDE_DIR AND
NOT DEFINED LIBPSL_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(LIBPSL ${LIBPSL_PC_REQUIRES})
pkg_check_modules(_libpsl ${_libpsl_pc_requires})
endif()
if(LIBPSL_FOUND AND LIBPSL_INCLUDE_DIRS)
if(_libpsl_FOUND AND _libpsl_INCLUDE_DIRS)
set(Libpsl_FOUND TRUE)
string(REPLACE ";" " " LIBPSL_CFLAGS "${LIBPSL_CFLAGS}")
message(STATUS "Found Libpsl (via pkg-config): ${LIBPSL_INCLUDE_DIRS} (found version \"${LIBPSL_VERSION}\")")
set(LIBPSL_FOUND TRUE)
set(LIBPSL_VERSION ${_libpsl_VERSION})
message(STATUS "Found Libpsl (via pkg-config): ${_libpsl_INCLUDE_DIRS} (found version \"${LIBPSL_VERSION}\")")
else()
find_path(LIBPSL_INCLUDE_DIR NAMES "libpsl.h")
find_library(LIBPSL_LIBRARY NAMES "psl" "libpsl")
@ -75,9 +72,21 @@ else()
)
if(LIBPSL_FOUND)
set(LIBPSL_INCLUDE_DIRS ${LIBPSL_INCLUDE_DIR})
set(LIBPSL_LIBRARIES ${LIBPSL_LIBRARY})
set(_libpsl_INCLUDE_DIRS ${LIBPSL_INCLUDE_DIR})
set(_libpsl_LIBRARIES ${LIBPSL_LIBRARY})
endif()
mark_as_advanced(LIBPSL_INCLUDE_DIR LIBPSL_LIBRARY)
endif()
if(LIBPSL_FOUND)
if(NOT TARGET CURL::libpsl)
add_library(CURL::libpsl INTERFACE IMPORTED)
set_target_properties(CURL::libpsl PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libpsl_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libpsl_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libpsl_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libpsl_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libpsl_LIBRARIES}")
endif()
endif()

View file

@ -1,103 +0,0 @@
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
# Find the librtmp library
#
# Input variables:
#
# - `LIBRTMP_INCLUDE_DIR`: The librtmp include directory.
# - `LIBRTMP_LIBRARY`: Path to `librtmp` library.
#
# Result variables:
#
# - `LIBRTMP_FOUND`: System has librtmp.
# - `LIBRTMP_INCLUDE_DIRS`: The librtmp include directories.
# - `LIBRTMP_LIBRARIES`: The librtmp library names.
# - `LIBRTMP_LIBRARY_DIRS`: The librtmp library directories.
# - `LIBRTMP_PC_REQUIRES`: The librtmp pkg-config packages.
# - `LIBRTMP_CFLAGS`: Required compiler flags.
# - `LIBRTMP_VERSION`: Version of librtmp.
set(LIBRTMP_PC_REQUIRES "librtmp")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBRTMP_INCLUDE_DIR AND
NOT DEFINED LIBRTMP_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(LIBRTMP ${LIBRTMP_PC_REQUIRES})
endif()
if(LIBRTMP_FOUND AND LIBRTMP_INCLUDE_DIRS)
set(Librtmp_FOUND TRUE)
string(REPLACE ";" " " LIBRTMP_CFLAGS "${LIBRTMP_CFLAGS}")
message(STATUS "Found Librtmp (via pkg-config): ${LIBRTMP_INCLUDE_DIRS} (found version \"${LIBRTMP_VERSION}\")")
else()
find_path(LIBRTMP_INCLUDE_DIR NAMES "librtmp/rtmp.h")
find_library(LIBRTMP_LIBRARY NAMES "rtmp")
unset(LIBRTMP_VERSION CACHE)
if(LIBRTMP_INCLUDE_DIR AND EXISTS "${LIBRTMP_INCLUDE_DIR}/librtmp/rtmp.h")
set(_version_regex "#[\t ]*define[\t ]+RTMP_LIB_VERSION[\t ]+0x([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F]).*")
file(STRINGS "${LIBRTMP_INCLUDE_DIR}/librtmp/rtmp.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str1 "${_version_str}")
string(REGEX REPLACE "${_version_regex}" "\\2" _version_str2 "${_version_str}")
if(CMAKE_VERSION VERSION_LESS 3.13)
# No support for hex version numbers, just strip leading zeroes
string(REGEX REPLACE "^0" "" _version_str1 "${_version_str1}")
string(REGEX REPLACE "^0" "" _version_str2 "${_version_str2}")
else()
math(EXPR _version_str1 "0x${_version_str1}" OUTPUT_FORMAT DECIMAL)
math(EXPR _version_str2 "0x${_version_str2}" OUTPUT_FORMAT DECIMAL)
endif()
set(LIBRTMP_VERSION "${_version_str1}.${_version_str2}")
unset(_version_regex)
unset(_version_str1)
unset(_version_str2)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Librtmp
REQUIRED_VARS
LIBRTMP_INCLUDE_DIR
LIBRTMP_LIBRARY
VERSION_VAR
LIBRTMP_VERSION
)
if(LIBRTMP_FOUND)
set(LIBRTMP_INCLUDE_DIRS ${LIBRTMP_INCLUDE_DIR})
set(LIBRTMP_LIBRARIES ${LIBRTMP_LIBRARY})
endif()
mark_as_advanced(LIBRTMP_INCLUDE_DIR LIBRTMP_LIBRARY)
# Necessary when linking a static librtmp
find_package(OpenSSL)
if(OPENSSL_FOUND)
list(APPEND LIBRTMP_LIBRARIES OpenSSL::SSL OpenSSL::Crypto)
endif()
endif()
if(LIBRTMP_FOUND AND WIN32)
list(APPEND LIBRTMP_LIBRARIES "winmm")
endif()

View file

@ -25,35 +25,44 @@
#
# Input variables:
#
# - `LIBSSH_INCLUDE_DIR`: The libssh include directory.
# - `LIBSSH_LIBRARY`: Path to libssh library.
# - `LIBSSH_INCLUDE_DIR`: Absolute path to libssh include directory.
# - `LIBSSH_LIBRARY`: Absolute path to `libssh` library.
# - `LIBSSH_USE_STATIC_LIBS`: Configure for static libssh libraries.
#
# Result variables:
# Defines:
#
# - `LIBSSH_FOUND`: System has libssh.
# - `LIBSSH_INCLUDE_DIRS`: The libssh include directories.
# - `LIBSSH_LIBRARIES`: The libssh library names.
# - `LIBSSH_LIBRARY_DIRS`: The libssh library directories.
# - `LIBSSH_PC_REQUIRES`: The libssh pkg-config packages.
# - `LIBSSH_CFLAGS`: Required compiler flags.
# - `LIBSSH_VERSION`: Version of libssh.
# - `LIBSSH_FOUND`: System has libssh.
# - `LIBSSH_VERSION`: Version of libssh.
# - `CURL::libssh`: libssh library target.
set(LIBSSH_PC_REQUIRES "libssh")
set(_libssh_pc_requires "libssh")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBSSH_INCLUDE_DIR AND
NOT DEFINED LIBSSH_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(LIBSSH ${LIBSSH_PC_REQUIRES})
pkg_check_modules(_libssh ${_libssh_pc_requires})
endif()
if(LIBSSH_FOUND)
if(_libssh_FOUND)
set(Libssh_FOUND TRUE)
string(REPLACE ";" " " LIBSSH_CFLAGS "${LIBSSH_CFLAGS}")
message(STATUS "Found Libssh (via pkg-config): ${LIBSSH_INCLUDE_DIRS} (found version \"${LIBSSH_VERSION}\")")
set(LIBSSH_FOUND TRUE)
set(LIBSSH_VERSION ${_libssh_VERSION})
if(LIBSSH_USE_STATIC_LIBS)
set(_libssh_CFLAGS "${_libssh_STATIC_CFLAGS}")
set(_libssh_INCLUDE_DIRS "${_libssh_STATIC_INCLUDE_DIRS}")
set(_libssh_LIBRARY_DIRS "${_libssh_STATIC_LIBRARY_DIRS}")
set(_libssh_LIBRARIES "${_libssh_STATIC_LIBRARIES}")
endif()
message(STATUS "Found Libssh (via pkg-config): ${_libssh_INCLUDE_DIRS} (found version \"${LIBSSH_VERSION}\")")
else()
find_path(LIBSSH_INCLUDE_DIR NAMES "libssh/libssh.h")
find_library(LIBSSH_LIBRARY NAMES "ssh" "libssh")
if(LIBSSH_USE_STATIC_LIBS)
set(_libssh_CFLAGS "-DLIBSSH_STATIC")
find_library(LIBSSH_LIBRARY NAMES "ssh_static" "libssh_static" "ssh" "libssh")
else()
find_library(LIBSSH_LIBRARY NAMES "ssh" "libssh")
endif()
unset(LIBSSH_VERSION CACHE)
if(LIBSSH_INCLUDE_DIR AND EXISTS "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h")
@ -85,13 +94,25 @@ else()
)
if(LIBSSH_FOUND)
set(LIBSSH_INCLUDE_DIRS ${LIBSSH_INCLUDE_DIR})
set(LIBSSH_LIBRARIES ${LIBSSH_LIBRARY})
set(_libssh_INCLUDE_DIRS ${LIBSSH_INCLUDE_DIR})
set(_libssh_LIBRARIES ${LIBSSH_LIBRARY})
endif()
mark_as_advanced(LIBSSH_INCLUDE_DIR LIBSSH_LIBRARY)
endif()
if(LIBSSH_FOUND AND WIN32)
list(APPEND LIBSSH_LIBRARIES "iphlpapi") # for if_nametoindex
if(LIBSSH_FOUND)
if(WIN32)
list(APPEND _libssh_LIBRARIES "iphlpapi") # for if_nametoindex
endif()
if(NOT TARGET CURL::libssh)
add_library(CURL::libssh INTERFACE IMPORTED)
set_target_properties(CURL::libssh PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libssh_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libssh_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libssh_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libssh_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libssh_LIBRARIES}")
endif()
endif()

View file

@ -25,35 +25,57 @@
#
# Input variables:
#
# - `LIBSSH2_INCLUDE_DIR`: The libssh2 include directory.
# - `LIBSSH2_LIBRARY`: Path to `libssh2` library.
# - `LIBSSH2_INCLUDE_DIR`: Absolute path to libssh2 include directory.
# - `LIBSSH2_LIBRARY`: Absolute path to `libssh2` library.
# - `LIBSSH2_USE_STATIC_LIBS`: Configure for static libssh2 libraries.
#
# Result variables:
# Defines:
#
# - `LIBSSH2_FOUND`: System has libssh2.
# - `LIBSSH2_INCLUDE_DIRS`: The libssh2 include directories.
# - `LIBSSH2_LIBRARIES`: The libssh2 library names.
# - `LIBSSH2_LIBRARY_DIRS`: The libssh2 library directories.
# - `LIBSSH2_PC_REQUIRES`: The libssh2 pkg-config packages.
# - `LIBSSH2_CFLAGS`: Required compiler flags.
# - `LIBSSH2_VERSION`: Version of libssh2.
# - `LIBSSH2_FOUND`: System has libssh2.
# - `LIBSSH2_VERSION`: Version of libssh2.
# - `CURL::libssh2`: libssh2 library target.
set(LIBSSH2_PC_REQUIRES "libssh2")
set(_libssh2_pc_requires "libssh2")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBSSH2_INCLUDE_DIR AND
if(NOT DEFINED LIBSSH2_INCLUDE_DIR AND
NOT DEFINED LIBSSH2_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(LIBSSH2 ${LIBSSH2_PC_REQUIRES})
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_libssh2 ${_libssh2_pc_requires})
endif()
if(NOT _libssh2_FOUND AND CURL_USE_CMAKECONFIG)
find_package(libssh2 CONFIG QUIET)
endif()
endif()
if(LIBSSH2_FOUND AND LIBSSH2_INCLUDE_DIRS)
if(_libssh2_FOUND AND _libssh2_INCLUDE_DIRS)
set(Libssh2_FOUND TRUE)
string(REPLACE ";" " " LIBSSH2_CFLAGS "${LIBSSH2_CFLAGS}")
message(STATUS "Found Libssh2 (via pkg-config): ${LIBSSH2_INCLUDE_DIRS} (found version \"${LIBSSH2_VERSION}\")")
set(LIBSSH2_FOUND TRUE)
set(LIBSSH2_VERSION ${_libssh2_VERSION})
if(LIBSSH2_USE_STATIC_LIBS)
set(_libssh2_CFLAGS "${_libssh2_STATIC_CFLAGS}")
set(_libssh2_INCLUDE_DIRS "${_libssh2_STATIC_INCLUDE_DIRS}")
set(_libssh2_LIBRARY_DIRS "${_libssh2_STATIC_LIBRARY_DIRS}")
set(_libssh2_LIBRARIES "${_libssh2_STATIC_LIBRARIES}")
endif()
message(STATUS "Found Libssh2 (via pkg-config): ${_libssh2_INCLUDE_DIRS} (found version \"${LIBSSH2_VERSION}\")")
elseif(libssh2_CONFIG)
set(Libssh2_FOUND TRUE)
set(LIBSSH2_FOUND TRUE)
set(LIBSSH2_VERSION ${libssh2_VERSION})
if(LIBSSH2_USE_STATIC_LIBS)
set(_libssh2_LIBRARIES libssh2::libssh2_static)
else()
set(_libssh2_LIBRARIES libssh2::libssh2)
endif()
message(STATUS "Found Libssh2 (via CMake Config): ${libssh2_CONFIG} (found version \"${LIBSSH2_VERSION}\")")
else()
find_path(LIBSSH2_INCLUDE_DIR NAMES "libssh2.h")
find_library(LIBSSH2_LIBRARY NAMES "ssh2" "libssh2")
if(LIBSSH2_USE_STATIC_LIBS)
find_library(LIBSSH2_LIBRARY NAMES "ssh2_static" "libssh2_static" "ssh2" "libssh2")
else()
find_library(LIBSSH2_LIBRARY NAMES "ssh2" "libssh2")
endif()
unset(LIBSSH2_VERSION CACHE)
if(LIBSSH2_INCLUDE_DIR AND EXISTS "${LIBSSH2_INCLUDE_DIR}/libssh2.h")
@ -75,9 +97,21 @@ else()
)
if(LIBSSH2_FOUND)
set(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR})
set(LIBSSH2_LIBRARIES ${LIBSSH2_LIBRARY})
set(_libssh2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR})
set(_libssh2_LIBRARIES ${LIBSSH2_LIBRARY})
endif()
mark_as_advanced(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY)
endif()
if(LIBSSH2_FOUND)
if(NOT TARGET CURL::libssh2)
add_library(CURL::libssh2 INTERFACE IMPORTED)
set_target_properties(CURL::libssh2 PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libssh2_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libssh2_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libssh2_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libssh2_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libssh2_LIBRARIES}")
endif()
endif()

View file

@ -25,32 +25,29 @@
#
# Input variables:
#
# - `LIBUV_INCLUDE_DIR`: The libuv include directory.
# - `LIBUV_LIBRARY`: Path to `libuv` library.
# - `LIBUV_INCLUDE_DIR`: Absolute path to libuv include directory.
# - `LIBUV_LIBRARY`: Absolute path to `libuv` library.
#
# Result variables:
# Defines:
#
# - `LIBUV_FOUND`: System has libuv.
# - `LIBUV_INCLUDE_DIRS`: The libuv include directories.
# - `LIBUV_LIBRARIES`: The libuv library names.
# - `LIBUV_LIBRARY_DIRS`: The libuv library directories.
# - `LIBUV_PC_REQUIRES`: The libuv pkg-config packages.
# - `LIBUV_CFLAGS`: Required compiler flags.
# - `LIBUV_VERSION`: Version of libuv.
# - `LIBUV_FOUND`: System has libuv.
# - `LIBUV_VERSION`: Version of libuv.
# - `CURL::libuv`: libuv library target.
set(LIBUV_PC_REQUIRES "libuv")
set(_libuv_pc_requires "libuv")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBUV_INCLUDE_DIR AND
NOT DEFINED LIBUV_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(LIBUV ${LIBUV_PC_REQUIRES})
pkg_check_modules(_libuv ${_libuv_pc_requires})
endif()
if(LIBUV_FOUND)
if(_libuv_FOUND)
set(Libuv_FOUND TRUE)
string(REPLACE ";" " " LIBUV_CFLAGS "${LIBUV_CFLAGS}")
message(STATUS "Found Libuv (via pkg-config): ${LIBUV_INCLUDE_DIRS} (found version \"${LIBUV_VERSION}\")")
set(LIBUV_FOUND TRUE)
set(LIBUV_VERSION ${_libuv_VERSION})
message(STATUS "Found Libuv (via pkg-config): ${_libuv_INCLUDE_DIRS} (found version \"${LIBUV_VERSION}\")")
else()
find_path(LIBUV_INCLUDE_DIR NAMES "uv.h")
find_library(LIBUV_LIBRARY NAMES "uv" "libuv")
@ -85,9 +82,21 @@ else()
)
if(LIBUV_FOUND)
set(LIBUV_INCLUDE_DIRS ${LIBUV_INCLUDE_DIR})
set(LIBUV_LIBRARIES ${LIBUV_LIBRARY})
set(_libuv_INCLUDE_DIRS ${LIBUV_INCLUDE_DIR})
set(_libuv_LIBRARIES ${LIBUV_LIBRARY})
endif()
mark_as_advanced(LIBUV_INCLUDE_DIR LIBUV_LIBRARY)
endif()
if(LIBUV_FOUND)
if(NOT TARGET CURL::libuv)
add_library(CURL::libuv INTERFACE IMPORTED)
set_target_properties(CURL::libuv PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libuv_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libuv_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libuv_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libuv_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libuv_LIBRARIES}")
endif()
endif()

View file

@ -25,20 +25,17 @@
#
# Input variables:
#
# - `MBEDTLS_INCLUDE_DIR`: The mbedTLS include directory.
# - `MBEDTLS_LIBRARY`: Path to `mbedtls` library.
# - `MBEDX509_LIBRARY`: Path to `mbedx509` library.
# - `MBEDCRYPTO_LIBRARY`: Path to `mbedcrypto` library.
# - `MBEDTLS_INCLUDE_DIR`: Absolute path to mbedTLS include directory.
# - `MBEDTLS_LIBRARY`: Absolute path to `mbedtls` library.
# - `MBEDX509_LIBRARY`: Absolute path to `mbedx509` library.
# - `MBEDCRYPTO_LIBRARY`: Absolute path to `mbedcrypto` library.
# - `MBEDTLS_USE_STATIC_LIBS`: Configure for static mbedTLS libraries.
#
# Result variables:
# Defines:
#
# - `MBEDTLS_FOUND`: System has mbedTLS.
# - `MBEDTLS_INCLUDE_DIRS`: The mbedTLS include directories.
# - `MBEDTLS_LIBRARIES`: The mbedTLS library names.
# - `MBEDTLS_LIBRARY_DIRS`: The mbedTLS library directories.
# - `MBEDTLS_PC_REQUIRES`: The mbedTLS pkg-config packages.
# - `MBEDTLS_CFLAGS`: Required compiler flags.
# - `MBEDTLS_VERSION`: Version of mbedTLS.
# - `MBEDTLS_FOUND`: System has mbedTLS.
# - `MBEDTLS_VERSION`: Version of mbedTLS.
# - `CURL::mbedtls`: mbedTLS library target.
if(DEFINED MBEDTLS_INCLUDE_DIRS AND NOT DEFINED MBEDTLS_INCLUDE_DIR)
message(WARNING "MBEDTLS_INCLUDE_DIRS is deprecated, use MBEDTLS_INCLUDE_DIR instead.")
@ -46,29 +43,57 @@ if(DEFINED MBEDTLS_INCLUDE_DIRS AND NOT DEFINED MBEDTLS_INCLUDE_DIR)
unset(MBEDTLS_INCLUDE_DIRS)
endif()
set(MBEDTLS_PC_REQUIRES "mbedtls" "mbedx509" "mbedcrypto")
set(_mbedtls_pc_requires "mbedtls" "mbedx509" "mbedcrypto")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED MBEDTLS_INCLUDE_DIR AND
if(NOT DEFINED MBEDTLS_INCLUDE_DIR AND
NOT DEFINED MBEDTLS_LIBRARY AND
NOT DEFINED MBEDX509_LIBRARY AND
NOT DEFINED MBEDCRYPTO_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(MBEDTLS ${MBEDTLS_PC_REQUIRES})
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_mbedtls ${_mbedtls_pc_requires})
endif()
if(NOT _mbedtls_FOUND AND CURL_USE_CMAKECONFIG)
find_package(MbedTLS CONFIG QUIET)
endif()
endif()
if(MBEDTLS_FOUND)
if(_mbedtls_FOUND)
set(MbedTLS_FOUND TRUE)
set(MBEDTLS_VERSION "${MBEDTLS_mbedtls_VERSION}")
string(REPLACE ";" " " MBEDTLS_CFLAGS "${MBEDTLS_CFLAGS}")
message(STATUS "Found MbedTLS (via pkg-config): ${MBEDTLS_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")")
set(MBEDTLS_FOUND TRUE)
set(MBEDTLS_VERSION ${_mbedtls_mbedtls_VERSION})
if(MBEDTLS_USE_STATIC_LIBS)
set(_mbedtls_CFLAGS "${_mbedtls_STATIC_CFLAGS}")
set(_mbedtls_INCLUDE_DIRS "${_mbedtls_STATIC_INCLUDE_DIRS}")
set(_mbedtls_LIBRARY_DIRS "${_mbedtls_STATIC_LIBRARY_DIRS}")
set(_mbedtls_LIBRARIES "${_mbedtls_STATIC_LIBRARIES}")
endif()
message(STATUS "Found MbedTLS (via pkg-config): ${_mbedtls_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")")
elseif(MbedTLS_CONFIG)
set(MbedTLS_FOUND TRUE)
set(MBEDTLS_FOUND TRUE)
set(MBEDTLS_VERSION ${MbedTLS_VERSION})
if(MBEDTLS_VERSION GREATER_EQUAL 4.0.0)
set(_mbedtls_LIBRARIES MbedTLS::tfpsacrypto)
else()
set(_mbedtls_LIBRARIES MbedTLS::mbedcrypto)
endif()
list(APPEND _mbedtls_LIBRARIES MbedTLS::mbedx509 MbedTLS::mbedtls)
message(STATUS "Found MbedTLS (via CMake Config): ${MbedTLS_CONFIG} (found version \"${MBEDTLS_VERSION}\")")
else()
set(MBEDTLS_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config
set(_mbedtls_pc_requires "") # Depend on pkg-config only when found via pkg-config
find_path(MBEDTLS_INCLUDE_DIR NAMES "mbedtls/ssl.h")
find_library(MBEDTLS_LIBRARY NAMES "mbedtls" "libmbedtls")
find_library(MBEDX509_LIBRARY NAMES "mbedx509" "libmbedx509")
find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto" "libmbedcrypto")
if(MBEDTLS_USE_STATIC_LIBS)
find_library(MBEDTLS_LIBRARY NAMES "mbedtls_static" "libmbedtls_static" "mbedtls" "libmbedtls")
find_library(MBEDX509_LIBRARY NAMES "mbedx509_static" "libmbedx509_static" "mbedx509" "libmbedx509")
find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto_static" "libmbedcrypto_static" "mbedcrypto" "libmbedcrypto"
"tfpsacrypto_static" "libtfpsacrypto_static" "tfpsacrypto" "libtfpsacrypto")
else()
find_library(MBEDTLS_LIBRARY NAMES "mbedtls" "libmbedtls")
find_library(MBEDX509_LIBRARY NAMES "mbedx509" "libmbedx509")
find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto" "libmbedcrypto" "tfpsacrypto" "libtfpsacrypto")
endif()
unset(MBEDTLS_VERSION CACHE)
if(MBEDTLS_INCLUDE_DIR AND EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h")
@ -92,9 +117,21 @@ else()
)
if(MBEDTLS_FOUND)
set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY})
set(_mbedtls_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
set(_mbedtls_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY})
endif()
mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
endif()
if(MBEDTLS_FOUND)
if(NOT TARGET CURL::mbedtls)
add_library(CURL::mbedtls INTERFACE IMPORTED)
set_target_properties(CURL::mbedtls PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_mbedtls_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_mbedtls_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_mbedtls_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_mbedtls_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_mbedtls_LIBRARIES}")
endif()
endif()

View file

@ -25,34 +25,56 @@
#
# Input variables:
#
# - `NGHTTP2_INCLUDE_DIR`: The nghttp2 include directory.
# - `NGHTTP2_LIBRARY`: Path to `nghttp2` library.
# - `NGHTTP2_INCLUDE_DIR`: Absolute path to nghttp2 include directory.
# - `NGHTTP2_LIBRARY`: Absolute path to `nghttp2` library.
# - `NGHTTP2_USE_STATIC_LIBS`: Configure for static nghttp2 libraries.
#
# Result variables:
# Defines:
#
# - `NGHTTP2_FOUND`: System has nghttp2.
# - `NGHTTP2_INCLUDE_DIRS`: The nghttp2 include directories.
# - `NGHTTP2_LIBRARIES`: The nghttp2 library names.
# - `NGHTTP2_LIBRARY_DIRS`: The nghttp2 library directories.
# - `NGHTTP2_PC_REQUIRES`: The nghttp2 pkg-config packages.
# - `NGHTTP2_CFLAGS`: Required compiler flags.
# - `NGHTTP2_VERSION`: Version of nghttp2.
# - `NGHTTP2_FOUND`: System has nghttp2.
# - `NGHTTP2_VERSION`: Version of nghttp2.
# - `CURL::nghttp2`: nghttp2 library target.
set(NGHTTP2_PC_REQUIRES "libnghttp2")
set(_nghttp2_pc_requires "libnghttp2")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED NGHTTP2_INCLUDE_DIR AND
if(NOT DEFINED NGHTTP2_INCLUDE_DIR AND
NOT DEFINED NGHTTP2_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(NGHTTP2 ${NGHTTP2_PC_REQUIRES})
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_nghttp2 ${_nghttp2_pc_requires})
endif()
if(NOT _nghttp2_FOUND AND CURL_USE_CMAKECONFIG)
find_package(nghttp2 CONFIG QUIET)
endif()
endif()
if(NGHTTP2_FOUND)
string(REPLACE ";" " " NGHTTP2_CFLAGS "${NGHTTP2_CFLAGS}")
message(STATUS "Found NGHTTP2 (via pkg-config): ${NGHTTP2_INCLUDE_DIRS} (found version \"${NGHTTP2_VERSION}\")")
if(_nghttp2_FOUND)
set(NGHTTP2_FOUND TRUE)
set(NGHTTP2_VERSION ${_nghttp2_VERSION})
if(NGHTTP2_USE_STATIC_LIBS)
set(_nghttp2_CFLAGS "${_nghttp2_STATIC_CFLAGS}")
set(_nghttp2_INCLUDE_DIRS "${_nghttp2_STATIC_INCLUDE_DIRS}")
set(_nghttp2_LIBRARY_DIRS "${_nghttp2_STATIC_LIBRARY_DIRS}")
set(_nghttp2_LIBRARIES "${_nghttp2_STATIC_LIBRARIES}")
endif()
message(STATUS "Found NGHTTP2 (via pkg-config): ${_nghttp2_INCLUDE_DIRS} (found version \"${NGHTTP2_VERSION}\")")
elseif(nghttp2_CONFIG)
set(NGHTTP2_FOUND TRUE)
set(NGHTTP2_VERSION ${nghttp2_VERSION})
if(NGHTTP2_USE_STATIC_LIBS)
set(_nghttp2_LIBRARIES nghttp2::nghttp2_static)
else()
set(_nghttp2_LIBRARIES nghttp2::nghttp2)
endif()
message(STATUS "Found NGHTTP2 (via CMake Config): ${nghttp2_CONFIG} (found version \"${NGHTTP2_VERSION}\")")
else()
find_path(NGHTTP2_INCLUDE_DIR NAMES "nghttp2/nghttp2.h")
find_library(NGHTTP2_LIBRARY NAMES "nghttp2" "nghttp2_static")
if(NGHTTP2_USE_STATIC_LIBS)
set(_nghttp2_CFLAGS "-DNGHTTP2_STATICLIB")
find_library(NGHTTP2_LIBRARY NAMES "nghttp2_static" "nghttp2")
else()
find_library(NGHTTP2_LIBRARY NAMES "nghttp2" "nghttp2_static")
endif()
unset(NGHTTP2_VERSION CACHE)
if(NGHTTP2_INCLUDE_DIR AND EXISTS "${NGHTTP2_INCLUDE_DIR}/nghttp2/nghttp2ver.h")
@ -74,9 +96,21 @@ else()
)
if(NGHTTP2_FOUND)
set(NGHTTP2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR})
set(NGHTTP2_LIBRARIES ${NGHTTP2_LIBRARY})
set(_nghttp2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR})
set(_nghttp2_LIBRARIES ${NGHTTP2_LIBRARY})
endif()
mark_as_advanced(NGHTTP2_INCLUDE_DIR NGHTTP2_LIBRARY)
endif()
if(NGHTTP2_FOUND)
if(NOT TARGET CURL::nghttp2)
add_library(CURL::nghttp2 INTERFACE IMPORTED)
set_target_properties(CURL::nghttp2 PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_nghttp2_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_nghttp2_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_nghttp2_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_nghttp2_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_nghttp2_LIBRARIES}")
endif()
endif()

View file

@ -25,34 +25,56 @@
#
# Input variables:
#
# - `NGHTTP3_INCLUDE_DIR`: The nghttp3 include directory.
# - `NGHTTP3_LIBRARY`: Path to `nghttp3` library.
# - `NGHTTP3_INCLUDE_DIR`: Absolute path to nghttp3 include directory.
# - `NGHTTP3_LIBRARY`: Absolute path to `nghttp3` library.
# - `NGHTTP3_USE_STATIC_LIBS`: Configure for static nghttp3 libraries.
#
# Result variables:
# Defines:
#
# - `NGHTTP3_FOUND`: System has nghttp3.
# - `NGHTTP3_INCLUDE_DIRS`: The nghttp3 include directories.
# - `NGHTTP3_LIBRARIES`: The nghttp3 library names.
# - `NGHTTP3_LIBRARY_DIRS`: The nghttp3 library directories.
# - `NGHTTP3_PC_REQUIRES`: The nghttp3 pkg-config packages.
# - `NGHTTP3_CFLAGS`: Required compiler flags.
# - `NGHTTP3_VERSION`: Version of nghttp3.
# - `NGHTTP3_FOUND`: System has nghttp3.
# - `NGHTTP3_VERSION`: Version of nghttp3.
# - `CURL::nghttp3`: nghttp3 library target.
set(NGHTTP3_PC_REQUIRES "libnghttp3")
set(_nghttp3_pc_requires "libnghttp3")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED NGHTTP3_INCLUDE_DIR AND
if(NOT DEFINED NGHTTP3_INCLUDE_DIR AND
NOT DEFINED NGHTTP3_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(NGHTTP3 ${NGHTTP3_PC_REQUIRES})
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_nghttp3 ${_nghttp3_pc_requires})
endif()
if(NOT _nghttp3_FOUND AND CURL_USE_CMAKECONFIG)
find_package(nghttp3 CONFIG QUIET)
endif()
endif()
if(NGHTTP3_FOUND)
string(REPLACE ";" " " NGHTTP3_CFLAGS "${NGHTTP3_CFLAGS}")
message(STATUS "Found NGHTTP3 (via pkg-config): ${NGHTTP3_INCLUDE_DIRS} (found version \"${NGHTTP3_VERSION}\")")
if(_nghttp3_FOUND)
set(NGHTTP3_FOUND TRUE)
set(NGHTTP3_VERSION ${_nghttp3_VERSION})
if(NGHTTP3_USE_STATIC_LIBS)
set(_nghttp3_CFLAGS "${_nghttp3_STATIC_CFLAGS}")
set(_nghttp3_INCLUDE_DIRS "${_nghttp3_STATIC_INCLUDE_DIRS}")
set(_nghttp3_LIBRARY_DIRS "${_nghttp3_STATIC_LIBRARY_DIRS}")
set(_nghttp3_LIBRARIES "${_nghttp3_STATIC_LIBRARIES}")
endif()
message(STATUS "Found NGHTTP3 (via pkg-config): ${_nghttp3_INCLUDE_DIRS} (found version \"${NGHTTP3_VERSION}\")")
elseif(nghttp3_CONFIG)
set(NGHTTP3_FOUND TRUE)
set(NGHTTP3_VERSION ${nghttp3_VERSION})
if(NGHTTP3_USE_STATIC_LIBS)
set(_nghttp3_LIBRARIES nghttp3::nghttp3_static)
else()
set(_nghttp3_LIBRARIES nghttp3::nghttp3)
endif()
message(STATUS "Found NGHTTP3 (via CMake Config): ${nghttp3_CONFIG} (found version \"${NGHTTP3_VERSION}\")")
else()
find_path(NGHTTP3_INCLUDE_DIR NAMES "nghttp3/nghttp3.h")
find_library(NGHTTP3_LIBRARY NAMES "nghttp3")
if(NGHTTP3_USE_STATIC_LIBS)
set(_nghttp3_CFLAGS "-DNGHTTP3_STATICLIB")
find_library(NGHTTP3_LIBRARY NAMES "nghttp3_static" "nghttp3")
else()
find_library(NGHTTP3_LIBRARY NAMES "nghttp3")
endif()
unset(NGHTTP3_VERSION CACHE)
if(NGHTTP3_INCLUDE_DIR AND EXISTS "${NGHTTP3_INCLUDE_DIR}/nghttp3/version.h")
@ -74,9 +96,21 @@ else()
)
if(NGHTTP3_FOUND)
set(NGHTTP3_INCLUDE_DIRS ${NGHTTP3_INCLUDE_DIR})
set(NGHTTP3_LIBRARIES ${NGHTTP3_LIBRARY})
set(_nghttp3_INCLUDE_DIRS ${NGHTTP3_INCLUDE_DIR})
set(_nghttp3_LIBRARIES ${NGHTTP3_LIBRARY})
endif()
mark_as_advanced(NGHTTP3_INCLUDE_DIR NGHTTP3_LIBRARY)
endif()
if(NGHTTP3_FOUND)
if(NOT TARGET CURL::nghttp3)
add_library(CURL::nghttp3 INTERFACE IMPORTED)
set_target_properties(CURL::nghttp3 PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_nghttp3_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_nghttp3_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_nghttp3_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_nghttp3_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_nghttp3_LIBRARIES}")
endif()
endif()

View file

@ -35,24 +35,21 @@
#
# Input variables:
#
# - `NGTCP2_INCLUDE_DIR`: The ngtcp2 include directory.
# - `NGTCP2_LIBRARY`: Path to `ngtcp2` library.
# - `NGTCP2_CRYPTO_BORINGSSL_LIBRARY`: Path to `ngtcp2_crypto_boringssl` library.
# - `NGTCP2_CRYPTO_GNUTLS_LIBRARY`: Path to `ngtcp2_crypto_gnutls` library.
# - `NGTCP2_CRYPTO_LIBRESSL_LIBRARY`: Path to `ngtcp2_crypto_libressl` library.
# - `NGTCP2_CRYPTO_OSSL_LIBRARY`: Path to `ngtcp2_crypto_ossl` library.
# - `NGTCP2_CRYPTO_QUICTLS_LIBRARY`: Path to `ngtcp2_crypto_quictls` library.
# - `NGTCP2_CRYPTO_WOLFSSL_LIBRARY`: Path to `ngtcp2_crypto_wolfssl` library.
# - `NGTCP2_INCLUDE_DIR`: Absolute path to ngtcp2 include directory.
# - `NGTCP2_LIBRARY`: Absolute path to `ngtcp2` library.
# - `NGTCP2_CRYPTO_BORINGSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_boringssl` library.
# - `NGTCP2_CRYPTO_GNUTLS_LIBRARY`: Absolute path to `ngtcp2_crypto_gnutls` library.
# - `NGTCP2_CRYPTO_LIBRESSL_LIBRARY`: Absolute path to `ngtcp2_crypto_libressl` library.
# - `NGTCP2_CRYPTO_OSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_ossl` library.
# - `NGTCP2_CRYPTO_QUICTLS_LIBRARY`: Absolute path to `ngtcp2_crypto_quictls` library.
# - `NGTCP2_CRYPTO_WOLFSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_wolfssl` library.
# - `NGTCP2_USE_STATIC_LIBS`: Configure for static ngtcp2 libraries.
#
# Result variables:
# Defines:
#
# - `NGTCP2_FOUND`: System has ngtcp2.
# - `NGTCP2_INCLUDE_DIRS`: The ngtcp2 include directories.
# - `NGTCP2_LIBRARIES`: The ngtcp2 library names.
# - `NGTCP2_LIBRARY_DIRS`: The ngtcp2 library directories.
# - `NGTCP2_PC_REQUIRES`: The ngtcp2 pkg-config packages.
# - `NGTCP2_CFLAGS`: Required compiler flags.
# - `NGTCP2_VERSION`: Version of ngtcp2.
# - `CURL::ngtcp2`: ngtcp2 library target.
if(NGTCP2_FIND_COMPONENTS)
set(_ngtcp2_crypto_backend "")
@ -71,27 +68,57 @@ if(NGTCP2_FIND_COMPONENTS)
endif()
endif()
set(NGTCP2_PC_REQUIRES "libngtcp2")
set(_ngtcp2_pc_requires "libngtcp2")
if(_ngtcp2_crypto_backend)
list(APPEND NGTCP2_PC_REQUIRES "lib${_crypto_library_lower}")
list(APPEND _ngtcp2_pc_requires "lib${_crypto_library_lower}")
endif()
set(_tried_pkgconfig FALSE)
if(CURL_USE_PKGCONFIG AND
NOT DEFINED NGTCP2_INCLUDE_DIR AND
if(NOT DEFINED NGTCP2_INCLUDE_DIR AND
NOT DEFINED NGTCP2_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(NGTCP2 ${NGTCP2_PC_REQUIRES})
set(_tried_pkgconfig TRUE)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_ngtcp2 ${_ngtcp2_pc_requires})
set(_tried_pkgconfig TRUE)
endif()
if(NOT _ngtcp2_FOUND AND CURL_USE_CMAKECONFIG)
find_package(ngtcp2 CONFIG QUIET)
# Skip using it if the crypto library target is not available
if(ngtcp2_CONFIG AND
NOT TARGET ngtcp2::${_crypto_library_lower}_static AND
NOT TARGET ngtcp2::${_crypto_library_lower})
unset(ngtcp2_CONFIG)
endif()
endif()
endif()
if(NGTCP2_FOUND)
set(NGTCP2_VERSION "${NGTCP2_libngtcp2_VERSION}")
string(REPLACE ";" " " NGTCP2_CFLAGS "${NGTCP2_CFLAGS}")
message(STATUS "Found NGTCP2 (via pkg-config): ${NGTCP2_INCLUDE_DIRS} (found version \"${NGTCP2_VERSION}\")")
if(_ngtcp2_FOUND)
set(NGTCP2_FOUND TRUE)
set(NGTCP2_VERSION ${_ngtcp2_libngtcp2_VERSION})
if(NGTCP2_USE_STATIC_LIBS)
set(_ngtcp2_CFLAGS "${_ngtcp2_STATIC_CFLAGS}")
set(_ngtcp2_INCLUDE_DIRS "${_ngtcp2_STATIC_INCLUDE_DIRS}")
set(_ngtcp2_LIBRARY_DIRS "${_ngtcp2_STATIC_LIBRARY_DIRS}")
set(_ngtcp2_LIBRARIES "${_ngtcp2_STATIC_LIBRARIES}")
endif()
message(STATUS "Found NGTCP2 (via pkg-config): ${_ngtcp2_INCLUDE_DIRS} (found version \"${NGTCP2_VERSION}\")")
elseif(ngtcp2_CONFIG)
set(NGTCP2_FOUND TRUE)
set(NGTCP2_VERSION ${ngtcp2_VERSION})
if(NGTCP2_USE_STATIC_LIBS)
set(_ngtcp2_LIBRARIES ngtcp2::ngtcp2_static ngtcp2::${_crypto_library_lower}_static)
else()
set(_ngtcp2_LIBRARIES ngtcp2::ngtcp2 ngtcp2::${_crypto_library_lower})
endif()
message(STATUS "Found NGTCP2 (via CMake Config): ${ngtcp2_CONFIG} (found version \"${NGTCP2_VERSION}\")")
else()
find_path(NGTCP2_INCLUDE_DIR NAMES "ngtcp2/ngtcp2.h")
find_library(NGTCP2_LIBRARY NAMES "ngtcp2")
if(NGTCP2_USE_STATIC_LIBS)
set(_ngtcp2_CFLAGS "-DNGTCP2_STATICLIB")
find_library(NGTCP2_LIBRARY NAMES "ngtcp2_static" "ngtcp2")
else()
find_library(NGTCP2_LIBRARY NAMES "ngtcp2")
endif()
unset(NGTCP2_VERSION CACHE)
if(NGTCP2_INCLUDE_DIR AND EXISTS "${NGTCP2_INCLUDE_DIR}/ngtcp2/version.h")
@ -104,8 +131,18 @@ else()
endif()
if(_ngtcp2_crypto_backend)
get_filename_component(_ngtcp2_library_dir "${NGTCP2_LIBRARY}" DIRECTORY)
find_library(${_crypto_library_upper}_LIBRARY NAMES ${_crypto_library_lower} HINTS ${_ngtcp2_library_dir})
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20)
cmake_path(GET NGTCP2_LIBRARY PARENT_PATH _ngtcp2_library_dir)
else()
get_filename_component(_ngtcp2_library_dir "${NGTCP2_LIBRARY}" DIRECTORY)
endif()
if(NGTCP2_USE_STATIC_LIBS)
find_library(${_crypto_library_upper}_LIBRARY NAMES ${_crypto_library_lower}_static ${_crypto_library_lower}
HINTS ${_ngtcp2_library_dir})
else()
find_library(${_crypto_library_upper}_LIBRARY NAMES ${_crypto_library_lower}
HINTS ${_ngtcp2_library_dir})
endif()
if(${_crypto_library_upper}_LIBRARY)
set(NGTCP2_${_ngtcp2_crypto_backend}_FOUND TRUE)
@ -124,8 +161,8 @@ else()
)
if(NGTCP2_FOUND)
set(NGTCP2_INCLUDE_DIRS ${NGTCP2_INCLUDE_DIR})
set(NGTCP2_LIBRARIES ${NGTCP2_LIBRARY} ${NGTCP2_CRYPTO_LIBRARY})
set(_ngtcp2_INCLUDE_DIRS ${NGTCP2_INCLUDE_DIR})
set(_ngtcp2_LIBRARIES ${NGTCP2_LIBRARY} ${NGTCP2_CRYPTO_LIBRARY})
endif()
mark_as_advanced(NGTCP2_INCLUDE_DIR NGTCP2_LIBRARY NGTCP2_CRYPTO_LIBRARY)
@ -135,3 +172,15 @@ else()
unset(NGTCP2_LIBRARY CACHE)
endif()
endif()
if(NGTCP2_FOUND)
if(NOT TARGET CURL::ngtcp2)
add_library(CURL::ngtcp2 INTERFACE IMPORTED)
set_target_properties(CURL::ngtcp2 PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_ngtcp2_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_ngtcp2_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_ngtcp2_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_ngtcp2_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_ngtcp2_LIBRARIES}")
endif()
endif()

View file

@ -25,32 +25,29 @@
#
# Input variables:
#
# - `NETTLE_INCLUDE_DIR`: The nettle include directory.
# - `NETTLE_LIBRARY`: Path to `nettle` library.
# - `NETTLE_INCLUDE_DIR`: Absolute path to nettle include directory.
# - `NETTLE_LIBRARY`: Absolute path to `nettle` library.
#
# Result variables:
# Defines:
#
# - `NETTLE_FOUND`: System has nettle.
# - `NETTLE_INCLUDE_DIRS`: The nettle include directories.
# - `NETTLE_LIBRARIES`: The nettle library names.
# - `NETTLE_LIBRARY_DIRS`: The nettle library directories.
# - `NETTLE_PC_REQUIRES`: The nettle pkg-config packages.
# - `NETTLE_CFLAGS`: Required compiler flags.
# - `NETTLE_VERSION`: Version of nettle.
# - `NETTLE_FOUND`: System has nettle.
# - `NETTLE_VERSION`: Version of nettle.
# - `CURL::nettle`: nettle library target.
set(NETTLE_PC_REQUIRES "nettle")
set(_nettle_pc_requires "nettle")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED NETTLE_INCLUDE_DIR AND
NOT DEFINED NETTLE_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(NETTLE ${NETTLE_PC_REQUIRES})
pkg_check_modules(_nettle ${_nettle_pc_requires})
endif()
if(NETTLE_FOUND)
if(_nettle_FOUND)
set(Nettle_FOUND TRUE)
string(REPLACE ";" " " NETTLE_CFLAGS "${NETTLE_CFLAGS}")
message(STATUS "Found Nettle (via pkg-config): ${NETTLE_INCLUDE_DIRS} (found version \"${NETTLE_VERSION}\")")
set(NETTLE_FOUND TRUE)
set(NETTLE_VERSION ${_nettle_VERSION})
message(STATUS "Found Nettle (via pkg-config): ${_nettle_INCLUDE_DIRS} (found version \"${NETTLE_VERSION}\")")
else()
find_path(NETTLE_INCLUDE_DIR NAMES "nettle/sha2.h")
find_library(NETTLE_LIBRARY NAMES "nettle")
@ -80,9 +77,21 @@ else()
)
if(NETTLE_FOUND)
set(NETTLE_INCLUDE_DIRS ${NETTLE_INCLUDE_DIR})
set(NETTLE_LIBRARIES ${NETTLE_LIBRARY})
set(_nettle_INCLUDE_DIRS ${NETTLE_INCLUDE_DIR})
set(_nettle_LIBRARIES ${NETTLE_LIBRARY})
endif()
mark_as_advanced(NETTLE_INCLUDE_DIR NETTLE_LIBRARY)
endif()
if(NETTLE_FOUND)
if(NOT TARGET CURL::nettle)
add_library(CURL::nettle INTERFACE IMPORTED)
set_target_properties(CURL::nettle PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_nettle_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_nettle_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_nettle_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_nettle_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_nettle_LIBRARIES}")
endif()
endif()

View file

@ -25,32 +25,29 @@
#
# Input variables:
#
# - `QUICHE_INCLUDE_DIR`: The quiche include directory.
# - `QUICHE_LIBRARY`: Path to `quiche` library.
# - `QUICHE_INCLUDE_DIR`: Absolute path to quiche include directory.
# - `QUICHE_LIBRARY`: Absolute path to `quiche` library.
#
# Result variables:
# Defines:
#
# - `QUICHE_FOUND`: System has quiche.
# - `QUICHE_INCLUDE_DIRS`: The quiche include directories.
# - `QUICHE_LIBRARIES`: The quiche library names.
# - `QUICHE_LIBRARY_DIRS`: The quiche library directories.
# - `QUICHE_PC_REQUIRES`: The quiche pkg-config packages.
# - `QUICHE_CFLAGS`: Required compiler flags.
# - `QUICHE_VERSION`: Version of quiche.
# - `QUICHE_FOUND`: System has quiche.
# - `QUICHE_VERSION`: Version of quiche.
# - `CURL::quiche`: quiche library target.
set(QUICHE_PC_REQUIRES "quiche")
set(_quiche_pc_requires "quiche")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED QUICHE_INCLUDE_DIR AND
NOT DEFINED QUICHE_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(QUICHE ${QUICHE_PC_REQUIRES})
pkg_check_modules(_quiche ${_quiche_pc_requires})
endif()
if(QUICHE_FOUND)
if(_quiche_FOUND)
set(Quiche_FOUND TRUE)
string(REPLACE ";" " " QUICHE_CFLAGS "${QUICHE_CFLAGS}")
message(STATUS "Found Quiche (via pkg-config): ${QUICHE_INCLUDE_DIRS} (found version \"${QUICHE_VERSION}\")")
set(QUICHE_FOUND TRUE)
set(QUICHE_VERSION ${_quiche_VERSION})
message(STATUS "Found Quiche (via pkg-config): ${_quiche_INCLUDE_DIRS} (found version \"${QUICHE_VERSION}\")")
else()
find_path(QUICHE_INCLUDE_DIR NAMES "quiche.h")
find_library(QUICHE_LIBRARY NAMES "quiche")
@ -63,9 +60,21 @@ else()
)
if(QUICHE_FOUND)
set(QUICHE_INCLUDE_DIRS ${QUICHE_INCLUDE_DIR})
set(QUICHE_LIBRARIES ${QUICHE_LIBRARY})
set(_quiche_INCLUDE_DIRS ${QUICHE_INCLUDE_DIR})
set(_quiche_LIBRARIES ${QUICHE_LIBRARY})
endif()
mark_as_advanced(QUICHE_INCLUDE_DIR QUICHE_LIBRARY)
endif()
if(QUICHE_FOUND)
if(NOT TARGET CURL::quiche)
add_library(CURL::quiche INTERFACE IMPORTED)
set_target_properties(CURL::quiche PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_quiche_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_quiche_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_quiche_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_quiche_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_quiche_LIBRARIES}")
endif()
endif()

View file

@ -25,34 +25,31 @@
#
# Input variables:
#
# - `RUSTLS_INCLUDE_DIR`: The Rustls include directory.
# - `RUSTLS_LIBRARY`: Path to `rustls` library.
# - `RUSTLS_INCLUDE_DIR`: Absolute path to Rustls include directory.
# - `RUSTLS_LIBRARY`: Absolute path to `rustls` library.
#
# Result variables:
# Defines:
#
# - `RUSTLS_FOUND`: System has Rustls.
# - `RUSTLS_INCLUDE_DIRS`: The Rustls include directories.
# - `RUSTLS_LIBRARIES`: The Rustls library names.
# - `RUSTLS_LIBRARY_DIRS`: The Rustls library directories.
# - `RUSTLS_PC_REQUIRES`: The Rustls pkg-config packages.
# - `RUSTLS_CFLAGS`: Required compiler flags.
# - `RUSTLS_VERSION`: Version of Rustls.
# - `RUSTLS_FOUND`: System has Rustls.
# - `RUSTLS_VERSION`: Version of Rustls.
# - `CURL::rustls`: Rustls library target.
set(RUSTLS_PC_REQUIRES "rustls")
set(_rustls_pc_requires "rustls")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED RUSTLS_INCLUDE_DIR AND
NOT DEFINED RUSTLS_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(RUSTLS ${RUSTLS_PC_REQUIRES})
pkg_check_modules(_rustls ${_rustls_pc_requires})
endif()
if(RUSTLS_FOUND)
if(_rustls_FOUND)
set(Rustls_FOUND TRUE)
string(REPLACE ";" " " RUSTLS_CFLAGS "${RUSTLS_CFLAGS}")
message(STATUS "Found Rustls (via pkg-config): ${RUSTLS_INCLUDE_DIRS} (found version \"${RUSTLS_VERSION}\")")
set(RUSTLS_FOUND TRUE)
set(RUSTLS_VERSION ${_rustls_VERSION})
message(STATUS "Found Rustls (via pkg-config): ${_rustls_INCLUDE_DIRS} (found version \"${RUSTLS_VERSION}\")")
else()
set(RUSTLS_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config
set(_rustls_pc_requires "") # Depend on pkg-config only when found via pkg-config
find_path(RUSTLS_INCLUDE_DIR NAMES "rustls.h")
find_library(RUSTLS_LIBRARY NAMES "rustls")
@ -65,8 +62,8 @@ else()
)
if(RUSTLS_FOUND)
set(RUSTLS_INCLUDE_DIRS ${RUSTLS_INCLUDE_DIR})
set(RUSTLS_LIBRARIES ${RUSTLS_LIBRARY})
set(_rustls_INCLUDE_DIRS ${RUSTLS_INCLUDE_DIR})
set(_rustls_LIBRARIES ${RUSTLS_LIBRARY})
endif()
mark_as_advanced(RUSTLS_INCLUDE_DIR RUSTLS_LIBRARY)
@ -79,31 +76,41 @@ if(RUSTLS_FOUND)
if(NOT SECURITY_FRAMEWORK)
message(FATAL_ERROR "Security framework not found")
endif()
list(APPEND RUSTLS_LIBRARIES "-framework Security")
list(APPEND _rustls_LIBRARIES "-framework Security")
find_library(FOUNDATION_FRAMEWORK NAMES "Foundation")
mark_as_advanced(FOUNDATION_FRAMEWORK)
if(NOT FOUNDATION_FRAMEWORK)
message(FATAL_ERROR "Foundation framework not found")
endif()
list(APPEND RUSTLS_LIBRARIES "-framework Foundation")
list(APPEND _rustls_LIBRARIES "-framework Foundation")
elseif(NOT WIN32)
find_library(PTHREAD_LIBRARY NAMES "pthread")
if(PTHREAD_LIBRARY)
list(APPEND RUSTLS_LIBRARIES ${PTHREAD_LIBRARY})
list(APPEND _rustls_LIBRARIES ${PTHREAD_LIBRARY})
endif()
mark_as_advanced(PTHREAD_LIBRARY)
find_library(DL_LIBRARY NAMES "dl")
if(DL_LIBRARY)
list(APPEND RUSTLS_LIBRARIES ${DL_LIBRARY})
list(APPEND _rustls_LIBRARIES ${DL_LIBRARY})
endif()
mark_as_advanced(DL_LIBRARY)
find_library(MATH_LIBRARY NAMES "m")
if(MATH_LIBRARY)
list(APPEND RUSTLS_LIBRARIES ${MATH_LIBRARY})
list(APPEND _rustls_LIBRARIES ${MATH_LIBRARY})
endif()
mark_as_advanced(MATH_LIBRARY)
endif()
if(NOT TARGET CURL::rustls)
add_library(CURL::rustls INTERFACE IMPORTED)
set_target_properties(CURL::rustls PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_rustls_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_rustls_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_rustls_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_rustls_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_rustls_LIBRARIES}")
endif()
endif()

View file

@ -1,65 +0,0 @@
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
# Find the wolfSSH library
#
# Input variables:
#
# - `WOLFSSH_INCLUDE_DIR`: The wolfSSH include directory.
# - `WOLFSSH_LIBRARY`: Path to `wolfssh` library.
#
# Result variables:
#
# - `WOLFSSH_FOUND`: System has wolfSSH.
# - `WOLFSSH_INCLUDE_DIRS`: The wolfSSH include directories.
# - `WOLFSSH_LIBRARIES`: The wolfSSH library names.
# - `WOLFSSH_VERSION`: Version of wolfSSH.
find_path(WOLFSSH_INCLUDE_DIR NAMES "wolfssh/ssh.h")
find_library(WOLFSSH_LIBRARY NAMES "wolfssh" "libwolfssh")
unset(WOLFSSH_VERSION CACHE)
if(WOLFSSH_INCLUDE_DIR AND EXISTS "${WOLFSSH_INCLUDE_DIR}/wolfssh/version.h")
set(_version_regex "#[\t ]*define[\t ]+LIBWOLFSSH_VERSION_STRING[\t ]+\"([^\"]*)\"")
file(STRINGS "${WOLFSSH_INCLUDE_DIR}/wolfssh/version.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(WOLFSSH_VERSION "${_version_str}")
unset(_version_regex)
unset(_version_str)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WolfSSH
REQUIRED_VARS
WOLFSSH_INCLUDE_DIR
WOLFSSH_LIBRARY
VERSION_VAR
WOLFSSH_VERSION
)
if(WOLFSSH_FOUND)
set(WOLFSSH_INCLUDE_DIRS ${WOLFSSH_INCLUDE_DIR})
set(WOLFSSH_LIBRARIES ${WOLFSSH_LIBRARY})
endif()
mark_as_advanced(WOLFSSH_INCLUDE_DIR WOLFSSH_LIBRARY)

View file

@ -25,18 +25,14 @@
#
# Input variables:
#
# - `WOLFSSL_INCLUDE_DIR`: The wolfSSL include directory.
# - `WOLFSSL_LIBRARY`: Path to `wolfssl` library.
# - `WOLFSSL_INCLUDE_DIR`: Absolute path to wolfSSL include directory.
# - `WOLFSSL_LIBRARY`: Absolute path to `wolfssl` library.
#
# Result variables:
# Defines:
#
# - `WOLFSSL_FOUND`: System has wolfSSL.
# - `WOLFSSL_INCLUDE_DIRS`: The wolfSSL include directories.
# - `WOLFSSL_LIBRARIES`: The wolfSSL library names.
# - `WOLFSSL_LIBRARY_DIRS`: The wolfSSL library directories.
# - `WOLFSSL_PC_REQUIRES`: The wolfSSL pkg-config packages.
# - `WOLFSSL_CFLAGS`: Required compiler flags.
# - `WOLFSSL_VERSION`: Version of wolfSSL.
# - `WOLFSSL_FOUND`: System has wolfSSL.
# - `WOLFSSL_VERSION`: Version of wolfSSL.
# - `CURL::wolfssl`: wolfSSL library target.
if(DEFINED WolfSSL_INCLUDE_DIR AND NOT DEFINED WOLFSSL_INCLUDE_DIR)
message(WARNING "WolfSSL_INCLUDE_DIR is deprecated, use WOLFSSL_INCLUDE_DIR instead.")
@ -47,19 +43,30 @@ if(DEFINED WolfSSL_LIBRARY AND NOT DEFINED WOLFSSL_LIBRARY)
set(WOLFSSL_LIBRARY "${WolfSSL_LIBRARY}")
endif()
set(WOLFSSL_PC_REQUIRES "wolfssl")
set(_wolfssl_pc_requires "wolfssl")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED WOLFSSL_INCLUDE_DIR AND
if(NOT DEFINED WOLFSSL_INCLUDE_DIR AND
NOT DEFINED WOLFSSL_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(WOLFSSL ${WOLFSSL_PC_REQUIRES})
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_wolfssl ${_wolfssl_pc_requires})
endif()
if(NOT _wolfssl_FOUND AND CURL_USE_CMAKECONFIG)
find_package(wolfssl CONFIG QUIET)
endif()
endif()
if(WOLFSSL_FOUND)
if(_wolfssl_FOUND)
set(WolfSSL_FOUND TRUE)
string(REPLACE ";" " " WOLFSSL_CFLAGS "${WOLFSSL_CFLAGS}")
message(STATUS "Found WolfSSL (via pkg-config): ${WOLFSSL_INCLUDE_DIRS} (found version \"${WOLFSSL_VERSION}\")")
set(WOLFSSL_FOUND TRUE)
set(WOLFSSL_VERSION ${_wolfssl_VERSION})
message(STATUS "Found WolfSSL (via pkg-config): ${_wolfssl_INCLUDE_DIRS} (found version \"${WOLFSSL_VERSION}\")")
elseif(wolfssl_CONFIG)
set(WolfSSL_FOUND TRUE)
set(WOLFSSL_FOUND TRUE)
set(WOLFSSL_VERSION ${wolfssl_VERSION})
set(_wolfssl_LIBRARIES wolfssl::wolfssl)
message(STATUS "Found WolfSSL (via CMake Config): ${wolfssl_CONFIG} (found version \"${WOLFSSL_VERSION}\")")
else()
find_path(WOLFSSL_INCLUDE_DIR NAMES "wolfssl/ssl.h")
find_library(WOLFSSL_LIBRARY NAMES "wolfssl")
@ -84,8 +91,8 @@ else()
)
if(WOLFSSL_FOUND)
set(WOLFSSL_INCLUDE_DIRS ${WOLFSSL_INCLUDE_DIR})
set(WOLFSSL_LIBRARIES ${WOLFSSL_LIBRARY})
set(_wolfssl_INCLUDE_DIRS ${WOLFSSL_INCLUDE_DIR})
set(_wolfssl_LIBRARIES ${WOLFSSL_LIBRARY})
endif()
mark_as_advanced(WOLFSSL_INCLUDE_DIR WOLFSSL_LIBRARY)
@ -98,19 +105,31 @@ if(WOLFSSL_FOUND)
if(NOT SECURITY_FRAMEWORK)
message(FATAL_ERROR "Security framework not found")
endif()
list(APPEND WOLFSSL_LIBRARIES "-framework Security")
list(APPEND _wolfssl_LIBRARIES "-framework Security")
find_library(COREFOUNDATION_FRAMEWORK NAMES "CoreFoundation")
mark_as_advanced(COREFOUNDATION_FRAMEWORK)
if(NOT COREFOUNDATION_FRAMEWORK)
message(FATAL_ERROR "CoreFoundation framework not found")
endif()
list(APPEND WOLFSSL_LIBRARIES "-framework CoreFoundation")
elseif(NOT WIN32)
list(APPEND _wolfssl_LIBRARIES "-framework CoreFoundation")
elseif(WIN32)
list(APPEND _wolfssl_LIBRARIES "crypt32")
else()
find_library(MATH_LIBRARY NAMES "m")
if(MATH_LIBRARY)
list(APPEND WOLFSSL_LIBRARIES ${MATH_LIBRARY}) # for log and pow
list(APPEND _wolfssl_LIBRARIES ${MATH_LIBRARY}) # for log and pow
endif()
mark_as_advanced(MATH_LIBRARY)
endif()
if(NOT TARGET CURL::wolfssl)
add_library(CURL::wolfssl INTERFACE IMPORTED)
set_target_properties(CURL::wolfssl PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_wolfssl_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_wolfssl_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_wolfssl_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_wolfssl_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_wolfssl_LIBRARIES}")
endif()
endif()

View file

@ -25,18 +25,15 @@
#
# Input variables:
#
# - `ZSTD_INCLUDE_DIR`: The zstd include directory.
# - `ZSTD_LIBRARY`: Path to `zstd` library.
# - `ZSTD_INCLUDE_DIR`: Absolute path to zstd include directory.
# - `ZSTD_LIBRARY`: Absolute path to `zstd` library.
# - `ZSTD_USE_STATIC_LIBS`: Configure for static zstd libraries.
#
# Result variables:
# Defines:
#
# - `ZSTD_FOUND`: System has zstd.
# - `ZSTD_INCLUDE_DIRS`: The zstd include directories.
# - `ZSTD_LIBRARIES`: The zstd library names.
# - `ZSTD_LIBRARY_DIRS`: The zstd library directories.
# - `ZSTD_PC_REQUIRES`: The zstd pkg-config packages.
# - `ZSTD_CFLAGS`: Required compiler flags.
# - `ZSTD_VERSION`: Version of zstd.
# - `ZSTD_FOUND`: System has zstd.
# - `ZSTD_VERSION`: Version of zstd.
# - `CURL::zstd`: zstd library target.
if(DEFINED Zstd_INCLUDE_DIR AND NOT DEFINED ZSTD_INCLUDE_DIR)
message(WARNING "Zstd_INCLUDE_DIR is deprecated, use ZSTD_INCLUDE_DIR instead.")
@ -47,22 +44,54 @@ if(DEFINED Zstd_LIBRARY AND NOT DEFINED ZSTD_LIBRARY)
set(ZSTD_LIBRARY "${Zstd_LIBRARY}")
endif()
set(ZSTD_PC_REQUIRES "libzstd")
set(_zstd_pc_requires "libzstd")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED ZSTD_INCLUDE_DIR AND
if(NOT DEFINED ZSTD_INCLUDE_DIR AND
NOT DEFINED ZSTD_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(ZSTD ${ZSTD_PC_REQUIRES})
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_zstd ${_zstd_pc_requires})
endif()
if(NOT _zstd_FOUND AND CURL_USE_CMAKECONFIG)
find_package(Zstd CONFIG QUIET)
# Skip using if older than v1.4.5
if(Zstd_CONFIG AND
NOT TARGET zstd::libzstd_static AND
NOT TARGET zstd::libzstd_shared)
unset(Zstd_CONFIG)
endif()
endif()
endif()
if(ZSTD_FOUND)
if(_zstd_FOUND)
set(Zstd_FOUND TRUE)
string(REPLACE ";" " " ZSTD_CFLAGS "${ZSTD_CFLAGS}")
message(STATUS "Found Zstd (via pkg-config): ${ZSTD_INCLUDE_DIRS} (found version \"${ZSTD_VERSION}\")")
set(ZSTD_FOUND TRUE)
set(ZSTD_VERSION ${_zstd_VERSION})
if(ZSTD_USE_STATIC_LIBS)
set(_zstd_CFLAGS "${_zstd_STATIC_CFLAGS}")
set(_zstd_INCLUDE_DIRS "${_zstd_STATIC_INCLUDE_DIRS}")
set(_zstd_LIBRARY_DIRS "${_zstd_STATIC_LIBRARY_DIRS}")
set(_zstd_LIBRARIES "${_zstd_STATIC_LIBRARIES}")
endif()
message(STATUS "Found Zstd (via pkg-config): ${_zstd_INCLUDE_DIRS} (found version \"${ZSTD_VERSION}\")")
elseif(Zstd_CONFIG)
set(ZSTD_FOUND TRUE)
set(ZSTD_VERSION ${Zstd_VERSION})
if(ZSTD_USE_STATIC_LIBS)
set(_zstd_LIBRARIES zstd::libzstd_static)
elseif(TARGET zstd::libzstd)
set(_zstd_LIBRARIES zstd::libzstd) # v1.5.6+
else()
set(_zstd_LIBRARIES zstd::libzstd_shared)
endif()
message(STATUS "Found Zstd (via CMake Config): ${Zstd_CONFIG} (found version \"${ZSTD_VERSION}\")")
else()
find_path(ZSTD_INCLUDE_DIR NAMES "zstd.h")
find_library(ZSTD_LIBRARY NAMES "zstd")
if(ZSTD_USE_STATIC_LIBS)
find_library(ZSTD_LIBRARY NAMES "zstd_static" "zstd")
else()
find_library(ZSTD_LIBRARY NAMES "zstd")
endif()
unset(ZSTD_VERSION CACHE)
if(ZSTD_INCLUDE_DIR AND EXISTS "${ZSTD_INCLUDE_DIR}/zstd.h")
@ -94,9 +123,21 @@ else()
)
if(ZSTD_FOUND)
set(ZSTD_INCLUDE_DIRS ${ZSTD_INCLUDE_DIR})
set(ZSTD_LIBRARIES ${ZSTD_LIBRARY})
set(_zstd_INCLUDE_DIRS ${ZSTD_INCLUDE_DIR})
set(_zstd_LIBRARIES ${ZSTD_LIBRARY})
endif()
mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY)
endif()
if(ZSTD_FOUND)
if(NOT TARGET CURL::zstd)
add_library(CURL::zstd INTERFACE IMPORTED)
set_target_properties(CURL::zstd PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_zstd_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_zstd_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_zstd_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_zstd_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_zstd_LIBRARIES}")
endif()
endif()

View file

@ -40,26 +40,18 @@ set(CURL_TEST_DEFINES "") # Initialize global variable
# Return result in variable: CURL_TEST_OUTPUT
macro(curl_internal_test _curl_test)
if(NOT DEFINED "${_curl_test}")
string(REPLACE ";" " " _cmake_required_definitions "${CMAKE_REQUIRED_DEFINITIONS}")
set(_curl_test_add_libraries "")
if(CMAKE_REQUIRED_LIBRARIES)
set(_curl_test_add_libraries
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
endif()
message(STATUS "Performing Test ${_curl_test}")
try_compile(${_curl_test}
${PROJECT_BINARY_DIR}
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c"
CMAKE_FLAGS
"-DCOMPILE_DEFINITIONS:STRING=-D${_curl_test} ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS} ${_cmake_required_definitions}"
"${_curl_test_add_libraries}"
COMPILE_DEFINITIONS "-D${_curl_test}" ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS} ${CMAKE_REQUIRED_DEFINITIONS}
LINK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}"
OUTPUT_VARIABLE CURL_TEST_OUTPUT)
if(${_curl_test})
set(${_curl_test} 1 CACHE INTERNAL "Curl test")
set(${_curl_test} 1 CACHE INTERNAL "curl test")
message(STATUS "Performing Test ${_curl_test} - Success")
else()
set(${_curl_test} "" CACHE INTERNAL "Curl test")
set(${_curl_test} "" CACHE INTERNAL "curl test")
message(STATUS "Performing Test ${_curl_test} - Failed")
endif()
endif()
@ -71,9 +63,21 @@ macro(curl_dependency_option _option_name _find_name _desc_name)
set_property(CACHE ${_option_name} PROPERTY STRINGS "AUTO" "ON" "OFF")
if(${_option_name} STREQUAL "AUTO")
find_package(${_find_name})
if(_find_name STREQUAL "ZLIB")
find_package(${_find_name})
else()
find_package(${_find_name} MODULE)
endif()
elseif(${_option_name})
find_package(${_find_name} REQUIRED)
if(_find_name STREQUAL "ZLIB")
find_package(${_find_name} REQUIRED)
else()
find_package(${_find_name} MODULE REQUIRED)
endif()
else()
string(TOUPPER "${_find_name}" _find_name_upper)
set(${_find_name}_FOUND OFF) # cmake-lint: disable=C0103
set(${_find_name_upper}_FOUND OFF) # cmake-lint: disable=C0103
endif()
endmacro()
@ -98,24 +102,24 @@ endmacro()
# Internal: Recurse into target libraries and collect their include directories
# and macro definitions.
macro(curl_collect_target_options _target)
get_target_property(_val ${_target} INTERFACE_INCLUDE_DIRECTORIES)
if(_val)
list(APPEND _includes ${_val})
endif()
get_target_property(_val ${_target} INCLUDE_DIRECTORIES)
if(_val)
list(APPEND _includes ${_val})
endif()
get_target_property(_val ${_target} COMPILE_DEFINITIONS)
macro(curl_collect_target_compile_options _target)
get_target_property(_val ${_target} INTERFACE_COMPILE_DEFINITIONS)
if(_val)
list(APPEND _definitions ${_val})
endif()
get_target_property(_val ${_target} INTERFACE_INCLUDE_DIRECTORIES)
if(_val)
list(APPEND _incsys ${_val})
endif()
get_target_property(_val ${_target} INTERFACE_COMPILE_OPTIONS)
if(_val)
list(APPEND _options ${_val})
endif()
get_target_property(_val ${_target} LINK_LIBRARIES)
if(_val)
foreach(_lib IN LISTS _val)
if(TARGET "${_lib}")
curl_collect_target_options(${_lib})
curl_collect_target_compile_options(${_lib})
endif()
endforeach()
endif()
@ -123,35 +127,94 @@ macro(curl_collect_target_options _target)
endmacro()
# Create a clang-tidy target for test targets
macro(curl_add_clang_tidy_test_target _target_clang_tidy _target)
function(curl_add_clang_tidy_test_target _target_clang_tidy _target)
if(CURL_CLANG_TIDY)
set(_includes "")
set(_definitions "")
set(_includes "")
set(_incsys "")
set(_options "")
# Collect header directories and macro definitions applying to the directory
get_directory_property(_val INCLUDE_DIRECTORIES)
if(_val)
list(APPEND _includes ${_val})
endif()
# Make a list of known system include directories
set(_sys_incdirs "${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}")
foreach(_inc IN LISTS CMAKE_SYSTEM_PREFIX_PATH)
if(NOT _inc MATCHES "/$")
string(APPEND _inc "/")
endif()
string(APPEND _inc "include")
if(NOT _inc IN_LIST _sys_incdirs AND IS_DIRECTORY "${_inc}")
list(APPEND _sys_incdirs "${_inc}")
endif()
endforeach()
# Collect options applying to the directory
get_directory_property(_val COMPILE_DEFINITIONS)
if(_val)
list(APPEND _definitions ${_val})
endif()
unset(_val)
get_directory_property(_val INCLUDE_DIRECTORIES)
if(_val)
list(APPEND _includes ${_val})
endif()
get_directory_property(_val COMPILE_OPTIONS)
if(_val)
list(APPEND _options ${_val})
endif()
# Collect options applying to the target
get_target_property(_val ${_target} COMPILE_DEFINITIONS)
if(_val)
list(APPEND _definitions ${_val})
endif()
get_target_property(_val ${_target} INCLUDE_DIRECTORIES)
if(_val)
list(APPEND _includes ${_val})
endif()
get_target_property(_val ${_target} COMPILE_OPTIONS)
if(_val)
list(APPEND _options ${_val})
endif()
# Collect header directories and macro definitions from lib dependencies
curl_collect_target_options(${_target})
list(REMOVE_ITEM _includes "")
string(REPLACE ";" ";-I" _includes ";${_includes}")
list(REMOVE_DUPLICATES _includes)
curl_collect_target_compile_options(${_target})
list(REMOVE_ITEM _definitions "")
string(REPLACE ";" ";-D" _definitions ";${_definitions}")
list(REMOVE_DUPLICATES _definitions)
list(SORT _definitions) # Sort like CMake does
list(REMOVE_ITEM _includes "")
string(REPLACE ";" ";-I" _includes ";${_includes}")
list(REMOVE_DUPLICATES _includes)
set(_incsys_tmp ${_incsys})
list(REMOVE_DUPLICATES _incsys_tmp)
set(_incsys "")
set(_incsystop "")
foreach(_inc IN LISTS _incsys_tmp)
if(_inc IN_LIST _sys_incdirs)
list(APPEND _incsystop "${_inc}") # Save system prefixes to re-add them later to the end of list
continue()
endif()
# Avoid empty and '$<INSTALL_INTERFACE:include>' items. The latter
# evaluates to an empty path in this context. Also skip
# '$<BUILD_INTERFACE:curl-include>', as already present in '_includes'.
if(_inc AND
NOT _inc MATCHES "INSTALL_INTERFACE:" AND
NOT _inc MATCHES "BUILD_INTERFACE:")
list(APPEND _incsys "-isystem" "${_inc}")
endif()
endforeach()
foreach(_inc IN LISTS _incsystop)
list(APPEND _incsys "-isystem" "${_inc}")
endforeach()
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
list(REMOVE_DUPLICATES _options) # Keep the first of duplicates to imitate CMake
else()
set(_options)
endif()
# Assemble source list
set(_sources "")
foreach(_source IN ITEMS ${ARGN})
@ -161,14 +224,55 @@ macro(curl_add_clang_tidy_test_target _target_clang_tidy _target)
list(APPEND _sources "${_source}")
endforeach()
set(_cc "${CMAKE_C_COMPILER}")
if(CMAKE_C_COMPILER_TARGET AND CMAKE_C_COMPILE_OPTIONS_TARGET)
list(APPEND _cc "${CMAKE_C_COMPILE_OPTIONS_TARGET}${CMAKE_C_COMPILER_TARGET}")
endif()
if(APPLE AND CMAKE_OSX_SYSROOT)
list(APPEND _cc "-isysroot" "${CMAKE_OSX_SYSROOT}")
elseif(CMAKE_SYSROOT AND CMAKE_C_COMPILE_OPTIONS_SYSROOT)
list(APPEND _cc "${CMAKE_C_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}")
endif()
# Pass -clang-diagnostic-unused-function to disable -Wunused-function implied by -Wunused
add_custom_target(${_target_clang_tidy} USES_TERMINAL
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMAND ${CMAKE_C_CLANG_TIDY} ${_sources} -- ${_includes} ${_definitions}
COMMAND ${CMAKE_C_CLANG_TIDY}
"--checks=-clang-diagnostic-unused-function"
${_sources} -- ${_cc} ${_definitions} ${_includes} ${_incsys} ${_options}
DEPENDS ${_sources})
add_dependencies(tests-clang-tidy ${_target_clang_tidy})
unset(_includes)
unset(_definitions)
unset(_sources)
endif()
endfunction()
# Internal: Recurse into interface targets and collect their libraries
# and library paths.
macro(curl_collect_target_link_options _target)
get_target_property(_val ${_target} INTERFACE_LINK_DIRECTORIES)
if(_val)
list(APPEND _libdirs ${_val})
endif()
get_target_property(_val ${_target} IMPORTED)
if(_val)
# LOCATION is empty for interface library targets and safe to ignore.
# Explicitly skip this query to avoid CMake v3.18 and older erroring out.
get_target_property(_val ${_target} TYPE)
if(NOT "${_val}" STREQUAL "INTERFACE_LIBRARY")
get_target_property(_val ${_target} LOCATION)
if(_val)
list(APPEND _libs ${_val})
endif()
endif()
endif()
get_target_property(_val ${_target} INTERFACE_LINK_LIBRARIES)
if(_val)
foreach(_lib IN LISTS _val)
if(TARGET "${_lib}")
curl_collect_target_link_options(${_lib})
else()
list(APPEND _libs ${_lib})
endif()
endforeach()
endif()
unset(_val)
endmacro()

View file

@ -50,19 +50,6 @@ if(NOT DEFINED HAVE_STRUCT_SOCKADDR_STORAGE)
cmake_pop_check_state()
endif()
if(NOT WIN32)
set(_source_epilogue "#undef inline")
curl_add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
check_c_source_compiles("${_source_epilogue}
#include <sys/socket.h>
int main(void)
{
int flag = MSG_NOSIGNAL;
(void)flag;
return 0;
}" HAVE_MSG_NOSIGNAL)
endif()
set(_source_epilogue "#undef inline")
check_c_source_compiles("${_source_epilogue}
#ifdef _MSC_VER
@ -91,7 +78,7 @@ if(WIN32)
elseif(NOT HAVE_GETADDRINFO)
set(HAVE_GETADDRINFO_THREADSAFE FALSE)
elseif(APPLE OR
CMAKE_SYSTEM_NAME STREQUAL "AIX" OR
AIX OR CMAKE_SYSTEM_NAME STREQUAL "AIX" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "HP-UX" OR
CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR

View file

@ -29,12 +29,10 @@ set(_picky_nocheck "") # not to pass to feature checks
if(CURL_WERROR)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
else()
if(MSVC)
list(APPEND _picky_nocheck "-WX")
else() # llvm/clang and gcc style options
list(APPEND _picky_nocheck "-Werror")
endif()
elseif(MSVC)
list(APPEND _picky_nocheck "-WX")
else() # llvm/clang and gcc-style options
list(APPEND _picky_nocheck "-Werror")
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
@ -47,8 +45,8 @@ endif()
if(APPLE AND
(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.6) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.3))
list(APPEND _picky "-Werror=partial-availability") # clang 3.6 appleclang 6.3
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.1))
list(APPEND _picky "-Werror=partial-availability") # clang 3.6 appleclang 6.1
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
@ -62,7 +60,9 @@ elseif(BORLAND)
endif()
if(PICKY_COMPILER)
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
# Leave disabled for GCC <4.6, because they lack #pragma features to silence locally.
if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.6) OR
CMAKE_C_COMPILER_ID MATCHES "Clang")
# https://clang.llvm.org/docs/DiagnosticsReference.html
# https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
@ -77,9 +77,15 @@ if(PICKY_COMPILER)
set(_picky_enable "-W")
endif()
list(APPEND _picky_enable
-Wall -pedantic
)
list(APPEND _picky_enable "-Wall")
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.2) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) OR
CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
list(APPEND _picky_enable "-Wpedantic") # clang 3.2 gcc 4.8 appleclang 4.2
else()
list(APPEND _picky_enable "-pedantic")
endif()
# ----------------------------------
# Add new options here, if in doubt:
@ -87,6 +93,9 @@ if(PICKY_COMPILER)
set(_picky_detect
)
# Notes: -Wno-* options should ideally be disabled at their precise cutoff versions,
# to suppress undesired warnings in case -Weverything is passed as a custom option.
# Assume these options always exist with both clang and gcc.
# Require clang 3.0 / gcc 2.95 or later.
list(APPEND _picky_enable
@ -110,7 +119,7 @@ if(PICKY_COMPILER)
-Waddress # clang 2.7 gcc 4.3
-Wattributes # clang 2.7 gcc 4.1
-Wcast-align # clang 1.0 gcc 4.2
-Wcast-qual # clang 3.0 gcc 3.4.6
-Wcast-qual # clang 2.7 gcc 3.4.6
-Wdeclaration-after-statement # clang 1.0 gcc 3.4
-Wdiv-by-zero # clang 2.7 gcc 4.1
-Wempty-body # clang 2.7 gcc 4.3
@ -120,14 +129,14 @@ if(PICKY_COMPILER)
-Wignored-qualifiers # clang 2.8 gcc 4.3
-Wmissing-field-initializers # clang 2.7 gcc 4.1
-Wmissing-noreturn # clang 2.7 gcc 4.1
-Wno-format-nonliteral # clang 1.0 gcc 2.96 (3.0)
-Wno-padded # clang 2.9 gcc 4.1 # Not used: We cannot change public structs
-Wno-sign-conversion # clang 2.9 gcc 4.3
-Wno-switch-default # clang 2.7 gcc 4.1 # Not used: Annoying to fix or silence
-Wno-switch-enum # clang 2.7 gcc 4.1 # Not used: It basically disallows default case
-Wno-system-headers # clang 1.0 gcc 3.0
# -Wpadded # clang 2.9 gcc 4.1 # Not used: We cannot change public structs
-Wold-style-definition # clang 2.7 gcc 3.4
-Wredundant-decls # clang 2.7 gcc 4.1
-Wstrict-prototypes # clang 1.0 gcc 3.3
# -Wswitch-enum # clang 2.7 gcc 4.1 # Not used: It basically disallows default case
-Wtype-limits # clang 2.7 gcc 4.3
-Wunreachable-code # clang 2.7 gcc 4.1
# -Wunused-macros # clang 2.7 gcc 4.1 # Not practical
@ -139,9 +148,11 @@ if(PICKY_COMPILER)
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
list(APPEND _picky_enable
${_picky_common_old}
-Wconditional-uninitialized # clang 3.0
-Wno-used-but-marked-unused # clang 2.9 # for typecheck-gcc.h with clang 14+, dependency headers
-Wshift-sign-overflow # clang 2.9
-Wshorten-64-to-32 # clang 1.0
-Wformat=2 # clang 3.0 gcc 4.8
-Wformat=2 # clang 2.7 gcc 4.8
)
if(NOT MSVC)
list(APPEND _picky_enable
@ -149,39 +160,119 @@ if(PICKY_COMPILER)
)
endif()
# Enable based on compiler version
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.6) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.3))
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.1)
list(APPEND _picky_enable
-Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.3
-Wenum-conversion # clang 3.2 gcc 10.0 appleclang 4.6 g++ 11.0
-Wno-covered-switch-default # clang 3.1 appleclang 3.1 # Annoying to fix or silence
-Wno-disabled-macro-expansion # clang 3.1 appleclang 3.1 # for std headers, and curl/curl.h (rare combos)
)
if(MSVC)
list(APPEND _picky_enable
-Wno-format-non-iso # clang 3.1 appleclang 3.1 # 'q' length modifier is not supported by ISO C
)
else()
list(APPEND _picky_enable
-Wformat-non-iso # clang 3.1 appleclang 3.1
)
endif()
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.3) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0))
list(APPEND _picky_enable
-Wenum-conversion # clang 3.2 gcc 10.0 appleclang 4.2 g++ 11.0
-Wmissing-variable-declarations # clang 3.2 appleclang 4.2
-Wno-documentation-unknown-command # clang 3.3 appleclang 5.0
-Wsometimes-uninitialized # clang 3.2 appleclang 4.2
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.6) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.1))
list(APPEND _picky_enable
-Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.1
-Wheader-guard # clang 3.4 appleclang 5.1
-Wpragmas # clang 3.5 gcc 4.1 appleclang 6.0
-Wsometimes-uninitialized # clang 3.2 appleclang 4.6
# -Wunreachable-code-break # clang 3.5 appleclang 6.0 # Not used: Silent in "unity" builds
-Wunused-const-variable # clang 3.4 gcc 6.0 appleclang 5.1
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.9) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.3))
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1))
list(APPEND _picky_enable
-Wcomma # clang 3.9 appleclang 8.3
-Wmissing-variable-declarations # clang 3.2 appleclang 4.6
-Wcomma # clang 3.9 appleclang 8.1
)
if(MSVC)
list(APPEND _picky_enable
-Wno-nonportable-system-include-path # clang 3.9 appleclang 8.1 # No truly portable solution to this
)
endif()
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.3))
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11))
list(APPEND _picky_enable
-Wassign-enum # clang 7.0 appleclang 10.3
-Wextra-semi-stmt # clang 7.0 appleclang 10.3
-Wassign-enum # clang 7.0 appleclang 11.0
-Wextra-semi-stmt # clang 7.0 appleclang 11.0
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.4))
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12))
list(APPEND _picky_enable
-Wimplicit-fallthrough # clang 4.0 gcc 7.0 appleclang 12.4 # We do silencing for clang 10.0 and above only
-Wxor-used-as-pow # clang 10.0 gcc 13.0
-Wimplicit-fallthrough # clang 4.0 gcc 7.0 appleclang 9.0 # We do silencing for clang 10.0 and above only
-Wxor-used-as-pow # clang 10.0 gcc 13.0 appleclang 12.0
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1))
list(APPEND _picky_enable
-Wcast-function-type # clang 13.0 appleclang 13.1
-Wreserved-identifier # clang 13.0 appleclang 13.1 # Keep it before -Wno-reserved-macro-identifier
-Wno-reserved-macro-identifier # clang 13.0 appleclang 13.1 # External macros have to be set sometimes
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 14.0.3))
if(CMAKE_GENERATOR STREQUAL "FASTBuild")
list(APPEND _picky_enable
-Wno-gnu-line-marker # clang 15.0 appleclang 14.0.3
)
endif()
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0))
list(APPEND _picky_enable
-Wno-unsafe-buffer-usage # clang 16.0 appleclang 15.0
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0))
list(APPEND _picky_enable
-Wcast-function-type-strict # clang 16.0 appleclang 16.0
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.1) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 17.0))
list(APPEND _picky_enable
-Wno-format-signedness # clang 19.1 gcc 5.1 appleclang 17.0 # In clang-cl enums are signed ints by default
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 21.1) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 26.4))
list(APPEND _picky_enable
-Warray-compare # clang 20.1 gcc 12.0 appleclang 26.4
-Wc++-hidden-decl # clang 21.1 appleclang 26.4
-Wimplicit-int-enum-cast # clang 21.1
-Wjump-misses-init # clang 21.1 gcc 4.5 appleclang 26.4
-Wno-implicit-void-ptr-cast # clang 21.1 appleclang 26.4
-Wtentative-definition-compat # clang 21.1 appleclang 26.4
)
if(WIN32)
list(APPEND _picky_enable
-Wno-c++-keyword # clang 21.1 appleclang 26.4 # `wchar_t` triggers it on Windows
)
else()
list(APPEND _picky_enable
-Wc++-keyword # clang 21.1 appleclang 26.4
)
endif()
endif()
else() # gcc
# Enable based on compiler version
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.3)
@ -197,7 +288,7 @@ if(PICKY_COMPILER)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.5)
list(APPEND _picky_enable
-Wjump-misses-init # gcc 4.5
-Wjump-misses-init # clang 21.1 gcc 4.5 appleclang 26.4
)
if(MINGW)
list(APPEND _picky_enable
@ -207,23 +298,24 @@ if(PICKY_COMPILER)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
list(APPEND _picky_enable
-Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.3
-Wformat=2 # clang 3.0 gcc 4.8
-Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.1
-Wformat=2 # clang 2.7 gcc 4.8
-Wtrampolines # gcc 4.6
)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0)
list(APPEND _picky_enable
-Warray-bounds=2 # clang 3.0 gcc 5.0 (clang default: -Warray-bounds)
-Warray-bounds=2 # clang 2.9 gcc 5.0 (clang default: -Warray-bounds)
-Wno-format-signedness # clang 19.1 gcc 5.1 appleclang 17.0
)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
list(APPEND _picky_enable
-Wduplicated-cond # gcc 6.0
-Wnull-dereference # clang 3.0 gcc 6.0 (clang default)
-Wnull-dereference # clang 2.9 gcc 6.0 (clang default)
-fdelete-null-pointer-checks
-Wshift-negative-value # clang 3.7 gcc 6.0 (clang default)
-Wshift-overflow=2 # clang 3.0 gcc 6.0 (clang default: -Wshift-overflow)
-Wshift-overflow=2 # clang 2.9 gcc 6.0 (clang default: -Wshift-overflow)
-Wunused-const-variable # clang 3.4 gcc 6.0 appleclang 5.1
)
endif()
@ -232,21 +324,21 @@ if(PICKY_COMPILER)
-Walloc-zero # gcc 7.0
-Wduplicated-branches # gcc 7.0
-Wformat-truncation=2 # gcc 7.0
-Wimplicit-fallthrough # clang 4.0 gcc 7.0
-Wimplicit-fallthrough # clang 4.0 gcc 7.0 appleclang 9.0
-Wrestrict # gcc 7.0
)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
list(APPEND _picky_enable
-Warith-conversion # gcc 10.0
-Wenum-conversion # clang 3.2 gcc 10.0 appleclang 4.6 g++ 11.0
-Wenum-conversion # clang 3.2 gcc 10.0 appleclang 4.2 g++ 11.0
)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)
list(APPEND _picky_enable
-Warray-compare # clang 20.0 gcc 12.0
-Warray-compare # clang 20.1 gcc 12.0 appleclang 26.4
-Wenum-int-mismatch # gcc 13.0
-Wxor-used-as-pow # clang 10.0 gcc 13.0
-Wxor-used-as-pow # clang 10.0 gcc 13.0 appleclang 12.0
)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0)
@ -258,12 +350,15 @@ if(PICKY_COMPILER)
endif()
endif()
#
# Assemble list of flags
set(_picky_skipped "")
foreach(_ccopt IN LISTS _picky_enable)
string(REGEX MATCH "-W([a-z0-9-]+)" _ccmatch "${_ccopt}")
if(_ccmatch AND CMAKE_C_FLAGS MATCHES "-Wno-${CMAKE_MATCH_1}" AND NOT _ccopt STREQUAL "-Wall" AND NOT _ccopt MATCHES "^-Wno-")
string(REGEX MATCH "-W([a-z0-9+-]+)" _ccmatch "${_ccopt}")
string(REPLACE "+" "\\+" _cmake_match_1 "${CMAKE_MATCH_1}") # escape '+' to make it a valid regex
if(_ccmatch AND "${CMAKE_C_FLAGS} " MATCHES "-Wno-${_cmake_match_1} " AND
NOT _ccopt STREQUAL "-Wall" AND
NOT _ccopt MATCHES "^-Wno-")
string(APPEND _picky_skipped " ${_ccopt}")
else()
list(APPEND _picky "${_ccopt}")
@ -286,15 +381,6 @@ if(PICKY_COMPILER)
endforeach()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
if(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
# Avoid false positives
list(APPEND _picky "-Wno-shadow")
list(APPEND _picky "-Wno-unreachable-code")
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
# GCC <4.6 do not support #pragma to suppress warnings locally. Disable them globally instead.
list(APPEND _picky "-Wno-overlength-strings")
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.0 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
list(APPEND _picky "-Wno-missing-field-initializers") # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36750
endif()
@ -305,7 +391,7 @@ if(PICKY_COMPILER)
list(APPEND _picky "-Wno-conversion") # Avoid false positives
endif()
endif()
elseif(MSVC AND MSVC_VERSION LESS_EQUAL 1944) # Skip for untested/unreleased newer versions
elseif(MSVC AND MSVC_VERSION LESS_EQUAL 1950) # Skip for untested/unreleased newer versions
list(APPEND _picky "-Wall")
list(APPEND _picky "-wd4061") # enumerator 'A' in switch of enum 'B' is not explicitly handled by a case label
list(APPEND _picky "-wd4191") # 'type cast': unsafe conversion from 'FARPROC' to 'void (__cdecl *)(void)'
@ -314,12 +400,11 @@ if(PICKY_COMPILER)
list(APPEND _picky "-wd4548") # expression before comma has no effect; expected expression with side-effect (in FD_SET())
list(APPEND _picky "-wd4574") # 'M' is defined to be '0': did you mean to use '#if M'? (in ws2tcpip.h)
list(APPEND _picky "-wd4668") # 'M' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' (in winbase.h)
list(APPEND _picky "-wd4710") # 'snprintf': function not inlined
list(APPEND _picky "-wd4710") # 'fprintf'/'printf'/'sscanf': function not inlined (in tests, with VS2022+ Release)
list(APPEND _picky "-wd4711") # function 'A' selected for automatic inline expansion
# volatile access of '<expression>' is subject to /volatile:<iso|ms> setting;
# consider using __iso_volatile_load/store intrinsic functions (ARM64)
list(APPEND _picky "-wd4746")
list(APPEND _picky "-wd4774") # 'snprintf': format string expected in argument 3 is not a string literal
list(APPEND _picky "-wd4820") # 'A': 'N' bytes padding added after data member 'B'
if(MSVC_VERSION GREATER_EQUAL 1900)
list(APPEND _picky "-wd5045") # Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
@ -345,6 +430,21 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND MSVC)
endforeach()
endif()
if(CMAKE_C_STANDARD STREQUAL 90)
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2))
list(APPEND _picky "-Wno-c99-extensions") # Avoid: warning: '_Bool' is a C99 extension
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.9) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1))
list(APPEND _picky "-Wno-comma") # Just silly
endif()
endif()
if(DOS AND CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
list(APPEND _picky "-Wno-arith-conversion") # Avoid warnings in DJGPP's built-in FD_SET() macro
endif()
if(_picky_nocheck OR _picky)
set(_picky_tmp "${_picky_nocheck}" "${_picky}")
string(REPLACE ";" " " _picky_tmp "${_picky_tmp}")

View file

@ -59,6 +59,11 @@ function(curl_dumptargetprops _target)
string(REPLACE "\n" ";" _cmake_property_list "${_cmake_property_list}")
list(REMOVE_DUPLICATES _cmake_property_list)
list(REMOVE_ITEM _cmake_property_list "")
list(APPEND _cmake_property_list "INTERFACE_LIBCURL_PC_MODULES")
get_target_property(_target_imported ${_target} IMPORTED)
if(NOT _target_imported)
list(REMOVE_ITEM _cmake_property_list "LOCATION" "LOCATION_<CONFIG>" "MACOSX_PACKAGE_LOCATION" "VS_DEPLOYMENT_LOCATION")
endif()
foreach(_prop IN LISTS _cmake_property_list)
if(_prop MATCHES "<CONFIG>")
foreach(_config IN ITEMS "DEBUG" "RELEASE" "MINSIZEREL" "RELWITHDEBINFO")

View file

@ -1,77 +0,0 @@
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
if("@USE_OPENSSL@")
if("@OPENSSL_VERSION_MAJOR@")
find_dependency(OpenSSL "@OPENSSL_VERSION_MAJOR@")
else()
find_dependency(OpenSSL)
endif()
endif()
if("@HAVE_LIBZ@")
find_dependency(ZLIB "@ZLIB_VERSION_MAJOR@")
endif()
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
# Alias for either shared or static library
if(NOT TARGET @PROJECT_NAME@::@LIB_NAME@)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.11 AND CMAKE_VERSION VERSION_LESS 3.18)
set_target_properties(@PROJECT_NAME@::@LIB_SELECTED@ PROPERTIES IMPORTED_GLOBAL TRUE)
endif()
add_library(@PROJECT_NAME@::@LIB_NAME@ ALIAS @PROJECT_NAME@::@LIB_SELECTED@)
endif()
# For compatibility with CMake's FindCURL.cmake
set(CURL_VERSION_STRING "@CURLVERSION@")
set(CURL_LIBRARIES @PROJECT_NAME@::@LIB_NAME@)
set_and_check(CURL_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
set(CURL_SUPPORTED_PROTOCOLS "@CURL_SUPPORTED_PROTOCOLS_LIST@")
set(CURL_SUPPORTED_FEATURES "@CURL_SUPPORTED_FEATURES_LIST@")
foreach(_item IN LISTS CURL_SUPPORTED_PROTOCOLS CURL_SUPPORTED_FEATURES)
set(CURL_SUPPORTS_${_item} TRUE)
endforeach()
set(_missing_req "")
foreach(_item IN LISTS CURL_FIND_COMPONENTS)
if(CURL_SUPPORTS_${_item})
set(CURL_${_item}_FOUND TRUE)
elseif(CURL_FIND_REQUIRED_${_item})
list(APPEND _missing_req ${_item})
endif()
endforeach()
if(_missing_req)
string(REPLACE ";" " " _missing_req "${_missing_req}")
if(CURL_FIND_REQUIRED)
message(FATAL_ERROR "CURL: missing required components: ${_missing_req}")
endif()
unset(_missing_req)
endif()
check_required_components("@PROJECT_NAME@")

196
CMake/curl-config.in.cmake Normal file
View file

@ -0,0 +1,196 @@
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
@PACKAGE_INIT@
option(CURL_USE_CMAKECONFIG "Enable detecting @PROJECT_NAME@ dependencies via CMake Config. Default: @CURL_USE_CMAKECONFIG@"
"@CURL_USE_CMAKECONFIG@")
option(CURL_USE_PKGCONFIG "Enable pkg-config to detect @PROJECT_NAME@ dependencies. Default: @CURL_USE_PKGCONFIG@"
"@CURL_USE_PKGCONFIG@")
if(CMAKE_VERSION VERSION_LESS @CMAKE_MINIMUM_REQUIRED_VERSION@)
message(STATUS "@PROJECT_NAME@: @PROJECT_NAME@-specific Find modules require "
"CMake @CMAKE_MINIMUM_REQUIRED_VERSION@ or upper, found: ${CMAKE_VERSION}.")
endif()
include(CMakeFindDependencyMacro)
if("@HAVE_THREADS_POSIX@" OR "@HAVE_THREADS_POSIX_BORINGSSL@")
find_dependency(Threads) # for Threads::Threads
endif()
if("@USE_OPENSSL@")
if("@OPENSSL_VERSION_MAJOR@")
find_dependency(OpenSSL "@OPENSSL_VERSION_MAJOR@")
else()
find_dependency(OpenSSL)
endif()
# Define lib duplicate to fixup lib order for GCC binutils ld in static builds
if(TARGET OpenSSL::Crypto AND NOT TARGET CURL::OpenSSL_Crypto)
add_library(CURL::OpenSSL_Crypto INTERFACE IMPORTED)
set_target_properties(CURL::OpenSSL_Crypto PROPERTIES INTERFACE_LINK_LIBRARIES OpenSSL::Crypto)
endif()
endif()
if("@HAVE_LIBZ@")
find_dependency(ZLIB "@ZLIB_VERSION_MAJOR@")
# Define lib duplicate to fixup lib order for GCC binutils ld in static builds
if(TARGET ZLIB::ZLIB AND NOT TARGET CURL::ZLIB)
add_library(CURL::ZLIB INTERFACE IMPORTED)
set_target_properties(CURL::ZLIB PROPERTIES INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
endif()
endif()
set(_curl_cmake_module_path_save ${CMAKE_MODULE_PATH})
list(PREPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
set(_curl_libs "")
if("@HAVE_BROTLI@")
find_dependency(Brotli MODULE)
list(APPEND _curl_libs CURL::brotli)
endif()
if("@USE_ARES@")
find_dependency(Cares MODULE)
list(APPEND _curl_libs CURL::cares)
endif()
if("@HAVE_GSSAPI@")
find_dependency(GSS MODULE)
list(APPEND _curl_libs CURL::gss)
endif()
if("@USE_BACKTRACE@")
find_dependency(Libbacktrace MODULE)
list(APPEND _curl_libs CURL::libbacktrace)
endif()
if("@USE_GSASL@")
find_dependency(Libgsasl MODULE)
list(APPEND _curl_libs CURL::libgsasl)
endif()
if(NOT "@USE_WIN32_LDAP@" AND NOT "@CURL_DISABLE_LDAP@")
find_dependency(LDAP MODULE)
list(APPEND _curl_libs CURL::ldap)
endif()
if("@HAVE_LIBIDN2@")
find_dependency(Libidn2 MODULE)
list(APPEND _curl_libs CURL::libidn2)
endif()
if("@USE_LIBPSL@")
find_dependency(Libpsl MODULE)
list(APPEND _curl_libs CURL::libpsl)
endif()
if("@USE_LIBSSH@")
find_dependency(Libssh MODULE)
list(APPEND _curl_libs CURL::libssh)
endif()
if("@USE_LIBSSH2@")
find_dependency(Libssh2 MODULE)
list(APPEND _curl_libs CURL::libssh2)
endif()
if("@USE_LIBUV@")
find_dependency(Libuv MODULE)
list(APPEND _curl_libs CURL::libuv)
endif()
if("@USE_MBEDTLS@")
find_dependency(MbedTLS MODULE)
list(APPEND _curl_libs CURL::mbedtls)
endif()
if("@USE_NGHTTP2@")
find_dependency(NGHTTP2 MODULE)
list(APPEND _curl_libs CURL::nghttp2)
endif()
if("@USE_NGHTTP3@")
find_dependency(NGHTTP3 MODULE)
list(APPEND _curl_libs CURL::nghttp3)
endif()
if("@USE_NGTCP2@")
find_dependency(NGTCP2 MODULE)
list(APPEND _curl_libs CURL::ngtcp2)
endif()
if("@USE_GNUTLS@")
find_dependency(GnuTLS MODULE)
list(APPEND _curl_libs CURL::gnutls)
find_dependency(Nettle MODULE)
list(APPEND _curl_libs CURL::nettle)
endif()
if("@USE_QUICHE@")
find_dependency(Quiche MODULE)
list(APPEND _curl_libs CURL::quiche)
endif()
if("@USE_RUSTLS@")
find_dependency(Rustls MODULE)
list(APPEND _curl_libs CURL::rustls)
endif()
if("@USE_WOLFSSL@")
find_dependency(WolfSSL MODULE)
list(APPEND _curl_libs CURL::wolfssl)
endif()
if("@HAVE_ZSTD@")
find_dependency(Zstd MODULE)
list(APPEND _curl_libs CURL::zstd)
endif()
set(CMAKE_MODULE_PATH ${_curl_cmake_module_path_save})
# Define lib duplicate to fixup lib order for GCC binutils ld in static builds
if(WIN32 AND NOT TARGET CURL::win32_winsock)
add_library(CURL::win32_winsock INTERFACE IMPORTED)
set_target_properties(CURL::win32_winsock PROPERTIES INTERFACE_LINK_LIBRARIES "ws2_32")
endif()
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
# Alias for either shared or static library
if(NOT TARGET @PROJECT_NAME@::@LIB_NAME@)
add_library(@PROJECT_NAME@::@LIB_NAME@ ALIAS @PROJECT_NAME@::@LIB_SELECTED@)
endif()
# For compatibility with CMake's FindCURL.cmake
set(CURL_VERSION_STRING "@CURLVERSION@")
set(CURL_LIBRARIES @PROJECT_NAME@::@LIB_NAME@)
set(CURL_LIBRARIES_PRIVATE "@LIBCURL_PC_LIBS_PRIVATE_LIST@")
set_and_check(CURL_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
set(CURL_SUPPORTED_PROTOCOLS "@CURL_SUPPORTED_PROTOCOLS_LIST@")
set(CURL_SUPPORTED_FEATURES "@CURL_SUPPORTED_FEATURES_LIST@")
foreach(_curl_item IN LISTS CURL_SUPPORTED_PROTOCOLS CURL_SUPPORTED_FEATURES)
set(CURL_SUPPORTS_${_curl_item} TRUE)
endforeach()
set(_curl_missing_req "")
foreach(_curl_item IN LISTS CURL_FIND_COMPONENTS)
if(CURL_SUPPORTS_${_curl_item})
set(CURL_${_curl_item}_FOUND TRUE)
elseif(CURL_FIND_REQUIRED_${_curl_item})
list(APPEND _curl_missing_req ${_curl_item})
endif()
endforeach()
if(_curl_missing_req)
string(REPLACE ";" " " _curl_missing_req "${_curl_missing_req}")
if(CURL_FIND_REQUIRED)
message(FATAL_ERROR "@PROJECT_NAME@: missing required components: ${_curl_missing_req}")
endif()
unset(_curl_missing_req)
endif()
check_required_components("@PROJECT_NAME@")

View file

@ -88,7 +88,6 @@ elseif(CYGWIN OR
set(HAVE_FSETXATTR_5 1)
set(HAVE_FSETXATTR_6 0)
endif()
set(HAVE_FTRUNCATE 1)
set(HAVE_GETADDRINFO 1)
if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_GETADDRINFO_THREADSAFE 0)
@ -142,7 +141,7 @@ set(HAVE_GETRLIMIT 1)
set(HAVE_GETSOCKNAME 1)
set(HAVE_GETTIMEOFDAY 1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_GLIBC_STRERROR_R 1)
# Depends on C library.
else()
set(HAVE_GLIBC_STRERROR_R 0)
endif()
@ -164,12 +163,12 @@ else()
endif()
set(HAVE_LIBGEN_H 1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_LINUX_TCP_H 1)
# Requires Linux kernel userspace headers. Expected with glibc. May be missing by default with MUSL.
else()
set(HAVE_LINUX_TCP_H 0)
endif()
set(HAVE_LOCALE_H 1)
set(HAVE_LONGLONG 1)
set(HAVE_LOCALTIME_R 1)
if(APPLE)
set(HAVE_MACH_ABSOLUTE_TIME 1)
endif()
@ -179,7 +178,6 @@ if(APPLE OR
else()
set(HAVE_MEMRCHR 1)
endif()
set(HAVE_MSG_NOSIGNAL 1)
set(HAVE_NETDB_H 1)
if(ANDROID)
set(HAVE_NETINET_IN6_H 1)
@ -196,15 +194,18 @@ if(APPLE OR
CYGWIN)
set(HAVE_PIPE2 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
BSD OR
CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "SunOS")
set(HAVE_PIPE2 1)
endif()
set(HAVE_POLL 1)
set(HAVE_POLL_H 1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_POSIX_STRERROR_R 0)
# Depends on C library.
else()
set(HAVE_POSIX_STRERROR_R 1)
endif()
@ -223,30 +224,22 @@ else()
endif()
set(HAVE_SENDMSG 1)
set(HAVE_SETLOCALE 1)
if(CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_SETMODE 0)
else()
set(HAVE_SETMODE 1)
endif()
set(HAVE_SETRLIMIT 1)
set(HAVE_SETSOCKOPT_SO_NONBLOCK 0)
set(HAVE_SIGACTION 1)
set(HAVE_SIGINTERRUPT 1)
set(HAVE_SIGNAL 1)
set(HAVE_SIGSETJMP 1)
set(HAVE_SNPRINTF 1)
set(HAVE_SOCKADDR_IN6_SIN6_ADDR 1)
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1)
set(HAVE_SOCKET 1)
set(HAVE_SOCKETPAIR 1)
set(HAVE_STDATOMIC_H 1)
set(HAVE_STDBOOL_H 1)
set(HAVE_STDDEF_H 1)
set(HAVE_STDINT_H 1)
set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size()
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size()
set(HAVE_STRCASECMP 1)
set(HAVE_STRCMPI 0)
set(HAVE_STRDUP 1)
set(HAVE_STRERROR_R 1)
set(HAVE_STRICMP 0)
set(HAVE_STRINGS_H 1)
@ -306,8 +299,5 @@ set(HAVE_UTIME 1)
set(HAVE_UTIMES 1)
set(HAVE_UTIME_H 1)
set(HAVE_WRITABLE_ARGV 1)
if(CYGWIN)
set(HAVE__SETMODE 1)
endif()
set(STDC_HEADERS 1)
set(USE_UNIX_SOCKETS 1)

View file

@ -29,11 +29,9 @@ if(MINGW)
set(HAVE_BASENAME 1)
set(HAVE_BOOL_T 1) # = HAVE_STDBOOL_H
set(HAVE_DIRENT_H 1)
set(HAVE_FTRUNCATE 1)
set(HAVE_GETTIMEOFDAY 1)
set(HAVE_LIBGEN_H 1)
set(HAVE_OPENDIR 1)
set(HAVE_SNPRINTF 1)
set(HAVE_STDBOOL_H 1)
set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size()
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size()
@ -43,7 +41,6 @@ if(MINGW)
set(HAVE_UTIME_H 1) # wrapper to sys/utime.h
else()
set(HAVE_DIRENT_H 0)
set(HAVE_FTRUNCATE 0)
set(HAVE_GETTIMEOFDAY 0)
set(HAVE_LIBGEN_H 0)
set(HAVE_OPENDIR 0)
@ -53,22 +50,13 @@ else()
if(MSVC)
set(HAVE_UNISTD_H 0)
set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size()
if(MSVC_VERSION GREATER_EQUAL 1600)
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size()
else()
set(HAVE_STDINT_H 0) # detected by CMake internally in check_type_size()
endif()
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size()
if(MSVC_VERSION GREATER_EQUAL 1800)
set(HAVE_STDBOOL_H 1)
else()
set(HAVE_STDBOOL_H 0)
endif()
set(HAVE_BOOL_T "${HAVE_STDBOOL_H}")
if(MSVC_VERSION GREATER_EQUAL 1900)
set(HAVE_SNPRINTF 1)
else()
set(HAVE_SNPRINTF 0)
endif()
set(HAVE_BASENAME 0)
endif()
endif()
@ -127,8 +115,8 @@ set(HAVE_IOCTL_SIOCGIFADDR 0)
set(HAVE_IO_H 1)
set(HAVE_LINUX_TCP_H 0)
set(HAVE_LOCALE_H 1)
set(HAVE_LOCALTIME_R 0)
set(HAVE_MEMRCHR 0)
set(HAVE_MSG_NOSIGNAL 0)
set(HAVE_NETDB_H 0)
set(HAVE_NETINET_IN6_H 0)
set(HAVE_NETINET_IN_H 0)
@ -147,7 +135,6 @@ set(HAVE_SEND 1)
set(HAVE_SENDMMSG 0)
set(HAVE_SENDMSG 0)
set(HAVE_SETLOCALE 1)
set(HAVE_SETMODE 1)
set(HAVE_SETRLIMIT 0)
set(HAVE_SETSOCKOPT_SO_NONBLOCK 0)
set(HAVE_SIGACTION 0)
@ -157,7 +144,6 @@ set(HAVE_SIGSETJMP 0)
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1)
set(HAVE_SOCKET 1)
set(HAVE_SOCKETPAIR 0)
set(HAVE_STRDUP 1)
set(HAVE_STRERROR_R 0)
set(HAVE_STROPTS_H 0)
set(HAVE_STRUCT_SOCKADDR_STORAGE 1)
@ -177,7 +163,6 @@ set(HAVE_TERMIO_H 0)
set(HAVE_TIME_T_UNSIGNED 0)
set(HAVE_UTIME 1)
set(HAVE_UTIMES 0)
set(HAVE__SETMODE 1)
set(STDC_HEADERS 1)
# Types and sizes
@ -188,11 +173,11 @@ set(HAVE_SIZEOF_SUSECONDS_T 0)
if(MINGW OR MSVC)
curl_prefill_type_size("INT" 4)
curl_prefill_type_size("LONG" 4)
curl_prefill_type_size("LONG_LONG" 8)
curl_prefill_type_size("__INT64" 8)
curl_prefill_type_size("CURL_OFF_T" 8)
# CURL_SOCKET_T, SIZE_T: 8 for _WIN64, 4 otherwise
# TIME_T: 8 for _WIN64 or UCRT or MSVC and not Windows CE, 4 otherwise
curl_prefill_type_size("CURL_SOCKET_T" ${CMAKE_SIZEOF_VOID_P})
curl_prefill_type_size("SIZE_T" ${CMAKE_SIZEOF_VOID_P})
# TIME_T: 8 for _WIN64 or UCRT or MSVC, 4 otherwise
# Also 4 for non-UCRT 32-bit when _USE_32BIT_TIME_T is set.
# mingw-w64 sets _USE_32BIT_TIME_T unless __MINGW_USE_VC2005_COMPAT is explicit defined.
if(MSVC)
@ -200,30 +185,8 @@ if(MINGW OR MSVC)
set(HAVE_FILE_OFFSET_BITS 0)
curl_prefill_type_size("OFF_T" 4)
else()
# SSIZE_T: 8 for _WIN64, 4 otherwise
curl_prefill_type_size("SSIZE_T" ${CMAKE_SIZEOF_VOID_P})
set(HAVE_FILE_OFFSET_BITS 1) # mingw-w64 v3+
curl_prefill_type_size("OFF_T" 8) # mingw-w64 v3+
endif()
endif()
# Windows CE exceptions
if(WINCE)
set(HAVE_FREEADDRINFO 0)
set(HAVE_GETADDRINFO 0)
set(HAVE_LOCALE_H 0)
set(HAVE_SETLOCALE 0)
set(HAVE_SETMODE 0)
set(HAVE_SIGNAL 0)
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 0)
curl_prefill_type_size("CURL_SOCKET_T" 4)
curl_prefill_type_size("TIME_T" 4)
curl_prefill_type_size("SIZE_T" 4)
if(MINGW32CE)
set(HAVE_STRTOK_R 0)
set(HAVE__SETMODE 0)
set(HAVE_FILE_OFFSET_BITS 0)
curl_prefill_type_size("SSIZE_T" 4)
curl_prefill_type_size("OFF_T" 4)
endif()
endif()

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
COPYRIGHT AND PERMISSION NOTICE
Copyright (c) 1996 - 2025, Daniel Stenberg, <daniel@haxx.se>, and many
Copyright (c) 1996 - 2026, Daniel Stenberg, <daniel@haxx.se>, and many
contributors, see the THANKS file.
All rights reserved.

View file

@ -24,7 +24,7 @@
# $ ./scripts/maketgz 8.7.1
# To update, get the latest digest e.g. from https://hub.docker.com/_/debian/tags
FROM debian:bookworm-slim@sha256:df52e55e3361a81ac1bead266f3373ee55d29aa50cf0975d440c2be3483d8ed3
FROM debian:bookworm-slim@sha256:4724b8cc51e33e398f0e2e15e18d5ec2851ff0c2280647e1310bc1642182655d
RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \
build-essential make autoconf automake libtool git perl zip zlib1g-dev gawk && \

View file

@ -1,3 +1,8 @@
<!--
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
_ _ ____ _
___| | | | _ \| |
/ __| | | | |_) | |

View file

@ -1,11 +0,0 @@
Copyright (c) <year> <owner>.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -1,15 +1,33 @@
BSD-4-Clause (University of California-Specific)
Copyright [various years] The Regents of the University of California. All rights reserved.
Copyright [various years] The Regents of the University of California.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the University of California, Berkeley and its contributors.
3. All advertising materials mentioning features or use of this software must
display the following acknowledgement: This product includes software
developed by the University of California, Berkeley and its contributors.
4. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
4. Neither the name of the University nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -26,75 +26,59 @@ AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
CMAKE_DIST = \
CMake/cmake_uninstall.cmake.in \
CMake/CMakeConfigurableFile.in \
CMake/curl-config.cmake.in \
CMake/CurlSymbolHiding.cmake \
CMake/CurlTests.c \
CMake/FindBrotli.cmake \
CMake/FindCares.cmake \
CMake/FindGSS.cmake \
CMake/FindLDAP.cmake \
CMake/FindLibgsasl.cmake \
CMake/FindLibidn2.cmake \
CMake/FindLibpsl.cmake \
CMake/FindLibrtmp.cmake \
CMake/FindLibssh.cmake \
CMake/FindLibssh2.cmake \
CMake/FindLibuv.cmake \
CMake/FindMbedTLS.cmake \
CMake/FindNGHTTP2.cmake \
CMake/FindNGHTTP3.cmake \
CMake/FindNGTCP2.cmake \
CMake/FindNettle.cmake \
CMake/FindQuiche.cmake \
CMake/FindRustls.cmake \
CMake/FindWolfSSH.cmake \
CMake/FindWolfSSL.cmake \
CMake/FindZstd.cmake \
CMake/Macros.cmake \
CMake/OtherTests.cmake \
CMake/PickyWarnings.cmake \
CMake/Utilities.cmake \
CMake/unix-cache.cmake \
CMake/win32-cache.cmake \
CMakeLists.txt \
tests/cmake/CMakeLists.txt \
tests/cmake/test.c \
tests/cmake/test.sh
CMAKE_DIST = \
CMake/cmake_uninstall.in.cmake \
CMake/curl-config.in.cmake \
CMake/CurlSymbolHiding.cmake \
CMake/CurlTests.c \
CMake/FindBrotli.cmake \
CMake/FindCares.cmake \
CMake/FindGnuTLS.cmake \
CMake/FindGSS.cmake \
CMake/FindLDAP.cmake \
CMake/FindLibbacktrace.cmake \
CMake/FindLibgsasl.cmake \
CMake/FindLibidn2.cmake \
CMake/FindLibpsl.cmake \
CMake/FindLibssh.cmake \
CMake/FindLibssh2.cmake \
CMake/FindLibuv.cmake \
CMake/FindMbedTLS.cmake \
CMake/FindNGHTTP2.cmake \
CMake/FindNGHTTP3.cmake \
CMake/FindNGTCP2.cmake \
CMake/FindNettle.cmake \
CMake/FindQuiche.cmake \
CMake/FindRustls.cmake \
CMake/FindWolfSSL.cmake \
CMake/FindZstd.cmake \
CMake/Macros.cmake \
CMake/OtherTests.cmake \
CMake/PickyWarnings.cmake \
CMake/Utilities.cmake \
CMake/unix-cache.cmake \
CMake/win32-cache.cmake \
CMakeLists.txt \
tests/cmake/CMakeLists.txt \
tests/cmake/test.c \
tests/cmake/test.cpp \
tests/cmake/test.sh
VC_DIST = projects/README.md projects/generate.bat
WINBUILD_DIST = winbuild/README.md \
winbuild/MakefileBuild.vc winbuild/Makefile.vc winbuild/makedebug.bat
PLAN9_DIST = plan9/include/mkfile \
plan9/include/mkfile \
plan9/mkfile.proto \
plan9/mkfile \
plan9/README \
plan9/lib/mkfile.inc \
plan9/lib/mkfile \
plan9/src/mkfile.inc \
plan9/src/mkfile
EXTRA_DIST = CHANGES.md COPYING RELEASE-NOTES Dockerfile .editorconfig \
$(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) $(PLAN9_DIST)
EXTRA_DIST = CHANGES.md COPYING RELEASE-NOTES Dockerfile .clang-tidy.yml .editorconfig $(CMAKE_DIST)
DISTCLEANFILES = buildinfo.txt
bin_SCRIPTS = curl-config
SUBDIRS = lib docs src scripts
DIST_SUBDIRS = $(SUBDIRS) tests packages include docs
DIST_SUBDIRS = $(SUBDIRS) tests projects include docs
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libcurl.pc
dist-hook:
rm -rf $(top_builddir)/tests/log
find $(distdir) -name "*.dist" -exec rm {} \;
find $(distdir) -name "*.dist" -exec rm -- {} \;
(distit=`find $(srcdir) -name "*.dist" | grep -v Makefile`; \
for file in $$distit; do \
strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \
@ -114,7 +98,7 @@ pytest: test
pytest-ci: test
test:
@echo "NOTICE: we can't run the tests when cross-compiling!"
@echo "NOTICE: we cannot run the tests when cross-compiling!"
else
@ -153,32 +137,6 @@ examples:
check-docs:
@(cd docs/libcurl; $(MAKE) check)
# Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros
# must contain the following line:
# %_topdir /home/loic/local/rpm
# and that /home/loic/local/rpm contains the directory SOURCES, BUILD etc.
#
# cd /home/loic/local/rpm ; mkdir -p SOURCES BUILD RPMS/i386 SPECS SRPMS
#
# If additional configure flags are needed to build the package, add the
# following in ~/.rpmmacros
# %configure CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix} ${AM_CONFIGFLAGS}
# and run make rpm in the following way:
# AM_CONFIGFLAGS='--with-uri=/home/users/loic/local/RedHat-6.2' make rpm
#
rpms:
$(MAKE) RPMDIST=curl rpm
$(MAKE) RPMDIST=curl-ssl rpm
rpm:
RPM_TOPDIR=`rpm --showrc | @PERL@ -n -e 'print if(s/.*_topdir\s+(.*)/$$1/)'` ; \
cp $(srcdir)/packages/Linux/RPM/$(RPMDIST).spec $$RPM_TOPDIR/SPECS ; \
cp $(PACKAGE)-$(VERSION).tar.gz $$RPM_TOPDIR/SOURCES ; \
rpm -ba --clean --rmsource $$RPM_TOPDIR/SPECS/$(RPMDIST).spec ; \
mv $$RPM_TOPDIR/RPMS/i386/$(RPMDIST)-*.rpm . ; \
mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm .
# We extend the standard install with a custom hook:
if BUILD_DOCS
install-data-hook:
@ -211,7 +169,13 @@ checksrc:
(cd tests && $(MAKE) checksrc)
(cd include/curl && $(MAKE) checksrc)
(cd docs/examples && $(MAKE) checksrc)
(cd packages && $(MAKE) checksrc)
(cd projects && $(MAKE) checksrc)
badwords:
@PERL@ $(top_srcdir)/scripts/badwords-all
lint: badwords checksrc
@PERL@ $(top_srcdir)/scripts/spacecheck.pl
tidy:
(cd src && $(MAKE) tidy)

17
README
View file

@ -15,7 +15,8 @@ README
available to be used by your software. Read the libcurl.3 man page to
learn how.
You find answers to the most frequent questions we get in the FAQ document.
You find answers to the most frequent questions we get in the FAQ.md
document.
Study the COPYING file for distribution terms.
@ -32,24 +33,18 @@ WEBSITE
Visit the curl website for the latest news and downloads:
https://curl.se/
https://curl.se/
GIT
To download the latest source code off the GIT server, do this:
git clone https://github.com/curl/curl.git
git clone https://github.com/curl/curl
(you will get a directory named curl created, filled with the source code)
SECURITY PROBLEMS
Report suspected security problems via our HackerOne page and not in public.
Report suspected security problems privately and not in public.
https://hackerone.com/curl
NOTICE
Curl contains pieces of source code that is Copyright (c) 1998, 1999
Kungliga Tekniska Högskolan. This notice is included here to comply with the
distribution terms.
https://curl.se/dev/vuln-disclosure.html

View file

@ -6,9 +6,13 @@ SPDX-License-Identifier: curl
# [![curl logo](https://curl.se/logo/curl-logo.svg)](https://curl.se/)
curl is a command-line tool for transferring data specified with URL syntax.
curl is a command-line tool for transferring data from or to a server using
URLs. It supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS,
HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, MQTTS, POP3, POP3S, RTSP, SCP,
SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS.
Learn how to use curl by reading [the
manpage](https://curl.se/docs/manpage.html) or [everything
man page](https://curl.se/docs/manpage.html) or [everything
curl](https://everything.curl.dev/).
Find out how to install curl by reading [the INSTALL
@ -16,7 +20,7 @@ document](https://curl.se/docs/install.html).
libcurl is the library curl is using to do its job. It is readily available to
be used by your software. Read [the libcurl
manpage](https://curl.se/libcurl/c/libcurl.html) to learn how.
man page](https://curl.se/libcurl/c/libcurl.html) to learn how.
## Open Source
@ -46,18 +50,12 @@ Visit the [curl website](https://curl.se/) for the latest news and downloads.
Download the latest source from the Git server:
git clone https://github.com/curl/curl.git
git clone https://github.com/curl/curl
## Security problems
Report suspected security problems via [our HackerOne
page](https://hackerone.com/curl) and not in public.
## Notice
curl contains pieces of source code that is Copyright (c) 1998, 1999 Kungliga
Tekniska Högskolan. This notice is included here to comply with the
distribution terms.
Report suspected security problems
[privately](https://curl.se/dev/vuln-disclosure.html) and not in public.
## Backers

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
# SPDX-FileCopyrightText: Daniel Stenberg, <daniel@haxx.se>, et al.
# This file describes the licensing and copyright situation for files that
# cannot be annotated directly, for example because of being simply
# cannot be annotated directly, for example because of being
# uncommentable. Unless this is the case, a file should be annotated directly.
#
# This follows the REUSE specification: https://reuse.software/spec-3.2/#reusetoml
@ -13,41 +13,26 @@ SPDX-PackageDownloadLocation = "https://curl.se/"
[[annotations]]
path = [
".mailmap",
"docs/FAQ",
"docs/INSTALL",
"docs/KNOWN_BUGS",
"docs/libcurl/symbols-in-versions",
"docs/MAIL-ETIQUETTE",
"docs/options-in-versions",
"docs/THANKS",
"docs/TODO",
"GIT-INFO.md",
"lib/libcurl.vers.in",
"lib/libcurl.def",
"packages/OS400/README.OS400",
"packages/vms/build_vms.com",
"packages/vms/curl_release_note_start.txt",
"packages/vms/curlmsg.sdl",
"packages/vms/macro32_exactcase.patch",
"packages/vms/readme",
"plan9/README",
"projects/OS400/README.OS400",
"projects/vms/build_vms.com",
"projects/vms/curl_release_note_start.txt",
"projects/vms/curlmsg.sdl",
"projects/vms/macro32_exactcase.patch",
"projects/vms/readme",
"projects/Windows/**",
"README",
"RELEASE-NOTES",
"renovate.json",
"tests/certs/**",
"tests/data/data**",
"tests/data/test**",
"tests/valgrind.supp",
# checksrc control files
"lib/.checksrc",
"lib/curlx/.checksrc",
"lib/vauth/.checksrc",
"lib/vquic/.checksrc",
"lib/vssh/.checksrc",
"lib/vtls/.checksrc",
"src/.checksrc",
"tests/server/.checksrc",
]
SPDX-FileCopyrightText = "Daniel Stenberg, <daniel@haxx.se>, et al."
SPDX-License-Identifier = "curl"

View file

@ -10,19 +10,20 @@ Read our [Vulnerability Disclosure Policy](docs/VULN-DISCLOSURE-POLICY.md).
## Reporting a Vulnerability
If you have found or just suspect a security problem somewhere in curl or
libcurl, report it on [HackerOne](https://hackerone.com/curl).
If you have found or suspect a security problem somewhere in curl or libcurl,
[report it](https://curl.se/dev/vuln-disclosure.html)!
We treat security issues with confidentiality until controlled and disclosed responsibly.
We treat security issues with confidentiality until controlled and disclosed
responsibly.
## OpenSSF Best Practices
curl has achieved Gold status on the Open Source Security Foundation (OpenSSF)
[Best Practices](https://bestpractices.dev/) (formerly Core Infrastructure
Initiative Best Practices), reflecting its adherence to rigorous
security and best practice standards. This achievement highlights curl's
comprehensive documentation, secure development processes, effective change
control mechanisms, and strong maintenance routines. Meeting these criteria
Initiative Best Practices), reflecting its adherence to rigorous security and
best practice standards. This achievement highlights curl's comprehensive
documentation, secure development processes, effective change control
mechanisms, and strong maintenance routines. Meeting these criteria
demonstrates curl's commitment to security and reliability, ensuring the
project's sustainability and trustworthiness. This underscores curl's role as
a leader in open-source software practices. More information can be found on

View file

@ -32,12 +32,12 @@ dnl result in a set of double-quoted strings the returned expansion will
dnl actually be a single double-quoted string concatenating all them.
AC_DEFUN([CURL_CHECK_DEF], [
AC_REQUIRE([CURL_CPP_P])dnl
AC_REQUIRE([CURL_CPP_P])
OLDCPPFLAGS=$CPPFLAGS
# CPPPFLAG comes from CURL_CPP_P
dnl CPPPFLAG comes from CURL_CPP_P
CPPFLAGS="$CPPFLAGS $CPPPFLAG"
AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])dnl
AS_VAR_PUSHDEF([ac_Def], [curl_cv_def_$1])dnl
AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])
AS_VAR_PUSHDEF([ac_Def], [curl_cv_def_$1])
if test -z "$SED"; then
AC_MSG_ERROR([SED not set. Cannot continue without SED being set.])
fi
@ -70,8 +70,8 @@ AC_DEFUN([CURL_CHECK_DEF], [
AS_VAR_SET(ac_Def, $tmp_exp)
ifelse($3,,[AC_MSG_RESULT([$tmp_exp])])
fi
AS_VAR_POPDEF([ac_Def])dnl
AS_VAR_POPDEF([ac_HaveDef])dnl
AS_VAR_POPDEF([ac_Def])
AS_VAR_POPDEF([ac_HaveDef])
CPPFLAGS=$OLDCPPFLAGS
])
@ -84,7 +84,7 @@ dnl default includes even if no INCLUDES argument is given. This macro
dnl will run silently when invoked with three arguments.
AC_DEFUN([CURL_CHECK_DEF_CC], [
AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])dnl
AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])
ifelse($3,,[AC_MSG_CHECKING([for compiler definition of $1])])
AC_COMPILE_IFELSE([
AC_LANG_SOURCE(
@ -109,7 +109,7 @@ AC_DEFUN([CURL_CHECK_DEF_CC], [
AS_VAR_SET(ac_HaveDef, no)
ifelse($3,,[AC_MSG_RESULT([no])])
fi
AS_VAR_POPDEF([ac_HaveDef])dnl
AS_VAR_POPDEF([ac_HaveDef])
])
@ -152,8 +152,8 @@ AC_DEFUN([CURL_CHECK_AIX_ALL_SOURCE], [
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif])
AC_BEFORE([$0], [AC_SYS_LARGEFILE])dnl
AC_BEFORE([$0], [CURL_CONFIGURE_REENTRANT])dnl
AC_BEFORE([$0], [AC_SYS_LARGEFILE])
AC_BEFORE([$0], [CURL_CONFIGURE_REENTRANT])
AC_MSG_CHECKING([if OS is AIX (to define _ALL_SOURCE)])
AC_EGREP_CPP([yes_this_is_aix],[
#ifdef _AIX
@ -190,7 +190,7 @@ AC_DEFUN([CURL_CHECK_NATIVE_WINDOWS], [
curl_cv_native_windows="no"
])
])
AM_CONDITIONAL(DOING_NATIVE_WINDOWS, test "x$curl_cv_native_windows" = xyes)
AM_CONDITIONAL(DOING_NATIVE_WINDOWS, test "$curl_cv_native_windows" = "yes")
])
@ -200,7 +200,7 @@ dnl Check for compilable and valid lber.h header,
dnl and check if it is needed even with ldap.h
AC_DEFUN([CURL_CHECK_HEADER_LBER], [
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])
AC_CACHE_CHECK([for lber.h], [curl_cv_header_lber_h], [
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
@ -233,7 +233,7 @@ AC_DEFUN([CURL_CHECK_HEADER_LBER], [
if test "$curl_cv_header_lber_h" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_LBER_H, 1,
[Define to 1 if you have the lber.h header file.])
#
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#undef inline
@ -264,7 +264,7 @@ AC_DEFUN([CURL_CHECK_HEADER_LBER], [
],[
curl_cv_need_header_lber_h="yes"
])
#
case "$curl_cv_need_header_lber_h" in
yes)
AC_DEFINE_UNQUOTED(NEED_LBER_H, 1,
@ -280,7 +280,7 @@ dnl -------------------------------------------------
dnl Check for compilable and valid ldap.h header
AC_DEFUN([CURL_CHECK_HEADER_LDAP], [
AC_REQUIRE([CURL_CHECK_HEADER_LBER])dnl
AC_REQUIRE([CURL_CHECK_HEADER_LBER])
AC_CACHE_CHECK([for ldap.h], [curl_cv_header_ldap_h], [
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
@ -327,7 +327,7 @@ dnl -------------------------------------------------
dnl Check for compilable and valid ldap_ssl.h header
AC_DEFUN([CURL_CHECK_HEADER_LDAP_SSL], [
AC_REQUIRE([CURL_CHECK_HEADER_LDAP])dnl
AC_REQUIRE([CURL_CHECK_HEADER_LDAP])
AC_CACHE_CHECK([for ldap_ssl.h], [curl_cv_header_ldap_ssl_h], [
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
@ -380,12 +380,12 @@ dnl whitespace separated list of libraries to check
dnl before the WINLDAP default ones.
AC_DEFUN([CURL_CHECK_LIBS_WINLDAP], [
AC_REQUIRE([CURL_CHECK_HEADER_WINBER])dnl
#
AC_REQUIRE([CURL_CHECK_HEADER_WINBER])
AC_MSG_CHECKING([for WINLDAP libraries])
#
u_libs=""
#
ifelse($1,,,[
for x_lib in $1; do
case "$x_lib" in
@ -403,10 +403,10 @@ AC_DEFUN([CURL_CHECK_LIBS_WINLDAP], [
fi
done
])
#
curl_cv_save_LIBS="$LIBS"
curl_cv_ldap_LIBS="unknown"
#
for x_nlibs in '' "$u_libs" \
'-lwldap32' ; do
if test "$curl_cv_ldap_LIBS" = "unknown"; then
@ -441,9 +441,9 @@ AC_DEFUN([CURL_CHECK_LIBS_WINLDAP], [
])
fi
done
#
LIBS="$curl_cv_save_LIBS"
#
case X-"$curl_cv_ldap_LIBS" in
X-unknown)
AC_MSG_RESULT([cannot find WINLDAP libraries])
@ -460,7 +460,6 @@ AC_DEFUN([CURL_CHECK_LIBS_WINLDAP], [
AC_MSG_RESULT([$curl_cv_ldap_LIBS])
;;
esac
#
])
@ -473,12 +472,12 @@ dnl whitespace separated list of libraries to check
dnl before the default ones.
AC_DEFUN([CURL_CHECK_LIBS_LDAP], [
AC_REQUIRE([CURL_CHECK_HEADER_LDAP])dnl
#
AC_REQUIRE([CURL_CHECK_HEADER_LDAP])
AC_MSG_CHECKING([for LDAP libraries])
#
u_libs=""
#
ifelse($1,,,[
for x_lib in $1; do
case "$x_lib" in
@ -496,10 +495,10 @@ AC_DEFUN([CURL_CHECK_LIBS_LDAP], [
fi
done
])
#
curl_cv_save_LIBS="$LIBS"
curl_cv_ldap_LIBS="unknown"
#
for x_nlibs in '' "$u_libs" \
'-lldap' \
'-lldap -llber' \
@ -552,9 +551,9 @@ AC_DEFUN([CURL_CHECK_LIBS_LDAP], [
])
fi
done
#
LIBS="$curl_cv_save_LIBS"
#
case X-"$curl_cv_ldap_LIBS" in
X-unknown)
AC_MSG_RESULT([cannot find LDAP libraries])
@ -568,14 +567,13 @@ AC_DEFUN([CURL_CHECK_LIBS_LDAP], [
else
LIBS="$curl_cv_ldap_LIBS $curl_cv_save_LIBS"
fi
# FIXME: Enable when ldap was detected via pkg-config
dnl FIXME: Enable when ldap was detected via pkg-config
if false; then
LIBCURL_PC_REQUIRES_PRIVATE="ldap $LIBCURL_PC_REQUIRES_PRIVATE"
fi
AC_MSG_RESULT([$curl_cv_ldap_LIBS])
;;
esac
#
])
@ -616,10 +614,10 @@ dnl -------------------------------------------------
dnl Test if the socket recv() function is available,
AC_DEFUN([CURL_CHECK_FUNC_RECV], [
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])
AC_CHECK_HEADERS(sys/types.h)
#
AC_MSG_CHECKING([for recv])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
@ -646,7 +644,7 @@ AC_DEFUN([CURL_CHECK_FUNC_RECV], [
AC_MSG_RESULT([no])
curl_cv_recv="no"
])
#
if test "$curl_cv_recv" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_RECV, 1,
[Define to 1 if you have the recv function.])
@ -662,10 +660,10 @@ dnl -------------------------------------------------
dnl Test if the socket send() function is available,
AC_DEFUN([CURL_CHECK_FUNC_SEND], [
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])
AC_CHECK_HEADERS(sys/types.h)
#
AC_MSG_CHECKING([for send])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
@ -693,7 +691,7 @@ AC_DEFUN([CURL_CHECK_FUNC_SEND], [
AC_MSG_RESULT([no])
curl_cv_send="no"
])
#
if test "$curl_cv_send" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_SEND, 1,
[Define to 1 if you have the send function.])
@ -703,52 +701,13 @@ AC_DEFUN([CURL_CHECK_FUNC_SEND], [
fi
])
dnl CURL_CHECK_MSG_NOSIGNAL
dnl -------------------------------------------------
dnl Check for MSG_NOSIGNAL
AC_DEFUN([CURL_CHECK_MSG_NOSIGNAL], [
AC_CHECK_HEADERS(sys/types.h)
AC_CACHE_CHECK([for MSG_NOSIGNAL], [curl_cv_msg_nosignal], [
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#undef inline
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <sys/socket.h>
#endif
]],[[
int flag = MSG_NOSIGNAL;
(void)flag;
]])
],[
curl_cv_msg_nosignal="yes"
],[
curl_cv_msg_nosignal="no"
])
])
case "$curl_cv_msg_nosignal" in
yes)
AC_DEFINE_UNQUOTED(HAVE_MSG_NOSIGNAL, 1,
[Define to 1 if you have the MSG_NOSIGNAL flag.])
;;
esac
])
dnl CURL_CHECK_STRUCT_TIMEVAL
dnl -------------------------------------------------
dnl Check for timeval struct
AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])
AC_CHECK_HEADERS(sys/types.h)
AC_CACHE_CHECK([for struct timeval], [curl_cv_struct_timeval], [
AC_COMPILE_IFELSE([
@ -769,7 +728,7 @@ AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [
#include <time.h>
]],[[
struct timeval ts;
ts.tv_sec = 0;
ts.tv_sec = 0;
ts.tv_usec = 0;
(void)ts;
]])
@ -795,7 +754,6 @@ dnl Check if monotonic clock_gettime is available.
AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC], [
AC_CHECK_HEADERS(sys/types.h)
AC_MSG_CHECKING([for monotonic clock_gettime])
#
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
@ -820,7 +778,7 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC], [
])
dnl Definition of HAVE_CLOCK_GETTIME_MONOTONIC is intentionally postponed
dnl until library linking and run-time checks for clock_gettime succeed.
dnl until library linking and runtime checks for clock_gettime succeed.
])
dnl CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW
@ -830,7 +788,7 @@ dnl Check if monotonic clock_gettime is available.
AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW], [
AC_CHECK_HEADERS(sys/types.h)
AC_MSG_CHECKING([for raw monotonic clock_gettime])
#
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
@ -861,15 +819,15 @@ dnl If monotonic clock_gettime is available then,
dnl check and prepended to LIBS any needed libraries.
AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
AC_REQUIRE([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC])dnl
#
AC_REQUIRE([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC])
if test "$curl_func_clock_gettime" = "yes"; then
#
AC_MSG_CHECKING([for clock_gettime in libraries])
#
curl_cv_save_LIBS="$LIBS"
curl_cv_gclk_LIBS="unknown"
#
for x_xlibs in '' '-lrt' '-lposix4' ; do
if test "$curl_cv_gclk_LIBS" = "unknown"; then
if test -z "$x_xlibs"; then
@ -896,9 +854,9 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
])
fi
done
#
LIBS="$curl_cv_save_LIBS"
#
case X-"$curl_cv_gclk_LIBS" in
X-unknown)
AC_MSG_RESULT([cannot find clock_gettime])
@ -910,7 +868,7 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
curl_func_clock_gettime="yes"
;;
*)
if test "x$dontwant_rt" = "xyes" ; then
if test "$dontwant_rt" = "yes"; then
AC_MSG_WARN([needs -lrt but asked not to use it, HAVE_CLOCK_GETTIME_MONOTONIC will not be defined])
curl_func_clock_gettime="no"
else
@ -924,9 +882,9 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
fi
;;
esac
#
dnl only do runtime verification when not cross-compiling
if test "x$cross_compiling" != "xyes" &&
if test "$cross_compiling" != "yes" &&
test "$curl_func_clock_gettime" = "yes"; then
AC_MSG_CHECKING([if monotonic clock_gettime works])
CURL_RUN_IFELSE([
@ -955,16 +913,14 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
LIBS="$curl_cv_save_LIBS"
])
fi
#
case "$curl_func_clock_gettime" in
yes)
AC_DEFINE_UNQUOTED(HAVE_CLOCK_GETTIME_MONOTONIC, 1,
[Define to 1 if you have the clock_gettime function and monotonic timer.])
;;
esac
#
fi
#
])
@ -974,8 +930,8 @@ dnl Verify if network connect function is already available
dnl using current libraries or if another one is required.
AC_DEFUN([CURL_CHECK_LIBS_CONNECT], [
AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
AC_REQUIRE([CURL_INCLUDES_WINSOCK2])
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])
AC_MSG_CHECKING([for connect in libraries])
tst_connect_save_LIBS="$LIBS"
tst_connect_need_LIBS="unknown"
@ -999,7 +955,7 @@ AC_DEFUN([CURL_CHECK_LIBS_CONNECT], [
fi
done
LIBS="$tst_connect_save_LIBS"
#
case X-"$tst_connect_need_LIBS" in
X-unknown)
AC_MSG_RESULT([cannot find connect])
@ -1021,10 +977,10 @@ dnl -------------------------------------------------
dnl Test if the socket select() function is available.
AC_DEFUN([CURL_CHECK_FUNC_SELECT], [
AC_REQUIRE([CURL_CHECK_STRUCT_TIMEVAL])dnl
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
AC_REQUIRE([CURL_CHECK_STRUCT_TIMEVAL])
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])
AC_CHECK_HEADERS(sys/select.h)
#
AC_MSG_CHECKING([for select])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
@ -1060,7 +1016,7 @@ AC_DEFUN([CURL_CHECK_FUNC_SELECT], [
AC_MSG_RESULT([no])
curl_cv_select="no"
])
#
if test "$curl_cv_select" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_SELECT, 1,
[Define to 1 if you have the select function.])
@ -1082,11 +1038,11 @@ dnl macro. It must also run AFTER all lib-checking macros are complete.
AC_DEFUN([CURL_VERIFY_RUNTIMELIBS], [
dnl this test is of course not sensible if we are cross-compiling!
if test "x$cross_compiling" != xyes; then
if test "$cross_compiling" != "yes"; then
dnl just run a program to verify that the libs checked for previous to this
dnl point also is available run-time!
AC_MSG_CHECKING([run-time libs availability])
dnl point also is available runtime!
AC_MSG_CHECKING([runtime libs availability])
CURL_RUN_IFELSE([
int main(void)
{
@ -1095,7 +1051,7 @@ AC_DEFUN([CURL_VERIFY_RUNTIMELIBS], [
],
AC_MSG_RESULT([fine]),
AC_MSG_RESULT([failed])
AC_MSG_ERROR([one or more libs available at link-time are not available run-time. Libs used at link-time: $LIBS])
AC_MSG_ERROR([one or more libs available at link-time are not available runtime. Libs used at link-time: $LIBS])
)
dnl if this test fails, configure has already stopped
@ -1122,7 +1078,7 @@ AC_DEFUN([CURL_CHECK_CA_BUNDLE], [
AC_ARG_WITH(ca-bundle,
AS_HELP_STRING([--with-ca-bundle=FILE],
[Absolute path to a file containing CA certificates (example: /etc/ca-bundle.crt)])
AS_HELP_STRING([--without-ca-bundle], [Don't use a default CA bundle]),
AS_HELP_STRING([--without-ca-bundle], [Do not use a default CA bundle]),
[
want_ca="$withval"
if test "x$want_ca" = "xyes"; then
@ -1136,7 +1092,7 @@ AS_HELP_STRING([--with-ca-path=DIRECTORY],
their filenames in a hash format. This option can be used with the OpenSSL, \
GnuTLS, mbedTLS and wolfSSL backends. Refer to OpenSSL c_rehash for details. \
(example: /etc/certificates)])
AS_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
AS_HELP_STRING([--without-ca-path], [Do not use a default CA path]),
[
want_capath="$withval"
if test "x$want_capath" = "xyes"; then
@ -1149,33 +1105,45 @@ AS_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
capath_warning=" (warning: certs not found)"
check_capath=""
if test "x$want_ca" != "xno" -a "x$want_ca" != "xunset" -a \
"x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then
if test "$APPLE_SECTRUST_ENABLED" = "1"; then
ca_native="Apple SecTrust"
elif test "$ca_native_opt" = "1"; then
ca_native="yes"
else
ca_native="no"
fi
if test "x$want_ca" != "xno" && test "x$want_ca" != "xunset" &&
test "x$want_capath" != "xno" && test "x$want_capath" != "xunset"; then
dnl both given
ca="$want_ca"
capath="$want_capath"
elif test "x$want_ca" != "xno" -a "x$want_ca" != "xunset"; then
elif test "x$want_ca" != "xno" && test "x$want_ca" != "xunset"; then
dnl --with-ca-bundle given
ca="$want_ca"
capath="no"
elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then
elif test "x$want_capath" != "xno" && test "x$want_capath" != "xunset"; then
dnl --with-ca-path given
capath="$want_capath"
ca="no"
elif test "$ca_native" != "no"; then
dnl native ca configured, do not look further
ca="no"
capath="no"
else
dnl First try auto-detecting a CA bundle, then a CA path.
dnl Both auto-detections can be skipped by --without-ca-*
ca="no"
capath="no"
if test "x$cross_compiling" != "xyes" -a \
"x$curl_cv_native_windows" != "xyes"; then
if test "$cross_compiling" != "yes" &&
test "$curl_cv_native_windows" != "yes"; then
dnl NOT cross-compiling and...
dnl neither of the --with-ca-* options are provided
if test "x$want_ca" = "xunset"; then
dnl the path we previously would have installed the curl CA bundle
dnl to, and thus we now check for an already existing cert in that
dnl place in case we find no other
if test "x$prefix" != xNONE; then
if test "x$prefix" != "xNONE"; then
cac="${prefix}/share/curl/curl-ca-bundle.crt"
else
cac="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
@ -1211,7 +1179,7 @@ AS_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
check_capath="$capath"
fi
if test ! -z "$check_capath"; then
if test -n "$check_capath"; then
for a in "$check_capath"; do
if test -d "$a" && ls "$a"/[[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]].0 >/dev/null 2>/dev/null; then
if test "x$capath" = "xno"; then
@ -1245,16 +1213,16 @@ AS_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
AC_MSG_CHECKING([whether to use OpenSSL's built-in CA store])
AC_ARG_WITH(ca-fallback,
AS_HELP_STRING([--with-ca-fallback], [Use OpenSSL's built-in CA store])
AS_HELP_STRING([--without-ca-fallback], [Don't use OpenSSL's built-in CA store]),
AS_HELP_STRING([--without-ca-fallback], [Do not use OpenSSL's built-in CA store]),
[
if test "x$with_ca_fallback" != "xyes" -a "x$with_ca_fallback" != "xno"; then
if test "x$with_ca_fallback" != "xyes" && test "x$with_ca_fallback" != "xno"; then
AC_MSG_ERROR([--with-ca-fallback only allows yes or no as parameter])
fi
],
[ with_ca_fallback="no"])
AC_MSG_RESULT([$with_ca_fallback])
if test "x$with_ca_fallback" = "xyes"; then
if test "x$OPENSSL_ENABLED" != "x1"; then
if test "$OPENSSL_ENABLED" != "1"; then
AC_MSG_ERROR([--with-ca-fallback only works with OpenSSL])
fi
AC_DEFINE_UNQUOTED(CURL_CA_FALLBACK, 1, [define "1" to use OpenSSL's built-in CA store])
@ -1273,7 +1241,7 @@ AC_DEFUN([CURL_CHECK_CA_EMBED], [
AC_ARG_WITH(ca-embed,
AS_HELP_STRING([--with-ca-embed=FILE],
[Absolute path to a file containing CA certificates to embed in the curl tool (example: /etc/ca-bundle.crt)])
AS_HELP_STRING([--without-ca-embed], [Don't embed a default CA bundle in the curl tool]),
AS_HELP_STRING([--without-ca-embed], [Do not embed a default CA bundle in the curl tool]),
[
want_ca_embed="$withval"
if test "x$want_ca_embed" = "xyes"; then
@ -1283,7 +1251,7 @@ AS_HELP_STRING([--without-ca-embed], [Don't embed a default CA bundle in the cur
[ want_ca_embed="unset" ])
CURL_CA_EMBED=''
if test "x$want_ca_embed" != "xno" -a "x$want_ca_embed" != "xunset" -a -f "$want_ca_embed"; then
if test "x$want_ca_embed" != "xno" && test "x$want_ca_embed" != "xunset" && test -f "$want_ca_embed"; then
if test -n "$PERL"; then
CURL_CA_EMBED="$want_ca_embed"
AC_SUBST(CURL_CA_EMBED)
@ -1297,47 +1265,15 @@ AS_HELP_STRING([--without-ca-embed], [Don't embed a default CA bundle in the cur
fi
])
dnl CURL_CHECK_WIN32_LARGEFILE
dnl -------------------------------------------------
dnl Check if curl's Win32 large file will be used
AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
if test "$curl_cv_native_windows" = 'yes'; then
AC_MSG_CHECKING([whether build target supports Win32 large files])
if test "$curl_cv_wince" = 'yes'; then
dnl Windows CE does not support large files
curl_win32_has_largefile='no'
else
dnl All mingw-w64 versions support large files
curl_win32_has_largefile='yes'
fi
case "$curl_win32_has_largefile" in
yes)
if test x"$enable_largefile" = 'xno'; then
AC_MSG_RESULT([yes (large file disabled)])
else
AC_MSG_RESULT([yes (large file enabled)])
AC_DEFINE_UNQUOTED(USE_WIN32_LARGE_FILES, 1,
[Define to 1 if you are building a Windows target with large file support.])
fi
;;
*)
AC_MSG_RESULT([no])
;;
esac
fi
])
dnl CURL_CHECK_WIN32_CRYPTO
dnl -------------------------------------------------
dnl Check if curl's Win32 crypto lib can be used
AC_DEFUN([CURL_CHECK_WIN32_CRYPTO], [
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])
AC_MSG_CHECKING([whether build target supports Win32 crypto API])
curl_win32_crypto_api="no"
if test "$curl_cv_native_windows" = "yes" -a "$curl_cv_winuwp" != "yes"; then
if test "$curl_cv_native_windows" = "yes" && test "$curl_cv_winuwp" != "yes"; then
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#undef inline
@ -1370,22 +1306,65 @@ AC_DEFUN([CURL_CHECK_WIN32_CRYPTO], [
esac
])
dnl CURL_EXPORT_PCDIR ($pcdir)
dnl CURL_EXPORT_PCDIR ($pcdir, [$additive])
dnl ------------------------
dnl if $pcdir is not empty, set PKG_CONFIG_LIBDIR to $pcdir and export
dnl if $pcdir is not empty, set PKG_CONFIG_LIBDIR to $pcdir and export.
dnl if $additive is set, extend PKG_CONFIG_PATH instead, by prepending $pcdir
dnl to it, to ensure that system locations are still checked. This is
dnl necessary for modules that depend on modules residing there
dnl (e.g. gnutls.pc).
dnl
dnl we need this macro since pkg-config distinguishes among empty and unset
dnl variable while checking PKG_CONFIG_LIBDIR
dnl we need this macro to limit/expand search locations to/with a custom
dnl configured one.
dnl
AC_DEFUN([CURL_EXPORT_PCDIR], [
if test -n "$1"; then
PKG_CONFIG_LIBDIR="$1"
export PKG_CONFIG_LIBDIR
if test -n "$2"; then
dnl honor system locations
PKG_CONFIG_PATH="$1${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH
else
dnl ignore and override system locations
PKG_CONFIG_LIBDIR="$1"
export PKG_CONFIG_LIBDIR
fi
fi
])
dnl CURL_CHECK_PKGCONFIG ($module, [$pcdir])
dnl CURL_TRACE_PCDIR ($module, [$pcdir], [$additive])
dnl ------------------------
dnl show pkg-config module lookup details, along with a detailed errors
dnl message in case of failure. Supports both pkg-config and pkgconf.
dnl
AC_DEFUN([CURL_TRACE_PCDIR], [
dnl Example pkgconf line:
dnl libpkgconf/pkg.c:746 [pkgconf_pkg_t *pkgconf_pkg_try_specific_path(pkgconf_client_t *, [...]*)]:
dnl trying path: /usr/local/lib/pkgconfig for libngtcp2_crypto_gnutls
dnl Rest of strings are for catching classic pkg-config lines.
trc=`CURL_EXPORT_PCDIR([$2], [$3])
if test -n "$PKG_CONFIG_LIBDIR"; then
echo "PKG_CONFIG_LIBDIR: '$PKG_CONFIG_LIBDIR'"
fi
if test -n "$PKG_CONFIG_PATH"; then
echo "PKG_CONFIG_PATH: '$PKG_CONFIG_PATH'"
fi
$PKGCONFIG --exists --debug $1 2>&1 | \
$EGREP '(trying path:|Adding directory|Looking for|Scanning directory|Cannot open directory)' | \
$SED 's/^.*trying path:/trying path:/'`
msg=`CURL_EXPORT_PCDIR([$2], [$3])
$PKGCONFIG --exists --print-errors $1 2>&1`
if test -n "$msg"; then
trc=`echo "$trc"; echo '==== error:'; echo "$msg"`
fi
AC_MSG_NOTICE([pkg-config --exists $1 trace:
---- begin
${trc}
---- end])
])
dnl CURL_CHECK_PKGCONFIG ($module, [$pcdir], [$additive])
dnl ------------------------
dnl search for the pkg-config tool. Set the PKGCONFIG variable to hold the
dnl path to it, or 'no' if not found/present.
@ -1404,19 +1383,25 @@ AC_DEFUN([CURL_CHECK_PKGCONFIG], [
[$PATH:/usr/bin:/usr/local/bin])
fi
if test "x$PKGCONFIG" != "xno"; then
if test "$PKGCONFIG" != "no"; then
AC_MSG_CHECKING([for $1 options with pkg-config])
dnl ask pkg-config about $1
itexists=`CURL_EXPORT_PCDIR([$2]) dnl
itexists=`CURL_EXPORT_PCDIR([$2], [$3])
$PKGCONFIG --exists $1 >/dev/null 2>&1 && echo 1`
if test -z "$itexists"; then
dnl pkg-config does not have info about the given module! set the
dnl variable to 'no'
PKGCONFIG="no"
AC_MSG_RESULT([no])
if test -n "$CURL_TRACE_PKG_CONFIG$CURL_CI"; then
CURL_TRACE_PCDIR([$1], [$2], [$3])
fi
PKGCONFIG="no"
else
AC_MSG_RESULT([found])
if test -n "$CURL_TRACE_PKG_CONFIG"; then
CURL_TRACE_PCDIR([$1], [$2], [$3])
fi
fi
fi
])
@ -1430,7 +1415,7 @@ dnl when the configure script runs. For portability reasons, test
dnl harness needs information on how to run the C preprocessor.
AC_DEFUN([CURL_PREPARE_CONFIGUREHELP_PM], [
AC_REQUIRE([AC_PROG_CPP])dnl
AC_REQUIRE([AC_PROG_CPP])
tmp_cpp=`eval echo "$ac_cpp" 2>/dev/null`
if test -z "$tmp_cpp"; then
tmp_cpp='cpp'
@ -1445,7 +1430,7 @@ dnl Save build info for test runner to pick up and log
AC_DEFUN([CURL_PREPARE_BUILDINFO], [
curl_pflags=""
if test "$curl_cv_apple" = 'yes'; then
if test "$curl_cv_apple" = "yes"; then
curl_pflags="${curl_pflags} APPLE"
fi
case $host in
@ -1465,37 +1450,31 @@ AC_DEFUN([CURL_PREPARE_BUILDINFO], [
fi
;;
esac
if test "$curl_cv_native_windows" = 'yes'; then
if test "$curl_cv_native_windows" = "yes"; then
curl_pflags="${curl_pflags} WIN32"
fi
if test "$curl_cv_wince" = 'yes'; then
curl_pflags="${curl_pflags} WINCE"
fi
if test "$curl_cv_winuwp" = 'yes'; then
if test "$curl_cv_winuwp" = "yes"; then
curl_pflags="${curl_pflags} UWP"
fi
case $host in
*-*-*bsd*|*-*-aix*|*-*-hpux*|*-*-interix*|*-*-irix*|*-*-linux*|*-*-solaris*|*-*-sunos*|*-apple-*|*-*-cygwin*|*-*-msys*)
curl_pflags="${curl_pflags} UNIX";;
case $host_os in
cygwin*|msys*) curl_pflags="${curl_pflags} CYGWIN";;
esac
case $host in
*-*-*bsd*)
curl_pflags="${curl_pflags} BSD";;
esac
if test "$curl_cv_cygwin" = 'yes'; then
curl_pflags="${curl_pflags} CYGWIN"
fi
case $host_os in
msdos*) curl_pflags="${curl_pflags} DOS";;
amiga*) curl_pflags="${curl_pflags} AMIGA";;
esac
if test "x$compiler_id" = 'xGNU_C'; then
if test "$compiler_id" = "GNU_C"; then
curl_pflags="${curl_pflags} GCC"
fi
if test "$compiler_id" = "APPLECLANG"; then
curl_pflags="${curl_pflags} APPLE-CLANG"
elif test "$compiler_id" = "CLANG"; then
curl_pflags="${curl_pflags} LLVM-CLANG"
fi
case $host_os in
mingw*) curl_pflags="${curl_pflags} MINGW";;
esac
if test "x$cross_compiling" = 'xyes'; then
if test "$cross_compiling" = "yes"; then
curl_pflags="${curl_pflags} CROSS"
fi
squeeze curl_pflags
@ -1537,7 +1516,7 @@ TEST EINVAL TEST
AC_MSG_RESULT([$cpp])
dnl we need cpp -P so check if it works then
if test "x$cpp" = "xyes"; then
if test "$cpp" = "yes"; then
AC_MSG_CHECKING([if cpp -P works])
OLDCPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -P"
@ -1547,18 +1526,18 @@ TEST EINVAL TEST
], [cpp_p=yes], [cpp_p=no])
AC_MSG_RESULT([$cpp_p])
if test "x$cpp_p" = "xno"; then
if test "$cpp_p" = "no"; then
AC_MSG_WARN([failed to figure out cpp -P alternative])
# without -P
dnl without -P
CPPPFLAG=""
else
# with -P
dnl with -P
CPPPFLAG="-P"
fi
dnl restore CPPFLAGS
CPPFLAGS=$OLDCPPFLAGS
else
# without -P
dnl without -P
CPPPFLAG=""
fi
])
@ -1567,7 +1546,7 @@ TEST EINVAL TEST
dnl CURL_DARWIN_CFLAGS
dnl
dnl Set -Werror=partial-availability to detect possible breaking code
dnl with very low deployment targets.
dnl with low deployment targets.
dnl
AC_DEFUN([CURL_DARWIN_CFLAGS], [
@ -1584,7 +1563,7 @@ AC_DEFUN([CURL_DARWIN_CFLAGS], [
dnl CURL_SUPPORTS_BUILTIN_AVAILABLE
dnl
dnl Check to see if the compiler supports __builtin_available. This built-in
dnl compiler function first appeared in Apple LLVM 9.0.0. It's so new that, at
dnl compiler function first appeared in Apple LLVM 9.0.0. It is so new that, at
dnl the time this macro was written, the function was not yet documented. Its
dnl purpose is to return true if the code is running under a certain OS version
dnl or later.

View file

@ -28,98 +28,83 @@ set -eux; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o pipefail
# build
case "${TARGET:-}" in
*Win32) openssl_suffix='-Win32';;
*) openssl_suffix='-Win64';;
esac
if [ -n "${CMAKE_GENERATOR:-}" ]; then
if [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2022' ]; then
openssl_root_win="C:/OpenSSL-v34${openssl_suffix}"
else
openssl_root_win="C:/OpenSSL-v111${openssl_suffix}"
fi
openssl_root="$(cygpath "${openssl_root_win}")"
PRJ_CFG='Debug'
[[ "${APPVEYOR_JOB_NAME}" = *'Release'* ]] && PRJ_CFG='Release'
# Configure OpenSSL
case "${CMAKE_GENERATE:-}" in
*Win32*) openssl_suffix='-Win32';;
*) openssl_suffix='-Win64';;
esac
if [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2022' ]; then
openssl_root_win="C:/OpenSSL-v35${openssl_suffix}"
openssl_root="$(cygpath "${openssl_root_win}")"
elif [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2019' ]; then
openssl_root_win="C:/OpenSSL-v30${openssl_suffix}"
openssl_root="$(cygpath "${openssl_root_win}")"
fi
# Install custom cmake version
if [ -n "${CMAKE_VERSION:-}" ]; then
cmake_ver="$(printf '%02d%02d' \
"$(echo "${CMAKE_VERSION}" | cut -f1 -d.)" \
"$(echo "${CMAKE_VERSION}" | cut -f2 -d.)")"
if [ "${cmake_ver}" -ge '0320' ]; then
fn="cmake-${CMAKE_VERSION}-windows-x86_64"
else
fn="cmake-${CMAKE_VERSION}-win64-x64"
fi
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${fn}.zip" --output pkg.bin
sha256sum pkg.bin && sha256sum pkg.bin | grep -qwF -- "${CMAKE_SHA256}" && 7z x -y pkg.bin >/dev/null && rm -f pkg.bin
PATH="$PWD/${fn}/bin:$PATH"
fi
if [ "${BUILD_SYSTEM}" = 'CMake' ]; then
# Set env CHKPREFILL to the value '_chkprefill' to compare feature detection
# results with and without the pre-fill feature. They have to match.
for _chkprefill in '' ${CHKPREFILL:-}; do
options=''
[ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF'
[[ "${TARGET}" = *'ARM64'* ]] && SKIP_RUN='ARM64 architecture'
[ -n "${TOOLSET:-}" ] && options+=" -T ${TOOLSET}"
[ -n "${WINTARGET:-}" ] && options+=" -DCURL_TARGET_WINDOWS_VERSION=${WINTARGET}"
[ "${OPENSSL}" = 'ON' ] && options+=" -DOPENSSL_ROOT_DIR=${openssl_root_win}"
[ -n "${CURLDEBUG:-}" ] && options+=" -DENABLE_CURLDEBUG=${CURLDEBUG}"
if [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2013' ]; then
mkdir "_bld${_chkprefill}"
cd "_bld${_chkprefill}"
options+=' ..'
root='..'
else
options+=" -B _bld${_chkprefill}"
options+=' -DCMAKE_VS_GLOBALS=TrackFileAccess=false'
options+=" -DCMAKE_UNITY_BUILD=${UNITY}"
root='.'
fi
[[ "${CMAKE_GENERATE:-}" = *'-A ARM64'* ]] && SKIP_RUN='ARM64 architecture'
[[ "${CMAKE_GENERATE:-}" = *'-DCURL_USE_OPENSSL=ON'* ]] && options+=" -DOPENSSL_ROOT_DIR=${openssl_root_win}"
# shellcheck disable=SC2086
time cmake -G "${PRJ_GEN}" ${TARGET} \
-DCURL_WERROR=ON \
-DBUILD_SHARED_LIBS="${SHARED}" \
time cmake -B "_bld${_chkprefill}" \
-DENABLE_DEBUG=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \
-DCMAKE_VS_GLOBALS=TrackFileAccess=false \
-DCURL_STATIC_CRT=ON \
-DENABLE_DEBUG="${DEBUG}" \
-DENABLE_UNICODE="${ENABLE_UNICODE}" \
-DHTTP_ONLY="${HTTP_ONLY}" \
-DCURL_USE_SCHANNEL="${SCHANNEL}" \
-DCURL_USE_OPENSSL="${OPENSSL}" \
-DCURL_USE_LIBPSL=OFF \
-DCURL_DROP_UNUSED=ON \
-DCURL_USE_SCHANNEL=ON -DCURL_USE_LIBPSL=OFF \
${CMAKE_GENERATE:-} \
${options} \
|| { cat ${root}/_bld/CMakeFiles/CMake* 2>/dev/null; false; }
[ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2013' ] && cd ..
|| { cat _bld/CMakeFiles/CMake* 2>/dev/null; false; }
done
if [ -d _bld_chkprefill ] && ! diff -u _bld/lib/curl_config.h _bld_chkprefill/lib/curl_config.h; then
cat _bld_chkprefill/CMakeFiles/CMake* 2>/dev/null || true
false
fi
echo 'curl_config.h'; grep -F '#define' _bld/lib/curl_config.h | sort || true
# shellcheck disable=SC2086
time cmake --build _bld --config "${PRJ_CFG}" --parallel 2 -- ${BUILD_OPT:-}
[ "${SHARED}" = 'ON' ] && PATH="$PWD/_bld/lib/${PRJ_CFG}:$PATH"
[ "${OPENSSL}" = 'ON' ] && { PATH="${openssl_root}:$PATH"; cp "${openssl_root}"/*.dll "_bld/src/${PRJ_CFG}"; }
time cmake --build _bld --config "${PRJ_CFG}" --parallel 2
[[ "${CMAKE_GENERATE:-}" != *'-DBUILD_SHARED_LIBS=OFF'* ]] && PATH="$PWD/_bld/lib/${PRJ_CFG}:$PATH"
[[ "${CMAKE_GENERATE:-}" = *'-DCURL_USE_OPENSSL=ON'* ]] && { PATH="${openssl_root}:$PATH"; cp "${openssl_root}"/*.dll "_bld/src/${PRJ_CFG}"; }
curl="_bld/src/${PRJ_CFG}/curl.exe"
elif [ "${BUILD_SYSTEM}" = 'VisualStudioSolution' ]; then
else
(
cd projects
cd projects/Windows
./generate.bat "${VC_VERSION}"
msbuild.exe -maxcpucount "-property:Configuration=${PRJ_CFG}" "Windows/${VC_VERSION}/curl-all.sln"
msbuild.exe -maxcpucount "-property:Configuration=${PRJ_CFG}" "-property:Platform=${PLAT}" "${VC_VERSION}/curl-all.sln"
)
curl="build/Win32/${VC_VERSION}/${PRJ_CFG}/curld.exe"
elif [ "${BUILD_SYSTEM}" = 'winbuild_vs2015' ]; then
(
cd winbuild
cat << EOF > _make.bat
call "C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin/SetEnv.cmd" /x64
call "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat" x86_amd64
nmake -f Makefile.vc mode=dll VC=14 "SSL_PATH=${openssl_root_win}" WITH_SSL=dll MACHINE=x64 DEBUG=${DEBUG} ENABLE_UNICODE=${ENABLE_UNICODE} WINBUILD_ACKNOWLEDGE_DEPRECATED=yes
EOF
./_make.bat
rm _make.bat
)
curl="builds/libcurl-vc14-x64-${PATHPART}-dll-ssl-dll-ipv6-sspi/bin/curl.exe"
elif [ "${BUILD_SYSTEM}" = 'winbuild_vs2017' ]; then
(
cd winbuild
cat << EOF > _make.bat
call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvars64.bat"
nmake -f Makefile.vc mode=dll VC=14.10 "SSL_PATH=${openssl_root_win}" WITH_SSL=dll MACHINE=x64 DEBUG=${DEBUG} ENABLE_UNICODE=${ENABLE_UNICODE} WINBUILD_ACKNOWLEDGE_DEPRECATED=yes
EOF
./_make.bat
rm _make.bat
)
curl="builds/libcurl-vc14.10-x64-${PATHPART}-dll-ssl-dll-ipv6-sspi/bin/curl.exe"
[ "${PLAT}" = 'x64' ] && platdir='Win64' || platdir='Win32'
[[ "${PRJ_CFG}" = *'Debug'* ]] && binsuffix='d' || binsuffix=''
curl="build/${platdir}/${VC_VERSION}/${PRJ_CFG}/curl${binsuffix}.exe"
fi
find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' -o -name '*.pdb' \) -exec file '{}' \;
find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' -o -name '*.pdb' \) -print0 | grep -z curl | xargs -0 file --
find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' -o -name '*.pdb' \) -print0 | grep -z curl | xargs -0 stat -c '%10s bytes: %n' --
if [ -z "${SKIP_RUN:-}" ]; then
"${curl}" --disable --version
else
@ -128,42 +113,19 @@ fi
# build tests
if [ "${TFLAGS}" != 'skipall' ] && \
[ "${BUILD_SYSTEM}" = 'CMake' ]; then
if [ -n "${CMAKE_GENERATOR:-}" ] && [[ "${APPVEYOR_JOB_NAME}" = *'Build-tests'* ]]; then
time cmake --build _bld --config "${PRJ_CFG}" --parallel 2 --target testdeps
fi
# run tests
if [ "${TFLAGS}" != 'skipall' ] && \
[ "${TFLAGS}" != 'skiprun' ]; then
if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
elif [ -x "$(cygpath 'C:/msys64/usr/bin/curl.exe')" ]; then
TFLAGS+=" -ac $(cygpath 'C:/msys64/usr/bin/curl.exe')"
fi
TFLAGS+=' -j0'
if [ "${BUILD_SYSTEM}" = 'CMake' ]; then
time cmake --build _bld --config "${PRJ_CFG}" --target test-ci
else
(
TFLAGS="-a -p !flaky -r ${TFLAGS}"
cd _bld/tests
time ./runtests.pl
)
fi
fi
# build examples
if [ "${EXAMPLES}" = 'ON' ] && \
[ "${BUILD_SYSTEM}" = 'CMake' ]; then
if [ -n "${CMAKE_GENERATOR:-}" ] && [[ "${APPVEYOR_JOB_NAME}" = *'examples'* ]]; then
time cmake --build _bld --config "${PRJ_CFG}" --parallel 2 --target curl-examples-build
fi
# disk space used
du -sh .; echo; du -sh -t 250KB ./*
if [ "${BUILD_SYSTEM}" = 'CMake' ]; then
if [ -n "${CMAKE_GENERATOR:-}" ]; then
echo; du -h -t 250KB _bld
fi

View file

@ -31,179 +31,92 @@
version: 7.50.0.{build}
environment:
BUILD_SYSTEM: CMake
UNITY: 'ON'
OPENSSL: 'OFF'
SCHANNEL: 'OFF'
ENABLE_UNICODE: 'OFF'
DEBUG: 'ON'
SHARED: 'OFF'
HTTP_ONLY: 'OFF'
TFLAGS: 'skiprun'
EXAMPLES: 'OFF'
matrix:
# CMake Visual Studio builds
# generated CMake-based Visual Studio builds
- job_name: 'CM VS2022, Release, x64, OpenSSL 3.5, Shared, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
CMAKE_GENERATOR: 'Visual Studio 17 2022'
CMAKE_GENERATE: '-A x64 -DCURL_USE_SCHANNEL=OFF -DCURL_USE_OPENSSL=ON'
- job_name: 'CMake, VS2022, Release, x64, OpenSSL 3.4, Shared, Build-tests'
- job_name: 'CM VS2022, Release, arm64, Schannel, Static, !DEBUGBUILD, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64'
PRJ_CFG: Release
OPENSSL: 'ON'
SHARED: 'ON'
- job_name: 'CMake, VS2022, Release, arm64, Schannel, Static, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A ARM64'
PRJ_CFG: Release
SCHANNEL: 'ON'
DEBUG: 'OFF'
CURLDEBUG: 'ON'
- job_name: 'CMake, VS2010, Debug, x64, Schannel, Shared, Build-tests & examples, XP'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2013'
PRJ_GEN: 'Visual Studio 10 2010'
TARGET: '-A x64'
WINTARGET: 0x0501 # Windows XP
PRJ_CFG: Debug
SCHANNEL: 'ON'
SHARED: 'ON'
EXAMPLES: 'ON'
- job_name: 'CMake, VS2012, Release, x86, OpenSSL 1.1.1 + Schannel, Shared, Build-tests'
CMAKE_GENERATOR: 'Visual Studio 17 2022'
CMAKE_GENERATE: '-A ARM64 -DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=OFF'
- job_name: 'CM VS2010, Debug, x64, Schannel, Shared, Build-tests & examples'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
PRJ_GEN: 'Visual Studio 11 2012'
TARGET: '-A Win32'
PRJ_CFG: Release
OPENSSL: 'ON'
SCHANNEL: 'ON'
SHARED: 'ON'
- job_name: 'CMake, VS2013, Debug, x64, OpenSSL 1.1.1, Shared, Build-only'
CMAKE_VERSION: 3.18.4
CMAKE_SHA256: a932bc0c8ee79f1003204466c525b38a840424d4ae29f9e5fb88959116f2407d
CMAKE_GENERATOR: 'Visual Studio 10 2010'
CMAKE_GENERATE: '-A x64'
- job_name: 'CM VS2012, Release, x86, Schannel, Shared, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
PRJ_GEN: 'Visual Studio 12 2013'
TARGET: '-A x64'
PRJ_CFG: Debug
OPENSSL: 'ON'
SHARED: 'ON'
TFLAGS: 'skipall'
- job_name: 'CMake, VS2015, Debug, x64, OpenSSL 1.1.1, Static, Build-only'
CMAKE_VERSION: 3.21.7
CMAKE_SHA256: 4c4840e2dc2bf82e8a16081ff506bba54f3a228b91ce36317129fed4035ef2e3
CMAKE_GENERATOR: 'Visual Studio 11 2012'
CMAKE_GENERATE: '-A Win32'
- job_name: 'CM VS2013, Debug, x64, Schannel, Shared'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
PRJ_GEN: 'Visual Studio 14 2015'
TARGET: '-A x64'
PRJ_CFG: Debug
OPENSSL: 'ON'
TFLAGS: 'skipall'
- job_name: 'CMake, VS2017, Debug, x64, OpenSSL 1.1.1, Shared, Build-only'
CMAKE_VERSION: 3.18.4
CMAKE_SHA256: a932bc0c8ee79f1003204466c525b38a840424d4ae29f9e5fb88959116f2407d
CMAKE_GENERATOR: 'Visual Studio 12 2013'
CMAKE_GENERATE: '-A x64'
- job_name: 'CM VS2015, Debug, x64, Schannel, Static'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
CMAKE_VERSION: 3.19.8
CMAKE_SHA256: 2a30877a3d6b50da305b289f4d1c03befdfaeb2edba02a563c681e883d810380
CMAKE_GENERATOR: 'Visual Studio 14 2015'
CMAKE_GENERATE: '-A x64 -DBUILD_SHARED_LIBS=OFF'
- job_name: 'CM VS2017, Debug, x64, Schannel, Shared'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017'
PRJ_GEN: 'Visual Studio 15 2017'
TARGET: '-A x64'
PRJ_CFG: Debug
OPENSSL: 'ON'
SHARED: 'ON'
TFLAGS: 'skipall'
- job_name: 'CMake, VS2019, Debug, x64, OpenSSL 1.1.1 + Schannel, Shared, Build-tests'
CMAKE_VERSION: 3.20.6
CMAKE_SHA256: f240a38c964712aac474644b3ba21bdc2b4e8d5e31179f67bd2e6f45fa349419
CMAKE_GENERATOR: 'Visual Studio 15 2017'
CMAKE_GENERATE: '-A x64'
- job_name: 'CM VS2019, Debug, x64, OpenSSL 3.0 + Schannel, Shared, !verbose, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2019'
PRJ_GEN: 'Visual Studio 16 2019'
TARGET: '-A x64'
PRJ_CFG: Debug
OPENSSL: 'ON'
SCHANNEL: 'ON'
SHARED: 'ON'
- job_name: 'CMake, VS2022, Debug, x64, OpenSSL 3.4 + Schannel, Static, Unicode, Build-tests & examples, clang-cl'
CMAKE_GENERATOR: 'Visual Studio 16 2019'
CMAKE_GENERATE: '-A x64 -DCURL_USE_OPENSSL=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON'
- job_name: 'CM VS2022, Debug, x64, OpenSSL 3.5 + Schannel, Static, Unicode, Build-tests & examples, clang-cl'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64'
PRJ_CFG: Debug
OPENSSL: 'ON'
SCHANNEL: 'ON'
CMAKE_GENERATOR: 'Visual Studio 17 2022'
CMAKE_GENERATE: '-A x64 -T ClangCl -DBUILD_SHARED_LIBS=OFF -DCURL_USE_OPENSSL=ON -DENABLE_UNICODE=ON'
- job_name: 'CM VS2022, Release, x64, Schannel, Shared, Unicode, !DEBUGBUILD, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
CMAKE_GENERATOR: 'Visual Studio 17 2022'
ENABLE_UNICODE: 'ON'
EXAMPLES: 'ON'
TOOLSET: 'ClangCl'
- job_name: 'CMake, VS2022, Debug, x64, Schannel, Static, Unicode, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64'
PRJ_CFG: Debug
SCHANNEL: 'ON'
ENABLE_UNICODE: 'ON'
- job_name: 'CMake, VS2022, Release, x64, Schannel, Shared, Unicode, DEBUGBUILD, no-CURLDEBUG, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64'
PRJ_CFG: Release
SCHANNEL: 'ON'
ENABLE_UNICODE: 'ON'
SHARED: 'ON'
CURLDEBUG: 'OFF'
- job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64'
PRJ_CFG: Debug
- job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, HTTP only, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64'
PRJ_CFG: Debug
HTTP_ONLY: 'ON'
CMAKE_GENERATE: '-A x64 -DENABLE_UNICODE=ON -DENABLE_DEBUG=OFF'
# winbuild-based builds
- job_name: 'CM VS2022, Debug, x64, !ssl, Static, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
CMAKE_GENERATOR: 'Visual Studio 17 2022'
CMAKE_GENERATE: '-A x64 -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=OFF'
- job_name: 'winbuild, VS2015, Debug, x64, OpenSSL 1.1.1, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
BUILD_SYSTEM: winbuild_vs2015
DEBUG: 'yes'
PATHPART: debug
ENABLE_UNICODE: 'no'
- job_name: 'winbuild, VS2015, Release, x64, OpenSSL 1.1.1, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
BUILD_SYSTEM: winbuild_vs2015
DEBUG: 'no'
PATHPART: release
ENABLE_UNICODE: 'no'
- job_name: 'winbuild, VS2017, Debug, x64, OpenSSL 1.1.1, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017'
BUILD_SYSTEM: winbuild_vs2017
DEBUG: 'yes'
PATHPART: debug
ENABLE_UNICODE: 'no'
- job_name: 'winbuild, VS2017, Release, x64, OpenSSL 1.1.1, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017'
BUILD_SYSTEM: winbuild_vs2017
DEBUG: 'no'
PATHPART: release
ENABLE_UNICODE: 'no'
- job_name: 'winbuild, VS2015, Debug, x64, OpenSSL 1.1.1, Unicode, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
BUILD_SYSTEM: winbuild_vs2015
DEBUG: 'yes'
PATHPART: debug
ENABLE_UNICODE: 'yes'
- job_name: 'winbuild, VS2015, Release, x64, OpenSSL 1.1.1, Unicode, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
BUILD_SYSTEM: winbuild_vs2015
DEBUG: 'no'
PATHPART: release
ENABLE_UNICODE: 'yes'
- job_name: 'winbuild, VS2017, Debug, x64, OpenSSL 1.1.1, Unicode, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017'
BUILD_SYSTEM: winbuild_vs2017
DEBUG: 'yes'
PATHPART: debug
ENABLE_UNICODE: 'yes'
- job_name: 'winbuild, VS2017, Release, x64, OpenSSL 1.1.1, Unicode, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017'
BUILD_SYSTEM: winbuild_vs2017
DEBUG: 'no'
PATHPART: release
ENABLE_UNICODE: 'yes'
- job_name: 'CM VS2022, Debug, x64, !ssl, Static, HTTP-only, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
CMAKE_GENERATOR: 'Visual Studio 17 2022'
CMAKE_GENERATE: '-A x64 -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=OFF -DHTTP_ONLY=ON'
# generated VisualStudioSolution-based builds
# VisualStudioSolution builds
- job_name: 'VisualStudioSolution, VS2013, Debug, x86, Schannel, Build-only'
- job_name: 'VisualStudioSolution VS2010, Release, x86, Schannel'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2013'
PRJ_CFG: 'DLL Release - DLL Windows SSPI - DLL WinIDN'
PLAT: 'Win32'
VC_VERSION: VC10
- job_name: 'VisualStudioSolution VS2013, Debug, x64, Schannel'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
BUILD_SYSTEM: VisualStudioSolution
PRJ_CFG: 'DLL Debug - DLL Windows SSPI - DLL WinIDN'
PLAT: 'x64'
VC_VERSION: VC12
install:
@ -225,11 +138,13 @@ skip_commits:
- '.circleci/*'
- '.github/**/*'
- 'Dockerfile'
- 'packages/**/*'
- 'plan9/**/*'
- 'projects/OS400/*'
- 'projects/vms/*'
#artifacts:
# - path: '**/curl.exe'
# name: curl
# - path: '**/*.dll'
# name: libcurl dll
# - path: '**/*.lib'
# name: libcurl lib

View file

@ -1,8 +0,0 @@
#!/bin/sh
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
echo "*** Do not use buildconf. Instead, just use: autoreconf -fi" >&2
exec ${AUTORECONF:-autoreconf} -fi "${@}"

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more