Compare commits

...

286 Commits

Author SHA1 Message Date
Viktor Szakats
b4834a7d6d
examples: prefer return over exit() (cont.)
Some of these calls were not in callbacks. These examples may leak
handles.

Also fix some whitespace.

Follow-up to 08c7c937dc #16507
Closes #16524
2025-03-01 02:09:02 +01:00
Viktor Szakats
5693342ec2
winbuild: reduce command-line length by dropping whitespace
Keep the `@for %%i in [...]` lines within limits by stripping whitespace
from the input `.c` source lists read from `Makefile.inc`. To avoid this
error after adding a new `.c` source:
```
configuration name: libcurl-vc14-x64-release-dll-ssl-dll-ipv6-sspi
NMAKE : fatal error U1095: expanded command line 'for %i in (altsvc.obj            amigaos.obj
           asyn-ares.obj         asyn-thread.obj       base64.obj            bufq.obj
              bufref.obj            cf-h1-proxy.obj       cf-h2-proxy.obj       cf-haproxy.obj [...]
  vssh/wolfssh.obj) do @echo ..\builds\libcurl-vc14-x64-release-dll-ssl-dll-ipv6-sspi-obj-lib/%i \
                   ' too long
Stop.
Command exited with code 2
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/51605338/job/dqg6qtebtscb279g#L44

Reported-by: Stefan Eissing
Bug: https://github.com/curl/curl/pull/16508#issuecomment-2690443409
Fixes #16521
Closes #16528
2025-03-01 02:04:42 +01:00
Dan Fandrich
c693cc02b0 docs: vulnerabilities in debug code are not eligible for a bounty
This is code that is off by default and is therefore treated as a
regular bug.

Ref: #16526
Closes #16527
2025-02-28 14:21:46 -08:00
Viktor Szakats
e7751571eb
GHA/macos: use quictls in some jobs, other small improvements
- enable quictls in autotools and cmake jobs. autotools requires
  a workaround due to wrong libpath in the quictls pkg-config.
  nghttp3 is offered by Homebrew, but not ngtcp2, to enable H3.

- install `libnghttp2` rather than `nghttp2`.
  `libnghttp2` is preinstalled and smaller. It also avoids detecting
  `nghttpx`, which confuses `pytest`.

- limit `brew unlink openssl` to libressl/quictls jobs.

Closes #16517
2025-02-28 16:58:12 +01:00
Zhaoming Luo
7211576442
tests: fix comment in lib533
Closes #16523
2025-02-28 16:12:20 +01:00
Stefan Eissing
794dfe7fc4
gnutls: fix use of pkcs11 urls for keys/certs
Fixes #16249
Forwarded-to-us-by: Carlos Henrique Lima Melara

Always use `gnutls_certificate_set_x509_key_file2()` for loading keys
and certificates, even without a password, since this function support
pkcs11 urls.

Thanks to @tatsuhiro-t for finding this out.
Help-by: Tatsuhiro Tsujikawa

Closes #16472
2025-02-28 16:08:10 +01:00
Viktor Szakats
049352dd80
cmake: allow CURL_STATIC_CRT with shared libcurl and no curl exe
Follow-up to edfa537100 #16456

Closes #16516
2025-02-28 13:11:41 +01:00
Viktor Szakats
08c7c937dc
tidy-up: prefer return over exit(), fix fallouts
To avoid breaking the control flow and align to majority of code
already using `return`.

`exit()` has the side-effect of suppressing leak detection in cases.
Fix fallouts detected after switching to `return`.

- configure:
  - fix `getaddrinfo` run test to call `freeaddrinfo()` to pacify ASAN,
    and call `WSACleanup()` to deinit winsock2.
  - fix `getifaddrs` run test to call `freeifaddrs()` to pacify ASAN.
- tests/server:
  - setup `atexit(win32_cleanup)` via `win32_init()`.
  - return 2 instead of 1 on winsock2 init failures.
  - sws: goto cleanup instead of `exit()` in `http_connect()`.
    Follow-up to 02dfe71937 #7235
- tests/client/http:
  - cleanup memory to pacify ASAN in `h2-upgrade-extreme`,
    `tls-session-reuse`.
- examples:
  - block_ip: fix memory leak reported by CI.
  - http2-upload: avoid handle leaks.

Untouched `exit()` calls, made from callbacks:
- docs/examples: ephiperfifo.c, ghiper.c, hiperfifo.c
- tests/libtest: lib582.c, lib655.c, lib670.c
- tests/server: tftpd.c

Closes #16507
2025-02-28 13:11:41 +01:00
Stefan Eissing
2e585f5640
test488: set --output-dir
Otherwise the downloaded files land in the `tests` directory and
show up in git status.

Closes #16519
2025-02-28 12:47:31 +01:00
Viktor Szakats
399cb7130a
cmake: drop HAVE_C_FLAG_Wno_long_double logic for ancient Apple gcc
The initial curl CMake commit introduced it in 2009-04-02 via
4c5307b456. Suppressing a stray
`-Wlong-double` warning in `mprintf.c`. This was before Apple switched
to clang, and likely affected the Apple distributed GCC, version 4.2.1
at the time. It applied the workaround to CMake builds only, though
the issue seems build-tool agnostic. Yet, it was not suppressed or
reported for autotools builds.

For these reasons this logic seems obsolete and this patch drops it with
no replacement. It saves a feature detection for GCC builds for macOS.

In PR sub-commits I added (and reverted) in-source suppression. In case
it becomes necessary, that should fix it for all build tools.

Closes #16513
2025-02-28 03:40:40 +01:00
Viktor Szakats
5a021aba41
cmake: improve httpd detection for pytest
Look for `httpd` in addition to `apache2`, like `./configure` does.
It fixes detection with macOS Homebrew for example.

Closes #16515
2025-02-28 03:40:40 +01:00
Viktor Szakats
6913c9b6ab
GHA/linux: improve 'test configs' step, don't set TFLAGS for pytest
- omit comments from th config dump, show filenames for each line.
- `TFLAGS` is not used by pytest, don't set it.

Closes #16514
2025-02-28 03:40:40 +01:00
Daniel Stenberg
953cd694dc
asyn-ares: use the correct port number
Only triggers with old c-ares versions.

Follow-up to 8ded8e5f3f

Closes #16511
2025-02-27 22:18:43 +01:00
Viktor Szakats
af6172c8f2
GHA/linux: merge two package install steps
Merge pytest prereq package install step into the main package install
step, to save install time.

Closes #16509
2025-02-27 20:32:50 +01:00
Daniel Stenberg
8ded8e5f3f
urldata: remove 'hostname' from struct Curl_async
It is unnecessary duplicated information, as the host name being
resolved is already present in conn->host.

Closes #16451
2025-02-27 17:18:43 +01:00
Daniel Stenberg
7007f59caa
GHA: spellcheck curl symbols better
This now makes sure to trim off exact matches for curl symbols and long
curl commanad line options instead of using pattern matching as before.
This should catch typoed names (that still follow the pattern) better.

The cleanspell.pl script is no longer used. cleancmd.pl is used for all
markdown files.

Closes #16504
2025-02-27 13:15:21 +01:00
Daniel Stenberg
a8ad9a5758
docs: minor edits to please the new spellchecker regime 2025-02-27 13:15:21 +01:00
Viktor Szakats
cba83bfb10
runtests: accept CURL_DIRSUFFIX without ending slash
Follow-up to 3585796049 #16452
Closes #16506
2025-02-27 12:11:23 +01:00
Viktor Szakats
59f4727480
appveyor: run VS2008 job with old CMake 3.12.2
Switch VS2008 job the oldest runner machine. It adds the oldest CMake to
the Windows mix, from 2018-11-30. Not a beauty, missing support for `-B`
and Unity, but it's a version curl supports. It's newer than Old Linux.
The previous oldest was 3.16.2. It remains used with VS2010-VS2017.

Also:
- fix VS2008 job to actually build examples.
- switch VS2019 job to OpenSSL 1.1.0 that wasn't tested before.
  Migrate OpenSSL 1.0.2 to the VS2008 job.
- measure run time of individual build steps.

Follow-up to 01c25e3b00 #16458
Closes #16505
2025-02-27 12:11:08 +01:00
Viktor Szakats
08a29e7f18
GHA: tidy up parallel options, improve performance for some jobs
- replace `--parallel <n>` and `-j<n>` for individual commands with
  `MAKEFLAGS`, for jobs not yet doing it.
  This enables parallel builds in distcheck / maketgz-and-verify-in-tree,
  where `-j` option was missing.
- add `--parallel` for iOS Xcode job for improved performance.
- drop redundant `-j5` for Android jobs.
- drop stray `cmake --config` options from single-target jobs (cygwin,
  msys/mingw, dl-mingw, non-native). Drop redundant
  `CMAKE_RUNTIME_OUTPUT_DIRECTORY_*` settings too.
- GHA/windows: add timeout for package install steps where missing.
- GHA/non-native: specify target type explicitly for iOS cmake jobs.
  Xcode default was already Debug, single-target default was generic,
  now it's Release, with unity batch to keep it fast.

`MAKEFLAGS` is necessary for autotools jobs and CMake jobs using
the default (GNU Make) generator. It's ignored by Ninja and other tools.
`cmake --parallel` is still necessary for jobs with Visual Studio or
Xcode generators. Parallelism is 5 for GHA Linux and Windows runners,
4 for macOS, 3 for VMs, 2 for AppVeyor.

Closes #16502
2025-02-27 12:11:07 +01:00
Daniel Stenberg
bc24c60512
urlapi: fix redirect from file:// with query, and simplify
- fix redirect from file:// URL with query part
- find_host_sep() simplify
- urlencode_str() simplify
- redirect_url() simplify
- made more const char *
- add more redirect URL test cases to test 1560

Closes #16498
2025-02-27 11:51:19 +01:00
Viktor Szakats
c028a243f2
build: set -O3 and tune WinCE in CI, fix getpart, vtls_scache fallouts
- GHA/windows/WinCE:
  - set `-O3 -DNDEBUG` C flags manually for the CMake mingw32ce build.
    CMake doesn't recognize the platform and fails to add them. To match
    autotools (using `-O2`), and hit similar compiler warnings.
  - enable parallel builds for cmake.
  - tune parallelism for cmake using unity batches.
  - tune parallelism for autotools.

  Follow-up to 2a292c3984 #15975

- tests: fix potentially uninitialized value in `readline()` in
  `getpart.c`. Detected by gcc 4.4.0 `-O2` (Windows CE) jobs:
  ```
  tests/server/getpart.c: In function 'getpart':
  tests/server/getpart.c:298: error: 'datalen' may be used uninitialized in this function
  ```
  Ref: https://github.com/curl/curl/actions/runs/13522595237/job/37785147505?pr=16476#step:11:25
  Follow-up to 592880a3ca

- vtls_scache: rework returning pointer to avoid compiler warning seen
  with `-O3` gcc 4.4.0 builds (Windows CE/schannel):
  ```
  lib/vtls/schannel.c: In function 'schannel_connect_step1':
  lib/vtls/vtls_scache.c:975: error: dereferencing pointer 'old_cred.4474' does break strict-aliasing rules
  lib/vtls/vtls_scache.c:985: error: dereferencing pointer 'old_cred.4474' does break strict-aliasing rules
  lib/vtls/schannel.c:959: note: initialized from here
  ```
  Ref: https://github.com/curl/curl/actions/runs/13523868335/job/37789610845#step:9:25
  Follow-up to fa0ccd9f1f #15774

Closes #16476
2025-02-26 21:23:11 +01:00
Viktor Szakats
4f98f354b1
GHA/windows: move UWP vcpkg job up top
To bring it closer to WinCE and make the vcpkg jobs with tests form
a continuous group.

Closes #16499
2025-02-26 16:21:01 +01:00
Stefan Eissing
4ed9db9eef
vtls: move common early data code into vtls.c
With now 2 backends implementing early data, it makes sense to have the
common handling in a single place.

Closes #16450
2025-02-26 16:00:37 +01:00
Viktor Szakats
a1d00da81e
test1167: catch #defines with extra whitespace
Before this patch, it missed this in `curl/curl.h`:
```c
#  define __has_declspec_attribute(x) 0
```
After this patch:
```
test 1167...[Verify curl prefix of public symbols in header files]
/usr/bin/perl -I. -I.  returned 1, when expecting 0
 1167: exit FAILED
== Contents of files in the log/14/ dir after test 1167
=== Start of file server.cmd
 Testnum 1167
=== End of file server.cmd
=== Start of file stdout1167
 Bad symbols in public header files:
   __has_declspec_attribute(x)
=== End of file stdout1167
FAIL 1167: 'Verify curl prefix of public symbols in header files' source analysis
TESTFAIL: These test cases failed: 1167
```

Ref: #16491
Closes #16496
2025-02-26 14:01:40 +01:00
Daniel Stenberg
f5527e57f8
tests: make sure gdb gets the right path for -x
Regression from #16452

Closes #16495
2025-02-26 13:12:04 +01:00
Viktor Szakats
dbbbf717f3
curl.h: stop defining non-curl __has_declspec_attribute
Public curl headers are best not to define 3rd-party or system macros.
Introduce `CURL_HAS_DECLSPEC_ATTRIBUTE` to cover this system macro and
use it.

Detected by test1167 after dropping the indentation:
```
test 1167...[Verify curl prefix of public symbols in header files]

/usr/bin/perl -I. -I.  returned 1, when expecting 0
 1167: exit FAILED
== Contents of files in the log/10/ dir after test 1167
=== Start of file server.cmd
 Testnum 1167
=== End of file server.cmd
=== Start of file stdout1167
 Bad symbols in public header files:
   __has_declspec_attribute(x)
=== End of file stdout1167
```
Ref: https://github.com/curl/curl/actions/runs/13533200900/job/37819784405?pr=16490#step:42:2087

Ref: https://clang.llvm.org/docs/LanguageExtensions.html#has-declspec-attribute
Follow-up to 50482b8c0a #3616
Ref: #16496 (fixing test1167)
Closes #16491
2025-02-26 13:10:31 +01:00
Viktor Szakats
3efc53f5e9
build: silence mingw32ce C99 format warnings, simplify CI
`./configure` mingw32ce builds enable C99 mode automatically, that
triggers compiler warnings in gcc 4.4.0. We initially worked it around
in CI by suppressing the detection of C99 with `ac_cv_prog_cc_c99=no`.

Replace it with automatically silencing the bogus warnings in C99 mode,
for all build systems:
```
lib/ftp.c: In function 'Curl_GetFTPResponse':
lib/ftp.c:726: error: format '%zd' expects type 'signed size_t', but argument 4 has type 'ssize_t'
lib/ws.c: In function 'ws_dec_pass_payload':
lib/ws.c:304: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/ws.c: In function 'ws_enc_write_head':
lib/ws.c:581: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'long int'
lib/vtls/schannel.c: In function 'schannel_connect_step1':
lib/vtls/schannel.c:1122: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/vtls/schannel.c: In function 'schannel_connect_step2':
lib/vtls/schannel.c:1311: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/vtls/schannel.c: In function 'schannel_send':
lib/vtls/schannel.c:1793: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/vtls/schannel.c:1810: error: format '%zd' expects type 'signed size_t', but argument 3 has type 'ssize_t'
lib/vtls/schannel.c: In function 'schannel_shutdown':
lib/vtls/schannel.c:2286: error: format '%zd' expects type 'signed size_t', but argument 4 has type 'ssize_t'
lib/vtls/vtls.c: In function 'ssl_cf_recv':
lib/vtls/vtls.c:1422: error: format '%zd' expects type 'signed size_t', but argument 5 has type 'ssize_t'
```
Ref: https://github.com/curl/curl/actions/runs/13533841306/job/37821720902?pr=16492#step:9:20

Also: simplify Windows CE job configuration in GHA/windows.

Follow-up to 2a292c3984 #15975
Closes #16492
2025-02-26 12:35:03 +01:00
Viktor Szakats
518543dec8
cmake: warn for OpenSSL versions missing TLS 1.3 support (revert)
We decided not to show warnings for this issue.

Also this:
```
CMake Warning at CMakeLists.txt:783 (message):
  OpenSSL does not support TLS 1.3.
```
as seen in #16483 with CMake 3.12.4, `OPENSSL_VERSION` is empty.
Perhaps detection isn't reliable? I haven't seen this so far with
mainline OpenSSL. An `if(OPENSSL_VERSION AND ...)` can fix it, if we
opt for this warning in the future.

Follow-up to #16122
This reverts commit 34c1c653fc #16120
Closes #16485
2025-02-26 12:35:03 +01:00
Viktor Szakats
bc42010f66
GHA/http3-linux: build out-of-tree, make test2502 support it
To sync with the rest of core workflows.

Also fixup test2502 failing for out-of-tree builds due to:
```
== Info: error reading ca cert file ./certs/EdelCurlRoot-ca.cacert (Error while reading file.)
```
Ref: https://github.com/curl/curl/actions/runs/13525575035/job/37795171282?pr=16480#step:23:3608

Cherry-picked from #16480
Closes #16481
2025-02-26 12:35:03 +01:00
Viktor Szakats
37523c91bc
GHA/linux: build out-of-tree, make autotools tidy target support it
To sync with the rest of core workflows.

Also fix the `tidy` (clang-tidy) target in autotools to support
out-of-tree builds:
```
clang-tidy slist_wc.c terminal.c tool_bname.c [...] var.c tool_hugehelp.c tool_ca_embed.c
  -quiet --warnings-as-errors=* -checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-optin.performance.Padding,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-clang-analyzer-valist.Uninitialized --
  -I../../include -I../lib -I../src -I../../lib -I../../src
  -DBUILDING_CURL -DUSE_MANUAL -D_GNU_SOURCE -DHAVE_CONFIG_H
[1/45] Processing file /home/runner/work/curl/curl/bld/src/slist_wc.c.
Error while processing /home/runner/work/curl/curl/bld/src/slist_wc.c.
[2/45] Processing file /home/runner/work/curl/curl/bld/src/terminal.c.
Error while processing /home/runner/work/curl/curl/bld/src/terminal.c.
[3/45] Processing file /home/runner/work/curl/curl/bld/src/tool_bname.c.
Error while processing /home/runner/work/curl/curl/bld/src/tool_bname.c.
[...]
```
Ref: https://github.com/curl/curl/actions/runs/13525337357/job/37794388404?pr=16480#step:36:561

Closes #16480
2025-02-26 12:35:03 +01:00
Daniel Stenberg
200993fccd
RELEASE-NOTES: synced 2025-02-26 10:31:16 +01:00
Jay Satiro
2fce176bf6 wolfssl: warn if CA native import option is ignored
- Show verbose message if the CA native import option is set but
  the wolfSSL build does not support it.

wolfSSL has to be built with WOLFSSL_SYS_CA_CERTS to import native
CA certificates and that may not be common.

Closes https://github.com/curl/curl/pull/16417
2025-02-26 03:05:36 -05:00
Daniel Stenberg
d485177151
altsvc: rewrite parser using strparse
Extend test 1654.

Closes #16454
2025-02-26 08:36:08 +01:00
Daniel Stenberg
5b5e2f7318
cookie: do prefix matching case-sensitively
According to section 4.1.3.1 and 4.1.3.2 of
draft-ietf-httpbis-rfc6265bis-19

Ref: https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis-19#section-4.1.3.1

Closes #16494
2025-02-26 08:33:49 +01:00
Daniel Stenberg
ac4a65f8d2
urldata: move the ech struct field to the "right place"
We keep the struct field ordered in a rough size order, big to small.

Closes #16489
2025-02-26 08:18:35 +01:00
Daniel Stenberg
71f190cbbc
GHA: enable the RTSP tests on macOS gcc-12 2025-02-26 07:58:54 +01:00
Daniel Stenberg
2ec00372a1
curl.h: change some enums to defines with L suffix
To help applications do the right thing easier, change some enum values
into defines with L suffixes so that they get the corect type (long)
easier when used with curl_easy_setopt(). This also fixes a few of our
own libtests.

To reduce the risk that this change breaks the compile for any existing
users, the previously provided enums are still provided, but the values
to use are not defined by the enums.

This change "magically" fixes a few RTSP test failures we have had on
64-bit platforms because those options were not see using longs
properly.

Closes #16482
2025-02-26 07:58:15 +01:00
Daniel Stenberg
7826927d9b
libtest/libprereq.c: set CURLOPT_FOLLOWLOCATION with a long
Previously this used '1', which as an int. The option needs a long.

Closes #16487
2025-02-26 00:06:24 +01:00
Daniel Stenberg
6c81f2a35c
CURLOPT_HTTPHEADER.md: add comments to the example
Ref: https://mastodon.social/@jpmens/114065709635360064
Closes #16488
2025-02-25 23:56:05 +01:00
Viktor Szakats
baa9c647d3
cmake: sync cutoff version with autotools for picky option -ftree-vrp
Sync cutoff version for `-ftree-vrp` with autotools, which enables it
for gcc 4.3+ (cmake builds enabled it for 5.0+, before this patch).

Cherry-picked from #16476
Closes #16478
2025-02-25 16:57:45 +01:00
Viktor Szakats
29978df61f
cmake: pre-fill known type sizes for Windows OSes
To save configuration time.

After this patch, for mingw-w64 and MSVC curl's CMake builds pre-fill
almost all type sizes without auto-detection. In most cases this leaves
3 type size auto-detections. Those depend on 64/32-bitness, and `time_t`
also depends on CRT and custom options. Old mingw-w64 versions require
some extra detections. We recommend v3.0 or newer to avoid them.

For Windows CE, this patch pre-fills all type sizes.

If this is causing any issue, please report it and disable pre-filling
with `-D_CURL_PREFILL=OFF` in the meantime.

Cherry-picked from #16394
Closes #16464
2025-02-25 16:57:13 +01:00
Derek Huang
af0100fc17
INSTALL-CMAKE.md: CMake usage updates
This PR updates the CMake build/install docs in `docs/INSTALL-CMAKE.md`,
in particular focusing on the use of libcurl from CMake using
`find_package` as well as the newly added features/protocols support via
using `COMPONENTS` or `OPTIONAL_COMPONENTS` with `find_package`.
See #15854 for initial discussion and the corresponding PR #15858 that
was merged.

Some additional best-practices notes are added, for example:

* Encouraging building out-of-source
* Using `--config` with `cmake --build` for multi-config CMake
  generators, not `CMAKE_BUILD_TYPE`

We also add a CURL CMake-specific tip on using `CMAKE_INSTALL_PREFIX`
during configure time to set the install prefix, not using `--prefix`
when running `cmake --install` so `curl-config` output is consistent.

Closes #16329
2025-02-25 13:02:51 +01:00
Viktor Szakats
84332d49fb
runtests: drop recognizing 'winssl' as Schannel
Follow-up to 180501cb02 #3504
Closes #16467
2025-02-25 12:59:10 +01:00
Viktor Szakats
31fd77fb3b
runtests: recognize AWS-LC as OpenSSL
Fixes (GHA/linux, AWS-LC jobs):
```
test 0307 SKIPPED: curl lacks OpenSSL support
test 0308 SKIPPED: curl lacks OpenSSL support
[...]
```
Ref: https://github.com/curl/curl/actions/runs/13511134270/job/37751473424#step:42:104

Follow-up to 34ef4fab22 #10320
Closes #16466
2025-02-25 12:59:09 +01:00
Daniel Stenberg
6306476fc3
tool_getparam: make --url support a file with URLs
It implies -O used for each URL.

Mention in the --url documentation.

Test 488 and 489 verify.

Closes #16099
2025-02-25 09:16:54 +01:00
Tianyi Song
5addb3e1cc
openssl: check return value of X509_get0_pubkey
Fixes #16468
Closes #16469
2025-02-25 08:10:18 +01:00
Yedaya Katsman
a55b5b7c62
rustls: add support for CERTINFO
This allows you to use the `certs` and `num_certs` writeout variables in
the curl tool, and getting information about the server certificates
using CURLINFO_CERTINFO.

Closes #16459
2025-02-25 07:59:39 +01:00
Viktor Szakats
3175984ab2
build: drop unused getpart tool
Drop the `getpart` test tool from standard builds. This tool was not
used by tests.

Also:
- make it easier to build it standalone for testing `getpart.c` on
  the command-line.
- reduce local var scopes in source.

Closes #16460
2025-02-25 01:52:13 +01:00
Daniel Stenberg
b930142d12
CURLOPT_HTTPHEADER.md: rephrases
An attempt to use better language

Closes #16461
2025-02-24 23:15:26 +01:00
Daniel Stenberg
413b2a44a8
curl_trc: fix build with CURL_DISABLE_VERBOSE_STRINGS
Fixes #16462
Closes #16463
2025-02-24 23:14:54 +01:00
Viktor Szakats
a7bcf25c83
runtests: drop ref to unused external function [ci skip]
Follow-up to 3585796049 #16452
2025-02-24 23:07:51 +01:00
Viktor Szakats
01c25e3b00
CI: misc improvements, restore VS2008 job
- appveyor: restore VS2008 job, after fixing its issues.
  Enable OpenSSL in it. It takes 1 minute.
  Follow-up to 9b0467b169 #16453
  Follow-up to edfa537100 #16456
- appveyor: make a copy of OpenSSL DLLs to have them picked up as an
  artifact (disabled by default) to aid local tests.
- appveyor: dump CMake configuration logs on failure.
- appveyor: tidy up job parameter defaults.
- GHA/windows: add pre-fill check option for dl-mingw jobs.
- GHA/windows: fix pre-fill check option for MSYS jobs by installing
  `diffutils`.
  Follow-up to e7adf3e837 #15841
- GHA/windows: de-duplicate to `PATH` commands for Cygwin.
- GHA/windows: drop `$SYSTEMROOT/System32` from `PATH` for Cygwin
  configure. It's not needed.
  Follow-up to 36fd2dd6ee #13599
- list `.pdb` files in curl version step for MSVC.
  Ref: #16439

Cherry-picked from #16394
Closes #16458
2025-02-24 22:47:37 +01:00
Laurențiu Nicola
46f17ef010
docs: bump rustls to 0.14.1
Closes #16446
2025-02-24 22:41:30 +01:00
Viktor Szakats
5070b6ac45
INSTALL-CMAKE.md: mention ZLIB_USE_STATIC_LIBS
Cherry-picked from #16394
Closes #16457
2025-02-24 21:00:31 +01:00
Viktor Szakats
edfa537100
cmake: restrict static CRT builds to static curl exe, test in CI
Static CRT crashes MSVCR* MSVC builds (in VS2008, VS2010, VS2012,
VS2013) according to CI and local tests. The reproducible crash happens
in `curl_mfprintf() -> fputc(s, stderr)` when trying to display the
warning message in `curl -V`. `stderr` is non-NULL and resolves to `2`.
This reproducer needs a debug-enabled build, but it's unrelated to debug
features or curl's memory tracker. It happens regardless of unity build,
CPU architecture or `DllMain()` use. Example from VS2013:

```
+ _bld/src/Debug/curl.exe --disable --version
./appveyor.sh: line 124:   203 Segmentation fault      "${curl}" --disable --version
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/51570451/job/ojpdqrsm1hmpmq6a#L210

Another crash happened in an UCRT build (VS2017) with a couple of
`printf()`s added to curl's `main()` function:

```
Microsoft Visual C++ Runtime Library
Debug Assertion Failed!
Program: C:/projects/curl/bld/src/Debug/curl.exe
File: minkernel/crts/ucrt/src/appcrt/heap/debug_heap.cpp
Line: 996
Expression: _act_first_block == header
```
(it hangs the job in CI due to the GUI popup)
Ref: https://github.com/curl/curl/pull/16394#issuecomment-2677181716

To avoid actual and potential issues, this patch issues a warning on
the shared-libcurl + static-CRT combination and falls back to the
default, shared CRT. IOW a static CRT build now requires a static curl
exe when using the `CURL_STATIC_CRT=ON` option.

Follow-up to 4fc6ebe18a #1621
Cherry-picked from #16394 (with more details there)

Closes #16456
2025-02-24 21:00:31 +01:00
Viktor Szakats
7b8b9b9c2b
cmake: hide empty MINGW64_VERSION output for mingw32ce
Follow-up to e49797abc2 #16022
Follow-up to 2a292c3984 #15975
Cherry-picked from #16394

Closes #16455
2025-02-24 21:00:31 +01:00
Viktor Szakats
9b0467b169
windows: drop code and curl manifest targeting W2K and older
curl requires Windows XP since 2023. Drop version detection code using
`GetVersionEx()` aimed to support earlier Windows versions. With that
call deleted, the embedded manifest in `curl.rc` becomes unnecessary.
Delete it too, along with the enabler logic in build systems.

This allows to stop forcing `/MANIFEST:NO` for MSVC builds. Dropping it
fixes VS2008 shared builds, that require an auto-generated SxS
(side-by-side assembly) manifest to find their CRT DLLs. This was the
issue that prevented VS2008 `curl.exe` launching on AppVeyor CI:
```
src/curl.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/51577006/job/eitypvwlb1rxr11d#L261

FWIW the `curl.rc` embedded manifest wasn't ever enabled for VS2008 CI
builds either, because CMake did not pass our custom macro via
`CMAKE_RC_FLAGS` to `rc.exe`. For reasons I could not figure out.

After this patch the curl build no longer inject its own manifest, and
lets the default be applied by linkers and toolchains. It fixes VS2008
shared builds. curl continues to detect the real Windows version via
`RtlVerifyVersionInfo()` from `ntdll`.

Follow-up to 960d601481 #12225
Follow-up to 5044909ca2 #7810
Follow-up to ebd213270a #1221
Ref: #15972
Cherry-picked from #16394

Closes #16453
2025-02-24 21:00:31 +01:00
Viktor Szakats
3585796049
runtests: support multi-target cmake, drop workarounds from CI
Support multi-target cmake builds via `CURL_DIRSUFFIX` env. For example:
`export CURL_DIRSUFFIX=Debug/`.

Multi-target generators place their output to `src/<subdir>/`,
`lib/<subdir>/`, `tests/server/<subdir>`, `tests/libtest/<subdir>` and
`tests/unit/<subdir>/` by default. Before this patch, `runtests.pl`
couldn't run on such builds because it expected the binaries under the
their `<subdir>`-less directories. This patch allows to set such subdir
and make `runtests.pl` find the binaries. In CI we use multi-target
builds with tests for MSVC. It also helps Xcode-generator builds, though
in CI we don't have such job running tests.

There may be better solutions to configure this, but passing a custom
value to `runtests.pl` including its subprocesses is somewhat tricky.
The reason the configuration value expects the slash at the end is
because MSYS is automagically expanding the env to a (wrong) absolute
path if the slash is in the front.

Also:
- drop the `-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_*=` workaround from CI.
- replace `resolve` references in tests with a new `%RESOLVE` variable.
  It didn't use a filename extension before. After this patch it uses
  `exe_ext('TOOL')`. I'm not sure if this is the correct choice vs.
  `exe_ext('SRV')`.
- fix `-c` option format in manual.
- fix some whitespace.

Note, in CI we still tweak `CMAKE_RUNTIME_OUTPUT_DIRECTORY_*` in jobs
which share steps between `./configure` and cmake. It's easier that way.

Ref: #15000
Cherry-picked from #16394

Closes #16452
2025-02-24 21:00:30 +01:00
Daniel Stenberg
db2fd7c3de
delta: get contributors without changing THANKS
Give contrithanks.sh the option to send the list of names to stdout so
that delta can use it appropriately for counting.

Closes #16449
2025-02-24 13:26:48 +01:00
Laurențiu Nicola
dfdd380844
ci: use stable rust toolchain for rustls and skip installing the docs
Closes #16447
2025-02-24 13:08:27 +01:00
Daniel Stenberg
8f79b3e696
contrithanks.sh: update docs/THANKS in place
Now using 'sort' for sorting the names. This has the small side-effect
that it sorts slightly different than the previously used sort function
(emacs).

I think this is a better sort and over all it makes it more convenient
to use the script as it removes a manual step.

Closes #16448
2025-02-24 13:04:11 +01:00
Daniel Stenberg
7694fc8256
RELEASE-NOTES: synced 2025-02-24 10:13:06 +01:00
Daniel Stenberg
04289c62de
http: convert parsers to strparse
Closes #16436
2025-02-24 10:02:40 +01:00
Stefan Eissing
edd573d980
wolfssl: tls early data support
Enable TLS Early Data for wolfSSL:

- merge WOLFSSL_CTX and WOLFSSL setup from ngtcp2 with the general
  implemenation in wolfssl.c
- enable for QUIC via ngtcp2
- give Curl_vquic_tls_init() a `struct alpn_spec` like used for the TCP
  case. Adapt gnutls and other users.
- enable pytest test cases for early data with wolfSSL

and while this messes up wolfssl.c anyway, do

- rename all struct/functions with prefix 'wolfssl_' to 'wssl_' to not
  pollute that name prefix
- rename `ctx/handle` to `ssl_ctx/ssl`, as used in openssl case

Closes #16167
2025-02-24 10:01:51 +01:00
Daniel Stenberg
efec626ebb
contributors.sh: lowercase 'github' for consistency
also fix contrithanks and THANKS-filter

Ref: #16438
Closes #16443
2025-02-24 08:05:06 +01:00
Timo Tijhof
9391fc151f
RELEASE-NOTES: fix github casing
Follows-up b22f9066a5, which added a new contributor with a different
casing for "github" than the others.

Closes #16438
2025-02-24 00:10:18 +01:00
Stefan Eissing
51f8aa79a9
CURLMOPT_SOCKETFUNCTION.md: add advice for socket callback invocation times
Explain when a registered socket callback may get invoked to make user
better aware on how to handle it.

Closes #16441
2025-02-24 00:05:56 +01:00
Daniel Stenberg
e1b3d46944
tool_operate: fail SSH transfers without server auth
This now insists on using a server auth option unless --insecure is
provided. As an added bonus, it now also only checks for the knownhosts
file once (if found).

Ref: #16197
Closes #16205
2025-02-23 17:54:21 +01:00
Daniel Stenberg
4c5099868e
http: make the RTSP version check stricter
- make it only accept version 1.0, as that is the version curl supports
- convert the parser to use strparse
- the status code max is now 999, but it does allow != 3 digits

Closes #16435
2025-02-22 15:07:31 +01:00
Stefan Eissing
cfc657a48d
multi: event based rework
Rework the event based handling of transfers and connections to
be "localized" into a single source file with clearer dependencies.

- add multi_ev.c and multi_ev.h
- add docs/internal/MULTI-EV.md to explain the overall workings
- only do event handling book keeping when the socket callback
  is set
- add handling for "connection only" event tracking, when internal
  easy handles are used that are not really tied to a connection.
  Used in connection pool.
- remove transfer member "last_poll" and connections "shutdown_poll"
  and keep all that internal to multi_ev.c
- add CURL_TRC_M() for tracing of "multi" related things, including
  event handling and connection pool operations. Add new trace
  feature "multi" for trace config.
  multi traces will show exactly what is going on in regard to
  event handling.
- multi: trace transfers "mstate" in every CURL_TRC_M() call
- make internal trace buffer 2048 bytes and end the silliness
  with +n here -m there. Adjust test 1652 expectations of resulting
  length and input edge cases.
- add trace feature "lib-ids" to perfix libcurl traces with transfer
  and connection ids. Useful for debugging libcurl applications.

Closes #16308
2025-02-22 14:47:40 +01:00
Daniel Stenberg
886f5dea80
test76: add test with comma-separated list of WWW-Auth methods
The support for this is not 100% but at least this works.

Closes #16425
2025-02-22 14:09:37 +01:00
Daniel Stenberg
c10fd464e0
setopt: remove unnecesary void pointer typecasts
Closes #16426
2025-02-22 13:04:02 +01:00
Daniel Stenberg
e739f5682d
cmake: disable HTTPS-proxy as a feature if proxy is disabled
Co-authored-by: Viktor Szakats

Closes #16434
2025-02-22 12:51:31 +01:00
Daniel Stenberg
a6e8ead533
var: add a '64dec' function that can base64 decode a string
Verified in test 455 and 487.

If the provided string cannot be base64-decoded, it will instead use
"[64dec-fail]" (without the quotes).

Documented

Ref: #16288
Closes #16330
2025-02-22 11:38:52 +01:00
Stefan Eissing
54c07fd6c5
curl: add write-out variable 'tls_earlydata'
Add the write-out variable 'tls_earlydata' to inspect the amount of
TLSv1.3 early data that had been sent.

Closes #15956
2025-02-22 10:02:39 +01:00
Stefan Eissing
952770dc65
gnutls: fix connection state check on handshake
When running curl event based, connect attempts stalled as the 'done'
check was using the wrong state in gnutls.

Add event based pytest runs to all http3 jobs and the openssl and
mbedtls ones on linux.

Closes #16423
2025-02-22 01:01:10 +01:00
Viktor Szakats
ea07a64cf6
cmake: avoid -Wnonnull warning in HAVE_FSETXATTR_5 detection
Seen in Android 21/35 CI jobs:
```
curl/CMake/CurlTests.c:315:16: warning: null passed to a callee that requires a non-null argument [-Wnonnull]
   315 |   fsetxattr(0, 0, 0, 0, 0);
       |                ^
 1 warning generated.
```
Ref: https://github.com/curl/curl/actions/runs/13460225795/job/37613494183#step:9:5978

Follow-up to bd9f9b085a #16377
Closes #16427
2025-02-21 20:53:56 +01:00
Viktor Szakats
d4896d94f2
GHA/windows: replace GfW with MSYS2 runtime downgrade
We recently switched to a known good version of Git for Windows to avoid
the MSYS2/Cygwin runtime performance regression.

MSYS2 is closer to the source of the MSYS2/Cygwin projects. Its known
good version is newer. Installing the downgrade is faster and safer. It
also allows to restore the scripts to their original iteration, making
the workaround easier to drop once the perf issue is fixed upstream.

Therefore, switch back to using MSYS2, and install the runtime downgrade
before running curl tests.

Also disable `pacman`'s `CheckSpace` for best performance.

Jeremy identified to the root cause of the perf regression in this
Cygwin commit (from 2024-09-17):
https://cygwin.com/git/?p=newlib-cygwin.git;a=commit;h=c7fe29f5cb85242ae2607945762f7e0b9af02513

Co-authored-by: Jeremy Drake
Patch: 95a404e19a
Ref: https://github.com/curl/curl/pull/16217#issuecomment-2673158597
Ref: https://github.com/curl/curl/pull/16217#issuecomment-2673461330

Follow-up to 116950a250 #16265
Follow-up to 1bf774df57 #16217
Follow-up to 5f9411f953 #15380

Closes #16424
2025-02-21 20:53:55 +01:00
Daniel Stenberg
f261c8d992
asyn-ares: renamed define
It has the same name as the one used in asyn-thread, but for a slightly
different purpose. This not only caused unity build problems, but would
also be confusing and error-prone.
2025-02-21 16:43:24 +01:00
Daniel Stenberg
17ab4d62e6
GHA: add a build with c-ares + HTTP-RR on Alpine
Closes #16413
2025-02-21 16:43:22 +01:00
Daniel Stenberg
e47a94228f
http: split Curl_http_input_auth into sub functions
Simplifies things. Increases readability a lot.

Fixes #16412
Reported-by: Viktor Szakats
Closes #16416
2025-02-21 14:46:55 +01:00
Viktor Szakats
fc4addbe50
c-ares: error out for unsupported versions, drop unused macros
Stop compilation with a clear error when build with versions older than
decribed in `docs/INTERNALS.md` and `docs/HTTPSRR.md` docs.

Also drop an unused macro and another one that's no longer used with
the required minimum c-ares version.

Closes #16407
2025-02-21 14:12:40 +01:00
Viktor Szakats
bd9f9b085a
configure: silence compiler warnings in feature checks, drop duplicates
Silence compiler warnings (200 of them across the main CI workflows):
```
warning #2193: null argument provided for parameter marked with attribute "nonnull"
warning: Null pointer passed to 1st parameter expecting 'nonnull' [core.NonNullParamChecker]
warning: Null pointer passed to 2nd parameter expecting 'nonnull' [core.NonNullParamChecker]
warning: argument 1 null where non-null expected [-Wnonnull]
warning: argument 2 null where non-null expected [-Wnonnull]
warning: comparison of unsigned expression in '< 0' is always false [-Wtype-limits]
warning: null argument where non-null required (argument 1) [-Wnonnull]
```

Also drop `if ... can be linked` feature checks that were identical to
`if ... is compilable` checks, for:
`closesocket`, `ioctlsocket`, `socket`, `freeaddrinfo`, `getaddrinfo`,
`gethostname`, `getpeername`, `getsockname`,
`CloseSocket` (AmigaOS), `IoctlSocket` (AmigaOS).
Another option is to really do the link checks. But, if they weren't
missed so far, it seems safer to drop than risk a detection failure,
as was the case with AmigaOS functions while working on this PR.

There remain 22 `-Wnonnull` warnings in `gethostbyname_r()`,
`getpeername()` `getsockname()`. Most of the rest is necessary for
detection, or originate from autotools and CMake detection code
templates. Some still fixable, like duplicate libs.

Follow-up to ca2f49ded0 #16287
Closes #16377
2025-02-21 13:59:51 +01:00
Viktor Szakats
2a292c3984
build: add Windows CE / CeGCC support, with CI jobs
Make it possible to build curl for Windows CE using the CeGCC toolchain.
With both CMake and autotools, including tests and examples, also in CI.
The build configuration is the default one with Schannel enabled. No
3rd-party dependencies have been tested.

Also revive old code to make Schannel build with Windows CE, including
certificate verification.

Builds have been throughougly tested. But, I've made no functional tests
for this PR. Some parts (esp. file operations, like truncate and seek)
are stubbed out and likely broken as a result. Test servers build, but
they do not work on Windows CE. This patch substitutes `fstat()` calls
with `stat()`, which operate on filenames, not file handles. This may or
may not work and/or may not be secure.

About CeGCC: I used the latest available macOS binary build v0.59.1
r1397 from 2009, in native `mingw32ce` build mode. CeGCC is in effect
MinGW + GCC 4.4.0 + old/classic-mingw Windows headers. It targets
Windows CE v3.0 according to its `_WIN32_WCE` value. It means this PR
restores portions of old/classic-mingw support. It makes the Windows CE
codepath compatible with GCC 4.4.0. It also adds workaround for CMake,
which cannot identify and configure this toolchain out of the box.

Notes:
- CMake doesn't recognize CeGCC/mingw32ce, necessitating tricks as seen
  with Amiga and MS-DOS.
- CMake doesn't set `MINGW` for mingw32ce. Set it and `MINGW32CE`
  manually as a helper variable, in addition to `WINCE` which CMake sets
  based on `CMAKE_SYSTEM_NAME`.
- CMake fails to create an implib for `libcurl.dll`, due to not
  recognizing the platform as a Windowsy one. This patch adds the
  necessary workaround to make it work.
- headers shipping with CeGCC miss some things curl needs for Schannel
  support. Fixed by restoring and renovating code previously deleted
  old-mingw code.
- it's sometime non-trivial to figure out if a fallout is WinCE,
  mingw32ce, old-mingw, or GCC version-specific.
- WinCE is always Unicode. With exceptions: no `wmain`,
  `GetProcAddress()`.
- `_fileno()` is said to convert from `FILE *` to `void *` which is
  a Win32 file `HANDLE`. (This patch doesn't use this, but with further
  effort it probably could be.)
  https://stackoverflow.com/questions/3989545/how-do-i-get-the-file-handle-from-the-fopen-file-structure
- WinCE has no signals, current directory, stdio/CRT file handles, no
  `_get_osfhandle()`, no `errno`, no `errno.h`. Some of this stuff is
  standard C89, yet missing from this platform. Microsoft expects
  Windows CE apps to use Win32 file API and `FILE *` exclusively.
- revived CeGCC here (not tested for this PR):
  https://building.enlyze.com/posts/a-new-windows-ce-x86-compiler-in-2024/

On `UNDER_CE` vs. `_WIN32_WCE`: (This patch settled on `UNDER_CE`)

- A custom VS2008 WinCE toolchain does not set any of these.
  The compiler binaries don't contain these strings, and has no compiler
  option for targeting WinCE, hinting that a vanilla toolchain isn't
  setting any of them either.
- `UNDER_CE` is automatically defined by the CeGCC compiler.
  https://cegcc.sourceforge.net/docs/details.html
- `UNDER_CE` is similar to `_WIN32`, except it's not set automatically
  by all compilers. It's not supposed to have any value, like a version.
  (Though e.g. OpenSSL sets it to a version)
- `_WIN32_WCE` is the CE counterpart of the non-CE `_WIN32_WINNT` macro.
  That does return the targeted Windows CE version.
- `_WIN32_WCE` is not defined by compilers, and relies on a header
  setting it to a default, or the build to set it to the desired target
  version. This is also how `_WIN32_WINNT` works.
- `_WIN32_WCE` default is set by `windef.h` in CeGCC.
- `_WIN32_WCE` isn't set to a default by MSVC Windows CE headers (the
  ones I checked at least).
- CMake sets `_WIN32_WCE=<ver>`, `UNDER_CE`, `WINCE` for MSVC WinCE.
- `_WIN32_WCE` seems more popular in other projects, including CeGCC
  itself. `zlib` is a notable exception amongst curl dependencies,
  which uses `UNDER_CE`.
- Since `_WIN32_WCE` needs "certain" headers to have it defined, it's
  undefined depending on headers included beforehand.
- `curl/curl.h` re-uses `_WIN32_WCE`'s as a self-guard, relying on
  its not-(necessarily)-defined-by-default property:
  25b445e479/include/curl/curl.h (L77)

Toolchain downloads:
- Windows:
  https://downloads.sourceforge.net/cegcc/cegcc/0.59.1/cegcc_mingw32ce_cygwin1.7_r1399.tar.bz2
- macOS Intel:
  https://downloads.sourceforge.net/cegcc/cegcc/0.59.1/cegcc_mingw32ce_snowleopard_r1397.tar.bz2

Closes #15975
2025-02-21 13:56:34 +01:00
Daniel Stenberg
93958499f2
http: fix the auth check
It used the wrong variable.

Follow-up to d1fc1c4a85
Pointed-out-by: qhill on github
Ref: https://github.com/curl/curl/pull/16406#pullrequestreview-2632734134
Closes #16419
2025-02-21 13:53:14 +01:00
renovate[bot]
7cb3903e25
GHA: update dependency ngtcp2/nghttp3 to v1.8.0
Closes #16421
2025-02-21 13:51:59 +01:00
renovate[bot]
20c53650f2
GHA: update dependency ngtcp2/ngtcp2 to v1.11.0
Closes #16422
2025-02-21 13:51:12 +01:00
Viktor Szakats
56db87a37c
schannel: guard ALPN init code to ALPN builds
To avoid unnecessary init work with toolchains not supporting ALPN.

Follow-up to 7fd15b4a82 #16393
Closes #16420
2025-02-21 13:17:56 +01:00
Viktor Szakats
7fd15b4a82
schannel: enable ALPN support under WINE 6.0+
ALPN support was announced in 5.6 (2020-04-10). It likely needs a WINE
built against GnuTLS 3.2.0 (2013-05-10) or upper (for macOS, GnuTLS was
made default in WINE 6.0.2). I could confirm ALPN working under 6.0.2
(2021-10-26).

https://www.winehq.org/announce/5.6
0527cf89fb
https://gitlab.winehq.org/wine/wine/-/blob/wine-5.6/dlls/secur32/schannel_gnutls.c
https://gitlab.winehq.org/wine/wine/-/blob/wine-5.6/dlls/secur32/tests/schannel.c

If you run into problems, open and Issue and disable ALPN manually with
`--no-alpn` or the equivalent for libcurl.

Ref: #983
Closes #16393
2025-02-21 12:16:41 +01:00
Viktor Szakats
4d01de3529
eventfd: allow for all CPUs
After fixing support for x32, unlock eventfd support for all CPUs.
Before this patch, it was explicitly limited to 64-bit ones.

You can disable eventfs manually on systems where it's auto-detected:
- cmake: `-DHAVE_EVENTFD=0`
- configure: `export ac_cv_func_eventfd=0`

Ref: c2aa504ab9 #16239
Closes #16277
2025-02-21 12:07:24 +01:00
Viktor Szakats
bf823397ba
cmake: drop CURL_DISABLE_TESTS option
curl builds tests with CMake when explicitly building the `testdeps`
target. It's not built by default. It seems overkill to have
a curl-specific variant of this (over CMake's `BUILD_TESTING`)
to disable generating this target.

Its history also doesn't make it obvious why this was necessary,
and there was a long debate how to do it, by the time the original
submitter abandoned CMake. The option also remained uninitialized
and thus undocumented.

Let me know if I missed something.

Ref: #6036
Ref: 3a1e798009 #6072
Closes #16134
2025-02-21 12:05:54 +01:00
Viktor Szakats
2cc90a679a
openssl: drop support for old OpenSSL/LibreSSL versions
Require OpenSSL 1.0.2a (2015-03-19) or LibreSSL 2.9.1 (2019-04-13).

Closes #16104
2025-02-21 12:02:35 +01:00
Viktor Szakats
e0fd5790d9
msvc: drop support for VS2005 and older
- cmake: assume large file support (VS2005+ / `_fseeki64()`)
- config-win32.h: assume large file support (VS2005+ / `_fseeki64()`)
- config-win32.h: assume `HAVE_LONGLONG` (VS2003+)
- config-win32.h: assume 64-bit `time_t` (VS2005+)
- config-win32.h: assume VS2008+
- cmake: use multi-threaded/parallel compilation (VS2008+)
- curl_setup.h: require multi-threading MSVC CRT (~VS2005+)
- curl_setup.h: hard fail for unsupported MSVC versions.
  Authored-by: Jay Satiro
- winbuild: bump minimum version

Follow-up to 308437ac53 #15992
Ref: #15972
Closes #16004
2025-02-21 12:01:00 +01:00
Viktor Szakats
4842f22bfa
tidy-up: align MSYS2/Cygwin codepaths, follow Cygwin MAX_PID bump
MSYS/MSYS2 and Cygwin are the same platform. Adjust code where they were
treated differently.

- drop separate `MSYS` from buildinfo flags. Our code is using the
  `CYGWIN` variable and CMake (since v3.21) sets it also for `MSYS`.
- fix test1158 and test1186 to exclude them for all Win32 targets,
  instead of just MSYS test envs. To align behavior between MSYS and
  Cygwin envs. Required for recent MSYS2 releases which reports itself
  as Cygwin, and no longer MSYS, which broke the previous exclusion
  logic.
- follow Cygwin bumping its `MAX_PID` value, to avoid PID collisions.
  https://cygwin.com/git/?p=newlib-cygwin.git;a=commit;h=363357c023ce01e936bdaedf0f479292a8fa4e0f

Reported-by: Jeremy Drake
Bug: https://github.com/curl/curl/pull/16217#issuecomment-2672768233
Ref: https://www.msys2.org/news/#2025-02-14-moving-msys2-closer-to-cygwin
Closes #16411
2025-02-21 11:58:05 +01:00
Viktor Szakats
540d341b38
schannel: deduplicate Windows Vista detection
curl detects Vista as part of its global initialization. Use that result
instead of detecting it again in Schannel, to save some cycles and API
calls.

Follow-up to 46e97b10ba #16400
Closes #16408
2025-02-21 11:48:56 +01:00
Daniel Stenberg
5693e3fa88
curlver.h: bump to 8.13.0 2025-02-21 11:07:56 +01:00
Daniel Stenberg
ecb382eca2
RELEASE-NOTES: synced 2025-02-21 10:36:53 +01:00
Jay Satiro
46e97b10ba cf-socket: deduplicate Windows Vista detection
- Remove Vista detection logic from Curl_sndbuf_init and evaluate global
  init variable Curl_isVistaOrGreater instead.

This way we don't need a separate initialization in Curl_sndbuf_init.

Ref: https://github.com/curl/curl/pull/16393#discussion_r1962377920

Closes https://github.com/curl/curl/pull/16400
2025-02-21 03:12:32 -05:00
Jay Satiro
210c0c088e wolfssl: fix CA certificate multiple location import
- Do not set x509_store_setup until after all CA certificate imports.

- If CA blob import fails then return error unconditionally.

This is to sync the behavior with OpenSSL and other backends.

Prior to this change, setting CA native and/or CA blob were treated as
mutually exclusive from setting CA file and/or CA path.

CA blob import still overrides CA file import as documented.

Closes https://github.com/curl/curl/pull/16391
2025-02-21 03:11:50 -05:00
Daniel Stenberg
fb61d76580
asyn-ares: fix the port assign
Follow-up to 6bc65a444b
Fixes #16414
Closes #16415
2025-02-21 08:37:24 +01:00
Daniel Stenberg
d1fc1c4a85
http: simplify the check for auth methods
Avoids having to use the correct index into the line. Avoids repeated
use of is_valid_auth_separator.

Require that the following letter is not an alnum instead of checking
explicitly for ch == '\0' || ch == ',' || ISSPACE(ch). After all, the
point is to not erroneously match another auth string using the same
prefix.

Follow-up to b75620b9a0

Closes #16406
2025-02-20 22:50:45 +01:00
Dexter Gerig
6bc65a444b
httpsrr: fix port detection
Closes #16409
2025-02-20 22:46:40 +01:00
Daniel Stenberg
655a4e83b7
GHA: add https-rr (asyn-rr) to the alpine job
Assisted-by: Viktor Szakats
Closes #16402
2025-02-20 22:21:31 +01:00
Stefan Eissing
df5db8afaf
conn: fix connection reuse when SSL is optional
In curl 8.12 I tried to improve the logic on how we handle connections
that "upgrade" to TLS later, e.g. with a STARTTLS. I found the existing
code hard to read in this regard. But of course, the "improvements" blew
up in my face.

We fixed issues with imap, opo3, smtp in 8.12.1, but ftp was no longer
reusing existing, upgraded control connections as before. This PR adds
checks in our pytest FTP tests that verify reuse is happening as
intended.

I rewrote the logic in url.c again, so that the new test checks now pass.

Reported-by: Zenju on github
Fixes #16384
Closes #16392
2025-02-20 16:23:35 +01:00
Stefan Eissing
f78700814d
client writer: handle pause before deocding
Adds a "cw-pause" client writer in the PROTOCOL phase that buffers
output when the client paused the transfer. This prevents content
decoding from blowing the buffer in the "cw-out" writer.

Added test_02_35 that downloads 2 100MB gzip bombs in parallel and
pauses after 1MB of decoded 0's.

This is a solution to issue #16280, with some limitations:
- cw-out still needs buffering of its own, since it can be paused
  "in the middle" of a write that started with some KB of gzipped
  zeros and exploded into several MB of calls to cw-out.
- cw-pause will then start buffering on its own *after* the write
  that caused the pause. cw-pause has no buffer limits, but the
  data it buffers is still content-encoded.
  Protocols like http/1.1 stop receiving, h2/h3 have window sizes,
  so the cw-pause buffer should not grow out of control, at least
  for these protocols.
- the current limit on cw-out's buffer is ~75MB (for whatever
  historical reason). A potential content-encoding that blows 16KB
  (the common h2 chunk size) into > 75MB would still blow the buffer,
  making the transfer fail. A gzip of 0's makes 16KB into ~16MB, so
  that still works.

A better solution would be to allow CURLE_AGAIN handling in the client
writer chain and make all content encoders handle that. This would stop
explosion of encoding on a pause right away. But this is a large change
of the deocoder operations.

Reported-by: lf- on github
Fixes #16280
Closes #16296
2025-02-20 15:53:18 +01:00
Stefan Eissing
279a4772ae
http: negotiation and room for alt-svc/https rr to navigate
Add a 'wanted' major HTTP version bitmask next to the 'allowed' bitmask
in HTTP version negotiation. This will try connections as specified in
'wanted', but enabled Alt-Svc and HTTPS-RR to redirect to other major
HTTP versions, if those are 'allowed'.

Changes libcurl internal default to `CURL_HTTP_VERSION_NONE` and removes
the code in curl that sets `CURL_HTTP_VERSION_2TLS` if the command line
does not say anything else.

Closes #16117
2025-02-20 15:45:46 +01:00
Stefan Eissing
a1850ad7de
cfilter: remove 'blocking' connect handling
Remove `blocking` argument from cfilter's connect method.

Implement blocking behaviour in Curl_conn_connect() instead for all
filter chains.

Update filters implementations. Several of which did never use the
paramter (QUIC for example). Simplifies connect handling in TLS filters
that no longer need to loop

Fixed a blocking connect call in FTP when waiting on a socket accept()
which only worked because the filter did not implement it.

Closes #16397
2025-02-20 11:13:51 +01:00
Daniel Stenberg
654f8cb5f3
tool_getparam: clear sensitive arguments better
curl attempts to clear some flags to hide them from snooping neighbors
(on platforms where it works). For example the credentials provided with
-u. Previously it would only do that if there was a space between the
option and the credentials as in "-u joe:s3cr3t" but not when done
without a separating space as in "-ujoe:s3cr3t".

This addresses that previous shortcoming.

Reported-by: kayrus on github
Fixes #16396
Closes #16401
2025-02-20 09:56:09 +01:00
Daniel Stenberg
c64304e111
httpsrr: fix the HTTPS-RR threaded-resolver build combo
Reported-by: Viktor Szakats
Fixes #16399
Closes #16404
2025-02-20 09:40:53 +01:00
Viktor Szakats
ee3f657607
build: silence bogus -Wconversion warnings with gcc 5.1-5.4
It's fixed in gcc 5.5.0.

Example: https://godbolt.org/z/x6Th8q844

Seen in gcc 5.1.0, 5.4.0 (both 32/64-bit) with dl-mingw:
```
lib/rtsp.c: In function 'rtsp_parse_transport':
lib/rtsp.c:1025:36: error: conversion to 'unsigned char' from 'int' may alter its value [-Werror=conversion]
           rtp_channel_mask[idx] |= (unsigned char)(1 << off);
                                    ^
lib/mprintf.c: In function 'parsefmt':
lib/mprintf.c:526:31: error: conversion to 'unsigned char' from 'int' may alter its value [-Werror=conversion]
         usedinput[width/8] |= (unsigned char)(1 << (width&7));
                               ^
lib/mprintf.c:544:35: error: conversion to 'unsigned char' from 'int' may alter its value [-Werror=conversion]
         usedinput[precision/8] |= (unsigned char)(1 << (precision&7));
                                   ^
lib/mprintf.c:559:29: error: conversion to 'unsigned char' from 'int' may alter its value [-Werror=conversion]
       usedinput[param/8] |= (unsigned char)(1 << (param&7));
                             ^
lib/cfilters.c: In function 'Curl_pollset_change':
lib/cfilters.c:935:25: error: conversion to 'unsigned char' from 'int' may alter its value [-Werror=conversion]
       ps->actions[i] |= (unsigned char)add_flags;
                         ^
```
gcc 5.1.0: https://github.com/curl/curl/actions/runs/13413103492/job/37467698381#step:9:21
gcc 5.4.0: https://github.com/curl/curl/actions/runs/13413103492/job/37467694479#step:9:19

Closes #16398
2025-02-19 18:03:23 +01:00
Daniel Stenberg
f0d7318193
strparse: provide access functions
To access the string and the length without having to directly use the
struct field names. Gives more freedom, flexbility and keeps
implementation specifics out of users' code.

Closes #16386
2025-02-19 12:17:32 +01:00
Daniel Stenberg
1aea05a6c2
cookie: convert to using strparse
- using strparse cleans up the code and makes it easier to read and follow
- remove ? handling never used - since the path is provided without queries nowadays
- simplify sanitize_cookie_path
- avoid the strdup in pathmatch()

Closes #16386
2025-02-19 12:17:32 +01:00
Viktor Szakats
397088e8f4
schannel: enable ALPN with MinGW, fix ALPN for UWP builds
ALPN requires mingw-w64 9.0 or newer.

Also fix ALPN-enabled builds for UWP. This assumes that WINE doesn't
support UWP, which seems to be the case when writing this.

Closes #16385
2025-02-19 11:27:01 +01:00
Jay Satiro
2335cbaa21 ca-native.md: sync with CURLSSLOPT_NATIVE_CA
- Add that the native CA store is used to verify certs in addition to
  the other certificate location settings.

Basically clarify that --ca-native does not override --cacert etc.

Prior to this change that behavior was only documented in
CURLSSLOPT_NATIVE_CA which is what --ca-native maps to.

Ref: https://github.com/curl/curl/pull/16181#issuecomment-2663998865

Closes https://github.com/curl/curl/pull/16373
2025-02-19 03:39:52 -05:00
Daniel Stenberg
3100fb45b7
RELEASE-NOTES: synced 2025-02-19 08:11:43 +01:00
John Bampton
8633b10a41
KNOWN_BUGS: fix typo
Closes #16383
2025-02-19 07:54:03 +01:00
Daniel Stenberg
a867314f4f
ssh: consider sftp quote commands case sensitive
They have always been documented in lowercase. They have never been
claimed to be case insensitive. They mostly map to unix counterparts
that are always lowercase. Switch to case sensitive checks: lowercase.

Closes #16382
2025-02-19 07:52:11 +01:00
Daniel Stenberg
ad700a0917
strparse: speed up the hex parser somewhat
Around 2.3x speed-up parsing many large hexadecimal numbers. The decimal and
octal parser get marginally faster.

Still very readable, compact and easy to follow code.

Tweaks

- combine the max and the overflow check, gains 3ns/num (use a separate
  check outside of the loop instead for max < base)
- one less indirection in the pointer, gains 3ns/num
- using the table lookup for hex nums, gains 5ns/num
- unfold the num_digit() macro, gains 3s/num
- use the hexasciitable unconditionally, gains 2ns/num
- use post-increment pointer in the table lookup, gains 1ns/num
- improved valid_digit() using the table for the hex case,
  gains 26 ns/num
- use "max char" in valid_digit(), gains 3ns/num

Behavior changes:

- no longer returns STRE_TOO_BIG - only STRE_OVERFLOW
- does not move the char ** on error, which is probably better

Updated and extended test 1664 (significantly).

Closes #16374
2025-02-19 07:49:06 +01:00
Viktor Szakats
3fd1dfc829
tidy-up: use CURL_ARRAYSIZE()
Follow-up to 13b2ea68f0 #16111

Closes #16381
2025-02-19 00:59:45 +01:00
Stefan Eissing
1b710381ca
https-rr: implementation improvements
- fold DoH and async HTTPS-RR handling into common code.
  have common cleanups, etc. Have a CURLcode result in async
  handling to allow HTTPS RR parsing to fail.
- keep target, ipv4hints, ipv6hints, port and echconfig also
  when resolving via cares. We need to know `target` and `port`
  when evaluating possible ALPN candidates to not go astray.
- add CURL_TRC_DNS for tracing DNS operations
- replace DoH specific tracing with DNS, use doh as alias
  for dns in curl_global_tracea()

Closes #16132
2025-02-18 16:12:26 +01:00
Stefan Eissing
db72b8d4d0
http: version negotiation
Translate the `data->set.httpwant` which is one of the consts from the
public API (CURL_HTTP_VERSION_*) into a major version mask plus
additional flags for internal handling.

`Curl_http_neg_init()` does the translation and flags setting in http.c,
using new internal consts CURL_HTTP_V1x, CURL_HTTP_V2x and CURL_HTTP_V3x
for the major versions. The flags are

- only_10: when the application explicity asked fro HTTP/1.0
- h2_upgrade: when the application asks for upgrading 1.1 to 2.
- h2_prior_knowledge: when directly talking h2 without ALPN
- accept_09: when a HTTP/0.9 response is acceptable.

The Alt-Svc and HTTPS RR redirections from one ALPN to another obey the
allowed major versions. If a transfer has only h3 enabled, Alt-Svc
redirection to h2 is ignored.

This is the current implementation. It can be debated if Alt-Svc should
be able to override the allowed major versions. Added test_12_06 to
verify the current restriction.

Closes #16100
2025-02-18 16:10:12 +01:00
Viktor Szakats
f7fcbb8127
cmake: SHARE_LIB_OBJECT=ON requires CMake 3.12 or newer
This feature requires Object Libraries which is supported by CMake 3.12
or newer: https://cmake.org/cmake/help/latest/release/3.12.html

Keep it permanently disabled for older CMake versions.
Also document it in `docs/INSTALL-CMAKE.md`.

Ref: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#object-libraries

Follow-up to fc9bfb1452 #11627
Follow-up to 2ebc74c36a #11546

Reported-by: Mark Phillips
Fixes #16375
Closes #16376
2025-02-18 15:05:39 +01:00
Daniel Stenberg
2f4dc6525c
hostip: make CURLOPT_RESOLVE support replacing IPv6 addresses
This also applies to --resolve of course.

Applied strparse functions on the function.

Fixes #16357
Reported-by: rmg-x on github
Closes #16358
Assisted-by: Jay Satiro
2025-02-18 08:55:56 +01:00
Viktor Szakats
61f85bf967
GHA/windows: drop no-op -DCMAKE_BUILD_TYPE= from MSVC jobs
They use Visual Studio generators, which are multi-target.
The build command does the Release/Debug selection via `--config`.

Also:
- appveyor: drop unnecessary conditional for 3 options.
  To sync with GHA.
- appveyor: drop unused `-DCMAKE_INSTALL_PREFIX=`.
  To sync with GHA.
- sync cmake option order between GHA and appveyor.

Closes #16372
2025-02-18 01:06:21 +01:00
Viktor Szakats
24ffcbad5f
cmake: sync OpenSSL(-fork) feature checks with ./configure
`./configure` uses `AC_CHECK_FUNC` for these checks, with one exception
(`SSL_CTX_set_srp_username`). It's slightly less precise but simpler as
it doesn't need headers and/or macros. Do the same in CMake.

It also allows merging ECH detections across OpenSSL forks in CMake too.

Closes #16352
2025-02-17 17:04:17 +01:00
Viktor Szakats
80d93799a6
asyn-thread: fix mutex refs and unused variable in no-HAVE_GETADDRINFO builds
Follow-up to 074048ae80 #16321
Follow-up to 2ee754d830 #16323
Closes #16370
2025-02-17 16:59:57 +01:00
Viktor Szakats
67559aa8ce
CI: dump non-pre-fill configure log on pre-fill check fail
To help debugging builds where the actual feature check is broken.

Follow-up to e7adf3e837 #15841
Closes #16369
2025-02-17 16:59:56 +01:00
dependabot[bot]
a74dd9f330
GHA: bump rojopolis/spellcheck-github-actions
Bumps [rojopolis/spellcheck-github-actions](https://github.com/rojopolis/spellcheck-github-actions) from 9e0a5fb25a80b89c84899657949cbd6e17eb376c to ed0756273a1658136c36d26e3d0353de35b98c8b.
- [Release notes](https://github.com/rojopolis/spellcheck-github-actions/releases)
- [Changelog](https://github.com/rojopolis/spellcheck-github-actions/blob/master/CHANGELOG.md)
- [Commits](9e0a5fb25a...ed0756273a)

---
updated-dependencies:
- dependency-name: rojopolis/spellcheck-github-actions
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Closes #16368
2025-02-17 16:47:10 +01:00
Daniel Stenberg
448caab0df
timediff: remove unnecessary double typecast
Closes #16367
2025-02-17 16:10:34 +01:00
Daniel Stenberg
bd15d8beb3
STRPARSE.md: sync with recent changes
New functions and Curl_str_number() changed number return type.

Closes #16365
2025-02-17 14:40:52 +01:00
Daniel Stenberg
bc6a404061
http_aws_sigv4: use strparse more for parsing
Closes #16366
2025-02-17 14:40:07 +01:00
Stefan Eissing
43012cb3af
ssl session cache: add exportable flag
Give peers and `exportable` flag, set TRUE when sessions for this peer
should not be exported. This evalualtes if the peer uses confidential
information (like srp username/password), a client certificate OR if the
"ssl_peer_key" contains relative paths.

When SSL is configured with paths for relevant components, like CA trust
anchors, an attempt is made to make this path absolute. When that does
not work or the infrstructure is not available, the peer key is marked
as *local*.

Exporting sessions based on relative paths may lead to confusion when
later imported in another execution context.

Closes #16322
2025-02-17 14:25:30 +01:00
Stefan Eissing
069f9d066e
hash: use single linked list for entries
Curl's double linked list is proven code, but it comes with some
additional memory overhead. Since hash's internal list of elements needs
only forward traversals, it seems worthwhile to use a single linked list
internally.

This saves 3 pointers per entry plus 3 pointers per slot.

Closes #16351
2025-02-17 14:23:23 +01:00
Daniel Stenberg
0064708f3f
cookie: minor parser simplification
- parse whitespace before the value is handled
- remove superflous checks from some ISBLANK() loops

Closes #16362
2025-02-17 13:22:14 +01:00
Daniel Stenberg
676de7f580
lib: use Curl_str_* instead of strtok_r()
Helps avoid extra mallocs. Gets rid of the private strtok_r
implementation.

Closes #16360
2025-02-17 13:18:28 +01:00
Daniel Stenberg
076444ec46
lib: simplify more white space loops
Since the ISBLANK() and ISSPACE() macros check for specific matches,
there is no point in using while(*ptr && ISSPACE(*ptr)) etc, as the
'*ptr' check is then superfluous.

Closes #16363
2025-02-17 13:17:18 +01:00
Daniel Stenberg
9d5563b535
build: even more strtoll cleanups
Follow-up to b4538ec522

Closes #16359
2025-02-17 11:40:17 +01:00
Marcel Raad
db4d617c1c
build: enable -Wjump-misses-init for GCC 4.5+
This should have caught https://github.com/curl/curl/issues/16246.

Closes https://github.com/curl/curl/pull/16252
2025-02-17 08:48:36 +01:00
Marcel Raad
d164f49520
openssl: remove bad gotos into other scope
All the `goto` did in these cases was effectively `return 0`, so just
use that explicitly.

Closes https://github.com/curl/curl/pull/16356
2025-02-17 08:46:11 +01:00
Marcel Raad
4afe3e7d8a
Revert "openssl: fix out of scope variables in goto"
This reverts the main part of commit
3f79695be9, but keeping the
formatting fix.

Closes https://github.com/curl/curl/pull/16356
2025-02-17 08:46:10 +01:00
Daniel Stenberg
b22f9066a5
RELEASE-NOTES: synced 2025-02-17 08:43:08 +01:00
Marcel Raad
fb60c9018d
asyn-thread: fix CURL_DISABLE_SOCKETPAIR build
Since commit 074048ae80, `td` is used also with
`CURL_DISABLE_SOCKETPAIR`.

Closes https://github.com/curl/curl/pull/16355
2025-02-17 08:38:24 +01:00
Jay Satiro
4a74135737 variable.md: clarify 'trim' example
- Use the variable name 'var' instead of 'url' since the latter is also
  a function name and that may confuse the user.

Closes https://github.com/curl/curl/pull/16346
2025-02-16 18:52:48 -05:00
Jay Satiro
28d3c5dced scripts/managen: fix parsing of markdown code sections
- Terminate a code section before parsing a heading line.

Prior to this change when a code line (eg "    code") was followed
by a heading line (eg "## heading") the code section in the output
was terminated after converting the header instead of before. That led
to some weird formatting outputs depending on the nroff or roffit etc.

With this change:

.nf
curl \--expand\-url https.//example.com/{{url:trim}}
.fi
.IP json

Without this change:

.nf
curl \--expand\-url https.//example.com/{{url:trim}}
.IP json
.fi

Closes https://github.com/curl/curl/pull/16345
2025-02-16 18:52:17 -05:00
Jay Satiro
760bbb2110 scripts/managen: fix option 'single'
- Fix option 'single' to generate single manpages.

As far as I can tell the option did not work prior to this change.

Example: scripts/managen -d docs/cmdline-opts single variable.md

Closes https://github.com/curl/curl/pull/16344
2025-02-16 18:51:30 -05:00
Viktor Szakats
0d4a6a9500
cmake: fix ECH detection in custom-patched OpenSSL
Typo found via #16352
Regression-from fd067bfb5b #15596
Closes #16354
2025-02-16 22:06:04 +01:00
Viktor Szakats
1d0ca25d8b
build: drop more unused HAVE_STRTOLL
Follow-up to e5326bfb44 #16350
Closes #16353
2025-02-16 22:06:03 +01:00
Daniel Stenberg
e5326bfb44
build: remove checks for strtoll()
Follow-up to b4538ec522

It is not being used anymore.

Closes #16350
2025-02-16 16:12:04 +01:00
Daniel Stenberg
37128035e5
CODE_STYLE: readability and banned functions
Closes #16349
2025-02-16 16:11:13 +01:00
Daniel Stenberg
1ee06e873c
asyn-thread: remove 'status' from struct Curl_async
While it gets stored, nothing needs nor uses it.

Closes #16347
2025-02-16 14:35:33 +01:00
Stefan Eissing
8b3690c688
lib: strparse.h include where missing
Closes #16348
2025-02-16 14:20:14 +01:00
Viktor Szakats
45f7cb7695
cmake: misc tidy-ups
- replace `add_compile_options()`,  `add_definitions()` with directory
  properties. To harmonize this across all scripts. The new commands are
  verbose, but describe better how they work. The syntax is also closer
  to setting target properties, helps grepping.

- prefer `CMAKE_INSTALL_PREFIX` over `--prefix` (in tests, CI).

- tidy up cmake invocations.

- formatting.

Closes #16238
2025-02-16 03:37:22 +01:00
Viktor Szakats
ca2f49ded0
build: fix compiler warnings in feature detections
Fix or silence compiler warnings happening in feature detections
to reduce log noise. Warnings may also get promoted to errors in certain
cases, causing missed detections.

It reduces the number of warnings by 4500+ across the linux, linux-old,
macos, non-native and windows GHA workflows (~142 jobs).

Also move picky warning logic for MSVC/Borland to
`CMake/PickyWarnings.cmake. To make them listed in the picky-warnings
log output, and to also apply to feature detections to make them compile
under the same conditions as source code. The hope is to help catching
issues faster. It also improves code quality of feature tests.

Fixed/silenced:
```
warning #177: variable "dummy" was declared but never referenced
warning #177: variable "flag" was declared but never referenced
warning #177: variable "res" was declared but never referenced
warning #592: variable "s" is used before its value is set
warning #1011: missing return statement at end of non-void function "main"
warning #1786: function "SSL_CTX_set_srp_password" (declared at line 1888 of "/usr/include/openssl/ssl.h") was declared deprecated ("Since OpenSSL 3.0")
warning #1786: function "SSL_CTX_set_srp_username" (declared at line 1887 of "/usr/include/openssl/ssl.h") was declared deprecated ("Since OpenSSL 3.0")
warning #2332: a value of type "const char *" cannot be assigned to an entity of type "char *" (dropping qualifiers)
warning: 'SSL_CTX_set_srp_password' is deprecated [-Wdeprecated-declarations]
warning: 'SSL_CTX_set_srp_password' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
warning: 'SSL_CTX_set_srp_username' is deprecated [-Wdeprecated-declarations]
warning: 'SSL_CTX_set_srp_username' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
warning: 'b' is used uninitialized [-Wuninitialized]
warning: 'gethostname' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
warning: Undefined or garbage value returned to caller [core.uninitialized.UndefReturn]
warning: Value stored to 'i' is never read [deadcode.DeadStores]
warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
warning: control reaches end of non-void function [-Wreturn-type]
warning: empty expression statement has no effect; remove unnecessary ';' to silence this warning [-Wextra-semi-stmt]
warning: excess elements in struct initializer
warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
warning: macro "_FILE_OFFSET_BITS" is not used [-Wunused-macros]
warning: macro "_REENTRANT" is not used [-Wunused-macros]
warning: missing braces around initializer [-Wmissing-braces]
warning: no previous extern declaration for non-static variable 'off_t_is_large' [-Wmissing-variable-declarations]
warning: no previous prototype for 'check' [-Wmissing-prototypes]
warning: no previous prototype for function 'check' [-Wmissing-prototypes]
warning: null argument where non-null required (argument 2) [-Wnonnull]
warning: passing 'const char[1]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
warning: passing argument 2 of 'SSL_CTX_set_srp_password' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
warning: passing argument 2 of 'SSL_CTX_set_srp_username' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
warning: unused parameter 'c' [-Wunused-parameter]
warning: unused parameter 'f' [-Wunused-parameter]
warning: unused variable 'data' [-Wunused-variable]
warning: unused variable 'dummy' [-Wunused-variable]
warning: unused variable 'flag' [-Wunused-variable]
warning: unused variable 'res' [-Wunused-variable]
warning: unused variable 's' [-Wunused-variable]
warning: variable 's' set but not used [-Wunused-but-set-variable]
warning: variable 'ts' set but not used [-Wunused-but-set-variable]
```

Closes #16287
2025-02-16 02:39:35 +01:00
Viktor Szakats
ebbf51e191
configure: use curl_cv_apple variable
Follow-up to 876db1070b #16338

Closes #16340
2025-02-16 02:03:16 +01:00
Viktor Szakats
1b87357967
cmake: allow empty custom IMPORT_LIB_SUFFIX, add suffix collision detection
Allow overriding the `IMPORT_LIB_SUFFIX` default with an empty value.

Also:
- add a fatal error if the implib and static lib filename are identical.
- clarify `IMPORT_LIB_SUFFIX` default value in the documentation.

Reported-by: RubisetCie on Github
Fixes #16324
Ref: 1199308dbc #11505

Closes #16332
2025-02-16 02:03:16 +01:00
Viktor Szakats
e7adf3e837
cmake: add pre-fill for Unix, enable in GHA/macos, verify pre-fills
TL;DR: Save 10 minutes of CI time for GHA/macos jobs using pre-fills and
add pre-fill verification for Apple and Windows. Also restores Xcode job
and saves 1.5-10 minutes configuring iOS jobs.

Pre-filling feature detection results can bring down the CMake configure
step to ~5 seconds on most GHA runners, ~10 seconds in slow envs like
Cygwin/MSYS2.

The potential savings per job are:
- 5-40 (average 19) seconds on GHA/macos (33 jobs)
- ~10 seconds on GHA for iOS GNU Makefile (1 job)
- 1.5-10 minutes on GHA for iOS Xcode generator (1 job)
- 10 seconds on GHA/linux with native Ubuntu (12 jobs)
- 40 seconds for Cygwin/MSYS2 (2 jobs)
- 5-10 seconds for virtualized BSDs, native CPU (3 jobs)
- ~60 seconds for virtualized BSDs, emulated CPU (1 job)

On native Windows pre-filling has been in place for a long time and
saving 8 minutes (VS2019-VS2015) to 1.5-2 minutes (VS2022), 3 minutes
(VS2022 UWP), and 30-60 seconds (MinGW), per CI job.

The downside is that detection results need to be manually collected and
filtered to those that universally apply to all platforms that they are
enabled on. Another downside is that by using a cache, we're not running
the actual detections, and thus won't catch regressions in them. It
means we must make sure that the cache is solid and matches with actual
detections results. An upside is that it gives a rough overview of which
features are available on which platforms. Another upside is pre-filled
values do work for feature detections skipped for cross-builds, e.g.
`HAVE_WRITABLE_ARGV`.

This PR adds a pre-fill cache that supports all Unixes (except OmniOS)
used in CI, and makes it usable with an internal option. It also enables
it for GHA/macos CI jobs, where the maximum savings are. And also for
the two iOS [1] and two Cygwin/MSYS2 jobs. The latters don't have
pre-fill checks and we can drop them if they turn into a hassle.

Saving:
- 10 minutes of CI time per GHA/macos workflow run. [2]
- ~80 seconds per GHA/windows workflow run with Cygwin/MSYS2.
  (offsetting the cost of pre-fill verifications)
- 1.5-10 minutes per GHA/non-native runs with iOS jobs. [3]

You can enable pre-fill locally with `-D_CURL_PREFILL=ON`. It's
experimental, and if you experience a problem, file a PR or an Issue.

This PR also adds a pre-fill checker for macOS and MinGW/MSVC Windows
GHA jobs to catch if the cache diverges from real detections. It also
adds this logic to AppVeyor, but doesn't enable it due to the perf
penalty of 2 minutes mininum.

The pre-fill checker works by configuring out-of-tree with and without
pre-fill, then diffing their `lib/curl_config.h` outputs.

Exceptions are 3 detection results exposed indirectly [4], and missing
to expose 2, of which one is the C89 header `stddef.h`. While we assume
the C99 `stdint.h` available outside iOS. We can expose them in the
future, if necessary.

The pre-fill checks cost in total:
- ~20 seconds for macOS
- ~40 seconds for MinGW on GHA
- ~80 seconds for MSVC on GHA (UWP would be 2x this)

An extra time saving potential is caching type sizes. They are
well-known, and seldom change, esp. in CI. GHA/Windows jobs spend 8-17
seconds per job on these ~12 feature checks. ~5s on Cygwin/MSYS2. Couple
of seconds on other platforms. (This PR doesn't make this optimization.)

Another opportunity is doing the same for autotools, which typically
spends more time in the configuration step than cmake.

[1] Xcode job restored as a
follow-up to be5f20202c #16302

[2] GHA/macos cmake configure times in seconds:
Job                                              |  Bef. | After |  Gain
:----------------------------------------------- | ----: | ----: | ----:
CM clang GnuTLS !ldap krb5                       |  21.2 |   4.5 |  16.7
CM clang LibreSSL !ldap heimdal c-ares +examples |  13.3 |   3.9 |   9.4
CM clang OpenSSL +static libssh +examples        |  20.0 |   4.6 |  15.4
CM clang OpenSSL IDN clang-tidy~ (w/chkprefill)  |  15.7 |  18.6 |  -2.9
CM clang OpenSSL gsasl rtmp AppleIDN             |  25.0 |   4.7 |  20.3
CM clang OpenSSL torture !FTP                    |  15.3 |   4.5 |  10.8
CM clang OpenSSL torture FTP                     |  25.0 |   5.9 |  19.1
CM clang SecureTransport debug                   |  18.0 |   3.8 |  14.2
CM clang macos-13 SecureTransport                |  45.8 |  12.4 |  33.4
CM clang macos-14 SecureTransport                |  15.8 |   4.6 |  11.2
CM clang macos-15 SecureTransport                |  26.8 |   6.1 |  20.7
CM clang mbedTLS openldap brotli zstd            |  15.1 |   6.5 |   8.6
CM clang wolfSSL !ldap brotli zstd               |  27.0 |   4.4 |  22.6
CM gcc-12 GnuTLS !ldap krb5                      |  39.1 |   8.7 |  30.4
CM gcc-12 LibreSSL !ldap heimdal c-ares +examples|  23.8 |   7.2 |  16.6
CM gcc-12 OpenSSL +static libssh +examples       |  20.7 |   8.5 |  12.2
CM gcc-12 OpenSSL gsasl rtmp AppleIDN            |  23.1 |  10.1 |  13.0
CM gcc-12 SecureTransport debug                  |  21.1 |   4.8 |  16.3
CM gcc-12 mbedTLS openldap brotli zstd           |  21.4 |   5.8 |  15.6
CM gcc-12 wolfSSL !ldap brotli zstd              |  21.1 |   6.9 |  14.2
CM gcc-14 macos-13 SecureTransport               |  61.9 |  18.7 |  43.2
CM gcc-14 macos-14 SecureTransport               |  30.5 |   6.4 |  24.1
CM gcc-14 macos-15 SecureTransport               |  32.7 |   8.4 |  24.3
CM llvm@15 GnuTLS !ldap krb5                     |  21.1 |   7.5 |  13.6
CM llvm@15 LibreSSL !ldap heimdal c-ares +exampl~|  24.6 |   6.8 |  17.8
CM llvm@15 OpenSSL +static libssh +examples      |  19.0 |   6.4 |  12.6
CM llvm@15 OpenSSL gsasl rtmp AppleIDN           |  19.0 |   8.2 |  10.8
CM llvm@15 SecureTransport debug                 |  18.0 |   5.4 |  12.6
CM llvm@15 macos-13 SecureTransport              |  66.2 |  25.7 |  40.5
CM llvm@15 macos-14 SecureTransport              |  31.9 |   6.1 |  25.8
CM llvm@15 mbedTLS openldap brotli zstd          |  19.5 |   8.9 |  10.6
CM llvm@15 wolfSSL !ldap brotli zstd             |  24.3 |   5.9 |  18.4
CM llvm@18 macos-15 SecureTransport              |  33.8 |   6.4 |  27.4
Total                                            | 856.8 | 257.3 | 599.5
Before: https://github.com/curl/curl/actions/runs/13311042735/job/37173478424
After: https://github.com/curl/curl/actions/runs/13313927119/job/37183206426?pr=15841

[3] iOS:
Before: https://github.com/curl/curl/actions/runs/13326401704?pr=15841
After: https://github.com/curl/curl/actions/runs/13332177764?pr=15841

[4] detection results exposed indirectly in `curl_config.h`:
- `HAVE_FILE_OFFSET_BITS` via `_FILE_OFFSET_BITS`
- `HAVE_GETHOSTBYNAME_R_*_REENTRANT` via `NEED_REENTRANT`
- `HAVE_SOCKADDR_IN6_SIN6_ADDR` via `USE_IPV6`

Closes #15841
2025-02-16 01:59:59 +01:00
Jay Satiro
1d7c3ab5aa curl_msh3: remove verify bypass from DEBUGBUILDs
- Remove the workaround that disabled peer verification in DEBUGBUILDs
  when CA certs were provided.

The workaround was part of a TODO that disabled verification in
DEBUGBUILDs with a CAfile/path because apparently there's no way to set
those options in msh3 and that caused some tests to fail. Instead the
tests should fail and this problem should not be covered up.

Ref: https://github.com/curl/curl/pull/16327#issuecomment-2661039423

Closes https://github.com/curl/curl/pull/16342
2025-02-15 18:04:15 -05:00
Daniel Stenberg
869d863318
RELEASE-NOTES: synced 2025-02-15 22:32:44 +01:00
kriztalz
2ec1ce92ff
docs: correct argument names & URL redirection
Closes #16334
2025-02-15 22:29:35 +01:00
Joseph Chen
63197b7ff2
wolfssh: retrieve the error using wolfSSH_get_error
Closes #16335
2025-02-15 22:20:15 +01:00
Daniel Stenberg
2ee754d830
asyn-thread: avoid the separate curl_mutex_t alloc
Just make it a part of the thread_sync_data struct.

Closes #16323
2025-02-15 22:13:56 +01:00
Daniel Stenberg
b4538ec522
strparse: switch to curl_off_t as base data type
- add hex and octal parsers to the Curl_str_* family
- make curlx_strtoofft use these parsers
- remove all use of strtol() and strtoul() in library code
- generally use Curl_str_* more than strtoofft, for stricter parsing
- supports 64-bit universally, instead of 'long' which differs in size
  between platforms

Extended the unit test 1664 to verify hex and octal parsing.

Closes #16336
2025-02-15 21:58:48 +01:00
Viktor Szakats
876db1070b
build: set HAVE_WRITABLE_ARGV for Apple cross-builds
Enable this feature for Apple cross-builds to match native macOS builds.

Closes #16338
2025-02-15 12:23:22 +01:00
Viktor Szakats
2533df6239
cmake: drop two stray TLS feature checks for wolfSSL
Drop check for `SSL_set0_wbio`, `SSL_CTX_set_srp_username`.

The wolfSSL backend doesn't implement these features. The checks were
wrong, and also missing from `./configure`.

If they get implemented, the feature checks should use distinct macros
from OpenSSL; they should check for the `wolfSSL_`-prefixed APIs via
wolfSSL headers; and matching checks should be added to `./configure`.

Follow-up to 781242ffa4 #11967 #11964

Closes #16339
2025-02-15 12:19:05 +01:00
Anthony Hu
97abcbd6ff
wolfssl: when using PQ KEM, use ML-KEM, not Kyber
Closes #16337
2025-02-14 22:58:53 +01:00
Daniel Stenberg
da9cdf7129
warnless: drop curlx_ultous as it is no longer used
Closes #16319
2025-02-14 10:38:56 +01:00
Daniel Stenberg
2e9773b76a
tests: change from curlx_ultous to util_ultous
Since the former function is getting removed from the lib.

Closes #16319
2025-02-14 10:38:56 +01:00
Daniel Stenberg
b696fc129b
lib: use Curl_str_number() for parsing decimal numbers
Instead of strtoul() and strtol() calls.

Easier API with better integer overflow detection and built-in max check
that now comes automatic everywhere this is used.

Closes #16319
2025-02-14 10:38:56 +01:00
Daniel Stenberg
130b6891c8
strparse: make Curl_str_number() return error for no digits
Closes #16319
2025-02-14 10:38:56 +01:00
Viktor Szakats
5d194d942d
cmake: mention 'insecure' in the debug build warning
Closes #16327
2025-02-14 10:37:14 +01:00
Viktor Szakats
784a8ec2c1
tidy-up: delete, comment or scope C macros reported unused
To reduce the number `-Wunused-macro` compiler warnings:
- delete unused macros.
- comment out unused macro that are part of a set.
- move macros into the scope they are used.

This may be useful to enable by default, but there are tricky cases that
I didn't manage to fix and paused the effort. E.g. internal features
checks in `openssl.c`. There is more, once those are fixed.

Closes #16279
2025-02-14 10:37:14 +01:00
Daniel Stenberg
edd013326d
lib: strtoofft.h header cleanup
Drop the include from five C files, add it to one.

Closes #16331
2025-02-14 10:30:39 +01:00
Stefan Eissing
915f3981c9
HTTP3.md: only speak about minimal versions
Closes #16320
2025-02-14 10:21:48 +01:00
Harry Sintonen
f138177b92
docs: add FD_ZERO to curl_multi_fdset example
While the examples are not intended to complete applications this is
quite relevant for the correct function of the code.

Closes #16325
2025-02-14 08:21:42 +01:00
Viktor Szakats
92af12a7e0
cmake: drop HAVE_IN_ADDR_T from pre-fill too [ci skip]
Follow-up to 90b72607fa #16318
2025-02-14 02:02:00 +01:00
Daniel Stenberg
074048ae80
asyn-thread: avoid the separate 'struct resdata' alloc
Instead move the only struct field (start) into the thread_data struct.

Closes #16321
2025-02-13 16:21:45 +01:00
Daniel Stenberg
d9fc64d3ab
asyn-thread: do not allocate thread_data separately
Put the full struct into Curl_async since it will be used for every name
resolve anyway.

Closes #16241
2025-02-13 15:35:40 +01:00
Daniel Stenberg
48f6bfa8c7
http: fix NTLM info message typo
Closes #16305
2025-02-13 12:54:03 +01:00
Daniel Stenberg
44deccf907
urlapi: simplify junkscan
Makes it smaller and possibly somewhat faster

Closes #16307
2025-02-13 12:51:47 +01:00
Daniel Stenberg
597ee915c4
cookie: simplify invalid_octets()
should also make it marginally faster and smaller.

Closes #16306
2025-02-13 12:49:13 +01:00
Daniel Stenberg
196e624471
timediff: fix comment for curlx_mstotv()
The max value when explaining the math was wrong.

Closes #16310
2025-02-13 12:47:57 +01:00
Viktor Szakats
90b72607fa
tidy-up: drop unused CURL_INADDR_NONE macro and in_addr_t type
Closes #16318
2025-02-13 12:46:40 +01:00
Viktor Szakats
4aec6cdfd3
tests: fix enum/int confusion (Intel C), fix autotools CFLAGS for servers
By dropping the unused enum wrappers for `AF_*` macros.

Also fix `./configure` to apply `--enable-werror` options to
`tests/servers`, to catch this next time.

Seen with Intel C compiler:
```
socksd.c(184): warning #188: enumerated type mixed with another type
socksd.c(881): warning #188: enumerated type mixed with another type
[...]
sws.c(76): warning #188: enumerated type mixed with another type
sws.c(229): warning #188: enumerated type mixed with another type
[...]
```
Ref: https://github.com/curl/curl/actions/runs/13296520425/job/37129676921#step:40:338

Closes #16314
2025-02-13 12:46:40 +01:00
Viktor Szakats
d550966bf8
cmake: fix HAVE_ATOMIC/HAVE_STDATOMIC pre-fill for clang-cl
`HAVE_ATOMIC` and `HAVE_STDATOMIC` is available in clang-cl builds.
Adjust the pre-filled values accordingly.

Detected by a temporary job comparing pre-filled and actual values
on AppVeyor CI:
https://ci.appveyor.com/project/curlorg/curl/builds/51506692/job/2v8qrytgdnlah348#L416

Closes #16313
2025-02-13 12:46:40 +01:00
Viktor Szakats
de0693f249
addrinfo: add curl macro to avoid redefining foreign symbols
Before this patch curl code was redefining `getaddrinfo` and
`freeaddrinfo` system symbols to plug in its debug wrappers. This was
causing pains to avoid applying the redefinitions to system headers
defining these functions, and to the local debug wrappers. Especially
in unity builds. It also required workarounds for systems where these
symbols are already macros.

Introduce curl-namespaced macros for these functions and use them.
This allows to drop all workarounds and makes it work in all envs,
local targets and unity/bundle combinations.

Also drop GHA/windows workaround and use the same unity batch across
all jobs. Follow-up to 29e4eda631 #16272

Ref: #16272
Ref: 71cf0d1fca #14772
Ref: 3efba94f77 #14765
Ref: f7d5f47059 #14399

Closes #16274
2025-02-13 12:46:39 +01:00
Daniel Stenberg
7241953ba5
RELEASE-NOTES: synced
Bump to 8.12.2 for now
2025-02-13 11:22:47 +01:00
Daniel Stenberg
c561c94ec3
managen: correct the warning for un-escaped '<' and '>'
1. make sure the check is done before the backticks are replaced

2. ignore less-than and greater-than used within backticks

(adjust proxy.md that now showed a two-space warning)

Closes #16315
2025-02-13 11:17:40 +01:00
Daniel Stenberg
92611f2a56
strparse: switch the API to work on 'const char *'
The functions are not meant to touch the input anyway.

Closes #16316
2025-02-13 11:16:04 +01:00
Sergey
c1341813bd
lib: better optimized casecompare() and ncasecompare()
Less 'jne` or `je` CPU instructions.

Closes #16311
2025-02-13 11:14:52 +01:00
Daniel Stenberg
57495c6487
RELEASE-NOTES: synced 2025-02-13 08:14:17 +01:00
Daniel Stenberg
e93514e9b3
THANKS: add contributors from 8.12.1 2025-02-13 08:14:17 +01:00
Jay Satiro
42960ebec0 write-out.md: add 'header' and 'output' to the variable list
Prior to this change %header{} and %output{} were explained in remarks
but not listed in the --write-out variable list.

Closes https://github.com/curl/curl/pull/16299
2025-02-12 17:49:37 -05:00
Viktor Szakats
0005f91259
GHA/linux: drop Linux arm job for runner image flakiness with stunnel4
Since last week the Ubuntu arm runner became flaky while installing `stunnel`.

```
08:07:26 Setting up stunnel4 (3:5.72-1build2) ...
08:07:26 Failed to check if group stunnel4 already exists: Connection refused
08:07:26 Group stunnel4 not found.
08:07:28 Reload daemon failed: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)
08:07:28 Created symlink /etc/systemd/system/multi-user.target.wants/stunnel.target -> /usr/lib/systemd/system/stunnel.target.
08:08:18 Failed to get unit file state for stunnel.target: Connection timed out
08:08:43 Failed to retrieve unit state: Connection timed out
08:08:43 stunnel.target is a disabled or a static unit, not starting it.
08:08:43 /bin/chown: invalid user: ‘stunnel4:stunnel4’
08:08:43 dpkg: error processing package stunnel4 (--configure):
08:08:43  installed stunnel4 package post-installation script subprocess returned error exit status 1
08:08:43 [...]
08:08:47 Errors were encountered while processing:
08:08:47 stunnel4
08:08:54 Error: Timeout was reached
08:08:55 E: Sub-process /usr/bin/dpkg returned an error code (1)
08:08:55 Error: Process completed with exit code 100.
```
Ref: https://github.com/curl/curl/actions/runs/13280736653/job/37078440398?pr=16300#step:2:94

Closes #16303
2025-02-12 16:28:44 +01:00
Viktor Szakats
be5f20202c
GHA/non-native: drop cmake Xcode generator iOS job for poor performance
The Xcode configure phase is slow. In most cases it's >10x slower than
the GNU Makefile configuration. This is after days of attempts to make
it faster. With GNU Makefile it takes 20-30 seconds, while Xcode can
take 3 to 10 minutes, which sometimes makes the job run out of its time
limit and fail.

CMake recommends this generator, but with such poor, and inconsistent
performance, it isn't practical. It helped detecting an Xcode-specific
CMake script issue, but aside from that it's not adding much value.

9m33s: https://github.com/curl/curl/actions/runs/13280738423/job/37078441164
8m18s: https://github.com/curl/curl/actions/runs/13281140850/job/37079589779
2m50s: https://github.com/curl/curl/actions/runs/13280725335/job/37078375179

Follow-up to 12a6de2f66 #16043

Closes #16302
2025-02-12 16:28:44 +01:00
renovate[bot]
d87969770f
GHA: update openssl/openssl to v3.4.1
Closes #16301
2025-02-12 10:56:02 +01:00
Viktor Szakats
eebb1c1c15
libssh2: drop obsolete macros and version checks
Follow-up to 553248f501 #16199

Closes #16292
2025-02-12 09:04:13 +01:00
Viktor Szakats
6ab1fa423b
cmake: fix/add missing feature detections for Windows/MS-DOS
Almost all feature detection results are pre-filled on Windows
for performance, so none of the issues fixed here affected builds.

For good measure, this patch add missing detections and fixes others
to make sure they work even when omitting the pre-fill.

It also fixes detecting IPv6 for MS-DOS.

- fix `HAVE_STRUCT_TIMEVAL` detection for MSVC.
  Follow-up to c1bc090d65 #12495
- add `HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID` detection for Windows.
- fix `HAVE_STRDUP` detection for MSVC.
- fix `HAVE_SNPRINTF` detection for Windows.
  Regression from 8e34505776 #15164
- fix `HAVE_IOCTLSOCKET` detection for non-UWP MSVC.
- exclude `if_nametoindex` detection for Windows.
  Although it exists on Windows, detection, usage and availability is
  complicated, and curl doesn't use it on this platform.
  Regression from 8e34505776 #15164
- move IPv6 detections so that pre-filling and MS-DOS Watt-32
  configuration applies to them. This fixes
  `HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID` detection with MS-DOS.
  Ref: https://github.com/curl/curl/actions/runs/13260511764/job/37015877585#step:7:306
  Follow-up to a3585c9576 #15543

Also:
- add debug option to test without pre-filling.
- replace `NOT LESS` with `GREATER_EQUAL`

Closes #16278
2025-02-11 14:15:40 +01:00
Viktor Szakats
e520493742
cmake: fix to detect HAVE_OPENSSL_SRP in MSVC UWP builds
A deprecation error prevented correct detection in MSVC UWP builds:
```
curl\\bld\\CMakeFiles\\CMakeScratch\\TryCompile-ks2aa4\\CheckSymbolExists.c(8,19):
  error C4996: 'SSL_CTX_set_srp_username': Since OpenSSL 3.0
```
Ref: https://github.com/curl/curl/actions/runs/13242285473/job/36960223663#step:8:898

It seems to be caused by different default warning levels used by
the toolchain (or CMake?): `/W3` for UWP and `/W1` for Windows desktop.

https://github.com/curl/curl/actions/runs/13242285473/job/36960223663#step:8:893 UWP
https://github.com/curl/curl/actions/runs/13242285473/job/36960223262#step:8:445 desktop

Fix by passing the OpenSSL macro suppressing its deprecation warnings.

Cherry-picked from #16287
Closes #16293
2025-02-11 11:38:18 +01:00
Viktor Szakats
6975a0ecda
libssh2: fix to use non-deprecated libssh2_scp_send64()
Seen in curl-for-win daily, building against libssh2 1.11.2_DEV:
```
curl-for-win/curl/lib/vssh/libssh2.c:2644:9: warning: 'libssh2_scp_send_ex' is deprecated:
  since libssh2 1.2.6. Use libssh2_scp_send64() [-Wdeprecated-declarations]
 2644 |         SCP_SEND(sshc->ssh_session, sshp->path, data->set.new_file_perms,
```
Ref: https://github.com/curl/curl-for-win/actions/runs/13229370277/job/36924363438#step:3:5805

Follow-up to 553248f501 #16199

Closes #16291
2025-02-11 11:38:18 +01:00
renovate[bot]
160c0ffc17
ci: update dependency gnutls/gnutls to v3.8.9
Closes #16257
2025-02-11 11:12:04 +01:00
Daniel Stenberg
c89871fa87
vquic: make the "disable GSO" use infof, not failf
... because it is not actually a fail.

Closes #16294
2025-02-11 09:48:45 +01:00
Daniel Stenberg
383c030d52
KNOWN_BUGS: --interface with link-scoped IPv6 address
Reported-by: Aaron Deadman
Closes #14782
Closes #16295
2025-02-11 09:37:47 +01:00
Daniel Stenberg
81d253365c
verbose.md: mention how carriage-return might occur in headers
Fixes #16285
Reported-by: Andrei Korshikov
Closes #16286
2025-02-11 07:44:36 +01:00
Viktor Szakats
e156c7f8ee
runtests.pl: reapply accidental revert
Reapply an accidental, and unrelated, change committed in
3c128966ed which unwantedly reverted
the preceding commit fcd5c2baff.

Caused by doing a local rebase when `git am` did not apply cleanly,
and most likely using a local base behind master.
2025-02-11 01:45:03 +01:00
Viktor Szakats
e9be5ff61d
tests: fix test 558, 1330 for MSVC, allow TrackMemory with MSVC in cmake
Extend output filter to pick up backslashes. This makes them pass in CI
when run in the vcpkg MSVC job, for example.

Also:
- cmake: allow TrackMemory, aka `ENABLE_CURLDEBUG` again. Drop FIXME.
- cmake: drop stale TODO.
- runtests: include the word 'TrackMemory' in the message disabling it.

Follow-up to 9f23c8f201 #14541
Follow-up to 94c596bbc5 #16283

Closes #16289
2025-02-10 22:35:15 +01:00
Daniel Stenberg
71ace9f3c1
checksrc.pl: warn on FIXME/TODO comments 2025-02-10 14:44:12 +01:00
Daniel Stenberg
94c596bbc5
all: remove FIXME and TODO comments
We can always improve. These comments tend to linger and go misleading
or plain wrong over time.

Closes #16283
2025-02-10 14:44:06 +01:00
Viktor Szakats
f1d1c98b7f
cmake: fix HAVE_GETHOSTBYNAME_R_* detections with CURL_WERROR=ON
Fix `HAVE_GETHOSTBYNAME_R_*` feature detections always failing with
`CURL_WERROR=ON` due to stripping a const.

Also fix the GHA/cmake-vs-configure to enable `CURL_WERROR=ON` to sync
this setting with `./configure` which enables it by default. With that,
CI detects this issue.

```
CMake/CurlTests.c:73:19: error: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   73 |   char *address = "example.com";
      |                   ^~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/13225827821/job/36916564107#step:33:4198

Closes #16282
2025-02-10 12:54:11 +01:00
Viktor Szakats
29e4eda631
GHA/windows: improve build perf with cmake unity batches
Default curl unity builds make a single unit for each target. It means
all target sources are batched together and built in a single compiler
invocation. With multi-core CPUs this doesn't always result in the best
possible performance. This patch enables smaller batches for jobs where
this resulted in shorter build times. These jobs are Cygwin, MSYS2,
MinGW, running on the Windows runners.

Use batch of 30 (meaning 30 sources batched into units), and 32 for
Cygwin/MSYS2 to avoid a unity fallout that's subject to a different PR.

(CMake allows to set the number of sources per unit, not the number
of units, though the latter may be more practical to max out CPU cores.)

Also override to not batch the `curlu` target because batching lost
a little bit of time there, due to the already existing parallelism when
building the `testdeps` targets.

For jobs on the macOS and Linux runners jobs were already mostly single
digit or below teen seconds, and batching didn't improve on them
noticeably. On VM jobs, the virtual CPUs are limited, so I didn't
make a try. In AppVeyor and GHA vcpkg jobs (using msbuild), batching
didn't result in conclusive or any gains.

Build times in seconds (curl + testdeps):
Job                  |          Before | After w curlu=0 | Gain
:--------------------| :-------------- | :-------------- | :---
cygwin, CM           |   19 + 32 =  51 |  12 +  32 =  44 |    7
msys2, CM            |    7 + 15 =  22 |   5 +  14 =  19 |    3
mingw gcc U, CM      |   19 + 30 =  49 |  13 +  32 =  45 |    4
mingw ucrt, CM       |   32 + 42 =  74 |  15 +  43 =  58 |   16
mingw clang, CM      |   15 + 21 =  36 |   8 +  21 =  29 |    7
mingw uwp, CM        |   30 + 40 =  70 |  14 +  40 =  54 |   16
mingw gcc, CM        |   20 + 31 =  51 |  12 +  31 =  43 |    8
mingw x86, CM        |   35 + 40 =  75 |  15 +  38 =  53 |   22
dl-mingw, CM 9.5.0   |   88 + 99 = 187 |  42 + 101 = 143 |   44
dl-mingw, CM 7.3.0 U |   24 + 32 =  56 |  17 +  35 =  52 |    4
Total                |                 |                 |  131

Total gain per GHA/windows workflow runs: 2m11s

Runs:
Before: https://github.com/curl/curl/actions/runs/13220256084/job/36904342259
After: https://github.com/curl/curl/actions/runs/13220383702/job/36904602981
       https://github.com/curl/curl/actions/runs/13220613141/job/36905170104
       https://github.com/curl/curl/actions/runs/13222019443/job/36908358550
With curlu tweak: https://github.com/curl/curl/actions/runs/13222239255/job/36908782462

Ref: 116950a250 #16265

Closes #16272
2025-02-10 12:54:11 +01:00
Daniel Stenberg
48df83a30e
tool_progress: fix percent output of large parallel transfers
When the total transfered amount (upload or download) for parallel
transfers was larger than 2^63/100 bytes (81 petabytes) the progress
percent counter would show wrong.

Closes #16284
2025-02-10 11:12:44 +01:00
jethrogb
cc6b630f13
KNOWN_BUGS: remove 2.5 client cert handling differs between backends
This was resolved in #4958

Closes #16175
2025-02-10 08:52:54 +01:00
Daniel Stenberg
cd8d8caae8
RELEASE-NOTES: synced 2025-02-10 08:43:41 +01:00
Viktor Szakats
c1f81adf48
GHA/linux: hide progress bar in apt remove
Also switch to `apt-get` and drop redundant `--yes` for conistency with
other GHA scripts.

Follow-up to b13e9066b3 #16127
Closes #16281
2025-02-10 05:15:42 +01:00
Jay Satiro
973ffaa83f curl_global_sslset.md: Add SSL backend names
- Add the names that can be used to select an SSL backend by name.

This change syncs the names in 3 places: curl_global_sslset
documentation, the curl tool environment variable documentation for
CURL_SSL_BACKEND and the libcurl environment variable documentation for
CURL_SSL_BACKEND.

Closes https://github.com/curl/curl/pull/16256
2025-02-09 14:56:06 -05:00
Viktor Szakats
e6ea56b9d9
lib: silence LibreSSL collision warning on non-MSVC Windows
LibreSSL headers emit this warning because we included `wincrypt.h`
before them. We have to include `wincrypt.h` before OpenSSL headers
to avoid symbol collisions when using other forks. LibreSSL 3.8.2+
offers a macro to silence its warnings to avoid this issue. This patch
sets it.

This allows to stop setting this macro in curl-for-win builds.

Warnings seen with MinGW with cmake non-unity (also unity batch=30):
```
[156/219] Building C object lib/CMakeFiles/libcurl_object.dir/vtls/openssl.c.obj
In file included from lib/vtls/openssl.h:35,
                 from lib/vtls/openssl.c:53:
dep/libressl-win-x64/include/openssl/ossl_typ.h:90:2: warning: #warning overriding WinCrypt defines [-Wcpp]
   90 | #warning overriding WinCrypt defines
      |  ^~~~~~~
In file included from dep/libressl-win-x64/include/openssl/pem.h:71,
                 from dep/libressl-win-x64/include/openssl/ssl.h:151,
                 from lib/vtls/openssl.h:36:
dep/libressl-win-x64/include/openssl/x509.h:108:2: warning: #warning overriding WinCrypt defines [-Wcpp]
  108 | #warning overriding WinCrypt defines
      |  ^~~~~~~
In file included from dep/libressl-win-x64/include/openssl/x509.h:319:
dep/libressl-win-x64/include/openssl/pkcs7.h:77:2: warning: #warning overriding WinCrypt defines [-Wcpp]
   77 | #warning overriding WinCrypt defines
      |  ^~~~~~~
```

Ref: https://github.com/libressl/portable/issues/910
Ref: https://github.com/libressl/portable/pull/924
Ref: e7fe6caab2
Ref: 760ccfcc91

Closes #16273
2025-02-09 13:50:02 +01:00
Daniel Stenberg
89ed161f56
asyn-thread: survive a c-ares channel set to NULL
When the c-ares setup fails and we get a NULL channel, the resolve still
continues and we just need to survive it and just not get any HTTPS RR.

Reported-by: nono303 on github
Fixes #16216
Closes #16244
2025-02-09 11:30:08 +01:00
Viktor Szakats
17c287854b
GHA/appveyor: tidy up quotes 2025-02-09 03:04:02 +01:00
Viktor Szakats
032447e624
GHA/windows: bump dl-mingw tests to -j8
To match the rest of Windows jobs.

dl-mingw, CM 9.5.0-x86_64 schannel: 4m24s -> 2m56s
dl-mingw, CM 7.3.0-x86_64 schannel U: 4m37s -> 3m10s
(based on a few runs.)

Closes #16271
2025-02-09 00:34:40 +01:00
Terence Eden
a042c67df3
docs: use valid example domain names
Replace .site domains and domain.com with valid example domains.

Fixes #16269
Closes #16270
2025-02-09 00:17:05 +01:00
Viktor Szakats
116950a250
GHA/windows: restore runtests perf with last known good Git for Windows
Use the last known good release of Git for Windows by installing it
manually. It restores `runtests.pl` performance to the levels before
the October 2024 and this week's fallouts which gradually deployed
MSYS2 runtimes with pipe/signal/concurrency issues.

Also:
- restore vcpkg job's test parallelism to `-j8` (from `-j4`).
- keep using the default shell for jobs not running tests.
  To avoid the unnecessary Git for Windows install overhead.

Upsides:
- good performance again.
- easy to experiment with any version.

Downsides:
- installing the Git for Windows package takes 15-30 seconds.
- we're pinned to an old package version.
- no canary to tell when the issue is fixed on the runner images.

Unknown:
- stability. (no MSYS2 runtimes were ever stable and it's difficult
  to quantify if a version improves or worsens stability/flakiness, and
  intermittent env failures.

Follow-up to 1bf774df57 #16217
Follow-up to 5f9411f953 #15380

Closes #16265
2025-02-08 23:59:57 +01:00
Daniel Stenberg
54cd27a50d
libssh2: comparison is always true because rc <= -1
Pointed out by CodeQL

Closes #16268
2025-02-08 23:24:08 +01:00
Viktor Szakats
68555467b1
GHA/http3-linux: fix quictls cache key mismatch
Closes #16266
2025-02-08 19:11:37 +01:00
Daniel Stenberg
5963f83176
lib3208: add a final easy_perform as well
Make the test also verify using the handle in the other order.

Closes #16262
2025-02-08 14:12:40 +01:00
Stefan Eissing
242a1439e7
vtsl: eliminate 'data->state.ssl_scache'
Keeping the relevant 'ssl_scache' in 'data->state' leads to problems
when the owner of the cache is cleaned up and this reference is left
dangling.

Remove the ref entirely and always find the ssl_scache at the current
share or multi.

Folded in #16260 (test 3208) to verify this fixes the bug with a
dangling reference when an easy handle is used with easy_perform first
and in a multi_perform after.

Ref: #16236
Closes #16261
2025-02-08 13:28:27 +01:00
Daniel Stenberg
f1939fa60d
vtls: fix multissl-init
Regression since and follow-up to 2bf48b48b3.

Don't call init functions set to NULL.

Fixes #16253
Reported-by: thisisgk on github
Closes #16258
2025-02-08 11:24:27 +01:00
Daniel Stenberg
3be33a1a47
RELEASE-NOTES: synced 2025-02-08 10:53:00 +01:00
Daniel Stenberg
bb65a52a05
release-notes.pl: manage more "closes" typos 2025-02-08 10:51:27 +01:00
Michael Kaufmann
9f3427b315
CURLSHOPT_SHARE.md: adjust for the new SSL session cache
curl 8.12.0 introduced an improved SSL session cache. All easy handles
that are added to the same multi handle automatically use the multi
handle's SSL session cache.

Clsoes #16245
2025-02-08 10:48:48 +01:00
Daniel Stenberg
3f79695be9
openssl: fix out of scope variables in goto
Some of the 'goto fail' situations could happen without having
initialized the local variables referenced in the error code flow.

Reported-by: Marcel Raad
Fixes #16246
Closes #16251
2025-02-08 10:41:12 +01:00
Jay Satiro
d4947203d0 generate.bat: remove curl_get_line.c from the curlx file list
Follow-up to d8618f4d which did the same for the other build systems.

Closes https://github.com/curl/curl/pull/16248
2025-02-08 03:23:34 -05:00
Stefan Eissing
3754115750
scache: add magic checks
DEBUGASSERT for debug builds, otherwise log failure and return error
code where possible.

Closes #16240
2025-02-07 17:15:20 +01:00
Viktor Szakats
9b3c4b08d4
cmake: save a line with CMAKE_C_IMPLICIT_LINK_DIRECTORIES exclusion
Also mind the quotes:
https://github.com/curl/curl/pull/16233#issuecomment-2642603412

Follow-up to f72b848092 #16233
Closes #16243
2025-02-07 16:56:06 +01:00
Viktor Szakats
a5f120df06
cmake: respect GNUTLS_CFLAGS when detected via pkg-config
Closes #16242
2025-02-07 16:56:05 +01:00
Daniel Stenberg
c2aa504ab9
wakeup_write: make sure the eventfd write sends eight bytes
The eventfd manpage says:

  A write(2) fails with the error EINVAL if the size of the supplied
  buffer is less than 8 bytes

When doing x32 on a 64-bit system, pointers are still four bytes so this
code must not use the size of a pointer but the size of a 64-bit type.

Fixes #16237
Reported-by: Jan Engelhardt
Closes #16239
2025-02-07 16:44:39 +01:00
Marcel Raad
c012c6062e
asyn-thread: fix build with CURL_DISABLE_SOCKETPAIR
With `CURL_DISABLE_SOCKETPAIR` defined and `USE_HTTPSRR_ARES`
undefined, the local variable `socketi` was unused.

This fixes a regression from commit 0d4fdbf15d.

Closes https://github.com/curl/curl/pull/16179
2025-02-07 15:30:59 +01:00
Viktor Szakats
13b2ea68f0
tidy-up: make per-file ARRAYSIZE macros global as CURL_ARRAYSIZE
Closes #16111
2025-02-07 14:21:59 +01:00
Daniel Stenberg
9da9a0226d
RELEASE-NOTES: synced 2025-02-07 13:34:26 +01:00
Stefan Eissing
cbf8fecda5
openssl-quic: ignore ciphers for h3
OpenSSL QUIC method errors on setting TLSv1.2 ciphers, where other
methods do not.

Refrain setting --ciphers when min TLS version is 1.3 or higher.
Refrain setting --tls13-ciphers when max TLS version is less than 1.3.
Add 2 test cases.

Fixes #16232
Reported-by: zzq1015 on github
Closes #16235
2025-02-07 13:31:54 +01:00
Kai Pastor
f72b848092
cmake: avoid unnecessary -L for implicit link dirs
The unnecessary `-L` may unexpectedly change the toolchain's chosen
search order in implicit link directories.

Causing this error noticed by a vcpkg user, and reproduced, in the
context of Android NDK r22b, API level 16, static library and CRT
linkage:
~~~
configure:23635: checking whether libcurl is usable
configure:23669: armv7a-linux-androideabi16-clang -o conftest
  --sysroot=/home/runner/work/boinc/boinc/3rdParty/android/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/sysroot
  -DANDROID -DDECLARE_TIMEZONE -Wall
  -I/home/runner/work/boinc/boinc/3rdParty/buildCache/android/android-tc/arm/arm-linux-androideabi/include
  -O3 -fomit-frame-pointer -fPIE -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -D__ANDROID_API__=16 -Wall
  -I/home/runner/work/boinc/boinc/3rdParty/android/vcpkg/installed/arm-android/include
  -I/home/runner/work/boinc/boinc/3rdParty/android/vcpkg/installed/arm-android/lib/pkgconfig/../../include -DCURL_STATICLIB
  -L/home/runner/work/boinc/boinc/3rdParty/android/vcpkg/installed/arm-android/lib -llog -fPIE -pie -latomic -static-libstdc++
  -march=armv7-a -Wl,--fix-cortex-a8 -L/home/runner/work/boinc/boinc/3rdParty/android/vcpkg/installed/arm-android/lib conftest.c
  -L/home/runner/work/boinc/boinc/3rdParty/android/vcpkg/installed/arm-android/lib/pkgconfig/../../lib -lcurl
  -L/home/runner/work/boinc/boinc/3rdParty/android/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi
  -lssl -lcrypto -ldl -pthread -lz  >&5
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
ld: error: undefined symbol: bsd_signal
>>> referenced by legacy_signal_inlines.h:116 (/home/runner/work/boinc/boinc/3rdParty/android/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/android/legacy_signal_inlines.h:116)
>>>               libcrypto-lib-ui_openssl.o:(read_string_inner) in archive /home/runner/work/boinc/boinc/3rdParty/android/vcpkg/installed/arm-android/lib/libcrypto.a
ld: error: undefined symbol: pthread_atfork
~~~
with the unnecessary option
~~~
-L/home/runner/work/boinc/boinc/3rdParty/android/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi
~~~
Reference: https://github.com/microsoft/vcpkg/pull/43463#issuecomment-2638611717

Closes #16233
2025-02-07 11:05:07 +01:00
Viktor Szakats
0c933081fb
GHA/appveyor: add VS2019 job, merge two others, fix build fallout
- add VS2019 job, with Schannel + OpenSSL 1.0.2.
  First MultiSSL job here and add the last missing modern VS version.

- fix builds with mixed ALPN capabilities in MultiSSL unity builds.
  Caused by reusing `HAS_ALPN` between TLS modules without
  resetting it. Fix it by using unique names for each backend.

- merge a VS2010 job into a VS2012. With MultiSSL and x86 OpenSSL.

- make a job static.

- fix `Shared`/`Static` in a job name.

- add `Shared` to job names.

Closes #16231
2025-02-07 10:52:56 +01:00
Viktor Szakats
0b3afd133a
wolfssl: silence compiler warning (MSVC 2019), simplify existing
Seen with VS2019 and older versions:
```
lib\vtls\wolfssl.c(773): warning C4706: assignment within conditional expression
```
Ref: https://github.com/curl/curl/actions/runs/13190321645/job/36821938202?pr=16217#step:9:30

Also replace pragma suppression with this simpler method, and silence
`checksrc` where it complains about the extra ` != NULL` this needs.

Closes #16230
2025-02-07 10:52:55 +01:00
Stefan Eissing
5c7bf5fe59
imap: TLS upgrade fix
There were two places in the code that tried to connect the SSL filter,
e.g. do the TLS handshake, but only one changed imap state to CAPA
afterwards.

Depending on timing, the wrong path was taken and the connection was
hanging, waiting for a server reply to a command not sent.

Do the upgrade to tls in one place and update connection filter and
smtps protocol handler at the same time. Always transition to CAPA on
success.

Closes #16213
2025-02-07 10:13:12 +01:00
Stefan Eissing
cc256e8f8a
pop3: TLS upgrade fix
There were two places in the code that tried to connect the SSL filter,
e.g. do the TLS handshake, but only one changed pop3 state to CAPA
afterwards.

Depending on timing, the wrong path was taken and the connection was
hanging, waiting for a server reply to a command not sent.

Do the upgrade to tls in one place and update connection filter and
smtps protocol handler at the same time. Always transition to CAPA on
success.

Ref: #16166
Closes #16208
2025-02-07 10:11:20 +01:00
Stefan Eissing
d23f8fec52
smtp: TLS upgrade fix
There were two places in the code that tried to connect the SSL filter,
e.g. do the TLS handshake, but only one changed stmp state to EHLO
afterwards.

Depending on timing, the wrong path was taken and the connection was
hanging, waiting for a server reply to a command not sent.

Do the upgrade to tls in one place and update connection filter and
smtps protocol handler at the same time. Always transition to EHLO on
success.

Fixes #16189
Reported-by: Christian Schmitz
Closes #16206
2025-02-07 10:09:35 +01:00
Daniel Stenberg
06bb158737
tool_cfgable: sort struct fields by size, use bitfields for booleans
Shrunk struct OperationConfig and struct GlobalConfig by several hundred
bytes combined. No loss of functionality.

Closes #16211
2025-02-07 09:51:43 +01:00
Daniel Stenberg
2ff01152c7
asyn-thread: fix the returned bitmask from Curl_resolver_getsock
It should use a bitwise OR, not an assignment so that it does not
override the c-ares bits.

Closes #16227
2025-02-07 09:49:14 +01:00
Daniel Stenberg
c0d38f547b
configure/cmake: check for realpath
And make vtls_scache use HAVE_REALPATH

Fixes #16209
Reported-by: Andrew Kirillov
Closes #16225
2025-02-07 09:45:20 +01:00
Viktor Szakats
1bf774df57
GHA/windows: mitigate drastic runtests perf drop under MSYS2
Today GHA Windows runner images (all versions) deployed an upgrade
(20250127.1.0 -> 20250203.1.0) that upgraded the default MSYS2, which
now seems to feature the October 2024 issue that caused curl runtests
run times increasing ~2.5x. It also causes test987 to fail, and vcpkg
jobs hitting their time limits and fail. Reliability also got a hit.

In October this issue came with a Git for Windows upgrade, and likely
the MSYS2 runtime update within it. It affected vcpkg jobs only, and
I mitigated it by switching them to use the default MSYS2 shell and
runtime (at `C:\msys64`):

5f9411f953 #15380

After today's update this mitigation no longer works. The issue also
affects `dl-mingw` jobs now, though to a lesser extent than vcpkg ones.

Tried switching back to Git for Windows which received several updates
since October, but the performance issue is still present.

I managed to mitigate the slowdown in vcpkg by lowering test parallelism
to `-j4` (from `-j8`), after which the jobs are about *half the speed*
than before, and fit their time limits. `dl-mingw` builds run slower by
1-1.5 minutes per job, they were already using `-j4`.

Example jobs:

Before (ALL GOOD):
https://github.com/curl/curl/actions/runs/13167230443/job/36750175428 installed MSYS2, mingw (-j8): 3m50s (OK)
https://github.com/curl/curl/actions/runs/13167230443/job/36750158662 default MSYS2, dl-mingw (-j4): 4m22s (OK)
https://github.com/curl/curl/actions/runs/13167230443/job/36750163392 default MSYS2, vcpkg (-j8): 3m27s (OK)
runner: https://github.com/actions/runner-images/blob/win22/20250127.1/images/windows/Windows2022-Readme.md
C:\msys64:
System: MSYS_NT-10.0-20348 fv-az1115-916 3.5.4-0bc1222b.x86_64 2024-12-05 09:27 UTC x86_64 Msys
https://github.com/msys2/msys2-runtime/commit/0bc1222b

After:
https://github.com/curl/curl/actions/runs/13186498273/job/36809747078 installed MSYS2, mingw (-j8): 3m48s (OK)
https://github.com/curl/curl/actions/runs/13186498273/job/36809728481 default MSYS2, dl-mingw (-j4): 5m56s (SLOW)
https://github.com/curl/curl/actions/runs/13186498273/job/36809736429 default MSYS2, vcpkg (-j8): 9m1s (SLOW)
runner: https://github.com/actions/runner-images/blob/win22/20250203.1/images/windows/Windows2022-Readme.md
C:\msys64:
System: MSYS_NT-10.0-20348 fv-az1115-498 3.5.7-2644508f.x86_64 2025-01-30 09:08 UTC x86_64 Msys
https://github.com/msys2/msys2-runtime/commit/2644508f

windows-2025 image:
C:\msys64:
System: MSYS_NT-10.0-26100 fv-az2043-515 3.5.7-2644508f.x86_64 2025-01-30 09:08 UTC x86_64 Msys

windows-2019 image:
C:\msys64:
System: MSYS_NT-10.0-17763 fv-az1434-677 3.5.7-2644508f.x86_64 2025-01-30 09:08 UTC x86_64 Msys

This PR:
final: https://github.com/curl/curl/actions/runs/13186498273/job/36809736429 GfW, vcpkg (*-j4*): ~7m (SLOW)
test: https://github.com/curl/curl/actions/runs/13187992987/job/36814644852?pr=16217, GfW, vcpkg (-j8): ~11m (SLOWER)

Before and after (unused) Git for Windows (SLOW as tested in this PR):
C:\Program Files\Git
System: MINGW64_NT-10.0-20348 fv-az1760-186 3.5.4-395fda67.x86_64 2024-11-25 09:49 UTC x86_64 Msys
https://github.com/msys2/msys2-runtime/commit/395fda67 (fork)

Before and after (used) MSYS2 installed via msys2/setup-msys2 (OK):
D:\a\_temp\msys64
System: MINGW64_NT-10.0-20348 fv-az836-378 3.5.4-0bc1222b.x86_64 2024-12-05 09:27 UTC x86_64 Msys

Perl pipe issue report from October, still open:
https://github.com/msys2/msys2-runtime/issues/230
ARM deadlock fixed by GfW 2.47.1(1), but for x86_64, on a quick glance:
290bea94d0
Possibly interesting:
https://github.com/msys2/msys2-autobuild/issues/62

Closes #16217
2025-02-07 02:44:09 +01:00
Viktor Szakats
fb70812437
cmake: add integration tests, run them in CI
Add CMake test project consuming curl via these methods:
`FetchContent`, `add_subdirectory()`, `find_package()`.

Also:
- GHA/distcheck: run these tests in CI.
- cmakelint: exclude a warning for calling "wonky-cased" built-in
  CMake functions, such as `FetchContent_Declare()`.

Closes #16126
2025-02-07 00:15:48 +01:00
Viktor Szakats
2b9b3ec579
cmake/Find: set <Modulename>_FOUND for compatibility when found via pkg-config
For Find modules where `<Modulename>` is not fully uppercase.

`<Modulename>` is case-exact name used in the Find modules filename:
`CMake/Find<Moduleame>.cmake`.

`find_package_handle_standard_args()` sets both `<MODULENAME>_FOUND` and
`<Modulename>_FOUND` when detecting the dependency. Some CMake code
relies on this and 3rd-party code may rely on it too. Make sure to set
the latter variant when detecting the dependency via `pkg-config`, where
we don't call `find_package_handle_standard_args()`.

CMake sets these variable to `TRUE` (not `ON` or `1`). Replicate this
for compatibility.

Closes #16153
2025-02-07 00:07:38 +01:00
Viktor Szakats
ffd6132da6
cmake: drop LDAP_DEPRECATED=1 macro, to sync with autotools
We set this macro to silence a warning inside `openldap.h`. With this
warning now silenced by using `-isystem`, we can drop it. Also it never
had to be set to `1`.

Also enable OpenLDAP in a CMake GHA/macos job.

Follow-up to 445fb81237 #14763
Follow-up to 751e168d93 #12024

Closes #16146
2025-02-07 00:07:38 +01:00
Viktor Szakats
8c5be18843
cmake: always reference OpenSSL and ZLIB via imported targets
Some places where still referencing them via global variables.

Closes #16207
2025-02-07 00:03:46 +01:00
Viktor Szakats
b3e12b7d6f
ldap: drop support for legacy Novell LDAP SDK
The latest copy I could find at:
https://beta.novell.com/developer/ndk/ldap_libraries_for_c.html
is from 2016-Feb-03, available for Linux and Windows.

I built curl against the Windows package with CMake:
https://sdk.suse.com/ndk/cldap/builds/2016/openldapsdk-devel-windows64-2016-01-28.zip
(It comes with OpenSSL 1.0.1q-fips (2015-Dec-03) binaries.)
CMake identified it as OpenLDAP and built with it as expected:
```
curl 8.12.0-DEV (x86_64-w64-mingw32) libcurl/8.12.0-DEV Schannel OpenLDAP/2.4.37
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS HSTS HTTPS-proxy IPv6 Kerberos Largefile NTLM SPNEGO SSL SSPI threadsafe UnixSockets
```

Since it identified it as OpenLDAP (`lib/openldap.c`), the branch
deleted in this PR (`lib/ldap.c`) wasn't reached. Thus, defining
the `CURL_HAS_NOVELL_LDAPSDK` also made no difference in the build.
This suggests the code guarded by it is now orphan and unnecessary.

Novell NetWare builds were another user, but we dropped support for them
in 2022: 3b16575ae9 #8358

Closes #16176
2025-02-06 23:45:05 +01:00
Viktor Szakats
3f9417b21d
GHA/curl-for-win: drop nolibgroup option, upstream default now
Ref: 2ed700e687
2025-02-06 23:43:09 +01:00
Viktor Szakats
e0443a76c4
cmake: lib order fixes for picky linkers (e.g. binutils ld)
This issue was not addressed with CMake builds so far. curl-for-win
worked thanks to its `-Wl,--start-group` workaround. It affects
binutils `ld` linking statically. Shared linking and llvm's `lld`
doesn't need strict lib order, and are not affected.

The solution is to pass libs in dependency order, with least dependent
(e.g. system) libs last. In case of cyclic dependency, may pass libs
twice.

Fix most issues by moving Windows system libs `ws2_32` and `bcrypt`
last, and move SSH libs first due to their dependence on crypto
backends and zlib compression.

Also:
- modify an existing Linux curl-for-win job to use gcc.
- add a specific Windows gcc job to test this. Make it use different
  options than the default to extend build coverage too: `libssh`,
  `zlib-ng`, 32-bit.
- prefer CMake imported targets for OpenSSL and ZLIB.

Examples of issues fixed:

Windows LibreSSL, libpsl vs. ws2_32:
```
x86_64-w64-mingw32-ld: curl/libressl/lib/libcrypto.a(bss_sock.c.obj):bss_sock.c:(.text$sock_ctrl[sock_ctrl]+0x59): undefined reference to `__imp_shutdown'
x86_64-w64-mingw32-ld: curl/libressl/lib/libcrypto.a(gcm128.c.obj):gcm128.c:(.text$CRYPTO_gcm128_init[CRYPTO_gcm128_init]+0x65): undefined reference to `__imp_ntohl'
x86_64-w64-mingw32-ld: curl/libpsl/_x64-win-ucrt/usr/lib/libpsl.a(psl.o):(.text$psl_is_cookie_domain_acceptable+0xef): undefined reference to `__imp_WSAStringToAddressW'
```
Ref: https://github.com/curl/curl/actions/runs/13157579253/job/36718144881?pr=16182#step:3:5354

Linux libssh2 vs. zlib:
```
/usr/lib/gcc-cross/aarch64-linux-gnu/12/../../../../aarch64-linux-gnu/bin/ld: curl/libssh2/_a64-linux-gnu-libressl/usr/lib/libssh2.a(unity_0_c.c.o): in function `comp_method_zlib_dtor':
(.text.comp_method_zlib_dtor+0x8c): undefined reference to `deflateEnd'
/usr/lib/gcc-cross/aarch64-linux-gnu/12/../../../../aarch64-linux-gnu/bin/ld: curl/libssh2/_a64-linux-gnu-libressl/usr/lib/libssh2.a(unity_0_c.c.o): in function `comp_method_zlib_comp':
(.text.comp_method_zlib_comp+0x50): undefined reference to `deflate'
/usr/lib/gcc-cross/aarch64-linux-gnu/12/../../../../aarch64-linux-gnu/bin/ld: curl/libssh2/_a64-linux-gnu-libressl/usr/lib/libssh2.a(unity_0_c.c.o): in function `comp_method_zlib_init':
(.text.comp_method_zlib_init+0x8c): undefined reference to `deflateInit_'
```
Ref: https://github.com/curl/curl/actions/runs/13157270420/job/36717189086?pr=16182#step:3:5285

Windows libssh vs. ws2_32 and LibreSSL:
```
/usr/bin/i686-w64-mingw32-ld: curl/libssh/_x86-win-ucrt-libressl/usr/lib/libssh.a(connect.c.obj):(.text$ssh_connect_host_nonblocking+0x92): undefined reference to `WspiapiGetAddrInfo@16'
/usr/bin/i686-w64-mingw32-ld: curl/libssh/_x86-win-ucrt-libressl/usr/lib/libssh.a(connect.c.obj):(.text$ssh_connect_host_nonblocking+0x3d9): undefined reference to `gai_strerrorA'
/usr/bin/i686-w64-mingw32-ld: curl/libssh/_x86-win-ucrt-libressl/usr/lib/libssh.a(kex.c.obj):(.text$ssh_client_select_hostkeys+0xd2): undefined reference to `FIPS_mode'
/usr/bin/i686-w64-mingw32-ld: curl/libssh/_x86-win-ucrt-libressl/usr/lib/libssh.a(options.c.obj):(.text$ssh_options_set+0x942): undefined reference to `FIPS_mode'
```
Ref: https://github.com/curl/curl/actions/runs/13163986294/job/36739557888?pr=16182#step:3:5127
Ref: https://github.com/curl/curl/actions/runs/13163986294/job/36739557888?pr=16182#step:3:5121

Closes #16182
2025-02-06 23:35:04 +01:00
Viktor Szakats
aa3e4c1db5
cmake: initialize variables where missing
As detected using `cmake --warn-uninitialized`.

It also lists:
- variables inherited from `Makefile.inc`, which this PR does not fix.

- a documented CMake global variable, which is unexpected:
  `CMAKE_MODULE_PATH`.
  I'd expect CMake to initialize its namespace.

- envs: `CI`, `CURL_CI` and `CURL_BUILDINFO`. Unexpected, as the manual
  mentions variables only. As of August 2024, there is no solution to
  silence them:
  https://discourse.cmake.org/t/how-to-test-for-set-env-variables-without-getting-warnings/11401

https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-warn-uninitialized

Closes #16198
2025-02-06 23:32:37 +01:00
Viktor Szakats
3c128966ed
cmake: tidy up string append and list prepend syntax
- `set(VAR "${VAR}<value>")` ->
  `string(APPEND VAR "<value>")`
  Available since CMake 3.4:
  https://cmake.org/cmake/help/latest/command/string.html#append

- `set(VAR "${VAR2}-or-<value>;${VAR}")` ->
  `set(VAR "${VAR2}-or-<value>" ${VAR})`

Closes #16144
2025-02-06 23:25:40 +01:00
Daniel Stenberg
fcd5c2baff
runtests: fix the disabling of the memory tracking
It should be done if "threaded-resolver" is enabled, but the detection
was slightly broken for builds that add c-ares for the asyn-rr feature.

Closes #16226
2025-02-06 23:14:34 +01:00
Viktor Szakats
d07853195d
cmake: normalize before matching paths with syspaths
Requires CMake 3.20:
https://cmake.org/cmake/help/latest/command/cmake_path.html

Co-authored-by: Kai Pastor
Ref: 307e1f9878
Closes #16191
2025-02-06 23:12:18 +01:00
renovate[bot]
b3d0c37ff4
CI: update dependency awslabs/aws-lc to v1.45.0
Closes #16151
2025-02-06 22:58:51 +01:00
Philip H.
1210caf489
GHA/linux: drop sudo sysctl vm.mmap_rnd_bits=28
useless on ubuntu-24.04 (ubuntu-latest)
as it uses read-only fs

Closes #16224
2025-02-06 22:56:55 +01:00
Daniel Stenberg
ba92296279
libssh: drop support for libssh older than 0.9.0
libssh 0.9.0 was shipped on June 28 2019 and is the first version
featuring the knownhosts API

Drop libssh from the GHA/linux-old CI job since it gets a libssh 0.7.3
version, too old for us now.

Closes #16200
2025-02-06 22:27:13 +01:00
Daniel Stenberg
1fa5f451e1
test2080: simplify, avoid the null byte
The null byte was not necessary for the test
2025-02-06 22:25:35 +01:00
Daniel Stenberg
d8618f4d84
tool_ssls: switch to tool-specific get_line function
Instead of picky-backing on the libcurl one using the curlx shortcut,
which is fragile since the libcurl one is not present in all builds.

Reported-by: mschroeder-fzj on github
Fixes #16201
Closes #16203
2025-02-06 22:25:35 +01:00
Viktor Szakats
3814fb5a9f
runtests: quote commands to support paths with spaces
In certain Windows configurations, Perl resides under `C:/Program Files`
causing tests to fail when executing Perl. Fix by quoting the command.

Seen in `dl-mingw` jobs when switching to the default `bash` shell
offered by the `windows-latest` runner on GHA.

Also:
- apply the same fix for `valgrind` for consistency.
- make more use of `shell_quote()` when passing the `srcdir` directory
  over the command-line. This doesn't come up in CI, but seems like
  good practice. There are lots more unquoted arguments and possibly
  also commands.

```
-------e--- OK (940 out of 1537, remaining: 00:32, took 0.217s, duration: 00:50)
test 1167...[Verify curl prefix of public symbols in header files]
/C/Program Files/Git/usr/bin/perl -I. -ID:/a/curl/curl/tests  returned 127, when expecting 0
 1167: exit FAILED
[...]
=== Start of file stderr1167
 sh: line 1: /C/Program: No such file or directory
```
Ref: https://github.com/curl/curl/actions/runs/13181757313/job/36794072190?pr=16217#step:13:2107

Closes #16220
2025-02-06 21:04:33 +01:00
Viktor Szakats
552e5305a1
test1516: avoid failure due to spaces in path
Sync the test path with test1515. If fixes the test when the perl tool
resides on a path with spaces in it. E.g. when using the perl from Git
for Windows. This is a workaround, there may be a better fix this
type of issue.

Similar fix for test1515: 38b055446a

Failure:
```
test 1516...[caching of manual libcurl DNS entries after dead connection]
lib1515.exe returned 3, when expecting 0
 1516: exit FAILED
=== Start of file stderr1516
 Test: lib1515
[...]
 17:59:32.390000 == Info: Expire cleared
 request http://testserver.example.com:63621/C:/Program Files/Git/path/15160001 failed with 3
 Test ended with result 3
=== End of file stderr1516
```
Ref: https://github.com/curl/curl/actions/runs/13184790755/job/36804217128?pr=16217#step:13:2805

Closes #16223
2025-02-06 20:34:06 +01:00
Daniel Stenberg
aa378570f5
INTERNALS: fix c-ares, as we actually support 1.6.0 or later
It was wrongly bumped to 1.16.0 in db50fc6e95. While we strongly
recommend using 1.16.0 or later, we still allow builds using older
versions.

It would make sense to raise the requirement to at least 1.11.0 (Feb 19
2016) but that's not done right now.

Closes #16221
2025-02-06 17:13:53 +01:00
Viktor Szakats
1fa3eb05b1
GHA/windows: always pass -A <arch> to cmake in vcpkg jobs
Instead of relying on the default `-A x64` on `windows-latest` runners,
tell cmake the arch explicitly, to be in sync with `matrix.arch`. Also
add support for arm64 and x86.

`-DVCPKG_TARGET_TRIPLET=` isn't enough to select the platform, ref:
https://github.com/curl/curl/actions/runs/13179082565/job/36785363766?pr=16210

Closes #16210
2025-02-06 15:44:18 +01:00
Viktor Szakats
5f6f446136
cmake: respect GNUTLS_LIBRARY_DIRS in libcurl.pc and curl-config
Authored-by: Kai Pastor
Ref: 0ed3bfe969
Closes #16190
2025-02-06 15:27:36 +01:00
andrewkirillov-ibm
449d9f7897
build: add tool_hugehelp.c into IBMi build
As `tool_hugehelp.c` is no longer included into `Makefile.inc`,
I did add it explicitly to list of source files built on IBMi.

Follow-up to 96843f4ef7 #16068
Fixes #16214
Closes #16215
2025-02-06 14:53:36 +01:00
Daniel Stenberg
3f7f180901
CURLOPT_SSH_KNOWNHOSTS.md: strongly recommend using this
Make setopt fail for SSH backends not supporting knownhosts or pub md5

Closes #16204
2025-02-06 13:51:50 +01:00
Daniel Stenberg
58674865fe
configure/cmake: set asyn-rr a feature only if httpsrr is enabled
Closes #16183
2025-02-06 11:42:17 +01:00
Daniel Stenberg
448e71d1b7
header.md: mention Authorization: and Cookie: special treatment
Fixes #16160
Reported-by: deliciouslytyped on github
Closes #16164
2025-02-06 11:40:56 +01:00
Daniel Stenberg
2f00a7d5a7
tool_getparam: add "TLS required" flag for each such option
... and check it early, once.

Closes #16159
2025-02-06 11:39:35 +01:00
Daniel Stenberg
943de21619
netrc: return code cleanup, fix missing file error
Made the netrc parser return a more consistent set of error codes and
error messages, and also return error properly if the .netrc file is
missing.

Add test 697 to verify error on missing netrc file.

Fixes #16163
Reported-by: arlt on github
Closes #16165
2025-02-06 10:34:02 +01:00
Daniel Stenberg
abca1f23a9
RELEASE-NOTES: synced
and bump curlver to 8.12.1 while "cooling off"
2025-02-06 10:30:07 +01:00
Daniel Stenberg
34acdf9986
content_encoding: #error on too old zlib
The previous runtime check using strcmp() risks failing when zlib
reaches 1.10. While this instead changes the logic to a cruder
build-time instead of runtime, it avoids the 1.10 risk.

I verified that ZLIB_VERNUM has been provided since at least the 1.2.0.3
release.

1.2.0.4 was released on 10 August 2003.

Reported-by: Fay Stegerman
Closes #16202
2025-02-06 10:26:23 +01:00
Daniel Stenberg
553248f501
libssh2: raise lowest supported version to 1.2.8
Shipped on April 5 2011

Closes #16199
2025-02-06 10:02:29 +01:00
Jay Satiro
3631c24861 docs: better explain multi-part byte range behavior
- Better explain that if the requested range (--range or CURLOPT_RANGE)
  contains multiple ranges then the response contains meta information
  in addition to the requested bytes.

Prior to this change it was noted that a multiple part response was
returned as-is but not what that meant. In particular, meta information
is returned in addition to the requested bytes and that may have been
unexpected.

Reported-by: Ralf A. Timmermann

Fixes https://github.com/curl/curl/issues/16139
Closes https://github.com/curl/curl/pull/16150
2025-02-06 03:09:45 -05:00
Daniel Stenberg
153453eb78
SPONSORS.md: clarify that we don't promise goods or services
Due to past events

Closes #16196
2025-02-05 23:40:24 +01:00
Viktor Szakats
136bec79a0
GHA/non-native: skip examples in non-unity job
To save time. They are built the same way in the other jobs.

Follow-up to 6fc703904b #16188
Closes #16195
2025-02-05 22:50:29 +01:00
Viktor Szakats
a0d3a32fba
libssh: silence -Wconversion with a cast (Windows 32-bit)
Seen with GCC 13 with Windows x86:
```
lib/vssh/libssh.c: In function 'myssh_statemach_act':
lib/vssh/libssh.c:1851:41: error: conversion from 'curl_off_t' {aka 'long long int'} to 'size_t' {aka 'unsigned int'} may change value [-Werror=conversion]
 1851 |                              data->state.infilesize,
      |                              ~~~~~~~~~~~^~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/13161422041/job/36737994642?pr=16182#step:3:5111

Closes #16194
2025-02-05 21:19:36 +01:00
Viktor Szakats
6fc703904b
lib: include necessary headers for inet_ntop/inet_pton
Include `netinet/in.h` for FreeBSD/OpenBSD. Also include `sys/socket.h`
just in case, based on earlier code in `tests/libtest/lib1960.c`.

Also:
- document these in `CMakeLists.txt`.
- add a CI job testing FreeBSD with no unity and no test bundles.
  (without running tests to keep it fast)

FreeBSD (autotools):
```
../../../tests/libtest/lib1960.c:66:22: error: variable has incomplete type 'struct sockaddr_in'
   66 |   struct sockaddr_in serv_addr;
      |                      ^
../../../tests/libtest/lib1960.c:66:10: note: forward declaration of 'struct sockaddr_in'
   66 |   struct sockaddr_in serv_addr;
      |          ^
```
Ref: https://github.com/curl/curl/actions/runs/13159721509/job/36725114118?pr=16188#step:3:5289

OpenBSD (cmake):
```
/home/runner/work/curl/curl/tests/libtest/lib1960.c:66:22: error: variable has incomplete type 'struct sockaddr_in'
  struct sockaddr_in serv_addr;
                     ^
/home/runner/work/curl/curl/tests/libtest/lib1960.c:66:10: note: forward declaration of 'struct sockaddr_in'
  struct sockaddr_in serv_addr;
         ^
1 error generated.
```
Ref: https://github.com/curl/curl/actions/runs/13159721509/job/36725102004?pr=16188#step:3:2166

Reported-by: CueXXIII on Github
Fixes #16184
Follow-up to a3585c9576 #15543
Closes #16188
2025-02-05 16:29:03 +01:00
Viktor Szakats
14f26f5ee7
smb: silence -Warray-bounds with gcc 13+
The code look correct. The compiler gets confused by the `byte[1]`
struct member mapped into a memory buffer with a variable-sized
payload starting at this member. Perhaps there is a cleaner way
to silence this by changing the code.

First seen with gcc 13.2.0 in curl-for-win builds. Then with 13.2.1 and
the latest 14.2.0.

```
curl/lib/smb.c: In function 'smb_connection_state':
curl/lib/smb.c:895:5: warning: 'memcpy' offset [74, 80] from the object at 'buf' is out of the bounds of referenced subobject 'bytes' with type 'char[1]' at offset 73 [-Warray-bounds=]
  895 |     memcpy(smbc->challenge, nrsp->bytes, sizeof(smbc->challenge));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
curl/lib/smb.c:130:8: note: subobject 'bytes' declared here
  130 |   char bytes[1];
      |        ^~~~~
```

gcc 14.2.0 debian:testing musl riscv64: https://github.com/curl/curl/actions/runs/13157579253/job/36718140035?pr=16182#step:3:5576
gcc 13.2.1 alpine amd64: https://github.com/curl/curl-for-win/actions/runs/9370491111/job/25797582549#step:3:4869
gcc 13.2.0 debian:testing glibc aarch64: https://github.com/curl/curl-for-win/actions/runs/9370491111/job/25797581315#step:3:6054
gcc 13.2.0 debian:testing glibc amd64: https://github.com/curl/curl-for-win/actions/runs/9370491111/job/25797581315#step:3:10959
gcc 13.2.0 debian:sid glibc riscv64: https://github.com/curl/curl-for-win/actions/runs/9370491111/job/25797580697#step:3:6122
gcc 13.2.0 debian:sid musl riscv64: https://github.com/curl/curl-for-win/actions/runs/9370491111/job/25797583450#step:3:6227

Closes #16187
2025-02-05 16:29:03 +01:00
Daniel Stenberg
e455757346
asyn-thread: fix HTTPS RR crash
By removing 'data' from the thread struct and passing it in as an
argument we avoid the case it could be dereferenced before stored when
shutting down HTTPS RR.

Also reordered the struct fields a little to remove holes.

Closes #16169
2025-02-05 14:05:22 +01:00
485 changed files with 12547 additions and 10270 deletions

6
.github/labeler.yml vendored
View File

@ -78,7 +78,8 @@ build:
plan9/**,\ plan9/**,\
projects/**,\ projects/**,\
winbuild/**,\ winbuild/**,\
lib/libcurl.def\ lib/libcurl.def,\
tests/cmake/**\
}" }"
CI: CI:
@ -100,7 +101,8 @@ cmake:
**/CMakeLists.txt,\ **/CMakeLists.txt,\
CMake/**,\ CMake/**,\
docs/INSTALL-CMAKE.md,\ docs/INSTALL-CMAKE.md,\
lib/curl_config.h.cmake\ lib/curl_config.h.cmake,\
tests/cmake/**\
}" }"
cmdline tool: cmdline tool:

View File

@ -17,7 +17,6 @@ b967734c9bfe3d7a1a7795f348f0bce4d9ba15ca9590697ef2d4d15b92822db0 ./tests/certs/
26ee981dcb84b6a2adce601084b78e6b787b54a2a997549582a8bd42087ab51b ./tests/data/test1426 26ee981dcb84b6a2adce601084b78e6b787b54a2a997549582a8bd42087ab51b ./tests/data/test1426
d640923e45809a3fe277e0af90459d82d32603aacc7b8db88754fcb335bf98df ./tests/data/test1531 d640923e45809a3fe277e0af90459d82d32603aacc7b8db88754fcb335bf98df ./tests/data/test1531
6f51bc318104fb5fe4b6013fc4e8e1c3c8dec1819202e8ea025bdbc4bbc8c02d ./tests/data/test1938 6f51bc318104fb5fe4b6013fc4e8e1c3c8dec1819202e8ea025bdbc4bbc8c02d ./tests/data/test1938
28a957ec3397881bbafd0d97879cedfd475bcd1ece903e531576affd7aa3865c ./tests/data/test2080
33809cab2442488e5985b4939727bc4ead9fc65150f53008e3e4c93140675a94 ./tests/data/test262 33809cab2442488e5985b4939727bc4ead9fc65150f53008e3e4c93140675a94 ./tests/data/test262
2d073a52984bab1f196d80464ea8ab6dafd887bd5fee9ed58603f8510df0c6a5 ./tests/data/test35 2d073a52984bab1f196d80464ea8ab6dafd887bd5fee9ed58603f8510df0c6a5 ./tests/data/test35
4cc9fd6f31d0bb4dcb38e1565796e7ec5e48ea5ac9d3c1101de576be618786ba ./tests/data/test463 4cc9fd6f31d0bb4dcb38e1565796e7ec5e48ea5ac9d3c1101de576be618786ba ./tests/data/test463

View File

@ -3,55 +3,117 @@
# #
# SPDX-License-Identifier: curl # SPDX-License-Identifier: curl
# #
# Input: a cmdline docs markdown, it gets modified *in place* # Input: cmdline docs markdown files, they get modified *in place*
#
# Strip off the leading meta-data/header part, remove all known curl symbols
# and long command line options. Also clean up whatever else the spell checker
# might have a problem with that we still deem is fine.
# #
# The main purpose is to strip off the leading meta-data part, but also to
# clean up whatever else the spell checker might have a problem with that we
# still deem is fine.
my $header = 1; open(S, "<./docs/libcurl/symbols-in-versions")
while(1) { || die "can't find symbols-in-versions";
# set this if the markdown has no meta-data header to skip while(<S>) {
if($ARGV[0] eq "--no-header") { if(/^([^ ]*) /) {
shift @ARGV; push @asyms, $1;
$header = 0;
}
else {
last;
} }
} }
close(S);
my $f = $ARGV[0]; # init the opts table with "special" options not easy to figure out
my @aopts = (
'--ftp-ssl-reqd', # old alias
);
open(F, "<$f") or die; open(O, "<./docs/options-in-versions")
|| die "can't find options-in-versions";
my $ignore = $header; while(<O>) {
my $sepcount = 0; chomp;
my @out; if(/^([^ ]+)/) {
while(<F>) { my $o = $1;
if(/^---/ && $header) { push @aopts, $o;
if(++$sepcount == 2) { if($o =~ /^--no-(.*)/) {
$ignore = 0; # for the --no options, also make one without it
push @aopts, "--$1";
} }
elsif($o =~ /^--disable-(.*)/) {
# for the --disable options, also make the special ones
push @aopts, "--$1";
push @aopts, "--no-$1";
}
}
}
close(O);
open(C, "<./.github/scripts/spellcheck.curl")
|| die "can't find spellcheck.curl";
while(<C>) {
if(/^\#/) {
next; next;
} }
next if($ignore); chomp;
if(/^([^ ]+)/) {
# strip out backticked words push @asyms, $1;
$_ =~ s/`[^`]+`//g; }
# strip out all long command line options
$_ =~ s/--[a-z0-9-]+//g;
# strip out https URLs, we don't want them spellchecked
$_ =~ s!https://[a-z0-9\#_/.-]+!!gi;
push @out, $_;
} }
close(F); close(C);
if(!$ignore) { # longest symbols first
open(O, ">$f") or die; my @syms = sort { length($b) <=> length($a) } @asyms;
print O @out;
close(O); # longest cmdline options first
my @opts = sort { length($b) <=> length($a) } @aopts;
sub process {
my ($f) = @_;
my $ignore = 0;
my $sepcount = 0;
my $out;
my $line = 0;
open(F, "<$f") or die;
while(<F>) {
$line++;
if(/^---/ && ($line == 1)) {
$ignore = 1;
next;
}
elsif(/^---/ && $ignore) {
$ignore = 0;
next;
}
next if($ignore);
my $l = $_;
# strip out backticked words
$l =~ s/`[^`]+`//g;
# **bold**
$l =~ s/\*\*(\S.*?)\*\*//g;
# *italics*
$l =~ s/\*(\S.*?)\*//g;
# strip out https URLs, we don't want them spellchecked
$l =~ s!https://[a-z0-9\#_/.-]+!!gi;
$out .= $l;
}
close(F);
# cut out all known curl cmdline options
map { $out =~ s/$_//g; } (@opts);
# cut out all known curl symbols
map { $out =~ s/\b$_\b//g; } (@syms);
if(!$ignore) {
open(O, ">$f") or die;
print O $out;
close(O);
}
}
for my $f (@ARGV) {
process($f);
} }

View File

@ -1,86 +0,0 @@
#!/usr/bin/env perl
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
#
# Given: a libcurl curldown man page
# Outputs: the same file, minus the SYNOPSIS and the EXAMPLE sections
#
my $f = $ARGV[0];
open(F, "<$f") or die;
my @out;
my $ignore = 0;
while(<F>) {
if($_ =~ /^# (SYNOPSIS|EXAMPLE)/) {
$ignore = 1;
}
elsif($ignore && ($_ =~ /^# [A-Z]/)) {
$ignore = 0;
}
elsif(!$ignore) {
# **bold**
$_ =~ s/\*\*(\S.*?)\*\*//g;
# *italics*
$_ =~ s/\*(\S.*?)\*//g;
$_ =~ s/CURL(M|SH|U|H)code//g;
$_ =~ s/CURL_[A-Z0-9_]*//g;
$_ =~ s/CURLALTSVC_[A-Z0-9_]*//g;
$_ =~ s/CURLAUTH_[A-Z0-9_]*//g;
$_ =~ s/CURLE_[A-Z0-9_]*//g;
$_ =~ s/CURLFORM_[A-Z0-9_]*//g;
$_ =~ s/CURLFTP_[A-Z0-9_]*//g;
$_ =~ s/CURLFTPAUTH_[A-Z0-9_]*//g;
$_ =~ s/CURLFTPMETHOD_[A-Z0-9_]*//g;
$_ =~ s/CURLFTPSSL_[A-Z0-9_]*//g;
$_ =~ s/CURLGSSAPI_[A-Z0-9_]*//g;
$_ =~ s/CURLHEADER_[A-Z0-9_]*//g;
$_ =~ s/CURLINFO_[A-Z0-9_]*//g;
$_ =~ s/CURLM_[A-Z0-9_]*//g;
$_ =~ s/CURLMIMEOPT_[A-Z0-9_]*//g;
$_ =~ s/CURLMOPT_[A-Z0-9_]*//g;
$_ =~ s/CURLOPT_[A-Z0-9_]*//g;
$_ =~ s/CURLPIPE_[A-Z0-9_]*//g;
$_ =~ s/CURLPROTO_[A-Z0-9_]*//g;
$_ =~ s/CURLPROXY_[A-Z0-9_]*//g;
$_ =~ s/CURLPX_[A-Z0-9_]*//g;
$_ =~ s/CURLSHE_[A-Z0-9_]*//g;
$_ =~ s/CURLSHOPT_[A-Z0-9_]*//g;
$_ =~ s/CURLSSLOPT_[A-Z0-9_]*//g;
$_ =~ s/CURLSSH_[A-Z0-9_]*//g;
$_ =~ s/CURLSSLBACKEND_[A-Z0-9_]*//g;
$_ =~ s/CURLU_[A-Z0-9_]*//g;
$_ =~ s/CURLUPART_[A-Z0-9_]*//g;
#$_ =~ s/\bCURLU\b//g; # stand-alone CURLU
$_ =~ s/CURLUE_[A-Z0-9_]*//g;
$_ =~ s/CURLHE_[A-Z0-9_]*//g;
$_ =~ s/CURLWS_[A-Z0-9_]*//g;
$_ =~ s/CURLKH[A-Z0-9_]*//g;
$_ =~ s/CURLUPART_[A-Z0-9_]*//g;
$_ =~ s/CURLUSESSL_[A-Z0-9_]*//g;
$_ =~ s/CURLPAUSE_[A-Z0-9_]*//g;
$_ =~ s/CURLHSTS_[A-Z0-9_]*//g;
$_ =~ s/curl_global_([a-z_]*)//g;
$_ =~ s/curl_(strequal|strnequal|formadd|waitfd|formget|getdate|formfree)//g;
$_ =~ s/curl_easy_([a-z]*)//g;
$_ =~ s/curl_multi_([a-z_]*)//g;
$_ =~ s/curl_mime_(subparts|addpart|filedata|data_cb)//g;
$_ =~ s/curl_ws_(send|recv|meta)//g;
$_ =~ s/curl_url_(dup)//g;
$_ =~ s/curl_pushheader_by(name|num)//g;
$_ =~ s/libcurl-(env|ws)//g;
$_ =~ s/libcurl\\-(env|ws)//g;
$_ =~ s/(^|\W)((tftp|https|http|ftp):\/\/[a-z0-9\-._~%:\/?\#\[\]\@!\$&'()*+,;=\\]+)//gi;
push @out, $_;
}
}
close(F);
open(O, ">$f") or die;
for my $l (@out) {
print O $l;
}
close(O);

151
.github/scripts/spellcheck.curl vendored Normal file
View File

@ -0,0 +1,151 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
#
# common variable types + structs
# callback typedefs
# public functions names
# some man page names
curl_fileinfo
curl_forms
curl_hstsentry
curl_httppost
curl_index
curl_khkey
curl_pushheaders
curl_waitfd
CURLcode
CURLformoption
CURLHcode
CURLMcode
CURLMsg
CURLSHcode
CURLUcode
curl_calloc_callback
curl_chunk_bgn_callback
curl_chunk_end_callback
curl_conv_callback
curl_debug_callback
curl_fnmatch_callback
curl_formget_callback
curl_free_callback
curl_hstsread_callback
curl_hstswrite_callback
curl_ioctl_callback
curl_malloc_callback
curl_multi_timer_callback
curl_opensocket_callback
curl_prereq_callback
curl_progress_callback
curl_push_callback
curl_read_callback
curl_realloc_callback
curl_resolver_start_callback
curl_seek_callback
curl_socket_callback
curl_sockopt_callback
curl_ssl_ctx_callback
curl_strdup_callback
curl_trailer_callback
curl_write_callback
curl_xferinfo_callback
curl_strequal
curl_strnequal
curl_mime_init
curl_mime_free
curl_mime_addpart
curl_mime_name
curl_mime_filename
curl_mime_type
curl_mime_encoder
curl_mime_data
curl_mime_filedata
curl_mime_data_cb
curl_mime_subparts
curl_mime_headers
curl_formadd
curl_formget
curl_formfree
curl_getdate
curl_getenv
curl_version
curl_easy_escape
curl_escape
curl_easy_unescape
curl_unescape
curl_free
curl_global_init
curl_global_init_mem
curl_global_cleanup
curl_global_trace
curl_global_sslset
curl_slist_append
curl_slist_free_all
curl_getdate
curl_share_init
curl_share_setopt
curl_share_cleanup
curl_version_info
curl_easy_strerror
curl_share_strerror
curl_easy_pause
curl_easy_ssls_import
curl_easy_ssls_export
curl_easy_init
curl_easy_setopt
curl_easy_perform
curl_easy_cleanup
curl_easy_getinfo
curl_easy_duphandle
curl_easy_reset
curl_easy_recv
curl_easy_send
curl_easy_upkeep
curl_easy_header
curl_easy_nextheader
curl_mprintf
curl_mfprintf
curl_msprintf
curl_msnprintf
curl_mvprintf
curl_mvfprintf
curl_mvsprintf
curl_mvsnprintf
curl_maprintf
curl_mvaprintf
curl_multi_init
curl_multi_add_handle
curl_multi_remove_handle
curl_multi_fdset
curl_multi_waitfds
curl_multi_wait
curl_multi_poll
curl_multi_wakeup
curl_multi_perform
curl_multi_cleanup
curl_multi_info_read
curl_multi_strerror
curl_multi_socket
curl_multi_socket_action
curl_multi_socket_all
curl_multi_timeout
curl_multi_setopt
curl_multi_assign
curl_multi_get_handles
curl_pushheader_bynum
curl_pushheader_byname
curl_multi_waitfds
curl_easy_option_by_name
curl_easy_option_by_id
curl_easy_option_next
curl_url
curl_url_cleanup
curl_url_dup
curl_url_get
curl_url_set
curl_url_strerror
curl_ws_recv
curl_ws_send
curl_ws_meta
libcurl-env
libcurl-ws

View File

@ -251,8 +251,10 @@ Feltzing
ffi ffi
filesize filesize
filesystem filesystem
FindCURL
FLOSS FLOSS
fnmatch fnmatch
footguns
formpost formpost
formposts formposts
Fortnite Fortnite
@ -949,7 +951,6 @@ winbuild
WinIDN WinIDN
WinLDAP WinLDAP
winsock winsock
winssl
Wireshark Wireshark
wolfSSH wolfSSH
wolfSSL wolfSSL

View File

@ -107,26 +107,14 @@ jobs:
persist-credentials: false persist-credentials: false
name: checkout name: checkout
- name: trim all man page *.md files - name: trim all *.md files in docs/
run: find docs -name "*.md" ! -name "_*" -print0 | xargs -0 -n1 .github/scripts/cleancmd.pl run: .github/scripts/cleancmd.pl $(find docs -name "*.md")
- name: trim libcurl man page *.md files
run: find docs/libcurl \( -name "curl_*.md" -o -name "libcurl*.md" \) -print0 | xargs -0 -n1 .github/scripts/cleanspell.pl
- name: trim libcurl option man page *.md files
run: find docs/libcurl/opts -name "CURL*.md" -print0 | xargs -0 -n1 .github/scripts/cleanspell.pl
- name: trim cmdline docs markdown _*.md files
run: find docs/cmdline-opts -name "_*.md" -print0 | xargs -0 -n1 .github/scripts/cleancmd.pl --no-header
- name: trim docs/ markdown _*.md files
run: git ls-files docs/*.md docs/internals/*.md | xargs -n1 .github/scripts/cleancmd.pl --no-header
- name: setup the custom wordlist - name: setup the custom wordlist
run: grep -v '^#' .github/scripts/spellcheck.words > wordlist.txt run: grep -v '^#' .github/scripts/spellcheck.words > wordlist.txt
- name: Check Spelling - name: Check Spelling
uses: rojopolis/spellcheck-github-actions@9e0a5fb25a80b89c84899657949cbd6e17eb376c # v0 uses: rojopolis/spellcheck-github-actions@ed0756273a1658136c36d26e3d0353de35b98c8b # v0
with: with:
config_path: .github/scripts/spellcheck.yaml config_path: .github/scripts/spellcheck.yaml

View File

@ -13,6 +13,7 @@ name: configure-vs-cmake
- '**/CMakeLists.txt' - '**/CMakeLists.txt'
- 'CMake/**' - 'CMake/**'
- 'lib/curl_config.h.cmake' - 'lib/curl_config.h.cmake'
- 'tests/cmake/**'
- '.github/scripts/cmp-config.pl' - '.github/scripts/cmp-config.pl'
- '.github/workflows/configure-vs-cmake.yml' - '.github/workflows/configure-vs-cmake.yml'
@ -25,6 +26,7 @@ name: configure-vs-cmake
- '**/CMakeLists.txt' - '**/CMakeLists.txt'
- 'CMake/**' - 'CMake/**'
- 'lib/curl_config.h.cmake' - 'lib/curl_config.h.cmake'
- 'tests/cmake/**'
- '.github/scripts/cmp-config.pl' - '.github/scripts/cmp-config.pl'
- '.github/workflows/configure-vs-cmake.yml' - '.github/workflows/configure-vs-cmake.yml'
@ -46,7 +48,7 @@ jobs:
- name: 'run cmake' - name: 'run cmake'
run: | run: |
cmake -B bld-cm -DCURL_USE_LIBPSL=OFF -DCURL_BROTLI=OFF cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF -DCURL_BROTLI=OFF
- name: 'configure log' - name: 'configure log'
run: cat bld-am/config.log 2>/dev/null || true run: cat bld-am/config.log 2>/dev/null || true
@ -86,7 +88,7 @@ jobs:
- name: 'run cmake' - name: 'run cmake'
run: | run: |
cmake -B bld-cm -DCURL_USE_LIBPSL=OFF -DCURL_DISABLE_LDAP=ON \ cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF -DCURL_DISABLE_LDAP=ON \
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \ -DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \
-DCURL_BROTLI=OFF \ -DCURL_BROTLI=OFF \
-DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH2=OFF
@ -126,7 +128,7 @@ jobs:
- name: 'run cmake' - name: 'run cmake'
run: | run: |
cmake -B bld-cm -DCURL_USE_SCHANNEL=ON -DCURL_USE_LIBPSL=OFF \ cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_SCHANNEL=ON -DCURL_USE_LIBPSL=OFF \
-DCMAKE_SYSTEM_NAME=Windows \ -DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_C_COMPILER_TARGET="${TRIPLET}" \ -DCMAKE_C_COMPILER_TARGET="${TRIPLET}" \
-DCMAKE_C_COMPILER="${TRIPLET}-gcc" -DCMAKE_C_COMPILER="${TRIPLET}-gcc"

View File

@ -42,7 +42,7 @@ env:
CW_NOPKG: '1' CW_NOPKG: '1'
jobs: jobs:
linux-glibc-llvm: linux-glibc-gcc:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 30 timeout-minutes: 30
steps: steps:
@ -55,7 +55,7 @@ jobs:
run: | run: |
git clone --depth 1 https://github.com/curl/curl-for-win git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* . mv curl-for-win/* .
export CW_CONFIG='-main-werror-linux-a64-x64' export CW_CONFIG='-main-werror-linux-a64-x64-gcc'
export CW_REVISION='${{ github.sha }}' export CW_REVISION='${{ github.sha }}'
DOCKER_IMAGE='debian:bookworm-slim' DOCKER_IMAGE='debian:bookworm-slim'
export DOCKER_CONTENT_TRUST=1 export DOCKER_CONTENT_TRUST=1
@ -137,3 +137,27 @@ jobs:
'^(CW_|GITHUB_)') \ '^(CW_|GITHUB_)') \
"${DOCKER_IMAGE}" \ "${DOCKER_IMAGE}" \
sh -c ./_ci-linux-debian.sh sh -c ./_ci-linux-debian.sh
win-gcc-libssh-zlibng-x86:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
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-win-x86-gcc-libssh1-zlibng'
export CW_REVISION='${{ github.sha }}'
. ./_versions.sh
docker trust inspect --pretty "${DOCKER_IMAGE}"
time docker pull "${DOCKER_IMAGE}"
docker images --digests
time docker run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \
--env-file <(env | grep -a -E \
'^(CW_|GITHUB_)') \
"${DOCKER_IMAGE}" \
sh -c ./_ci-linux-debian.sh

View File

@ -19,6 +19,9 @@ concurrency:
permissions: {} permissions: {}
env:
MAKEFLAGS: -j 5
jobs: jobs:
maketgz-and-verify-in-tree: maketgz-and-verify-in-tree:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -55,9 +58,9 @@ jobs:
tar xvf curl-99.98.97.tar.gz tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97 pushd curl-99.98.97
./configure --prefix=$HOME/temp --without-ssl --without-libpsl ./configure --prefix=$HOME/temp --without-ssl --without-libpsl
make -j5 make
make -j5 test-ci make test-ci
make -j5 install make install
popd popd
# basic check of the installed files # basic check of the installed files
bash scripts/installcheck.sh $HOME/temp bash scripts/installcheck.sh $HOME/temp
@ -80,8 +83,8 @@ jobs:
mkdir build mkdir build
pushd build pushd build
../curl-99.98.97/configure --without-ssl --without-libpsl ../curl-99.98.97/configure --without-ssl --without-libpsl
make -j5 make
make -j5 test-ci make test-ci
popd popd
rm -rf build rm -rf build
rm -rf curl-99.98.97 rm -rf curl-99.98.97
@ -103,9 +106,9 @@ jobs:
mkdir build mkdir build
pushd build pushd build
../configure --without-ssl --enable-debug "--prefix=${PWD}/pkg" --without-libpsl ../configure --without-ssl --enable-debug "--prefix=${PWD}/pkg" --without-libpsl
make -j5 make
make -j5 test-ci make test-ci
make -j5 install make install
verify-out-of-tree-cmake: verify-out-of-tree-cmake:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -122,7 +125,7 @@ jobs:
tar xvf curl-99.98.97.tar.gz tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97 pushd curl-99.98.97
cmake -B build -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF cmake -B build -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF
make -C build -j5 make -C build
missing-files: missing-files:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -159,3 +162,33 @@ jobs:
mv curl-9.10.11.tar.gz _verify mv curl-9.10.11.tar.gz _verify
cd _verify cd _verify
../scripts/verify-release curl-9.10.11.tar.gz ../scripts/verify-release curl-9.10.11.tar.gz
cmake-integration:
name: 'cmake-integration-on-${{ matrix.image }}'
runs-on: ${{ matrix.image }}
timeout-minutes: 10
env:
CC: clang
CMAKE_GENERATOR: Ninja
strategy:
fail-fast: false
matrix:
image: [ubuntu-latest, macos-latest]
steps:
- name: 'install prereqs'
run: |
if [[ '${{ matrix.image }}' = *'ubuntu'* ]]; then
sudo apt-get -o Dpkg::Use-Pty=0 install ninja-build libpsl-dev libssl-dev
else
brew install ninja libpsl openssl
fi
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
- name: 'via FetchContent'
run: ./tests/cmake/test.sh FetchContent
- name: 'via add_subdirectory'
run: ./tests/cmake/test.sh add_subdirectory
- name: 'via find_package'
run: ./tests/cmake/test.sh find_package

View File

@ -39,17 +39,17 @@ permissions: {}
env: env:
MAKEFLAGS: -j 5 MAKEFLAGS: -j 5
# handled in renovate.json # handled in renovate.json
openssl-version: 3.4.0 openssl-version: 3.4.1
# handled in renovate.json # handled in renovate.json
quictls-version: 3.3.0 quictls-version: 3.3.0
# renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver registryUrl=https://github.com # renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver registryUrl=https://github.com
gnutls-version: 3.8.8 gnutls-version: 3.8.9
# renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?<version>.+)-stable$ registryUrl=https://github.com # renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?<version>.+)-stable$ registryUrl=https://github.com
wolfssl-version: 5.7.6 wolfssl-version: 5.7.6
# renovate: datasource=github-tags depName=ngtcp2/nghttp3 versioning=semver registryUrl=https://github.com # renovate: datasource=github-tags depName=ngtcp2/nghttp3 versioning=semver registryUrl=https://github.com
nghttp3-version: 1.7.0 nghttp3-version: 1.8.0
# renovate: datasource=github-tags depName=ngtcp2/ngtcp2 versioning=semver registryUrl=https://github.com # renovate: datasource=github-tags depName=ngtcp2/ngtcp2 versioning=semver registryUrl=https://github.com
ngtcp2-version: 1.10.0 ngtcp2-version: 1.11.0
# renovate: datasource=github-tags depName=nghttp2/nghttp2 versioning=semver registryUrl=https://github.com # renovate: datasource=github-tags depName=nghttp2/nghttp2 versioning=semver registryUrl=https://github.com
nghttp2-version: 1.64.0 nghttp2-version: 1.64.0
# renovate: datasource=github-tags depName=cloudflare/quiche versioning=semver registryUrl=https://github.com # renovate: datasource=github-tags depName=cloudflare/quiche versioning=semver registryUrl=https://github.com
@ -232,6 +232,7 @@ jobs:
--with-ngtcp2=$HOME/ngtcp2/build --enable-warnings --enable-werror --enable-debug --disable-ntlm --with-ngtcp2=$HOME/ngtcp2/build --enable-warnings --enable-werror --enable-debug --disable-ntlm
--with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx" --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
--with-openssl=$HOME/quictls/build --enable-ssls-export --with-openssl=$HOME/quictls/build --enable-ssls-export
--with-libuv
- name: gnutls - name: gnutls
PKG_CONFIG_PATH: '$HOME/gnutls/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig' PKG_CONFIG_PATH: '$HOME/gnutls/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig'
@ -240,6 +241,7 @@ jobs:
--with-ngtcp2=$HOME/ngtcp2/build --enable-warnings --enable-werror --enable-debug --with-ngtcp2=$HOME/ngtcp2/build --enable-warnings --enable-werror --enable-debug
--with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx" --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
--with-gnutls=$HOME/gnutls/build --enable-ssls-export --with-gnutls=$HOME/gnutls/build --enable-ssls-export
--with-libuv
- name: wolfssl - name: wolfssl
PKG_CONFIG_PATH: '$HOME/wolfssl/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig' PKG_CONFIG_PATH: '$HOME/wolfssl/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig'
@ -249,6 +251,7 @@ jobs:
--with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx" --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
--with-wolfssl=$HOME/wolfssl/build --with-wolfssl=$HOME/wolfssl/build
--enable-ech --enable-ssls-export --enable-ech --enable-ssls-export
--with-libuv
- name: wolfssl - name: wolfssl
PKG_CONFIG_PATH: '$HOME/wolfssl/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig' PKG_CONFIG_PATH: '$HOME/wolfssl/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig'
@ -257,6 +260,7 @@ jobs:
-DTEST_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx" -DTEST_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx"
-DHTTPD_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx" -DHTTPD_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx"
-DUSE_ECH=ON -DUSE_ECH=ON
-DCURL_USE_LIBUV=ON
- name: openssl-quic - name: openssl-quic
PKG_CONFIG_PATH: '$HOME/openssl/build/lib64/pkgconfig' PKG_CONFIG_PATH: '$HOME/openssl/build/lib64/pkgconfig'
@ -266,6 +270,7 @@ jobs:
--with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx" --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
--with-openssl=$HOME/openssl/build --with-openssl-quic --with-openssl=$HOME/openssl/build --with-openssl-quic
--with-nghttp3=$HOME/nghttp3/build --with-nghttp3=$HOME/nghttp3/build
--with-libuv
- name: quiche - name: quiche
configure: >- configure: >-
@ -275,6 +280,7 @@ jobs:
--with-quiche=$HOME/quiche/target/release --with-quiche=$HOME/quiche/target/release
--with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx" --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
--with-ca-fallback --with-ca-fallback
--with-libuv
- name: quiche - name: quiche
PKG_CONFIG_PATH: '$HOME/quiche/target/release' PKG_CONFIG_PATH: '$HOME/quiche/target/release'
@ -284,6 +290,7 @@ jobs:
-DTEST_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx" -DTEST_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx"
-DHTTPD_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx" -DHTTPD_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx"
-DCURL_CA_FALLBACK=ON -DCURL_CA_FALLBACK=ON
-DCURL_USE_LIBUV=ON
steps: steps:
- name: 'install prereqs' - name: 'install prereqs'
@ -295,7 +302,7 @@ jobs:
libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libev-dev libc-ares-dev \ 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 \ 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 \ 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 \ texinfo texlive texlive-extra-utils autopoint libev-dev libuv1-dev \
apache2 apache2-dev libnghttp2-dev vsftpd apache2 apache2-dev libnghttp2-dev vsftpd
python3 -m venv $HOME/venv python3 -m venv $HOME/venv
echo 'CC=gcc-12' >> $GITHUB_ENV echo 'CC=gcc-12' >> $GITHUB_ENV
@ -308,7 +315,7 @@ jobs:
cache-name: cache-quictls-no-deprecated cache-name: cache-quictls-no-deprecated
with: with:
path: ~/quictls/build path: ~/quictls/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.quictls-version }} key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.quictls-version }}-quic1
fail-on-cache-miss: true fail-on-cache-miss: true
- name: 'cache gnutls' - name: 'cache gnutls'
@ -427,46 +434,45 @@ jobs:
export PKG_CONFIG_PATH="${{ matrix.build.PKG_CONFIG_PATH }}" export PKG_CONFIG_PATH="${{ matrix.build.PKG_CONFIG_PATH }}"
fi fi
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
cmake -B . -G Ninja \ cmake -B bld -G Ninja \
-DCMAKE_C_COMPILER_TARGET=$(uname -m)-pc-linux-gnu -DBUILD_STATIC_LIBS=ON \ -DCMAKE_C_COMPILER_TARGET=$(uname -m)-pc-linux-gnu -DBUILD_STATIC_LIBS=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \ -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \
${{ matrix.build.generate }} ${{ matrix.build.generate }}
else else
./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
--disable-dependency-tracking \
${{ matrix.build.configure }} ${{ matrix.build.configure }}
fi fi
- name: 'configure log' - name: 'configure log'
if: ${{ !cancelled() }} if: ${{ !cancelled() }}
run: cat config.log CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true run: cat bld/config.log bld/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
- name: 'curl_config.h' - name: 'curl_config.h'
run: | run: |
echo '::group::raw'; cat lib/curl_config.h || true; echo '::endgroup::' echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' lib/curl_config.h | sort || true grep -F '#define' bld/lib/curl_config.h | sort || true
- name: 'test configs' - name: 'test configs'
run: | run: grep -H -v '^#' bld/tests/config bld/tests/http/config.ini || true
cat tests/config || true
cat tests/http/config.ini || true
- name: 'build' - name: 'build'
run: | run: |
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build . --verbose cmake --build bld --verbose
else else
make V=1 make -C bld V=1
fi fi
- name: 'check curl -V output' - name: 'check curl -V output'
run: ./src/curl -V run: bld/src/curl -V
- name: 'build tests' - name: 'build tests'
run: | run: |
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build . --verbose --target testdeps cmake --build bld --verbose --target testdeps
else else
make V=1 -C tests make -C bld V=1 -C tests
fi fi
- name: 'install test prereqs' - name: 'install test prereqs'
@ -480,9 +486,9 @@ jobs:
run: | run: |
source $HOME/venv/bin/activate source $HOME/venv/bin/activate
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build . --verbose --target test-ci cmake --build bld --verbose --target test-ci
else else
make V=1 test-ci make -C bld V=1 test-ci
fi fi
- name: 'install pytest prereqs' - name: 'install pytest prereqs'
@ -490,23 +496,23 @@ jobs:
source $HOME/venv/bin/activate source $HOME/venv/bin/activate
python3 -m pip install -r tests/http/requirements.txt python3 -m pip install -r tests/http/requirements.txt
- name: 'run pytest' - name: 'run pytest event based'
env: env:
TFLAGS: '${{ matrix.build.tflags }}' CURL_TEST_EVENT: 1
CURL_CI: github CURL_CI: github
PYTEST_ADDOPTS: '--color=yes' PYTEST_ADDOPTS: '--color=yes'
run: | run: |
source $HOME/venv/bin/activate source $HOME/venv/bin/activate
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build . --verbose --target curl-pytest-ci cmake --build bld --verbose --target curl-pytest-ci
else else
make V=1 pytest-ci make -C bld V=1 pytest-ci
fi fi
- name: 'build examples' - name: 'build examples'
run: | run: |
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build . --verbose --target curl-examples cmake --build bld --verbose --target curl-examples
else else
make V=1 examples make -C bld V=1 examples
fi fi

View File

@ -91,12 +91,14 @@ jobs:
echo '::group::raw'; cat bld-1/lib/curl_config.h || true; echo '::endgroup::' echo '::group::raw'; cat bld-1/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld-1/lib/curl_config.h | sort || true grep -F '#define' bld-1/lib/curl_config.h | sort || true
- name: 'cmake generate (out-of-tree, c-ares, libssh, zstd, gssapi)' # 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)'
run: | run: |
mkdir bld-cares mkdir bld-cares
cd bld-cares cd bld-cares
cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
-DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON -DUSE_LIBRTMP=ON \ -DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON \
-DCURL_LIBCURL_VERSIONED_SYMBOLS=ON -DCURL_LIBCURL_VERSIONED_SYMBOLS=ON
- name: 'cmake curl_config.h' - name: 'cmake curl_config.h'
@ -121,12 +123,12 @@ jobs:
- name: 'autoreconf' - name: 'autoreconf'
run: autoreconf -if run: autoreconf -if
- name: 'configure (out-of-tree, c-ares, libssh, zstd, gssapi)' - name: 'configure (out-of-tree, c-ares, libssh2, zstd, gssapi)'
run: | run: |
mkdir bld-am mkdir bld-am
cd bld-am cd bld-am
../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ ../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
--with-openssl --enable-ares --with-libssh --with-zstd --with-gssapi --with-librtmp \ --with-openssl --enable-ares --with-libssh2 --with-zstd --with-gssapi --with-librtmp \
--prefix="$PWD"/../install-am --prefix="$PWD"/../install-am
- name: 'autoconf curl_config.h' - name: 'autoconf curl_config.h'

View File

@ -51,9 +51,9 @@ env:
# renovate: datasource=github-tags depName=nibanks/msh3 versioning=semver registryUrl=https://github.com # renovate: datasource=github-tags depName=nibanks/msh3 versioning=semver registryUrl=https://github.com
msh3-version: 0.6.0 msh3-version: 0.6.0
# renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com # renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com
awslc-version: 1.42.0 awslc-version: 1.45.0
# handled in renovate.json # handled in renovate.json
openssl-version: 3.4.0 openssl-version: 3.4.1
# handled in renovate.json # handled in renovate.json
quictls-version: 3.3.0 quictls-version: 3.3.0
# renovate: datasource=github-tags depName=rustls/rustls-ffi versioning=semver registryUrl=https://github.com # renovate: datasource=github-tags depName=rustls/rustls-ffi versioning=semver registryUrl=https://github.com
@ -164,12 +164,6 @@ jobs:
install_steps: pytest install_steps: pytest
configure: CFLAGS=-std=gnu89 --with-openssl --enable-debug configure: CFLAGS=-std=gnu89 --with-openssl --enable-debug
- name: openssl arm
install_packages: zlib1g-dev
install_steps: pytest
configure: CFLAGS=-std=gnu89 --with-openssl --enable-debug
image: 'ubuntu-24.04-arm'
- name: openssl -O3 valgrind - name: openssl -O3 valgrind
install_packages: zlib1g-dev valgrind install_packages: zlib1g-dev valgrind
configure: CFLAGS=-O3 --with-openssl --enable-debug configure: CFLAGS=-O3 --with-openssl --enable-debug
@ -292,9 +286,13 @@ jobs:
# Docker Hub image that `container-job` executes in # Docker Hub image that `container-job` executes in
container: 'andy5995/slackware-build-essential:15.0' container: 'andy5995/slackware-build-essential:15.0'
- name: Alpine MUSL - name: Alpine MUSL https-rr
configure: --enable-debug --with-ssl --with-libssh2 --with-libidn2 --with-gssapi --enable-ldap --with-libpsl configure: --enable-debug --with-ssl --with-libssh2 --with-libidn2 --with-gssapi --enable-ldap --with-libpsl --enable-threaded-resolver --enable-ares --enable-httpsrr
container: 'alpine:3.18' container: 'alpine:3.20'
- name: Alpine MUSL c-ares https-rr
configure: --enable-debug --with-ssl --with-libssh2 --with-libidn2 --with-gssapi --enable-ldap --with-libpsl --disable-threaded-resolver --enable-ares --enable-httpsrr --disable-unity
container: 'alpine:3.20'
steps: steps:
- name: 'install prereqs' - name: 'install prereqs'
@ -306,7 +304,8 @@ jobs:
libtool autoconf automake pkgconf ninja-build \ libtool autoconf automake pkgconf ninja-build \
${{ matrix.build.install_steps != 'skipall' && matrix.build.install_steps != 'skiprun' && 'stunnel4' || '' }} \ ${{ matrix.build.install_steps != 'skipall' && matrix.build.install_steps != 'skiprun' && 'stunnel4' || '' }} \
libpsl-dev libbrotli-dev libzstd-dev \ libpsl-dev libbrotli-dev libzstd-dev \
${{ matrix.build.install_packages }} ${{ matrix.build.install_packages }} \
${{ contains(matrix.build.install_steps, 'pytest') && 'apache2 apache2-dev libnghttp2-dev vsftpd' || '' }}
python3 -m venv $HOME/venv python3 -m venv $HOME/venv
- name: 'install prereqs' - name: 'install prereqs'
@ -321,27 +320,15 @@ jobs:
${{ matrix.build.install_packages }} ${{ matrix.build.install_packages }}
python3 -m venv $HOME/venv python3 -m venv $HOME/venv
- name: 'install prereqs for pytest'
if: contains(matrix.build.install_steps, 'pytest')
run: |
sudo apt-get -o Dpkg::Use-Pty=0 install apache2 apache2-dev libnghttp2-dev vsftpd
- name: 'install dependencies' - name: 'install dependencies'
if: startsWith(matrix.build.container, 'alpine') if: startsWith(matrix.build.container, 'alpine')
run: | run: |
apk add --no-cache build-base autoconf automake libtool perl openssl-dev libssh2-dev \ apk add --no-cache build-base autoconf automake libtool perl openssl-dev \
zlib-dev brotli-dev zstd-dev libidn2-dev openldap-dev heimdal-dev libpsl-dev \ libssh2-dev zlib-dev brotli-dev zstd-dev libidn2-dev openldap-dev \
heimdal-dev libpsl-dev c-ares-dev \
py3-impacket py3-asn1 py3-six py3-pycryptodomex \ py3-impacket py3-asn1 py3-six py3-pycryptodomex \
perl-time-hires openssh stunnel sudo git perl-time-hires openssh stunnel sudo git
- name: 'fix kernel mmap rnd bits'
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
# high-entropy ASLR in much newer kernels that GitHub runners are
# using leading to random crashes: https://reviews.llvm.org/D148280
# See https://github.com/actions/runner-images/issues/9491
continue-on-error: true
run: sudo sysctl vm.mmap_rnd_bits=28
- name: 'cache bearssl' - name: 'cache bearssl'
if: contains(matrix.build.install_steps, 'bearssl') if: contains(matrix.build.install_steps, 'bearssl')
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4 uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
@ -569,7 +556,7 @@ jobs:
cd $HOME cd $HOME
curl -sSf --compressed https://sh.rustup.rs/ | sh -s -- -y curl -sSf --compressed https://sh.rustup.rs/ | sh -s -- -y
source $HOME/.cargo/env source $HOME/.cargo/env
rustup toolchain install nightly rustup toolchain install stable --profile minimal
- name: 'build rustls' - name: 'build rustls'
if: contains(matrix.build.install_steps, 'rustls') && steps.cache-rustls.outputs.cache-hit != 'true' if: contains(matrix.build.install_steps, 'rustls') && steps.cache-rustls.outputs.cache-hit != 'true'
@ -597,41 +584,42 @@ jobs:
- name: 'configure' - name: 'configure'
run: | run: |
[[ '${{ matrix.build.install_steps }}' = *'awslc'* ]] && sudo apt remove --yes libssl-dev [[ '${{ matrix.build.install_steps }}' = *'awslc'* ]] && sudo apt-get -o Dpkg::Use-Pty=0 purge libssl-dev
if [ -n '${{ matrix.build.PKG_CONFIG_PATH }}' ]; then if [ -n '${{ matrix.build.PKG_CONFIG_PATH }}' ]; then
export PKG_CONFIG_PATH="${{ matrix.build.PKG_CONFIG_PATH }}" export PKG_CONFIG_PATH="${{ matrix.build.PKG_CONFIG_PATH }}"
fi fi
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
cmake -B . -G Ninja \ cmake -B bld -G Ninja \
-DCMAKE_INSTALL_PREFIX="$HOME/curl" \
-DCMAKE_C_COMPILER_TARGET=$(uname -m)-pc-linux-gnu -DBUILD_STATIC_LIBS=ON \ -DCMAKE_C_COMPILER_TARGET=$(uname -m)-pc-linux-gnu -DBUILD_STATIC_LIBS=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \ -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \
${{ matrix.build.generate }} ${{ matrix.build.generate }}
else else
mkdir bld && cd bld && \
${{ matrix.build.configure-prefix }} \ ${{ matrix.build.configure-prefix }} \
./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
--disable-dependency-tracking \
${{ matrix.build.configure }} ${{ matrix.build.configure }}
fi fi
- name: 'configure log' - name: 'configure log'
if: ${{ !cancelled() }} if: ${{ !cancelled() }}
run: cat config.log CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true run: cat bld/config.log bld/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
- name: 'curl_config.h' - name: 'curl_config.h'
run: | run: |
echo '::group::raw'; cat lib/curl_config.h || true; echo '::endgroup::' echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' lib/curl_config.h | sort || true grep -F '#define' bld/lib/curl_config.h | sort || true
- name: 'test configs' - name: 'test configs'
run: | run: grep -H -v '^#' bld/tests/config bld/tests/http/config.ini || true
cat tests/config || true
cat tests/http/config.ini || true
- name: 'build' - name: 'build'
run: | run: |
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
${{ matrix.build.make-prefix }} cmake --build . --verbose ${{ matrix.build.make-prefix }} cmake --build bld --verbose
else else
${{ matrix.build.make-prefix }} make V=1 ${{ matrix.build.make-custom-target }} ${{ matrix.build.make-prefix }} make -C bld V=1 ${{ matrix.build.make-custom-target }}
fi fi
- name: 'single-use function check' - name: 'single-use function check'
@ -639,27 +627,27 @@ jobs:
run: | run: |
git config --global --add safe.directory "*" git config --global --add safe.directory "*"
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
libcurla=lib/libcurl.a libcurla=bld/lib/libcurl.a
else else
libcurla=lib/.libs/libcurl.a libcurla=bld/lib/.libs/libcurl.a
fi fi
./scripts/singleuse.pl --unit ${libcurla} ./scripts/singleuse.pl --unit ${libcurla}
- name: 'check curl -V output' - name: 'check curl -V output'
if: ${{ matrix.build.make-custom-target != 'tidy' }} if: ${{ matrix.build.make-custom-target != 'tidy' }}
run: ./src/curl -V run: bld/src/curl -V
- name: 'cmake install' - name: 'cmake install'
if: ${{ matrix.build.generate }} if: ${{ matrix.build.generate }}
run: cmake --install . --prefix $HOME/curl --strip run: cmake --install bld --strip
- name: 'build tests' - name: 'build tests'
if: ${{ matrix.build.install_steps != 'skipall' }} if: ${{ matrix.build.install_steps != 'skipall' }}
run: | run: |
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build . --verbose --target testdeps cmake --build bld --verbose --target testdeps
else else
make V=1 -C tests make -C bld V=1 -C tests
fi fi
- name: 'install test prereqs' - name: 'install test prereqs'
@ -686,9 +674,9 @@ jobs:
fi fi
[ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate [ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build . --verbose --target ${{ matrix.build.torture && 'test-torture' || 'test-ci' }} cmake --build bld --verbose --target ${{ matrix.build.torture && 'test-torture' || 'test-ci' }}
else else
make V=1 ${{ matrix.build.torture && 'test-torture' || 'test-ci' }} make -C bld V=1 ${{ matrix.build.torture && 'test-torture' || 'test-ci' }}
fi fi
- name: 'install pytest prereqs' - name: 'install pytest prereqs'
@ -700,22 +688,21 @@ jobs:
- name: 'run pytest' - name: 'run pytest'
if: contains(matrix.build.install_steps, 'pytest') if: contains(matrix.build.install_steps, 'pytest')
env: env:
TFLAGS: '${{ matrix.build.tflags }}'
CURL_CI: github CURL_CI: github
PYTEST_ADDOPTS: '--color=yes' PYTEST_ADDOPTS: '--color=yes'
run: | run: |
[ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate [ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build . --verbose --target curl-pytest-ci cmake --build bld --verbose --target curl-pytest-ci
else else
make V=1 pytest-ci make -C bld V=1 pytest-ci
fi fi
- name: 'build examples' - name: 'build examples'
if: ${{ matrix.build.make-custom-target != 'tidy' }} if: ${{ matrix.build.make-custom-target != 'tidy' }}
run: | run: |
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
${{ matrix.build.make-prefix }} cmake --build . --verbose --target curl-examples ${{ matrix.build.make-prefix }} cmake --build bld --verbose --target curl-examples
else else
${{ matrix.build.make-prefix }} make V=1 examples ${{ matrix.build.make-prefix }} make -C bld V=1 examples
fi fi

View File

@ -47,8 +47,8 @@ permissions: {}
# newer than the 10.8 required by `CFURLCreateDataAndPropertiesFromResource`. # newer than the 10.8 required by `CFURLCreateDataAndPropertiesFromResource`.
env: env:
LDFLAGS: -w # suppress 'object file was built for newer macOS version than being linked' warnings
MAKEFLAGS: -j 4 MAKEFLAGS: -j 4
LDFLAGS: -w # suppress 'object file was built for newer macOS version than being linked' warnings
jobs: jobs:
macos: macos:
@ -123,9 +123,10 @@ jobs:
compiler: clang compiler: clang
configure: --enable-debug --with-openssl=$(brew --prefix openssl) configure: --enable-debug --with-openssl=$(brew --prefix openssl)
tflags: --test-event tflags: --test-event
- name: 'OpenSSL libssh2 !ldap 10.15' - name: 'quictls libssh2 !ldap 10.15'
compiler: clang compiler: clang
configure: --enable-debug --disable-ldap --with-openssl=$(brew --prefix openssl) install: quictls
configure: --enable-debug --disable-ldap --with-openssl=$(brew --prefix quictls) LDFLAGS="${LDFLAGS} -L$(brew --prefix quictls)/lib"
macos-version-min: '10.15' macos-version-min: '10.15'
# cmake # cmake
- name: 'OpenSSL gsasl rtmp AppleIDN' - name: 'OpenSSL gsasl rtmp AppleIDN'
@ -135,9 +136,10 @@ jobs:
install: llvm install: llvm
generate: -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DUSE_APPLE_IDN=ON -DCURL_CLANG_TIDY=ON -DCLANG_TIDY=$(brew --prefix llvm)/bin/clang-tidy generate: -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DUSE_APPLE_IDN=ON -DCURL_CLANG_TIDY=ON -DCLANG_TIDY=$(brew --prefix llvm)/bin/clang-tidy
clang-tidy: true clang-tidy: true
- name: 'OpenSSL +static libssh +examples' chkprefill: _chkprefill
install: libssh - name: 'quictls +static libssh +examples'
generate: -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DBUILD_STATIC_LIBS=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON install: quictls libssh
generate: -DOPENSSL_ROOT_DIR=$(brew --prefix quictls) -DBUILD_STATIC_LIBS=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON
- name: 'SecureTransport debug' - name: 'SecureTransport debug'
generate: -DCURL_USE_SECTRANSP=ON -DENABLE_DEBUG=ON generate: -DCURL_USE_SECTRANSP=ON -DENABLE_DEBUG=ON
macos-version-min: '10.8' macos-version-min: '10.8'
@ -147,9 +149,9 @@ jobs:
- name: 'wolfSSL !ldap brotli zstd' - name: 'wolfSSL !ldap brotli zstd'
install: brotli wolfssl zstd install: brotli wolfssl zstd
generate: -DCURL_USE_WOLFSSL=ON -DCURL_DISABLE_LDAP=ON -DUSE_ECH=ON generate: -DCURL_USE_WOLFSSL=ON -DCURL_DISABLE_LDAP=ON -DUSE_ECH=ON
- name: 'mbedTLS !ldap brotli zstd' - name: 'mbedTLS openldap brotli zstd'
install: brotli mbedtls zstd install: brotli mbedtls zstd openldap
generate: -DCURL_USE_MBEDTLS=ON -DCURL_DISABLE_LDAP=ON generate: -DCURL_USE_MBEDTLS=ON -DLDAP_INCLUDE_DIR="$(brew --prefix openldap)/include" -DLDAP_LIBRARY="$(brew --prefix openldap)/lib/libldap.dylib" -DLDAP_LBER_LIBRARY="$(brew --prefix openldap)/lib/liblber.dylib"
- name: 'GnuTLS !ldap krb5' - name: 'GnuTLS !ldap krb5'
install: gnutls nettle krb5 install: gnutls nettle krb5
generate: -DCURL_USE_GNUTLS=ON -DCURL_USE_OPENSSL=OFF -DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=$(brew --prefix krb5) -DCURL_DISABLE_LDAP=ON -DUSE_SSLS_EXPORT=ON generate: -DCURL_USE_GNUTLS=ON -DCURL_USE_OPENSSL=OFF -DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=$(brew --prefix krb5) -DCURL_DISABLE_LDAP=ON -DUSE_SSLS_EXPORT=ON
@ -183,11 +185,12 @@ jobs:
run: | run: |
echo ${{ matrix.build.generate && 'ninja' || 'automake libtool' }} \ echo ${{ matrix.build.generate && 'ninja' || 'automake libtool' }} \
pkgconf libpsl libssh2 \ pkgconf libpsl libssh2 \
${{ !matrix.build.clang-tidy && 'nghttp2 stunnel' || '' }} \ ${{ !matrix.build.clang-tidy && 'libnghttp2 stunnel' || '' }} \
${{ matrix.build.install }} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile ${{ matrix.build.install }} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
while [[ $? == 0 ]]; do for i in 1 2 3; do brew update && brew bundle install --no-lock --file /tmp/Brewfile && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done while [[ $? == 0 ]]; do for i in 1 2 3; do brew update && brew bundle install --no-lock --file /tmp/Brewfile && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done
- name: 'brew unlink openssl' - name: 'brew unlink openssl'
if: ${{ contains(matrix.build.install, 'libressl') || contains(matrix.build.install, 'quictls') }}
run: | run: |
if test -d $(brew --prefix)/include/openssl; then if test -d $(brew --prefix)/include/openssl; then
brew unlink openssl brew unlink openssl
@ -228,11 +231,20 @@ jobs:
fi fi
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
[ -n '${{ matrix.build.macos-version-min }}' ] && options+=' -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.build.macos-version-min }}' for _chkprefill in '' ${{ matrix.build.chkprefill }}; do
cmake -B bld -G Ninja -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \ options=''
-DCMAKE_OSX_SYSROOT="${sysroot}" \ [ -n '${{ matrix.build.macos-version-min }}' ] && options+=' -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.build.macos-version-min }}'
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \ [ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF'
${{ matrix.build.generate }} ${options} cmake -B "bld${_chkprefill}" -G Ninja -D_CURL_PREFILL=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \
-DCMAKE_OSX_SYSROOT="${sysroot}" \
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \
${{ matrix.build.generate }} ${options}
done
if [ -d bld_chkprefill ] && ! diff -u bld/lib/curl_config.h bld_chkprefill/lib/curl_config.h; then
echo '::group::reference configure log'; cat bld_chkprefill/CMakeFiles/CMake*.yaml 2>/dev/null || true; echo '::endgroup::'
false
fi
else else
export CFLAGS export CFLAGS
if [[ '${{ matrix.compiler }}' = 'llvm'* ]]; then if [[ '${{ matrix.compiler }}' = 'llvm'* ]]; then
@ -303,7 +315,6 @@ jobs:
if [ -z '${{ matrix.build.torture }}' ]; then if [ -z '${{ matrix.build.torture }}' ]; then
TFLAGS+=' ~2037 ~2041' # flaky TFLAGS+=' ~2037 ~2041' # flaky
if [[ '${{ matrix.compiler }}' = 'gcc'* ]]; then if [[ '${{ matrix.compiler }}' = 'gcc'* ]]; then
TFLAGS+=' ~RTSP' # 567 568 569 570 571 572 577 689 3100
TFLAGS+=' ~1156 ~1539' # HTTP Content-Range, Content-Length TFLAGS+=' ~1156 ~1539' # HTTP Content-Range, Content-Length
if [[ -n '${{ matrix.build.configure }}' || \ if [[ -n '${{ matrix.build.configure }}' || \
'${{ matrix.build.generate }}' = *'-DCURL_USE_SECTRANSP=ON'* ]]; then '${{ matrix.build.generate }}' = *'-DCURL_USE_SECTRANSP=ON'* ]]; then
@ -334,7 +345,7 @@ jobs:
if: ${{ contains(matrix.build.name, '+examples') }} if: ${{ contains(matrix.build.name, '+examples') }}
run: | run: |
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build bld --target curl-examples --verbose cmake --build bld --verbose --target curl-examples
else else
make -C bld examples V=1 make -C bld examples V=1
fi fi
@ -443,7 +454,8 @@ jobs:
[ '${{ matrix.config }}' = 'SecureTransport' ] && options+=' -DCURL_USE_SECTRANSP=ON' [ '${{ matrix.config }}' = 'SecureTransport' ] && options+=' -DCURL_USE_SECTRANSP=ON'
[ -n '${{ matrix.macos-version-min }}' ] && options+=' -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.macos-version-min }}' [ -n '${{ matrix.macos-version-min }}' ] && options+=' -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.macos-version-min }}'
# would pick up nghttp2, libidn2, and libssh2 # would pick up nghttp2, libidn2, and libssh2
cmake -B bld -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \ cmake -B bld -D_CURL_PREFILL=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \
-DCMAKE_OSX_SYSROOT="${sysroot}" \ -DCMAKE_OSX_SYSROOT="${sysroot}" \
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \ -DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \
-DCMAKE_IGNORE_PREFIX_PATH="$(brew --prefix)" \ -DCMAKE_IGNORE_PREFIX_PATH="$(brew --prefix)" \

View File

@ -59,21 +59,21 @@ jobs:
time cmake -B bld -G Ninja \ time cmake -B bld -G Ninja \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
-DCURL_WERROR=ON \ -DCURL_WERROR=ON \
-DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \ -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_USE_OPENSSL=ON \ -DCURL_USE_OPENSSL=ON \
-DCURL_USE_GSSAPI=ON \ -DCURL_USE_GSSAPI=ON \
|| { cat bld/CMakeFiles/CMake*.yaml; false; } || { 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 (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::' echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
time cmake --build bld --config Debug time cmake --build bld
bld/src/curl --disable --version bld/src/curl --disable --version
if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU
time cmake --build bld --config Debug --target testdeps time cmake --build bld --target testdeps
export TFLAGS='-j4' export TFLAGS='-j4'
time cmake --build bld --config Debug --target test-ci time cmake --build bld --target test-ci
fi fi
echo '::group::build examples' echo '::group::build examples'
time cmake --build bld --config Debug --target curl-examples time cmake --build bld --target curl-examples
echo '::endgroup::' echo '::endgroup::'
openbsd: openbsd:
@ -100,30 +100,31 @@ jobs:
time cmake -B bld -G Ninja \ time cmake -B bld -G Ninja \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
-DCURL_WERROR=ON \ -DCURL_WERROR=ON \
-DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \ -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_USE_OPENSSL=ON \ -DCURL_USE_OPENSSL=ON \
|| { cat bld/CMakeFiles/CMake*.yaml; false; } || { 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 (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::' echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
time cmake --build bld --config Debug time cmake --build bld
bld/src/curl --disable --version bld/src/curl --disable --version
if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU
time cmake --build bld --config Debug --target testdeps time cmake --build bld --target testdeps
export TFLAGS='-j8 ~3017 ~TFTP ~FTP' # FIXME: TFTP requests executed twice? Related: `curl: (69) TFTP: Access Violation`? export TFLAGS='-j8 ~3017 ~TFTP ~FTP' # FIXME: TFTP requests executed twice? Related: `curl: (69) TFTP: Access Violation`?
time cmake --build bld --config Debug --target test-ci time cmake --build bld --target test-ci
fi fi
echo '::group::build examples' echo '::group::build examples'
time cmake --build bld --config Debug --target curl-examples time cmake --build bld --target curl-examples
echo '::endgroup::' echo '::endgroup::'
freebsd: freebsd:
name: "FreeBSD, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }} openssl ${{ matrix.arch }}" name: "FreeBSD, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }} openssl${{ matrix.desc }} ${{ matrix.arch }}"
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 20 timeout-minutes: 20
strategy: strategy:
matrix: matrix:
include: include:
- { build: 'autotools', arch: 'x86_64', compiler: 'clang' } - { build: 'autotools', arch: 'x86_64', compiler: 'clang' }
- { build: 'cmake' , arch: 'x86_64', compiler: 'clang', options: '-DCMAKE_UNITY_BUILD=OFF -DCURL_TEST_BUNDLES=OFF', desc: ' !unity !bundle !runtests !examples' }
- { build: 'autotools', arch: 'arm64', compiler: 'clang' } - { build: 'autotools', arch: 'arm64', compiler: 'clang' }
- { build: 'cmake' , arch: 'arm64', compiler: 'clang' } - { build: 'cmake' , arch: 'arm64', compiler: 'clang' }
fail-fast: false fail-fast: false
@ -139,6 +140,7 @@ jobs:
version: '14.1' version: '14.1'
architecture: ${{ matrix.arch }} architecture: ${{ matrix.arch }}
run: | run: |
export MAKEFLAGS=-j3
# https://ports.freebsd.org/ # https://ports.freebsd.org/
time sudo pkg install -y autoconf automake libtool \ time sudo pkg install -y autoconf automake libtool \
pkgconf brotli openldap26-client libidn2 libnghttp2 stunnel py311-impacket pkgconf brotli openldap26-client libidn2 libnghttp2 stunnel py311-impacket
@ -148,18 +150,25 @@ jobs:
--prefix="${HOME}"/install \ --prefix="${HOME}"/install \
--with-openssl \ --with-openssl \
--with-brotli --enable-ldap --enable-ldaps --with-libidn2 --with-libssh2 --with-nghttp2 --with-gssapi \ --with-brotli --enable-ldap --enable-ldaps --with-libidn2 --with-libssh2 --with-nghttp2 --with-gssapi \
--disable-dependency-tracking || { tail -n 1000 config.log; false; } --disable-dependency-tracking \
${{ matrix.options }} \
|| { tail -n 1000 config.log; false; }
echo '::group::curl_config.h (raw)'; cat lib/curl_config.h || true; echo '::endgroup::' echo '::group::curl_config.h (raw)'; cat lib/curl_config.h || true; echo '::endgroup::'
echo '::group::curl_config.h'; grep -F '#define' lib/curl_config.h | sort || true; echo '::endgroup::' echo '::group::curl_config.h'; grep -F '#define' lib/curl_config.h | sort || true; echo '::endgroup::'
time make -j3 install time make install
src/curl --disable --version src/curl --disable --version
desc='${{ matrix.desc }}'
if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU
time make -j3 -C tests time make -C tests
time make test-ci V=1 TFLAGS='-j4' if [ "${desc#*!runtests*}" = "${desc}" ]; then
time make test-ci V=1 TFLAGS='-j4'
fi
fi
if [ "${desc#*!examples*}" = "${desc}" ]; then
echo '::group::build examples'
time make examples
echo '::endgroup::'
fi fi
echo '::group::build examples'
time make -j3 examples
echo '::endgroup::'
- name: 'cmake' - name: 'cmake'
if: ${{ matrix.build == 'cmake' }} if: ${{ matrix.build == 'cmake' }}
@ -176,21 +185,27 @@ jobs:
-DCMAKE_C_COMPILER='${{ matrix.compiler }}' \ -DCMAKE_C_COMPILER='${{ matrix.compiler }}' \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
-DCURL_WERROR=ON \ -DCURL_WERROR=ON \
-DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \ -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_USE_OPENSSL=ON \ -DCURL_USE_OPENSSL=ON \
-DCURL_USE_GSSAPI=ON \ -DCURL_USE_GSSAPI=ON \
${{ matrix.options }} \
|| { cat bld/CMakeFiles/CMake*.yaml; false; } || { 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 (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::' echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
time cmake --build bld --config Debug time cmake --build bld
bld/src/curl --disable --version bld/src/curl --disable --version
desc='${{ matrix.desc }}'
if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU
time cmake --build bld --config Debug --target testdeps time cmake --build bld --target testdeps
time cmake --build bld --config Debug --target test-ci if [ "${desc#*!runtests*}" = "${desc}" ]; then
time cmake --build bld --target test-ci
fi
fi
if [ "${desc#*!examples*}" = "${desc}" ]; then
echo '::group::build examples'
time cmake --build bld --target curl-examples
echo '::endgroup::'
fi fi
echo '::group::build examples'
time cmake --build bld --config Debug --target curl-examples
echo '::endgroup::'
omnios: omnios:
name: 'OmniOS, AM gcc openssl amd64' name: 'OmniOS, AM gcc openssl amd64'
@ -209,19 +224,21 @@ jobs:
run: | run: |
set -e set -e
ln -s /usr/bin/gcpp /usr/bin/cpp # Some tests expect `cpp`, which is named `gcpp` in this env. ln -s /usr/bin/gcpp /usr/bin/cpp # Some tests expect `cpp`, which is named `gcpp` in this env.
export MAKEFLAGS=-j3
time autoreconf -fi time autoreconf -fi
mkdir bld && cd bld && time ../configure --enable-unity --enable-test-bundles --enable-debug --enable-warnings --enable-werror \ mkdir bld && cd bld && time ../configure --enable-unity --enable-test-bundles --enable-debug --enable-warnings --enable-werror \
--prefix="${HOME}"/install \ --prefix="${HOME}"/install \
--with-openssl \ --with-openssl \
--disable-dependency-tracking || { tail -n 1000 config.log; false; } --disable-dependency-tracking \
|| { tail -n 1000 config.log; false; }
echo '::group::curl_config.h (raw)'; cat lib/curl_config.h || true; echo '::endgroup::' echo '::group::curl_config.h (raw)'; cat lib/curl_config.h || true; echo '::endgroup::'
echo '::group::curl_config.h'; grep -F '#define' lib/curl_config.h | sort || true; echo '::endgroup::' echo '::group::curl_config.h'; grep -F '#define' lib/curl_config.h | sort || true; echo '::endgroup::'
time gmake -j3 install time gmake install
src/curl --disable --version src/curl --disable --version
time gmake -j3 -C tests time gmake -C tests
time gmake test-ci V=1 time gmake test-ci V=1
echo '::group::build examples' echo '::group::build examples'
time gmake -j3 examples time gmake examples
echo '::endgroup::' echo '::endgroup::'
ios: ios:
@ -229,9 +246,9 @@ jobs:
runs-on: 'macos-latest' runs-on: 'macos-latest'
timeout-minutes: 10 timeout-minutes: 10
env: env:
MAKEFLAGS: -j 4
DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer" DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer"
CC: ${{ matrix.build.compiler || 'clang' }} CC: ${{ matrix.build.compiler || 'clang' }}
MAKEFLAGS: -j 4
# renovate: datasource=github-tags depName=libressl-portable/portable versioning=semver registryUrl=https://github.com # renovate: datasource=github-tags depName=libressl-portable/portable versioning=semver registryUrl=https://github.com
libressl-version: 4.0.0 libressl-version: 4.0.0
strategy: strategy:
@ -246,6 +263,7 @@ jobs:
install_steps: libressl install_steps: libressl
# FIXME: Could not make OPENSSL_ROOT_DIR work. CMake seems to prepend sysroot to it. # FIXME: Could not make OPENSSL_ROOT_DIR work. CMake seems to prepend sysroot to it.
generate: >- generate: >-
-DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD_BATCH_SIZE=50
-DOPENSSL_INCLUDE_DIR="$HOME/libressl/include" -DOPENSSL_INCLUDE_DIR="$HOME/libressl/include"
-DOPENSSL_SSL_LIBRARY="$HOME/libressl/lib/libssl.a" -DOPENSSL_SSL_LIBRARY="$HOME/libressl/lib/libssl.a"
-DOPENSSL_CRYPTO_LIBRARY="$HOME/libressl/lib/libcrypto.a" -DOPENSSL_CRYPTO_LIBRARY="$HOME/libressl/lib/libcrypto.a"
@ -254,6 +272,7 @@ jobs:
- name: 'libressl' - name: 'libressl'
install_steps: libressl install_steps: libressl
generator: Xcode generator: Xcode
options: --config Debug
generate: >- generate: >-
-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=OFF -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=OFF
-DMACOSX_BUNDLE_GUI_IDENTIFIER=se.curl -DMACOSX_BUNDLE_GUI_IDENTIFIER=se.curl
@ -296,7 +315,7 @@ jobs:
https://github.com/libressl/portable/releases/download/v${{ env.libressl-version }}/libressl-${{ env.libressl-version }}.tar.gz | tar -x https://github.com/libressl/portable/releases/download/v${{ env.libressl-version }}/libressl-${{ env.libressl-version }}.tar.gz | tar -x
cd libressl-${{ env.libressl-version }} cd libressl-${{ env.libressl-version }}
# FIXME: on the 4.0.1 release, delete '-DHAVE_ENDIAN_H=0' # FIXME: on the 4.0.1 release, delete '-DHAVE_ENDIAN_H=0'
cmake . \ cmake -B . \
-DHAVE_ENDIAN_H=0 \ -DHAVE_ENDIAN_H=0 \
-DCMAKE_INSTALL_PREFIX="$HOME/libressl" \ -DCMAKE_INSTALL_PREFIX="$HOME/libressl" \
-DCMAKE_SYSTEM_NAME=iOS \ -DCMAKE_SYSTEM_NAME=iOS \
@ -320,7 +339,8 @@ jobs:
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
# https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-ios-tvos-visionos-or-watchos # https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-ios-tvos-visionos-or-watchos
[ -n '${{ matrix.build.generator }}' ] && options='-G ${{ matrix.build.generator }}' [ -n '${{ matrix.build.generator }}' ] && options='-G ${{ matrix.build.generator }}'
cmake -B bld -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \ cmake -B bld -D_CURL_PREFILL=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \
-DCMAKE_SYSTEM_NAME=iOS \ -DCMAKE_SYSTEM_NAME=iOS \
-DUSE_APPLE_IDN=ON \ -DUSE_APPLE_IDN=ON \
${{ matrix.build.generate }} ${options} ${{ matrix.build.generate }} ${options}
@ -345,7 +365,7 @@ jobs:
- name: 'build' - name: 'build'
run: | run: |
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build bld --verbose cmake --build bld ${{ matrix.build.options }} --parallel 4 --verbose
else else
make -C bld V=1 make -C bld V=1
fi fi
@ -356,7 +376,7 @@ jobs:
- name: 'build tests' - name: 'build tests'
run: | run: |
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build bld --target testdeps --verbose cmake --build bld ${{ matrix.build.options }} --parallel 4 --target testdeps --verbose
else else
make -C bld V=1 -C tests make -C bld V=1 -C tests
fi fi
@ -364,7 +384,7 @@ jobs:
- name: 'build examples' - name: 'build examples'
run: | run: |
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build bld --target curl-examples --verbose cmake --build bld ${{ matrix.build.options }} --parallel 4 --target curl-examples --verbose
else else
make -C bld examples V=1 make -C bld examples V=1
fi fi
@ -374,9 +394,9 @@ jobs:
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
timeout-minutes: 25 timeout-minutes: 25
env: env:
MAKEFLAGS: -j 5
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite' VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
VCPKG_DISABLE_METRICS: '1' VCPKG_DISABLE_METRICS: '1'
MAKEFLAGS: -j 5
strategy: strategy:
matrix: matrix:
include: include:
@ -474,7 +494,7 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --verbose cmake --build bld --verbose
else else
make -j5 -C bld V=1 make -C bld V=1
fi fi
- name: 'curl info' - name: 'curl info'
@ -485,7 +505,7 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --target testdeps cmake --build bld --target testdeps
else else
make -j5 -C bld -C tests make -C bld -C tests
fi fi
- name: 'build examples' - name: 'build examples'
@ -493,7 +513,7 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --target curl-examples cmake --build bld --target curl-examples
else else
make -j5 -C bld examples make -C bld examples
fi fi
amiga: amiga:
@ -501,6 +521,7 @@ jobs:
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
timeout-minutes: 5 timeout-minutes: 5
env: env:
MAKEFLAGS: -j 5
amissl-version: 5.18 amissl-version: 5.18
strategy: strategy:
matrix: matrix:
@ -568,9 +589,9 @@ jobs:
- name: 'build' - name: 'build'
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --parallel 5 cmake --build bld
else else
make -j5 -C bld make -C bld
fi fi
- name: 'curl info' - name: 'curl info'
@ -580,18 +601,18 @@ jobs:
if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --parallel 5 --target testdeps cmake --build bld --target testdeps
else else
make -j5 -C bld -C tests make -C bld -C tests
fi fi
- name: 'build examples' - name: 'build examples'
if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --parallel 5 --target curl-examples cmake --build bld --target curl-examples
else else
make -j5 -C bld examples make -C bld examples
fi fi
msdos: msdos:
@ -599,6 +620,7 @@ jobs:
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
timeout-minutes: 5 timeout-minutes: 5
env: env:
MAKEFLAGS: -j 5
toolchain-version: '3.4' toolchain-version: '3.4'
strategy: strategy:
matrix: matrix:
@ -678,7 +700,7 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld cmake --build bld
else else
make -j5 -C bld make -C bld
fi fi
- name: 'curl info' - name: 'curl info'
@ -690,7 +712,7 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --target testdeps cmake --build bld --target testdeps
else else
make -j5 -C bld -C tests make -C bld -C tests
fi fi
- name: 'build examples' - name: 'build examples'
@ -699,5 +721,5 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --target curl-examples cmake --build bld --target curl-examples
else else
make -j5 -C bld examples make -C bld examples
fi fi

View File

@ -44,6 +44,7 @@ jobs:
run: run:
shell: C:\cygwin\bin\bash.exe '{0}' shell: C:\cygwin\bin\bash.exe '{0}'
env: env:
MAKEFLAGS: -j 5
SHELLOPTS: 'igncr' SHELLOPTS: 'igncr'
strategy: strategy:
matrix: matrix:
@ -83,14 +84,13 @@ jobs:
- name: 'configure' - name: 'configure'
timeout-minutes: 5 timeout-minutes: 5
run: | run: |
PATH=/usr/bin
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
PATH="/usr/bin:$(cygpath "${SYSTEMROOT}")/System32" cmake -B bld -G Ninja -D_CURL_PREFILL=ON ${options} \
cmake -B bld -G Ninja ${options} \ -DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=30 -DCURL_TEST_BUNDLES=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
-DCURL_WERROR=ON \ -DCURL_WERROR=ON \
${{ matrix.config }} ${{ matrix.config }}
else else
PATH="/usr/bin:$(cygpath "${SYSTEMROOT}")/System32"
mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
--prefix="${HOME}"/install \ --prefix="${HOME}"/install \
--with-openssl \ --with-openssl \
@ -112,9 +112,9 @@ jobs:
timeout-minutes: 10 timeout-minutes: 10
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --config '${{ matrix.type }}' cmake --build bld
else else
make -C bld -j5 V=1 install make -C bld V=1 install
fi fi
- name: 'curl version' - name: 'curl version'
@ -131,9 +131,9 @@ jobs:
timeout-minutes: 15 timeout-minutes: 15
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --config '${{ matrix.type }}' --target testdeps cmake --build bld --target testdeps
else else
make -C bld -j5 V=1 -C tests make -C bld V=1 -C tests
fi fi
- name: 'run tests' - name: 'run tests'
@ -146,9 +146,9 @@ jobs:
fi fi
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
PATH="$PWD/bld/lib:$PATH" PATH="$PWD/bld/lib:$PATH"
cmake --build bld --config '${{ matrix.type }}' --target test-ci cmake --build bld --target test-ci
else else
make -C bld -j5 V=1 test-ci make -C bld V=1 test-ci
fi fi
- name: 'build examples' - name: 'build examples'
@ -156,9 +156,9 @@ jobs:
timeout-minutes: 5 timeout-minutes: 5
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --config '${{ matrix.type }}' --target curl-examples cmake --build bld --target curl-examples
else else
make -C bld -j5 V=1 examples make -C bld V=1 examples
fi fi
msys2: # both msys and mingw-w64 msys2: # both msys and mingw-w64
@ -168,6 +168,8 @@ jobs:
defaults: defaults:
run: run:
shell: msys2 {0} shell: msys2 {0}
env:
MAKEFLAGS: -j 5
strategy: strategy:
matrix: matrix:
include: include:
@ -180,7 +182,7 @@ jobs:
# FIXME: WebSockets test results ignored due to frequent failures on native Windows: # FIXME: WebSockets test results ignored due to frequent failures on native Windows:
- { build: 'cmake' , sys: 'mingw64', env: 'x86_64' , tflags: '' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_ARES=ON', type: 'Debug', name: 'schannel c-ares U' } - { build: 'cmake' , sys: 'mingw64', env: 'x86_64' , tflags: '' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_ARES=ON', type: 'Debug', name: 'schannel c-ares U' }
- { build: 'cmake' , sys: 'ucrt64' , env: 'ucrt-x86_64' , tflags: 'skiprun' , config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_CURLDEBUG=ON', type: 'Release', name: 'schannel R TrackMemory' } - { build: 'cmake' , sys: 'ucrt64' , env: 'ucrt-x86_64' , tflags: 'skiprun' , config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_CURLDEBUG=ON', type: 'Release', name: 'schannel R TrackMemory' }
- { build: 'cmake' , sys: 'clang64', env: 'clang-x86_64', tflags: 'skiprun' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_OPENSSL=ON -DENABLE_UNICODE=OFF', type: 'Release', name: 'openssl' } - { build: 'cmake' , sys: 'clang64', env: 'clang-x86_64', tflags: 'skiprun' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_OPENSSL=ON -DENABLE_UNICODE=OFF', type: 'Release', name: 'openssl', chkprefill: '_chkprefill' }
- { build: 'cmake' , sys: 'ucrt64' , env: 'ucrt-x86_64' , tflags: 'skiprun' , config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON', type: 'Release', test: 'uwp', name: 'schannel' } - { build: 'cmake' , sys: 'ucrt64' , env: 'ucrt-x86_64' , tflags: 'skiprun' , config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON', type: 'Release', test: 'uwp', name: 'schannel' }
# { build: 'autotools', sys: 'ucrt64' , env: 'ucrt-x86_64' , tflags: 'skiprun' , config: '--without-debug --with-schannel --enable-shared', type: 'Release', test: 'uwp', name: 'schannel' } # { build: 'autotools', sys: 'ucrt64' , env: 'ucrt-x86_64' , tflags: 'skiprun' , config: '--without-debug --with-schannel --enable-shared', type: 'Release', test: 'uwp', name: 'schannel' }
- { build: 'cmake' , sys: 'mingw64', env: 'x86_64' , tflags: 'skiprun' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DCMAKE_VERBOSE_MAKEFILE=ON', type: 'Debug', cflags: '-DCURL_SCHANNEL_DEV_DEBUG', name: 'schannel dev debug' } - { build: 'cmake' , sys: 'mingw64', env: 'x86_64' , tflags: 'skiprun' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DCMAKE_VERBOSE_MAKEFILE=ON', type: 'Debug', cflags: '-DCURL_SCHANNEL_DEV_DEBUG', name: 'schannel dev debug' }
@ -205,6 +207,7 @@ jobs:
libnghttp2-devel libnghttp2-devel
libpsl-devel libpsl-devel
libssh2-devel libssh2-devel
${{ matrix.chkprefill == '_chkprefill' && 'diffutils' || '' }}
- uses: msys2/setup-msys2@d44ca8e88d8b43d56cf5670f91747359d5537f97 # v2 - uses: msys2/setup-msys2@d44ca8e88d8b43d56cf5670f91747359d5537f97 # v2
if: ${{ matrix.sys != 'msys' }} if: ${{ matrix.sys != 'msys' }}
@ -218,6 +221,7 @@ jobs:
mingw-w64-${{ matrix.env }}-libssh2 mingw-w64-${{ matrix.env }}-libssh2
mingw-w64-${{ matrix.env }}-libpsl mingw-w64-${{ matrix.env }}-libpsl
mingw-w64-${{ matrix.env }}-c-ares mingw-w64-${{ matrix.env }}-c-ares
${{ matrix.chkprefill == '_chkprefill' && format('mingw-w64-{0}-diffutils', matrix.env) || '' }}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with: with:
@ -241,20 +245,26 @@ jobs:
fi fi
fi fi
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
if [[ '${{ matrix.env }}' = 'clang'* ]]; then for _chkprefill in '' ${{ matrix.chkprefill }}; do
options='-DCMAKE_C_COMPILER=clang' if [[ '${{ matrix.env }}' = 'clang'* ]]; then
else options='-DCMAKE_C_COMPILER=clang'
options='-DCMAKE_C_COMPILER=gcc' else
options='-DCMAKE_C_COMPILER=gcc'
fi
[ '${{ matrix.sys }}' = 'msys' ] && options+=' -D_CURL_PREFILL=ON'
[ '${{ matrix.test }}' = 'uwp' ] && options+=' -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0'
[ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF'
cmake -B "bld${_chkprefill}" -G Ninja ${options} \
-DCMAKE_C_FLAGS="${{ matrix.cflags }} ${CFLAGS_CMAKE} ${CPPFLAGS}" \
-DCMAKE_BUILD_TYPE='${{ matrix.type }}' \
-DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=30 -DCURL_TEST_BUNDLES=ON \
-DCURL_WERROR=ON \
${{ matrix.config }}
done
if [ -d bld_chkprefill ] && ! diff -u bld/lib/curl_config.h bld_chkprefill/lib/curl_config.h; then
echo '::group::reference configure log'; cat bld_chkprefill/CMakeFiles/CMake*.yaml 2>/dev/null || true; echo '::endgroup::'
false
fi fi
[ '${{ matrix.test }}' = 'uwp' ] && options+=' -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0'
[ '${{ matrix.type }}' = 'Debug' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG='
[ '${{ matrix.type }}' = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE='
cmake -B bld -G Ninja ${options} \
-DCMAKE_C_FLAGS="${{ matrix.cflags }} ${CFLAGS_CMAKE} ${CPPFLAGS}" \
-DCMAKE_BUILD_TYPE='${{ matrix.type }}' \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
-DCURL_WERROR=ON \
${{ matrix.config }}
else else
export CFLAGS CPPFLAGS export CFLAGS CPPFLAGS
mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
@ -277,9 +287,9 @@ jobs:
timeout-minutes: 10 timeout-minutes: 10
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --config '${{ matrix.type }}' cmake --build bld
else else
make -C bld -j5 V=1 install make -C bld V=1 install
fi fi
- name: 'curl version' - name: 'curl version'
@ -302,9 +312,9 @@ jobs:
timeout-minutes: 10 timeout-minutes: 10
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --config '${{ matrix.type }}' --target testdeps cmake --build bld --target testdeps
else else
make -C bld -j5 V=1 -C tests make -C bld V=1 -C tests
fi fi
if [ '${{ matrix.build }}' != 'cmake' ]; then if [ '${{ matrix.build }}' != 'cmake' ]; then
# avoid libtool's .exe wrappers # avoid libtool's .exe wrappers
@ -338,10 +348,10 @@ jobs:
PATH="$PATH:/c/Program Files (x86)/stunnel/bin" PATH="$PATH:/c/Program Files (x86)/stunnel/bin"
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
PATH="$PWD/bld/lib:$PATH" PATH="$PWD/bld/lib:$PATH"
cmake --build bld --config '${{ matrix.type }}' --target test-ci cmake --build bld --target test-ci
else else
PATH="$PWD/bld/lib/.libs:$PATH" PATH="$PWD/bld/lib/.libs:$PATH"
make -C bld -j5 V=1 test-ci make -C bld V=1 test-ci
fi fi
- name: 'build examples' - name: 'build examples'
@ -349,9 +359,9 @@ jobs:
timeout-minutes: 5 timeout-minutes: 5
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --config '${{ matrix.type }}' --target curl-examples cmake --build bld --target curl-examples
else else
make -C bld -j5 V=1 examples make -C bld V=1 examples
fi fi
mingw-w64-standalone-downloads: mingw-w64-standalone-downloads:
@ -361,6 +371,8 @@ jobs:
defaults: defaults:
run: run:
shell: C:\msys64\usr\bin\bash.exe {0} shell: C:\msys64\usr\bin\bash.exe {0}
env:
MAKEFLAGS: -j 5
strategy: strategy:
matrix: matrix:
include: include:
@ -417,15 +429,21 @@ jobs:
timeout-minutes: 5 timeout-minutes: 5
run: | run: |
PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH" PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
[ '${{ matrix.type }}' = 'Debug' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=' for _chkprefill in '' ${{ matrix.chkprefill }}; do
[ '${{ matrix.type }}' = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=' options=''
cmake -B bld -G 'MSYS Makefiles' ${options} \ [ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF'
-DCMAKE_C_COMPILER=gcc \ cmake -B "bld${_chkprefill}" -G 'MSYS Makefiles' ${options} \
-DCMAKE_BUILD_TYPE='${{ matrix.type }}' \ -DCMAKE_C_COMPILER=gcc \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ -DCMAKE_BUILD_TYPE='${{ matrix.type }}' \
-DCURL_WERROR=ON \ -DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=30 -DCURL_TEST_BUNDLES=ON \
-DCURL_USE_LIBPSL=OFF \ -DCURL_WERROR=ON \
${{ matrix.config }} -DCURL_USE_LIBPSL=OFF \
${{ matrix.config }}
done
if [ -d bld_chkprefill ] && ! diff -u bld/lib/curl_config.h bld_chkprefill/lib/curl_config.h; then
echo '::group::reference configure log'; cat bld_chkprefill/CMakeFiles/CMake*.yaml 2>/dev/null || true; echo '::endgroup::'
false
fi
- name: 'configure log' - name: 'configure log'
if: ${{ !cancelled() }} if: ${{ !cancelled() }}
@ -440,7 +458,7 @@ jobs:
timeout-minutes: 5 timeout-minutes: 5
run: | run: |
PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH" PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
cmake --build bld --config '${{ matrix.type }}' --parallel 5 cmake --build bld
- name: 'curl version' - name: 'curl version'
timeout-minutes: 1 timeout-minutes: 1
@ -454,7 +472,7 @@ jobs:
timeout-minutes: 10 timeout-minutes: 10
run: | run: |
PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH" PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target testdeps cmake --build bld --target testdeps
- name: 'install test prereqs' - name: 'install test prereqs'
if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
@ -464,37 +482,48 @@ jobs:
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 https://live.sysinternals.com/handle64.exe --output /bin/handle64.exe curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 https://live.sysinternals.com/handle64.exe --output /bin/handle64.exe
python3 -m pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary impacket python3 -m pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary impacket
- name: 'downgrade msys2-runtime'
if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
timeout-minutes: 2
# Downgrade to a known good MSYS2 runtime version to avoid the performance regression
# causing runtests.pl to run at 2-3x reduced speed.
run: |
/usr/bin/sed -i 's/^CheckSpace/#CheckSpace/' /etc/pacman.conf
exec /usr/bin/pacman --noconfirm --noprogressbar --upgrade https://mirror.msys2.org/msys/x86_64/msys2-runtime-3.5.4-8-x86_64.pkg.tar.zst
- name: 'run tests' - name: 'run tests'
if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
timeout-minutes: 10 timeout-minutes: 10
run: | run: |
PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH" PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
export TFLAGS='-j4 ~WebSockets ${{ matrix.tflags }}' export TFLAGS='-j8 ~WebSockets ${{ matrix.tflags }}'
if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")" TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
fi fi
PATH="$PWD/bld/lib:$PATH:/c/Program Files (x86)/stunnel/bin" PATH="$PWD/bld/lib:$PATH:/c/Program Files (x86)/stunnel/bin"
cmake --build bld --config '${{ matrix.type }}' --target test-ci cmake --build bld --target test-ci
- name: 'build examples' - name: 'build examples'
timeout-minutes: 5 timeout-minutes: 5
run: | run: |
PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH" PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target curl-examples cmake --build bld --target curl-examples
linux-cross-mingw-w64: linux-cross-mingw-w64:
name: "linux-mingw, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }}" name: "linux-mingw, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }}"
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 15 timeout-minutes: 15
env:
MAKEFLAGS: -j 5
TRIPLET: 'x86_64-w64-mingw32'
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
build: [autotools, cmake] build: [autotools, cmake]
compiler: [gcc] compiler: [gcc]
env:
TRIPLET: 'x86_64-w64-mingw32'
steps: steps:
- name: 'install packages' - name: 'install packages'
timeout-minutes: 5
run: sudo apt-get -o Dpkg::Use-Pty=0 install mingw-w64 ${{ matrix.build == 'cmake' && 'ninja-build' || '' }} run: sudo apt-get -o Dpkg::Use-Pty=0 install mingw-w64 ${{ matrix.build == 'cmake' && 'ninja-build' || '' }}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@ -538,7 +567,7 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld cmake --build bld
else else
make -C bld -j5 make -C bld
fi fi
- name: 'curl info' - name: 'curl info'
@ -550,7 +579,7 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --target testdeps cmake --build bld --target testdeps
else else
make -C bld -j5 -C tests make -C bld -C tests
fi fi
- name: 'build examples' - name: 'build examples'
@ -558,7 +587,114 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --target curl-examples cmake --build bld --target curl-examples
else else
make -C bld -j5 examples make -C bld examples
fi
wince:
name: "mingw32ce, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} 4.4.0-arm schannel"
runs-on: 'macos-latest'
timeout-minutes: 10
env:
MAKEFLAGS: -j 4
toolchain-version: '0.59.1'
strategy:
matrix:
build: [autotools, cmake]
fail-fast: false
steps:
- name: 'install packages'
if: ${{ matrix.build == 'autotools' }}
timeout-minutes: 5
run: |
echo automake libtool | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
while [[ $? == 0 ]]; do for i in 1 2 3; do brew update && brew bundle install --no-lock --file /tmp/Brewfile && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done
- name: 'cache compiler (mingw32ce)'
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
id: cache-compiler
with:
path: ~/opt/mingw32ce
key: ${{ runner.os }}-mingw32ce-${{ env.toolchain-version }}-amd64
- name: 'install compiler (mingw32ce)'
if: ${{ steps.cache-compiler.outputs.cache-hit != 'true' }}
timeout-minutes: 5
run: |
cd "${HOME}" || exit 1
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 3 --retry-connrefused --proto-redir =https \
--location 'https://downloads.sourceforge.net/cegcc/cegcc/${{ env.toolchain-version }}/cegcc_mingw32ce_snowleopard_r1397.tar.bz2' | tar -x
ls -l
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: 'configure'
run: |
PATH="$HOME/opt/mingw32ce/bin:$PATH"
if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake -B bld \
-DCMAKE_SYSTEM_NAME=WindowsCE \
-DCMAKE_SYSTEM_VERSION=8.0 \
-DCMAKE_SYSTEM_PROCESSOR=arm \
-DCMAKE_C_FLAGS='-O3 -DNDEBUG' \
-DCMAKE_C_COMPILER_TARGET=arm-mingw32ce \
-DCMAKE_C_COMPILER=arm-mingw32ce-gcc \
-DCMAKE_RC_COMPILER=arm-mingw32ce-windres \
-DMINGW32CE_LIBRARY_DIR="$HOME/opt/mingw32ce/arm-mingw32ce/lib" \
-DCMAKE_IGNORE_PREFIX_PATH="$(brew --prefix)" \
-DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=50 -DCURL_TEST_BUNDLES=ON \
-DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_STATIC_CURL=OFF \
-DCURL_WERROR=ON \
-DCURL_USE_SCHANNEL=ON \
-DCURL_USE_LIBPSL=OFF
else
autoreconf -fi
mkdir bld && cd bld && ../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
--host=arm-mingw32ce \
--with-schannel \
--without-libpsl \
--disable-shared
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: |
PATH="$HOME/opt/mingw32ce/bin:$PATH"
if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld
else
make -C bld
fi
- name: 'curl info'
run: |
find . \( -name '*.exe' -o -name '*.dll' -o -name '*.a' \) -exec file '{}' \;
- name: 'build tests'
if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
run: |
PATH="$HOME/opt/mingw32ce/bin:$PATH"
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: |
PATH="$HOME/opt/mingw32ce/bin:$PATH"
if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --target curl-examples
else
make -C bld examples
fi fi
msvc: msvc:
@ -574,16 +710,16 @@ jobs:
strategy: strategy:
matrix: matrix:
include: include:
- name: 'schannel MultiSSL U' - name: 'openssl'
install: 'brotli zlib zstd libpsl nghttp2 libssh2[core,zlib] pkgconf gsasl openssl mbedtls wolfssl' install: 'brotli zlib zstd nghttp2 nghttp3 openssl libssh2'
arch: 'x64' arch: 'x64'
plat: 'windows' plat: 'uwp'
type: 'Debug' type: 'Debug'
tflags: '~1516 ~2301 ~2302 ~2303 ~2307 ~2310' tflags: 'skiprun'
config: >- config: >-
-DCURL_USE_LIBSSH2=ON -DCURL_USE_LIBSSH2=ON
-DCURL_USE_SCHANNEL=ON -DCURL_USE_OPENSSL=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_WOLFSSL=ON -DCURL_DEFAULT_SSL_BACKEND=schannel -DCURL_USE_SCHANNEL=OFF -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON
-DCURL_USE_GSASL=ON -DUSE_WIN32_IDN=ON -DENABLE_UNICODE=ON -DUSE_SSLS_EXPORT=ON -DCURL_USE_LIBPSL=OFF
- name: 'openssl' - name: 'openssl'
install: 'brotli zlib zstd libpsl nghttp2 nghttp3 openssl libssh2 pkgconf gsasl c-ares libuv krb5' install: 'brotli zlib zstd libpsl nghttp2 nghttp3 openssl libssh2 pkgconf gsasl c-ares libuv krb5'
@ -596,16 +732,16 @@ jobs:
-DCURL_USE_SCHANNEL=OFF -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON -DCURL_USE_SCHANNEL=OFF -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON
-DCURL_USE_GSASL=ON -DENABLE_ARES=ON -DCURL_USE_LIBUV=ON -DCURL_USE_GSSAPI=ON -DCURL_USE_GSASL=ON -DENABLE_ARES=ON -DCURL_USE_LIBUV=ON -DCURL_USE_GSSAPI=ON
- name: 'openssl' - name: 'schannel MultiSSL U'
install: 'brotli zlib zstd nghttp2 nghttp3 openssl libssh2' install: 'brotli zlib zstd libpsl nghttp2 libssh2[core,zlib] pkgconf gsasl openssl mbedtls wolfssl'
arch: 'x64' arch: 'x64'
plat: 'uwp' plat: 'windows'
type: 'Debug' type: 'Debug'
tflags: 'skiprun' tflags: '~1516 ~2301 ~2302 ~2303 ~2307 ~2310'
config: >- config: >-
-DCURL_USE_LIBSSH2=ON -DCURL_USE_LIBSSH2=ON
-DCURL_USE_SCHANNEL=OFF -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON -DCURL_USE_SCHANNEL=ON -DCURL_USE_OPENSSL=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_WOLFSSL=ON -DCURL_DEFAULT_SSL_BACKEND=schannel
-DCURL_USE_LIBPSL=OFF -DCURL_USE_GSASL=ON -DUSE_WIN32_IDN=ON -DENABLE_UNICODE=ON -DUSE_SSLS_EXPORT=ON
- name: 'libressl' - name: 'libressl'
install: 'brotli zlib zstd libpsl nghttp2 libressl libssh2[core,zlib] pkgconf ngtcp2[libressl] nghttp3' install: 'brotli zlib zstd libpsl nghttp2 libressl libssh2[core,zlib] pkgconf ngtcp2[libressl] nghttp3'
@ -647,6 +783,7 @@ jobs:
plat: 'windows' plat: 'windows'
type: 'Debug' type: 'Debug'
tflags: '~1516' tflags: '~1516'
chkprefill: '_chkprefill'
# WARNING: libssh uses hard-coded world-writable paths (/etc/..., ~/.ssh/) to # WARNING: libssh uses hard-coded world-writable paths (/etc/..., ~/.ssh/) to
# read its configuration from, making it vulnerable to attacks on # read its configuration from, making it vulnerable to attacks on
# Windows. Do not use this component till there is a fix for these. # Windows. Do not use this component till there is a fix for these.
@ -683,28 +820,36 @@ jobs:
timeout-minutes: 5 timeout-minutes: 5
run: | run: |
PATH="/c/msys64/usr/bin:$PATH" PATH="/c/msys64/usr/bin:$PATH"
if [ '${{ matrix.plat }}' = 'uwp' ]; then for _chkprefill in '' ${{ matrix.chkprefill }}; do
options+=' -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0' options=''
cflags='-DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP' if [ '${{ matrix.plat }}' = 'uwp' ]; then
ldflags='-OPT:NOREF -OPT:NOICF -APPCONTAINER:NO' options+=' -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0'
vsglobals=';AppxPackage=false;WindowsAppContainer=false' cflags='-DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP'
ldflags='-OPT:NOREF -OPT:NOICF -APPCONTAINER:NO'
vsglobals=';AppxPackage=false;WindowsAppContainer=false'
fi
[ '${{ matrix.arch }}' = 'arm64' ] && options+=' -A ARM64'
[ '${{ matrix.arch }}' = 'x64' ] && options+=' -A x64'
[ '${{ matrix.arch }}' = 'x86' ] && options+=' -A Win32'
[ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF'
cmake -B "bld${_chkprefill}" ${options} \
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \
-DVCPKG_INSTALLED_DIR="$VCPKG_INSTALLATION_ROOT/installed" \
-DVCPKG_TARGET_TRIPLET='${{ matrix.arch }}-${{ matrix.plat }}' \
-DCMAKE_C_FLAGS="${cflags}" \
-DCMAKE_EXE_LINKER_FLAGS="-INCREMENTAL:NO ${ldflags}" \
-DCMAKE_SHARED_LINKER_FLAGS="-INCREMENTAL:NO ${ldflags}" \
-DCMAKE_VS_GLOBALS="TrackFileAccess=false${vsglobals}" \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
-DCURL_WERROR=ON \
-DBUILD_SHARED_LIBS=OFF \
-DENABLE_DEBUG=ON \
${{ matrix.config }}
done
if [ -d bld_chkprefill ] && ! diff -u bld/lib/curl_config.h bld_chkprefill/lib/curl_config.h; then
echo '::group::reference configure log'; cat bld_chkprefill/CMakeFiles/CMake*.yaml 2>/dev/null || true; echo '::endgroup::'
false
fi fi
cmake -B bld ${options} \
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \
-DVCPKG_INSTALLED_DIR="$VCPKG_INSTALLATION_ROOT/installed" \
-DVCPKG_TARGET_TRIPLET='${{ matrix.arch }}-${{ matrix.plat }}' \
-DCMAKE_C_FLAGS="${cflags}" \
-DCMAKE_EXE_LINKER_FLAGS="-INCREMENTAL:NO ${ldflags}" \
-DCMAKE_SHARED_LINKER_FLAGS="-INCREMENTAL:NO ${ldflags}" \
-DCMAKE_VS_GLOBALS="TrackFileAccess=false${vsglobals}" \
-DCMAKE_BUILD_TYPE='${{ matrix.type }}' \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
-DCURL_WERROR=ON \
-DBUILD_SHARED_LIBS=OFF \
-DENABLE_DEBUG=ON \
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE= \
${{ matrix.config }}
- name: 'configure log' - name: 'configure log'
if: ${{ !cancelled() }} if: ${{ !cancelled() }}
@ -724,10 +869,10 @@ jobs:
- name: 'curl version' - name: 'curl version'
timeout-minutes: 1 timeout-minutes: 1
run: | run: |
PATH=/usr/bin find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' \) -exec file '{}' \; PATH=/usr/bin find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' -o -name '*.pdb' \) -exec file '{}' \;
if [ '${{ matrix.plat }}' != 'uwp' ]; then # Missing: ucrtbased.dll, VCRUNTIME140D.dll, VCRUNTIME140D_APP.dll if [ '${{ matrix.plat }}' != 'uwp' ]; then # Missing: ucrtbased.dll, VCRUNTIME140D.dll, VCRUNTIME140D_APP.dll
PATH="$PWD/bld/lib:$PATH" PATH="$PWD/bld/lib/${{ matrix.type }}:$PATH"
bld/src/curl.exe --disable --version 'bld/src/${{ matrix.type }}/curl.exe' --disable --version
fi fi
- name: 'build tests' - name: 'build tests'
@ -749,17 +894,27 @@ jobs:
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 https://live.sysinternals.com/handle64.exe --output /bin/handle64.exe curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 https://live.sysinternals.com/handle64.exe --output /bin/handle64.exe
python3 -m pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary impacket python3 -m pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary impacket
- name: 'downgrade msys2-runtime'
if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
timeout-minutes: 2
# Downgrade to a known good MSYS2 runtime version to avoid the performance regression
# causing runtests.pl to run at 2-3x reduced speed.
run: |
/usr/bin/sed -i 's/^CheckSpace/#CheckSpace/' /etc/pacman.conf
exec /usr/bin/pacman --noconfirm --noprogressbar --upgrade https://mirror.msys2.org/msys/x86_64/msys2-runtime-3.5.4-8-x86_64.pkg.tar.zst
- name: 'run tests' - name: 'run tests'
if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
timeout-minutes: 10 timeout-minutes: 10
run: | run: |
export CURL_DIRSUFFIX='${{ matrix.type }}'
export TFLAGS='-j8 ~WebSockets ~SCP ~612 ${{ matrix.tflags }}' export TFLAGS='-j8 ~WebSockets ~SCP ~612 ${{ matrix.tflags }}'
if [[ '${{ matrix.install }}' = *'libssh2[core,zlib]'* ]]; then if [[ '${{ matrix.install }}' = *'libssh2[core,zlib]'* ]]; then
TFLAGS+=' ~SFTP' TFLAGS+=' ~SFTP'
elif [[ '${{ matrix.install }}' = *'libssh '* ]]; then elif [[ '${{ matrix.install }}' = *'libssh '* ]]; then
TFLAGS+=' ~614' # 'SFTP pre-quote chmod' SFTP, pre-quote, directory TFLAGS+=' ~614' # 'SFTP pre-quote chmod' SFTP, pre-quote, directory
fi fi
PATH="$PWD/bld/lib:$PATH:/c/Program Files (x86)/stunnel/bin:/c/Program Files/OpenSSH-Win64" PATH="$PWD/bld/lib/${{ matrix.type }}:$PATH:/c/Program Files (x86)/stunnel/bin:/c/Program Files/OpenSSH-Win64"
PATH="/c/msys64/usr/bin:$PATH" PATH="/c/msys64/usr/bin:$PATH"
cmake --build bld --config '${{ matrix.type }}' --target test-ci cmake --build bld --config '${{ matrix.type }}' --target test-ci

View File

@ -29,7 +29,7 @@ if(WIN32 AND (ENABLE_DEBUG OR ENABLE_CURLDEBUG))
# e.g. curl_easy_perform_ev() or curl_dbg_*(), # e.g. curl_easy_perform_ev() or curl_dbg_*(),
# so disable symbol hiding for debug builds and for memory tracking. # so disable symbol hiding for debug builds and for memory tracking.
set(CURL_HIDDEN_SYMBOLS OFF) set(CURL_HIDDEN_SYMBOLS OFF)
elseif(DOS OR AMIGA) elseif(DOS OR AMIGA OR MINGW32CE)
set(CURL_HIDDEN_SYMBOLS OFF) set(CURL_HIDDEN_SYMBOLS OFF)
endif() endif()

View File

@ -30,14 +30,14 @@
/* */ /* */
#if defined(sun) || defined(__sun__) || \ #if defined(sun) || defined(__sun__) || \
defined(__SUNPRO_C) || defined(__SUNPRO_CC) defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# if defined(__SVR4) || defined(__srv4__) # if defined(__SVR4) || defined(__srv4__)
# define PLATFORM_SOLARIS # define PLATFORM_SOLARIS
# else # else
# define PLATFORM_SUNOS4 # define PLATFORM_SUNOS4
# endif # endif
#endif #endif
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41) #if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41)
# define PLATFORM_AIX_V3 # define PLATFORM_AIX_V3
#endif #endif
/* */ /* */
#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) #if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3)
@ -55,72 +55,52 @@ int main(void)
#endif #endif
/* tests for gethostbyname_r */ /* tests for gethostbyname_r */
#if defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT) || \
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT) || \
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
# define _REENTRANT
/* no idea whether _REENTRANT is always set, just invent a new flag */
# define TEST_GETHOSTBYFOO_REENTRANT
#endif
#if defined(HAVE_GETHOSTBYNAME_R_3) || \ #if defined(HAVE_GETHOSTBYNAME_R_3) || \
defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT) || \
defined(HAVE_GETHOSTBYNAME_R_5) || \ defined(HAVE_GETHOSTBYNAME_R_5) || \
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT) || \
defined(HAVE_GETHOSTBYNAME_R_6) || \ defined(HAVE_GETHOSTBYNAME_R_6) || \
defined(TEST_GETHOSTBYFOO_REENTRANT) defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
#include <sys/types.h> #include <sys/types.h>
#include <netdb.h> #include <netdb.h>
int main(void) int main(void)
{ {
char *address = "example.com"; const char *address = "example.com";
int length = 0;
int type = 0;
struct hostent h; struct hostent h;
int rc = 0; int rc = 0;
#if defined(HAVE_GETHOSTBYNAME_R_3) || \ #if defined(HAVE_GETHOSTBYNAME_R_3) || \
defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT) defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT)
struct hostent_data hdata; struct hostent_data hdata;
#elif defined(HAVE_GETHOSTBYNAME_R_5) || \ #elif defined(HAVE_GETHOSTBYNAME_R_5) || \
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT) || \ defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT) || \
defined(HAVE_GETHOSTBYNAME_R_6) || \ defined(HAVE_GETHOSTBYNAME_R_6) || \
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT) defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
char buffer[8192]; char buffer[8192];
int h_errnop;
struct hostent *hp; struct hostent *hp;
int h_errnop;
#endif #endif
#if defined(HAVE_GETHOSTBYNAME_R_3) || \ #if defined(HAVE_GETHOSTBYNAME_R_3) || \
defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT) defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT)
rc = gethostbyname_r(address, &h, &hdata); rc = gethostbyname_r(address, &h, &hdata);
(void)hdata;
#elif defined(HAVE_GETHOSTBYNAME_R_5) || \ #elif defined(HAVE_GETHOSTBYNAME_R_5) || \
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT) defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT)
rc = gethostbyname_r(address, &h, buffer, 8192, &h_errnop); rc = gethostbyname_r(address, &h, buffer, 8192, &h_errnop);
(void)hp; /* not used for test */ (void)hp; /* not used for test */
(void)h_errnop;
#elif defined(HAVE_GETHOSTBYNAME_R_6) || \ #elif defined(HAVE_GETHOSTBYNAME_R_6) || \
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT) defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
rc = gethostbyname_r(address, &h, buffer, 8192, &hp, &h_errnop); rc = gethostbyname_r(address, &h, buffer, 8192, &hp, &h_errnop);
(void)hp;
(void)h_errnop;
#endif #endif
(void)h;
(void)length;
(void)type;
(void)rc; (void)rc;
return 0; return 0;
} }
#endif #endif
#ifdef HAVE_IN_ADDR_T
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
int main(void)
{
if((in_addr_t *) 0)
return 0;
if(sizeof(in_addr_t))
return 0;
;
return 0;
}
#endif
#ifdef HAVE_BOOL_T #ifdef HAVE_BOOL_T
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
@ -130,10 +110,7 @@ int main(void)
#endif #endif
int main(void) int main(void)
{ {
if(sizeof(bool *)) return (int)sizeof(bool *);
return 0;
;
return 0;
} }
#endif #endif
@ -146,18 +123,20 @@ int main(void) { return 0; }
#endif #endif
#ifdef HAVE_FILE_OFFSET_BITS #ifdef HAVE_FILE_OFFSET_BITS
#undef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64
#include <sys/types.h> #include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly. /* Check that off_t can represent 2**63 - 1 correctly.
We cannot simply define LARGE_OFF_T to be 9223372036854775807, We cannot simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */ 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))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 static int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 &&
&& LARGE_OFF_T % 2147483647 == 1) LARGE_OFF_T % 2147483647 == 1)
? 1 : -1]; ? 1 : -1];
int main(void) { return 0; } int main(void)
{
(void)off_t_is_large;
return 0;
}
#endif #endif
#ifdef HAVE_IOCTLSOCKET #ifdef HAVE_IOCTLSOCKET
@ -167,9 +146,9 @@ int main(void) { return 0; }
int main(void) int main(void)
{ {
/* ioctlsocket source code */ /* ioctlsocket source code */
int socket; int socket = -1;
unsigned long flags = ioctlsocket(socket, FIONBIO, &flags); unsigned long flags = ioctlsocket(socket, FIONBIO, &flags);
; (void)flags;
return 0; return 0;
} }
@ -182,7 +161,6 @@ int main(void)
/* IoctlSocket source code */ /* IoctlSocket source code */
if(0 != IoctlSocket(0, 0, 0)) if(0 != IoctlSocket(0, 0, 0))
return 1; return 1;
;
return 0; return 0;
} }
#endif #endif
@ -198,7 +176,7 @@ int main(void)
long flags = 0; long flags = 0;
if(0 != IoctlSocket(0, FIONBIO, &flags)) if(0 != IoctlSocket(0, FIONBIO, &flags))
return 1; return 1;
; (void)flags;
return 0; return 0;
} }
#endif #endif
@ -212,7 +190,7 @@ int main(void)
unsigned long flags = 0; unsigned long flags = 0;
if(0 != ioctlsocket(0, FIONBIO, &flags)) if(0 != ioctlsocket(0, FIONBIO, &flags))
return 1; return 1;
; (void)flags;
return 0; return 0;
} }
#endif #endif
@ -239,7 +217,7 @@ int main(void)
int flags = 0; int flags = 0;
if(0 != ioctl(0, FIONBIO, &flags)) if(0 != ioctl(0, FIONBIO, &flags))
return 1; return 1;
; (void)flags;
return 0; return 0;
} }
#endif #endif
@ -267,7 +245,7 @@ int main(void)
struct ifreq ifr; struct ifreq ifr;
if(0 != ioctl(0, SIOCGIFADDR, &ifr)) if(0 != ioctl(0, SIOCGIFADDR, &ifr))
return 1; return 1;
; (void)ifr;
return 0; return 0;
} }
#endif #endif
@ -286,7 +264,6 @@ int main(void)
{ {
if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0)) if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0))
return 1; return 1;
;
return 0; return 0;
} }
#endif #endif
@ -295,7 +272,7 @@ int main(void)
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
void check(char c) {} static void check(char c) { (void)c; }
int main(void) int main(void)
{ {
@ -311,7 +288,7 @@ int main(void)
#include <errno.h> #include <errno.h>
/* Float, because a pointer cannot be implicitly cast to float */ /* Float, because a pointer cannot be implicitly cast to float */
void check(float f) {} static void check(float f) { (void)f; }
int main(void) int main(void)
{ {
@ -335,7 +312,7 @@ int main(void)
#include <sys/xattr.h> /* header from libc, not from libattr */ #include <sys/xattr.h> /* header from libc, not from libattr */
int main(void) int main(void)
{ {
fsetxattr(0, 0, 0, 0, 0); fsetxattr(0, "", 0, 0, 0);
return 0; return 0;
} }
#endif #endif
@ -344,8 +321,9 @@ int main(void)
#include <time.h> #include <time.h>
int main(void) int main(void)
{ {
struct timespec ts = {0, 0}; struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts); (void)clock_gettime(CLOCK_MONOTONIC, &ts);
(void)ts;
return 0; return 0;
} }
#endif #endif

View File

@ -51,6 +51,7 @@ if(CURL_USE_PKGCONFIG AND
endif() endif()
if(BROTLI_FOUND AND BROTLIDEC_FOUND) if(BROTLI_FOUND AND BROTLIDEC_FOUND)
set(Brotli_FOUND TRUE)
list(APPEND BROTLIDEC_LIBRARIES ${BROTLI_LIBRARIES}) # order is significant: brotlidec then brotlicommon list(APPEND BROTLIDEC_LIBRARIES ${BROTLI_LIBRARIES}) # order is significant: brotlidec then brotlicommon
list(REVERSE BROTLIDEC_LIBRARIES) list(REVERSE BROTLIDEC_LIBRARIES)
list(REMOVE_DUPLICATES BROTLIDEC_LIBRARIES) list(REMOVE_DUPLICATES BROTLIDEC_LIBRARIES)

View File

@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
endif() endif()
if(CARES_FOUND) if(CARES_FOUND)
set(Cares_FOUND TRUE)
string(REPLACE ";" " " CARES_CFLAGS "${CARES_CFLAGS}") string(REPLACE ";" " " CARES_CFLAGS "${CARES_CFLAGS}")
message(STATUS "Found Cares (via pkg-config): ${CARES_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")") message(STATUS "Found Cares (via pkg-config): ${CARES_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")")
else() else()

View File

@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
endif() endif()
if(LIBGSASL_FOUND) if(LIBGSASL_FOUND)
set(Libgsasl_FOUND TRUE)
string(REPLACE ";" " " LIBGSASL_CFLAGS "${LIBGSASL_CFLAGS}") string(REPLACE ";" " " LIBGSASL_CFLAGS "${LIBGSASL_CFLAGS}")
message(STATUS "Found Libgsasl (via pkg-config): ${LIBGSASL_INCLUDE_DIRS} (found version \"${LIBGSASL_VERSION}\")") message(STATUS "Found Libgsasl (via pkg-config): ${LIBGSASL_INCLUDE_DIRS} (found version \"${LIBGSASL_VERSION}\")")
else() else()

View File

@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
endif() endif()
if(LIBIDN2_FOUND) if(LIBIDN2_FOUND)
set(Libidn2_FOUND TRUE)
string(REPLACE ";" " " LIBIDN2_CFLAGS "${LIBIDN2_CFLAGS}") string(REPLACE ";" " " LIBIDN2_CFLAGS "${LIBIDN2_CFLAGS}")
message(STATUS "Found Libidn2 (via pkg-config): ${LIBIDN2_INCLUDE_DIRS} (found version \"${LIBIDN2_VERSION}\")") message(STATUS "Found Libidn2 (via pkg-config): ${LIBIDN2_INCLUDE_DIRS} (found version \"${LIBIDN2_VERSION}\")")
else() else()

View File

@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
endif() 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}") string(REPLACE ";" " " LIBPSL_CFLAGS "${LIBPSL_CFLAGS}")
message(STATUS "Found Libpsl (via pkg-config): ${LIBPSL_INCLUDE_DIRS} (found version \"${LIBPSL_VERSION}\")") message(STATUS "Found Libpsl (via pkg-config): ${LIBPSL_INCLUDE_DIRS} (found version \"${LIBPSL_VERSION}\")")
else() else()

View File

@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
endif() endif()
if(LIBRTMP_FOUND AND LIBRTMP_INCLUDE_DIRS) if(LIBRTMP_FOUND AND LIBRTMP_INCLUDE_DIRS)
set(Librtmp_FOUND TRUE)
string(REPLACE ";" " " LIBRTMP_CFLAGS "${LIBRTMP_CFLAGS}") string(REPLACE ";" " " LIBRTMP_CFLAGS "${LIBRTMP_CFLAGS}")
message(STATUS "Found Librtmp (via pkg-config): ${LIBRTMP_INCLUDE_DIRS} (found version \"${LIBRTMP_VERSION}\")") message(STATUS "Found Librtmp (via pkg-config): ${LIBRTMP_INCLUDE_DIRS} (found version \"${LIBRTMP_VERSION}\")")
else() else()

View File

@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
endif() endif()
if(LIBSSH_FOUND) if(LIBSSH_FOUND)
set(Libssh_FOUND TRUE)
string(REPLACE ";" " " LIBSSH_CFLAGS "${LIBSSH_CFLAGS}") string(REPLACE ";" " " LIBSSH_CFLAGS "${LIBSSH_CFLAGS}")
message(STATUS "Found Libssh (via pkg-config): ${LIBSSH_INCLUDE_DIRS} (found version \"${LIBSSH_VERSION}\")") message(STATUS "Found Libssh (via pkg-config): ${LIBSSH_INCLUDE_DIRS} (found version \"${LIBSSH_VERSION}\")")
else() else()

View File

@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
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}") string(REPLACE ";" " " LIBSSH2_CFLAGS "${LIBSSH2_CFLAGS}")
message(STATUS "Found Libssh2 (via pkg-config): ${LIBSSH2_INCLUDE_DIRS} (found version \"${LIBSSH2_VERSION}\")") message(STATUS "Found Libssh2 (via pkg-config): ${LIBSSH2_INCLUDE_DIRS} (found version \"${LIBSSH2_VERSION}\")")
else() else()

View File

@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
endif() endif()
if(LIBUV_FOUND) if(LIBUV_FOUND)
set(Libuv_FOUND TRUE)
string(REPLACE ";" " " LIBUV_CFLAGS "${LIBUV_CFLAGS}") string(REPLACE ";" " " LIBUV_CFLAGS "${LIBUV_CFLAGS}")
message(STATUS "Found Libuv (via pkg-config): ${LIBUV_INCLUDE_DIRS} (found version \"${LIBUV_VERSION}\")") message(STATUS "Found Libuv (via pkg-config): ${LIBUV_INCLUDE_DIRS} (found version \"${LIBUV_VERSION}\")")
else() else()

View File

@ -60,6 +60,7 @@ if(CURL_USE_PKGCONFIG AND
endif() endif()
if(MBEDTLS_FOUND AND MBEDX509_FOUND AND MBEDCRYPTO_FOUND) if(MBEDTLS_FOUND AND MBEDX509_FOUND AND MBEDCRYPTO_FOUND)
set(MbedTLS_FOUND TRUE)
list(APPEND MBEDTLS_LIBRARIES ${MBEDX509_LIBRARIES} ${MBEDCRYPTO_LIBRARIES}) list(APPEND MBEDTLS_LIBRARIES ${MBEDX509_LIBRARIES} ${MBEDCRYPTO_LIBRARIES})
list(REVERSE MBEDTLS_LIBRARIES) list(REVERSE MBEDTLS_LIBRARIES)
list(REMOVE_DUPLICATES MBEDTLS_LIBRARIES) list(REMOVE_DUPLICATES MBEDTLS_LIBRARIES)

View File

@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
endif() endif()
if(NETTLE_FOUND) if(NETTLE_FOUND)
set(Nettle_FOUND TRUE)
string(REPLACE ";" " " NETTLE_CFLAGS "${NETTLE_CFLAGS}") string(REPLACE ";" " " NETTLE_CFLAGS "${NETTLE_CFLAGS}")
message(STATUS "Found Nettle (via pkg-config): ${NETTLE_INCLUDE_DIRS} (found version \"${NETTLE_VERSION}\")") message(STATUS "Found Nettle (via pkg-config): ${NETTLE_INCLUDE_DIRS} (found version \"${NETTLE_VERSION}\")")
else() else()

View File

@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
endif() endif()
if(QUICHE_FOUND) if(QUICHE_FOUND)
set(Quiche_FOUND TRUE)
string(REPLACE ";" " " QUICHE_CFLAGS "${QUICHE_CFLAGS}") string(REPLACE ";" " " QUICHE_CFLAGS "${QUICHE_CFLAGS}")
message(STATUS "Found Quiche (via pkg-config): ${QUICHE_INCLUDE_DIRS} (found version \"${QUICHE_VERSION}\")") message(STATUS "Found Quiche (via pkg-config): ${QUICHE_INCLUDE_DIRS} (found version \"${QUICHE_VERSION}\")")
else() else()

View File

@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
endif() endif()
if(RUSTLS_FOUND) if(RUSTLS_FOUND)
set(Rustls_FOUND TRUE)
string(REPLACE ";" " " RUSTLS_CFLAGS "${RUSTLS_CFLAGS}") string(REPLACE ";" " " RUSTLS_CFLAGS "${RUSTLS_CFLAGS}")
message(STATUS "Found Rustls (via pkg-config): ${RUSTLS_INCLUDE_DIRS} (found version \"${RUSTLS_VERSION}\")") message(STATUS "Found Rustls (via pkg-config): ${RUSTLS_INCLUDE_DIRS} (found version \"${RUSTLS_VERSION}\")")
else() else()

View File

@ -57,6 +57,7 @@ if(CURL_USE_PKGCONFIG AND
endif() endif()
if(WOLFSSL_FOUND) if(WOLFSSL_FOUND)
set(WolfSSL_FOUND TRUE)
string(REPLACE ";" " " WOLFSSL_CFLAGS "${WOLFSSL_CFLAGS}") string(REPLACE ";" " " WOLFSSL_CFLAGS "${WOLFSSL_CFLAGS}")
message(STATUS "Found WolfSSL (via pkg-config): ${WOLFSSL_INCLUDE_DIRS} (found version \"${WOLFSSL_VERSION}\")") message(STATUS "Found WolfSSL (via pkg-config): ${WOLFSSL_INCLUDE_DIRS} (found version \"${WOLFSSL_VERSION}\")")
else() else()

View File

@ -57,6 +57,7 @@ if(CURL_USE_PKGCONFIG AND
endif() endif()
if(ZSTD_FOUND) if(ZSTD_FOUND)
set(Zstd_FOUND TRUE)
string(REPLACE ";" " " ZSTD_CFLAGS "${ZSTD_CFLAGS}") string(REPLACE ";" " " ZSTD_CFLAGS "${ZSTD_CFLAGS}")
message(STATUS "Found Zstd (via pkg-config): ${ZSTD_INCLUDE_DIRS} (found version \"${ZSTD_VERSION}\")") message(STATUS "Found Zstd (via pkg-config): ${ZSTD_INCLUDE_DIRS} (found version \"${ZSTD_VERSION}\")")
else() else()

View File

@ -34,11 +34,14 @@ macro(check_include_file_concat_curl _file _variable)
endif() endif()
endmacro() endmacro()
set(CURL_TEST_DEFINES "") # Initialize global variable
# For other curl specific tests, use this macro. # For other curl specific tests, use this macro.
# Return result in variable: CURL_TEST_OUTPUT # Return result in variable: CURL_TEST_OUTPUT
macro(curl_internal_test _curl_test) macro(curl_internal_test _curl_test)
if(NOT DEFINED "${_curl_test}") if(NOT DEFINED "${_curl_test}")
string(REPLACE ";" " " _cmake_required_definitions "${CMAKE_REQUIRED_DEFINITIONS}") string(REPLACE ";" " " _cmake_required_definitions "${CMAKE_REQUIRED_DEFINITIONS}")
set(_curl_test_add_libraries "")
if(CMAKE_REQUIRED_LIBRARIES) if(CMAKE_REQUIRED_LIBRARIES)
set(_curl_test_add_libraries set(_curl_test_add_libraries
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
@ -84,3 +87,10 @@ macro(curl_required_libpaths _libpaths_arg)
list(APPEND CMAKE_REQUIRED_LINK_DIRECTORIES "${_libpaths_arg}") list(APPEND CMAKE_REQUIRED_LINK_DIRECTORIES "${_libpaths_arg}")
endif() endif()
endmacro() endmacro()
# Pre-fill variables set by a check_type_size() call.
macro(curl_prefill_type_size _type _size)
set(HAVE_SIZEOF_${_type} TRUE)
set(SIZEOF_${_type} ${_size})
set(SIZEOF_${_type}_CODE "#define SIZEOF_${_type} ${_size}")
endmacro()

View File

@ -65,6 +65,9 @@ endif()
set(_source_epilogue "#undef inline") set(_source_epilogue "#undef inline")
curl_add_header_include(HAVE_SYS_TIME_H "sys/time.h") curl_add_header_include(HAVE_SYS_TIME_H "sys/time.h")
check_c_source_compiles("${_source_epilogue} check_c_source_compiles("${_source_epilogue}
#ifdef _MSC_VER
#include <winsock2.h>
#endif
#include <time.h> #include <time.h>
int main(void) int main(void)
{ {
@ -104,11 +107,10 @@ if(NOT DEFINED HAVE_GETADDRINFO_THREADSAFE)
check_c_source_compiles("${_source_epilogue} check_c_source_compiles("${_source_epilogue}
int main(void) int main(void)
{ {
#ifdef h_errno #ifndef h_errno
return 0;
#else
#error force compilation error #error force compilation error
#endif #endif
return 0;
}" HAVE_H_ERRNO) }" HAVE_H_ERRNO)
if(NOT HAVE_H_ERRNO) if(NOT HAVE_H_ERRNO)
@ -124,12 +126,11 @@ if(NOT DEFINED HAVE_GETADDRINFO_THREADSAFE)
int main(void) int main(void)
{ {
#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L) #if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
return 0;
#elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700) #elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700)
return 0;
#else #else
#error force compilation error #error force compilation error
#endif #endif
return 0;
}" HAVE_H_ERRNO_SBS_ISSUE_7) }" HAVE_H_ERRNO_SBS_ISSUE_7)
endif() endif()
endif() endif()

View File

@ -44,6 +44,15 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
list(APPEND _picky "-Werror-implicit-function-declaration") # clang 1.0 gcc 2.95 list(APPEND _picky "-Werror-implicit-function-declaration") # clang 1.0 gcc 2.95
endif() endif()
if(MSVC)
if(CMAKE_C_FLAGS MATCHES "[/-]W[0-4]")
string(REGEX REPLACE "[/-]W[0-4]" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
endif()
list(APPEND _picky "-W4")
elseif(BORLAND)
list(APPEND _picky "-w-") # Disable warnings on Borland to avoid changing 3rd party code.
endif()
if(PICKY_COMPILER) if(PICKY_COMPILER)
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
@ -113,6 +122,7 @@ if(PICKY_COMPILER)
-Wtype-limits # clang 2.7 gcc 4.3 -Wtype-limits # clang 2.7 gcc 4.3
-Wunreachable-code # clang 2.7 gcc 4.1 -Wunreachable-code # clang 2.7 gcc 4.1
# -Wunused-macros # clang 2.7 gcc 4.1 # Not practical # -Wunused-macros # clang 2.7 gcc 4.1 # Not practical
# -Wno-error=unused-macros # clang 2.7 gcc 4.1
-Wunused-parameter # clang 2.7 gcc 4.1 -Wunused-parameter # clang 2.7 gcc 4.1
-Wvla # clang 2.8 gcc 4.3 -Wvla # clang 2.8 gcc 4.3
) )
@ -172,12 +182,19 @@ if(PICKY_COMPILER)
-Wold-style-declaration # gcc 4.3 -Wold-style-declaration # gcc 4.3
-Wpragmas # clang 3.5 gcc 4.1 appleclang 6.0 -Wpragmas # clang 3.5 gcc 4.1 appleclang 6.0
-Wstrict-aliasing=3 # gcc 4.0 -Wstrict-aliasing=3 # gcc 4.0
-ftree-vrp # gcc 4.3 (required for -Warray-bounds, included in -Wall)
) )
endif() endif()
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5 AND MINGW) if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
list(APPEND _picky_enable list(APPEND _picky_enable
-Wno-pedantic-ms-format # gcc 4.5 (MinGW-only) -Wjump-misses-init # gcc 4.5
) )
if(MINGW)
list(APPEND _picky_enable
-Wno-pedantic-ms-format # gcc 4.5 (MinGW-only)
)
endif()
endif() endif()
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8) if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
list(APPEND _picky_enable list(APPEND _picky_enable
@ -188,7 +205,7 @@ if(PICKY_COMPILER)
endif() endif()
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
list(APPEND _picky_enable list(APPEND _picky_enable
-Warray-bounds=2 -ftree-vrp # clang 3.0 gcc 5.0 (clang default: -Warray-bounds) -Warray-bounds=2 # clang 3.0 gcc 5.0 (clang default: -Warray-bounds)
) )
endif() endif()
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0) if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0)
@ -252,6 +269,9 @@ if(PICKY_COMPILER)
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.3 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8) if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.3 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
list(APPEND _picky "-Wno-type-limits") # Avoid false positives list(APPEND _picky "-Wno-type-limits") # Avoid false positives
endif() endif()
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 5.5)
list(APPEND _picky "-Wno-conversion") # Avoid false positives
endif()
endif() endif()
endif() endif()
endif() endif()
@ -274,6 +294,6 @@ endif()
if(_picky) if(_picky)
string(REPLACE ";" " " _picky "${_picky}") string(REPLACE ";" " " _picky "${_picky}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_picky}") string(APPEND CMAKE_C_FLAGS " ${_picky}")
message(STATUS "Picky compiler options: ${_picky}") message(STATUS "Picky compiler options: ${_picky}")
endif() endif()

View File

@ -47,7 +47,7 @@ function(curl_dumpvars)
if(_var_advanced) if(_var_advanced)
set(_var_advanced " [adv]") set(_var_advanced " [adv]")
endif() endif()
message("${_var}${_var_type}${_var_advanced} = ${${_var}}") message("${_var}${_var_type}${_var_advanced} = '${${_var}}'")
endforeach() endforeach()
message("::endgroup::") message("::endgroup::")
endfunction() endfunction()

311
CMake/unix-cache.cmake Normal file
View File

@ -0,0 +1,311 @@
#***************************************************************************
# _ _ ____ _
# 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
#
###########################################################################
# Based on CI runs for Cygwin/MSYS2, Linux, macOS, FreeBSD, NetBSD, OpenBSD
if(NOT UNIX)
message(FATAL_ERROR "This file should be included on Unix platforms only")
endif()
set(HAVE_ALARM 1)
if(ANDROID)
set(HAVE_ARC4RANDOM 1)
else()
set(HAVE_ARC4RANDOM 0)
endif()
set(HAVE_ARPA_INET_H 1)
set(HAVE_ATOMIC 1)
set(HAVE_BASENAME 1)
set(HAVE_BOOL_T 1)
if(NOT APPLE)
set(HAVE_CLOCK_GETTIME_MONOTONIC 1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_CLOCK_GETTIME_MONOTONIC_RAW 1)
else()
set(HAVE_CLOCK_GETTIME_MONOTONIC_RAW 0)
endif()
endif()
set(HAVE_CLOSESOCKET 0)
set(HAVE_DECL_FSEEKO 1)
set(HAVE_DIRENT_H 1)
if(APPLE OR
CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_EVENTFD 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
set(HAVE_EVENTFD 1)
endif()
set(HAVE_FCNTL 1)
set(HAVE_FCNTL_H 1)
set(HAVE_FCNTL_O_NONBLOCK 1)
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(HAVE_FILE_OFFSET_BITS 0)
else()
set(HAVE_FILE_OFFSET_BITS 1)
endif()
set(HAVE_FNMATCH 1)
set(HAVE_FREEADDRINFO 1)
set(HAVE_FSEEKO 1)
if(APPLE)
set(HAVE_FSETXATTR 1)
set(HAVE_FSETXATTR_5 0)
set(HAVE_FSETXATTR_6 1)
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_FSETXATTR 0)
set(HAVE_FSETXATTR_5 0)
set(HAVE_FSETXATTR_6 0)
elseif(CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
set(HAVE_FSETXATTR 1)
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)
elseif(CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
set(HAVE_GETADDRINFO_THREADSAFE 1)
endif()
set(HAVE_GETEUID 1)
if(APPLE OR
CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_GETHOSTBYNAME_R 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(HAVE_GETHOSTBYNAME_R 1)
endif()
set(HAVE_GETHOSTBYNAME_R_3 0)
set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
set(HAVE_GETHOSTBYNAME_R_5 0)
set(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_GETHOSTBYNAME_R_6 1)
set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 1)
else()
set(HAVE_GETHOSTBYNAME_R_6 0)
set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)
endif()
set(HAVE_GETHOSTNAME 1)
if(NOT ANDROID OR ANDROID_PLATFORM_LEVEL GREATER_EQUAL 24)
set(HAVE_GETIFADDRS 1)
else()
set(HAVE_GETIFADDRS 0)
endif()
if(APPLE OR
CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_GETPASS_R 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
set(HAVE_GETPASS_R 1)
endif()
set(HAVE_GETPEERNAME 1)
set(HAVE_GETPPID 1)
set(HAVE_GETPWUID 1)
set(HAVE_GETPWUID_R 1)
set(HAVE_GETRLIMIT 1)
set(HAVE_GETSOCKNAME 1)
set(HAVE_GETTIMEOFDAY 1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_GLIBC_STRERROR_R 1)
else()
set(HAVE_GLIBC_STRERROR_R 0)
endif()
set(HAVE_GMTIME_R 1)
set(HAVE_IFADDRS_H 1)
set(HAVE_IF_NAMETOINDEX 1)
set(HAVE_INET_NTOP 1)
set(HAVE_INET_PTON 1)
set(HAVE_IOCTLSOCKET 0)
set(HAVE_IOCTLSOCKET_CAMEL 0)
set(HAVE_IOCTLSOCKET_CAMEL_FIONBIO 0)
set(HAVE_IOCTLSOCKET_FIONBIO 0)
set(HAVE_IOCTL_FIONBIO 1)
set(HAVE_IOCTL_SIOCGIFADDR 1)
if(CYGWIN)
set(HAVE_IO_H 1)
else()
set(HAVE_IO_H 0)
endif()
set(HAVE_LIBGEN_H 1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_LINUX_TCP_H 1)
else()
set(HAVE_LINUX_TCP_H 0)
endif()
set(HAVE_LOCALE_H 1)
set(HAVE_LONGLONG 1)
if(APPLE)
set(HAVE_MACH_ABSOLUTE_TIME 1)
endif()
if(APPLE OR
CYGWIN)
set(HAVE_MEMRCHR 0)
else()
set(HAVE_MEMRCHR 1)
endif()
set(HAVE_MSG_NOSIGNAL 1)
set(HAVE_NETDB_H 1)
if(ANDROID)
set(HAVE_NETINET_IN6_H 1)
else()
set(HAVE_NETINET_IN6_H 0)
endif()
set(HAVE_NETINET_IN_H 1)
set(HAVE_NETINET_TCP_H 1)
set(HAVE_NETINET_UDP_H 1)
set(HAVE_NET_IF_H 1)
set(HAVE_OPENDIR 1)
set(HAVE_PIPE 1)
set(HAVE_POLL 1)
set(HAVE_POLL_H 1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_POSIX_STRERROR_R 0)
else()
set(HAVE_POSIX_STRERROR_R 1)
endif()
set(HAVE_PWD_H 1)
set(HAVE_REALPATH 1)
set(HAVE_RECV 1)
set(HAVE_SA_FAMILY_T 1)
set(HAVE_SCHED_YIELD 1)
set(HAVE_SELECT 1)
set(HAVE_SEND 1)
if(APPLE OR
CYGWIN)
set(HAVE_SENDMMSG 0)
else()
set(HAVE_SENDMMSG 1)
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)
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(HAVE_SOCKADDR_IN6_SIN6_ADDR 0)
else()
set(HAVE_SOCKADDR_IN6_SIN6_ADDR 1)
endif()
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)
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(HAVE_STDDEF_H 0)
set(HAVE_STDINT_H 0)
else()
set(HAVE_STDDEF_H 1)
set(HAVE_STDINT_H 1)
endif()
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)
if(_CURL_OLD_LINUX)
set(HAVE_STROPTS_H 1)
else()
set(HAVE_STROPTS_H 0) # glibc 2.30 or newer. https://sourceware.org/legacy-ml/libc-alpha/2019-08/msg00029.html
endif()
set(HAVE_STRUCT_SOCKADDR_STORAGE 1)
set(HAVE_STRUCT_TIMEVAL 1)
if(ANDROID OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(HAVE_SUSECONDS_T 1)
endif()
if(APPLE OR
CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_SYS_EVENTFD_H 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
set(HAVE_SYS_EVENTFD_H 1)
endif()
if(CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_SYS_FILIO_H 0)
else()
set(HAVE_SYS_FILIO_H 1)
endif()
set(HAVE_SYS_IOCTL_H 1)
set(HAVE_SYS_PARAM_H 1)
set(HAVE_SYS_POLL_H 1)
set(HAVE_SYS_RESOURCE_H 1)
set(HAVE_SYS_SELECT_H 1)
set(HAVE_SYS_SOCKET_H 1)
if(CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_SYS_SOCKIO_H 0)
else()
set(HAVE_SYS_SOCKIO_H 1)
endif()
set(HAVE_SYS_STAT_H 1)
set(HAVE_SYS_TIME_H 1)
set(HAVE_SYS_TYPES_H 1)
set(HAVE_SYS_UN_H 1)
if(CYGWIN)
set(HAVE_SYS_UTIME_H 1)
else()
set(HAVE_SYS_UTIME_H 0)
endif()
set(HAVE_TERMIOS_H 1)
if(CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_TERMIO_H 1)
else()
set(HAVE_TERMIO_H 0)
endif()
set(HAVE_TIME_T_UNSIGNED 0)
set(HAVE_UNISTD_H 1)
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

@ -35,7 +35,6 @@ if(MINGW)
set(HAVE_STDINT_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_STDBOOL_H 1) set(HAVE_STDBOOL_H 1)
set(HAVE_BOOL_T "${HAVE_STDBOOL_H}") set(HAVE_BOOL_T "${HAVE_STDBOOL_H}")
set(HAVE_STRTOLL 1)
set(HAVE_BASENAME 1) set(HAVE_BASENAME 1)
set(HAVE_FTRUNCATE 1) set(HAVE_FTRUNCATE 1)
set(HAVE_SYS_PARAM_H 1) set(HAVE_SYS_PARAM_H 1)
@ -45,21 +44,6 @@ if(MINGW)
set(HAVE_UTIME_H 1) # wrapper to sys/utime.h set(HAVE_UTIME_H 1) # wrapper to sys/utime.h
set(HAVE_DIRENT_H 1) set(HAVE_DIRENT_H 1)
set(HAVE_OPENDIR 1) set(HAVE_OPENDIR 1)
if(MINGW64_VERSION)
if(NOT MINGW64_VERSION VERSION_LESS 4.0)
set(HAVE_STRTOK_R 1)
else()
set(HAVE_STRTOK_R 0)
endif()
endif()
if((CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) OR
(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.6))
set(HAVE_STDATOMIC_H 1)
set(HAVE_ATOMIC 1)
else()
set(HAVE_STDATOMIC_H 0)
set(HAVE_ATOMIC 0)
endif()
else() else()
set(HAVE_LIBGEN_H 0) set(HAVE_LIBGEN_H 0)
set(HAVE_FTRUNCATE 0) set(HAVE_FTRUNCATE 0)
@ -73,32 +57,36 @@ else()
if(MSVC) if(MSVC)
set(HAVE_UNISTD_H 0) set(HAVE_UNISTD_H 0)
set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size() set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size()
set(HAVE_STDATOMIC_H 0) if(MSVC_VERSION GREATER_EQUAL 1600)
if(NOT MSVC_VERSION LESS 1600)
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size() set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size()
else() else()
set(HAVE_STDINT_H 0) # detected by CMake internally in check_type_size() set(HAVE_STDINT_H 0) # detected by CMake internally in check_type_size()
endif() endif()
if(NOT MSVC_VERSION LESS 1800) if(MSVC_VERSION GREATER_EQUAL 1800)
set(HAVE_STDBOOL_H 1) set(HAVE_STDBOOL_H 1)
set(HAVE_STRTOLL 1)
else() else()
set(HAVE_STDBOOL_H 0) set(HAVE_STDBOOL_H 0)
set(HAVE_STRTOLL 0)
endif() endif()
set(HAVE_BOOL_T "${HAVE_STDBOOL_H}") set(HAVE_BOOL_T "${HAVE_STDBOOL_H}")
if(NOT MSVC_VERSION LESS 1900) if(MSVC_VERSION GREATER_EQUAL 1900)
set(HAVE_SNPRINTF 1) set(HAVE_SNPRINTF 1)
else() else()
set(HAVE_SNPRINTF 0) set(HAVE_SNPRINTF 0)
endif() endif()
set(HAVE_BASENAME 0) set(HAVE_BASENAME 0)
set(HAVE_STRTOK_R 0)
set(HAVE_FILE_OFFSET_BITS 0)
set(HAVE_ATOMIC 0)
endif() endif()
endif() endif()
if((CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) OR
(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.6))
# MinGW or clang-cl
set(HAVE_STDATOMIC_H 1)
set(HAVE_ATOMIC 1)
else()
set(HAVE_STDATOMIC_H 0)
set(HAVE_ATOMIC 0)
endif()
# Available in Windows XP and newer # Available in Windows XP and newer
set(HAVE_GETADDRINFO 1) set(HAVE_GETADDRINFO 1)
set(HAVE_FREEADDRINFO 1) set(HAVE_FREEADDRINFO 1)
@ -198,8 +186,59 @@ set(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0)
set(HAVE_GETHOSTBYNAME_R_6 0) set(HAVE_GETHOSTBYNAME_R_6 0)
set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0) set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)
set(HAVE_IN_ADDR_T 0)
set(STDC_HEADERS 1) set(STDC_HEADERS 1)
set(HAVE_SIZEOF_SUSECONDS_T 0) set(HAVE_SIZEOF_SUSECONDS_T 0)
set(HAVE_SIZEOF_SA_FAMILY_T 0) set(HAVE_SIZEOF_SA_FAMILY_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
# 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)
set(HAVE_SIZEOF_SSIZE_T 0)
set(HAVE_FILE_OFFSET_BITS 0)
curl_prefill_type_size("OFF_T" 4)
curl_prefill_type_size("ADDRESS_FAMILY" 2)
else()
# SSIZE_T: 8 for _WIN64, 4 otherwise
if(MINGW64_VERSION)
if(NOT MINGW64_VERSION VERSION_LESS 3.0)
set(HAVE_FILE_OFFSET_BITS 1)
curl_prefill_type_size("OFF_T" 8)
endif()
if(NOT MINGW64_VERSION VERSION_LESS 2.0)
curl_prefill_type_size("ADDRESS_FAMILY" 2)
else()
set(HAVE_SIZEOF_ADDRESS_FAMILY 0)
endif()
endif()
endif()
endif()
if(WINCE) # Windows CE exceptions
set(HAVE_LOCALE_H 0)
set(HAVE_GETADDRINFO 0)
set(HAVE_FREEADDRINFO 0)
set(HAVE_SETLOCALE 0)
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 0)
set(HAVE_SIGNAL 0)
set(HAVE_SETMODE 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)
set(HAVE_SIZEOF_ADDRESS_FAMILY 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

@ -60,8 +60,12 @@ CMAKE_DIST = \
CMake/OtherTests.cmake \ CMake/OtherTests.cmake \
CMake/PickyWarnings.cmake \ CMake/PickyWarnings.cmake \
CMake/Utilities.cmake \ CMake/Utilities.cmake \
CMake/unix-cache.cmake \
CMake/win32-cache.cmake \ CMake/win32-cache.cmake \
CMakeLists.txt CMakeLists.txt \
tests/cmake/CMakeLists.txt \
tests/cmake/test.c \
tests/cmake/test.sh
VC_DIST = projects/README.md \ VC_DIST = projects/README.md \
projects/build-openssl.bat \ projects/build-openssl.bat \

View File

@ -1,272 +1,136 @@
curl and libcurl 8.12.0 curl and libcurl 8.13.0
Public curl releases: 264 Public curl releases: 266
Command line options: 267 Command line options: 267
curl_easy_setopt() options: 306 curl_easy_setopt() options: 306
Public functions in libcurl: 96 Public functions in libcurl: 96
Contributors: 3332 Contributors: 3354
This release includes the following changes: This release includes the following changes:
o curl: add byte range support to --variable reading from file [56] o curl: add write-out variable 'tls_earlydata' [79]
o curl: make --etag-save acknowledge --create-dirs [31] o rustls: add support for CERTINFO [106]
o getinfo: fix CURLINFO_QUEUE_TIME_T and add 'time_queue' var [55] o tool_getparam: make --url support a file with URLs [104]
o getinfo: provide info which auth was used for HTTP and proxy [40] o var: add a '64dec' function that can base64 decode a string [78]
o hyper: drop support [57] o wolfssl: tls early data support [50]
o openssl: add support to use keys and certificates from PKCS#11 provider [77]
o QUIC: 0RTT for gnutls via CURLSSLOPT_EARLYDATA [61]
o vtls: feature ssls-export for SSL session im-/export [141]
This release includes the following bugfixes: This release includes the following bugfixes:
o altsvc: avoid integer overflow in expire calculation [16] o addrinfo: add curl macro to avoid redefining foreign symbols [29]
o altsvc: return error on dot-only name [178] o asyn-thread: avoid the separate 'struct resdata' alloc [20]
o android: add CI jobs, buildinfo, cmake docs, disable `CURL_USE_PKGCONFIG` by default [185] o asyn-thread: avoid the separate curl_mutex_t alloc [6]
o asyn-ares: acknowledge CURLOPT_DNS_SERVERS set to NULL [190] o asyn-thread: do not allocate thread_data separately [21]
o asyn-ares: fix memory leak [233] o asyn-thread: remove 'status' from struct Curl_async [36]
o asyn-ares: initial HTTPS resolve support [166] o build: add Windows CE / CeGCC support, with CI jobs [87]
o asyn-thread: use c-ares to resolve HTTPS RR [205] o build: drop unused `getpart` tool [107]
o async-thread: avoid closing eventfd twice [9] o build: enable -Wjump-misses-init for GCC 4.5+ [62]
o autotools: add support for mingw UWP builds [192] o build: fix compiler warnings in feature detections [39]
o autotools: silence gcc warnings in libtool code [96] o build: set `HAVE_WRITABLE_ARGV` for Apple cross-builds [8]
o binmode: convert to macro and use it from tests [44] o build: silence bogus `-Wconversion` warnings with gcc 5.1-5.4 [68]
o build: delete `-Wsign-conversion` related FIXMEs [137] o c-ares: error out for unsupported versions, drop unused macros [85]
o build: drop `-Winline` picky warning [53] o ca-native.md: sync with CURLSSLOPT_NATIVE_CA [72]
o build: drop `tool_hugehelp.c.cvs`, tidy up macros, drop `buildconf.bat` [200] o cf-socket: deduplicate Windows Vista detection [11]
o build: drop macro used to enable `-Wsign-conversion` warnings in CI [224] o client writer: handle pause before deocding [61]
o build: drop unused feature macros, update exception list [51] o cmake: `SHARE_LIB_OBJECT=ON` requires CMake 3.12 or newer [46]
o build: fix `-Wtrampolines` picky warning for gcc 4.x versions [156] o cmake: add pre-fill for Unix, enable in GHA/macos, verify pre-fills [42]
o build: fix compiling with GCC 4.x versions [214] o cmake: allow empty `IMPORT_LIB_SUFFIX`, add suffix collision detection [41]
o build: fix the tidy targets for autotools [52] o cmake: avoid `-Wnonnull` warning in `HAVE_FSETXATTR_5` detection [81]
o build: fix unsigned `time_t` detection for cmake, MS-DOS, AmigaOS [104] o cmake: disable HTTPS-proxy as a feature if proxy is disabled [77]
o build: replace configure check with PP condition (Android <21) [97] o cmake: drop `CURL_DISABLE_TESTS` option [94]
o build: stop detecting `sched_yield()` on Windows [176] o cmake: drop `HAVE_IN_ADDR_T` from pre-fill too
o c-ares: fix/tidy-up macro initializations, avoid a deprecated function [209] o cmake: drop two stray TLS feature checks for wolfSSL [9]
o cd2nroff: do not insist on quoted <> within backticks [222] o cmake: fix `HAVE_ATOMIC`/`HAVE_STDATOMIC` pre-fill for clang-cl [28]
o cd2nroff: support "none" as a TLS backend [29] o cmake: fix ECH detection in custom-patched OpenSSL [32]
o cf-https-connect: look into httpsrr alpns when available [152] o cmake: hide empty `MINGW64_VERSION` output for mingw32ce [114]
o cf-socket: error if address can't be copied [72] o cmake: mention 'insecure' in the debug build warning [15]
o cfilters: kill connection filter events attach+detach [217] o cmake: misc tidy-ups [38]
o checksrc.bat: remove explicit SNPRINTF bypass [174] o cmake: pre-fill known type sizes for Windows OSes [100]
o checksrc: ban use of sscanf() [7] o cmake: restrict static CRT builds to static curl exe, test in CI [113]
o checksrc: check for return with parens around a value/name [130] o cmake: sync cutoff version with autotools for picky option `-ftree-vrp` [99]
o checksrc: exclude generated bundle files to avoid race condition [235] o cmake: sync OpenSSL(-fork) feature checks with `./configure` [49]
o checksrc: fix the return() checker [35] o CODE_STYLE: readability and banned functions [35]
o checksrc: introduce 'banfunc' to ban specific functions [117] o configure: silence compiler warnings in feature checks, drop duplicates [86]
o cmake/Find: add `iphlpapi` for c-ares, omit syslibs if dep not found [203] o configure: use `curl_cv_apple` variable [40]
o cmake/FindLDAP: avoid empty 'Requires' item when omitting `pkg-config` module [90] o conn: fix connection reuse when SSL is optional [54]
o cmake/FindLDAP: avoid framework locations for libs too (Apple) [122] o contributors.sh: lowercase 'github' for consistency [52]
o cmake/FindLibpsl: protect against `pkg-config` "half-detection" [89] o contrithanks.sh: update docs/THANKS in place [119]
o cmake/FindLibssh: sync header comment with other modules o cookie: do prefix matching case-sensitively [82]
o cmake/FindMbedTLS: drop lib duplicates early [17] o cookie: minor parser simplification [58]
o cmake: add `librtmp` Find module [86] o cookie: simplify invalid_octets() [24]
o cmake: add LDAP Find module [46] o curl.h: change some enums to defines with L suffix [84]
o cmake: add native `pkg-config` detection for remaining Find modules [37] o curl_msh3: remove verify bypass from DEBUGBUILDs [43]
o cmake: allow `CURL_LTO` regardless of `CURL_BUILD_TYPE`, enable in CI [88] o curl_trc: fix build with CURL_DISABLE_VERBOSE_STRINGS [109]
o cmake: clang-cl improvements [42] o CURLMOPT_SOCKETFUNCTION.md: add advice for socket callback invocation[69]
o cmake: delete accidental debug message o CURLOPT_HTTPHEADER.md: add comments to the example [90]
o cmake: deprecate winbuild, add migration guide from legacy build methods [157] o CURLOPT_HTTPHEADER.md: rephrases [108]
o cmake: detect mingw-w64 version, pre-fill `HAVE_STRTOK_R` [179] o docs: add FD_ZERO to curl_multi_fdset example [19]
o cmake: do not store `MINGW64_VERSION` in cache [175] o docs: bump `rustls` to 0.14.1 [111]
o cmake: drop `CURL_USE_PKGCONFIG` from `curl-config.cmake.in` [208] o docs: correct argument names & URL redirection [4]
o cmake: drop `fseeko()` pre-fill and check for Windows [201] o eventfd: allow use on all CPUs [93]
o cmake: drop duplicate Windows cache value [81] o gnutls: fix connection state check on handshake [80]
o cmake: drop redundant FOUND checks (libgsasl, libssh, libuv) [49] o hash: use single linked list for entries [57]
o cmake: drop redundant opening/closing `.*` from `MATCH` expressions [64] o hostip: make CURLOPT_RESOLVE support replacing IPv6 addresses [47]
o cmake: drop unused `HAVE_SYS_XATTR_H` detection [79] o HTTP3.md: only speak about minimal versions [18]
o cmake: drop VS2010 "Dialog Hell" workaround added in 2013 [136] o http: convert parsers to strparse [48]
o cmake: extend zlib's `AUTO` option to brotli, zstd and enable if found [36] o http: fix NTLM info message typo [22]
o cmake: fix `net/in.h` detection for MS-DOS [103] o http: fix the auth check [88]
o cmake: improve `curl_dumpvars()` and move to `Utilities.cmake` [50] o http: make the RTSP version check stricter [73]
o cmake: make libpsl required by default [45] o http: negotiation and room for alt-svc/https rr to navigate [64]
o cmake: make system libraries `dl`, `m`, `pthread` customizable [123] o http: version negotiation [45]
o cmake: move `pkg-config` names to Find modules [87] o http_aws_sigv4: use strparse more for parsing [55]
o cmake: move GSS init before feature detections [93] o https-rr: implementation improvements [44]
o cmake: move mingw UWP workaround from GHA to `CMakeLists.txt` [194] o httpsrr: fix port detection [51]
o cmake: namespace functions and macros [41] o httpsrr: fix the HTTPS-RR threaded-resolver build combo [67]
o cmake: optimize out 4 picky warning option detections with gcc [78] o INSTALL-CMAKE.md: CMake usage updates [101]
o cmake: pick a better IPv6 feature flag when assembling the feature list [132] o INSTALL-CMAKE.md: mention `ZLIB_USE_STATIC_LIBS` [112]
o cmake: pre-fill `HAVE_STDATOMIC_H`, `HAVE_ATOMIC` for mingw-w64 [180] o lib: better optimized casecompare() and ncasecompare() [3]
o cmake: pre-fill `HAVE_STDINT_H` on Windows [149] o lib: simplify more white space loops [60]
o cmake: prefer dash-style MSVC options [216] o lib: strtoofft.h header cleanup [17]
o cmake: publish/check supported protocols/features via `CURLConfig.cmake` [100] o lib: use Curl_str_* instead of strtok_r() [59]
o cmake: replace `unset(VAR)` with `set(VAR "")` for init [43] o lib: use Curl_str_number() for parsing decimal numbers [13]
o cmake: sync OpenSSL QUIC fork detection with autotools [102] o libtest/libprereq.c: set CURLOPT_FOLLOWLOCATION with a long [89]
o cmake: use `CMAKE_REQUIRED_LINK_DIRECTORIES` [48] o managen: correct the warning for un-escaped '<' and '>' [1]
o cmake: use `STREQUAL` to detect Linux [68] o msvc: drop support for VS2005 and older [96]
o cmake: warn for OpenSSL versions missing TLS 1.3 support [221] o multi: event based rework [74]
o cmdline-opts/version.md: describe multissl, mention SSLS-EXPORT [170] o openssl: check return value of X509_get0_pubkey [105]
o completion.pl: add completion for paths after @ for fish [82] o openssl: drop support for old OpenSSL/LibreSSL versions [95]
o config-mac: drop `MACOS_SSL_SUPPORT` macro [63] o openssl: remove bad `goto`s into other scope [63]
o config: drop unused code and variables [135] o runtests: drop recognizing 'winssl' as Schannel [102]
o configure: do not inline 'dnl' comments o runtests: drop ref to unused external function
o configure: drop unused detections and macros [105] o runtests: recognize AWS-LC as OpenSSL [103]
o configure: streamline Windows large file feature check [138] o runtests: support multi-target cmake, drop workarounds from CI [116]
o configure: UWP and Android follow-up fixes [184] o schannel: deduplicate Windows Vista detection [98]
o conncache: count shutdowns against host and max limits [154] o schannel: enable ALPN support under WINE 6.0+ [92]
o conncache: result_cb comment removed from function docs [1] o schannel: enable ALPN with MinGW, fix ALPN for UWP builds [71]
o content_encoding: drop support for zlib before 1.2.0.4 [211] o schannel: guard ALPN init code to ALPN builds [91]
o content_encoding: namespace GZIP flag constants [147] o scripts/managen: fix option 'single' [31]
o content_encoding: put the decomp buffers into the writer structs [210] o scripts/managen: fix parsing of markdown code sections [30]
o content_encoding: support use of custom libzstd memory functions [186] o setopt: remove unnecesary void pointer typecasts [76]
o cookie: cap expire times to 400 days [111] o ssh: consider sftp quote commands case sensitive [33]
o cookie: fix crash in netscape cookie parsing [84] o ssl session cache: add exportable flag [56]
o cookie: parse only the exact expire date [3] o strparse: make Curl_str_number() return error for no digits [14]
o curl-functions.m4: fix indentation in `CURL_SIZEOF()` [131] o strparse: switch the API to work on 'const char *' [2]
o curl: return error if etag options are used with multiple URLs [5] o strparse: switch to curl_off_t as base data type [7]
o curl_multi_fdset: include the shutdown connections in the set [168] o tests: fix enum/int confusion, fix autotools `CFLAGS` for `servers` [27]
o curl_multi_waitfds.md: tidy up the example [162] o tidy-up: align MSYS2/Cygwin codepaths, follow Cygwin `MAX_PID` bump [97]
o curl_multibyte: support Windows paths longer than MAX_PATH [76] o tidy-up: delete, comment or scope C macros reported unused [16]
o curl_setup: fix missing `ADDRESS_FAMILY` type in rare build cases [144] o tidy-up: drop unused `CURL_INADDR_NONE` macro and `in_addr_t` type [26]
o curl_sha512_256: rename symbols to the curl namespace [124] o tidy-up: use `CURL_ARRAYSIZE()` [37]
o curl_url_set.md: adjust the added-in to 7.62.0 [94] o timediff: fix comment for curlx_mstotv() [25]
o curl_ws_recv.md: fix typo o timediff: remove unnecessary double typecast [53]
o CURLOPT_CONNECT_ONLY.md: an easy handle with this option set cannot be reused [164] o tool_getparam: clear sensitive arguments better [66]
o CURLOPT_PROXY.md: clarify the crendential support in proxy URLs [66] o tool_operate: fail SSH transfers without server auth [70]
o CURLOPT_RESOLVE.md: fix wording [30] o urlapi: simplify junkscan [23]
o CURLOPT_SEEKFUNCTION.md: used for FTP, HTTP and SFTP (only) [109] o variable.md: clarify 'trim' example [12]
o docs/BUGS.md: remove leading space from a link o windows: drop code and curl manifest targeting W2K and older [115]
o docs/cmdline-opts/_ENVIRONMENT.md: minor language fix [119] o wolfssh: retrieve the error using wolfSSH_get_error [5]
o docs/cmdline-opts/location.md: fix typos for location flag [226] o wolfssl: fix CA certificate multiple location import [34]
o docs/HTTP-COOKIES.md: link to more information [125] o wolfssl: warn if CA native import option is ignored [65]
o docs/HTTPSRR.md: initial HTTPS RR documentation [204] o wolfssl: when using PQ KEM, use ML-KEM, not Kyber [10]
o docs/libcurl/opts: clarify the return values [114]
o docs/libcurl: return value overhall [120]
o docs/TLS-SESSIONS: fix typo, the->they [189]
o docs: document the behavior of -- in the curl command line [198]
o docs: use lowercase curl and libcurl [113]
o doh: cleanups and extended HTTPS RR code [161]
o doh: send HTTPS RR requests for all HTTP(S) transfers [160]
o easy: allow connect-only handle reuse with easy_perform [232]
o easy: make curl_easy_perform() return error if connection still there [163]
o easy_lock: use Sleep(1) for thread yield on old Windows [191]
o ECH: update APIs to those agreed with OpenSSL maintainers [101]
o examples/block-ip: drop redundant `memory.h` include
o examples/block-ip: show how to block IP addresses [74]
o examples/complicated: fix warnings, bump deprecated callback, tidy up [59]
o examples/synctime.c: remove references to dead URLs and functionality [62]
o examples: make them compile with compatibility functions disabled (Windows) [58]
o examples: use return according to code style
o file: drop `OPEN_NEEDS_ARG3` option [91]
o file: fix Android compiler warning [85]
o gitignore: add generated unity sources for lib and src
o GnuTLS: fix 'time_appconnect' for early data [127]
o hash: add asserts in hash_element_dtor() [126]
o HTTP/2: strip TE request header [140]
o http2: fix data_pending check [241]
o http2: fix value stored to 'result' is never read [71]
o http: fix build with `CURL_DISABLE_COOKIES` [95]
o http: ignore invalid Retry-After times [107]
o http_aws_sigv4: Fix invalid compare function handling zero-length pairs [24]
o https-connect: start next immediately on failure [223]
o INFRASTRUCTURE.md: project infra [99]
o INSTALL-CMAKE.md: fix punctuation
o INSTALL.md: add CMake examples for macOS and iOS [242]
o INSTALL.md: document VS2008 and mingw-w64 [165]
o INTERNALS.md: sync wolfSSL version requirement with source code
o lib517: extend the getdate test with quotes and leading "junk" [4]
o lib: clarify 'conn->httpversion' [213]
o lib: redirect handling by protocol handler [212]
o lib: remove `__EMX__` guards [83]
o lib: replace `inline` redefine with `CURL_INLINE` macro [47]
o lib: supress deprecation warnings in apple builds [32]
o lib: TLS session ticket caching reworked [60]
o libcurl/opts: do not save files in dirs where attackers have access [199]
o Makefile.dist: delete [237]
o Makefile.mk: drop in favour of autotools and cmake (MS-DOS, AmigaOS3) [38]
o mbedtls: fix handling of blocked sends [116]
o mbedtls: PSA can be used independently of TLS 1.3 (avoid runtime errors) [219]
o mime: explicitly rewind subparts at attachment time. [80]
o mprintf: fix integer handling in float precision [173]
o mprintf: terminate snprintf output on windows [172]
o msvc: add missing push/pop for warning pragmas [236]
o msvc: assume `_INTEGRAL_MAX_BITS >= 64` [158]
o msvc: drop checks for ancient versions [133]
o msvc: fix building with `HAVE_INET_NTOP` and MSVC <=1900 [151]
o msvc: require VS2005 for large file support [143]
o msvc: tidy up `_CRT_*_NO_DEPRECATE` definitions [148]
o multi: fix curl_multi_waitfds reporting of fd_count [73]
o multi: fix return code for an already-removed easy handle [106]
o multihandle: add an ssl_scache here [129]
o multissl: auto-enable `OPENSSL_COEXIST` for wolfSSL + OpenSSL [92]
o multissl: make openssl + wolfssl builds work [34]
o netrc: 'default' with no credentials is not a match [108]
o netrc: fix password-only entries [28]
o netrc: restore _netrc fallback logic [6]
o ngtcp2: fix memory leak on connect failure [225]
o ngtcp2: fix two cases of value stored never read [65]
o openssl: define `HAVE_KEYLOG_CALLBACK` before use [227]
o openssl: drop unused `HAVE_SSL_GET_SHUTDOWN` macro [228]
o openssl: fix ECH logic [67]
o osslq: use SSL_poll to determine writeability of QUIC streams [139]
o projects/Windows: remove wolfSSL from legacy projects [75]
o projects: fix `INSTALL-CMAKE.md` references
o pytest: remove 'repeat' parameter [182]
o pytest: use httpd/apache2 directly, no apachectl [169]
o RELEASE-PROCEDURE.md: mention how to publish security advisories [2]
o runtests.pl: fix precedence issue [207]
o scripts/mdlinkcheck: markdown link checker [19]
o sectransp: free certificate on error [12]
o select: avoid a NULL deref in cwfds_add_sock [128]
o smb: fix compiler warning [112]
o src: add `CURL_STRICMP()` macro, use `_stricmp()` on Windows [54]
o src: drop support for `CURL_TESTDIR` debug env [121]
o src: omit hugehelp and ca-embed from libcurltool [215]
o ssl session cache: change cache dimensions [159]
o strparse: string parsing helper functions [8]
o symbols-in-versions: update version for LIBCURL_VERSION and LIBCURL_VERSION_NUM [193]
o system.h: add 64-bit curl_off_t definitions for NonStop [11]
o system.h: drop compilers lacking 64-bit integer type (Windows/MS-DOS) [155]
o system.h: drop duplicate and no-op code [153]
o system.h: fix indentation [142]
o telnet: handle single-byte input option [177]
o test1960: don't close the socket too early [220]
o test483: require cookie support [98]
o tests/http/clients: use proper sleep() call on NonStop [10]
o tests: change the behavior of swsbounce [202]
o tests: stop promoting perl warnings to fatal errors
o TheArtOfHttpScripting.md: rewrite double 'that' [115]
o tidy-up: `curl_setup.h`, `curl_setup_once.h`, `config-win32ce.h` [146]
o tidy-up: drop parenthesis around `return` expression [167]
o tidy-up: drop parenthesis around `return` values [134]
o tidy-up: extend `CURL_O_BINARY` to lib and tests [195]
o TLS: check connection for SSL use, not handler [181]
o tool_formparse.c: make curlx_uztoso a static in here [39]
o tool_formparse: accept digits in --form type= strings [33]
o tool_getparam: ECH param parsing refix [150]
o tool_getparam: fail --hostpubsha256 if libssh2 is not used [229]
o tool_getparam: fix "Ignored Return Value" [21]
o tool_getparam: fix memory leak on error in parse_ech [14]
o tool_getparam: fix the ECH parser [20]
o tool_operate: make --etag-compare always accept a non-existing file [22]
o transfer: fix CURLOPT_CURLU override logic [171]
o urlapi: fix redirect to a new fragment or query (only) [118]
o urldata: tweak the UserDefined struct [240]
o variable.md: mention --expand-variable for variables to variables [13]
o variable.md: show function use with examples [18]
o version: fix the IDN feature for winidn and appleidn [187]
o vquic: fix 4th function call argument is an uninitialized value [70]
o vquic: make vquic_send_packets not return without setting psent [69]
o vtls: fix default SSL backend as a fallback [231]
o vtls: only remember the expiry timestamp in session cache [110]
o vtls: remove 'detach/attach' functions from TLS handler struct [25]
o vtls: remove unusued 'check_cxn' from TLS handler struct [26]
o vtls: replace "none"-functions with NULL pointers [27]
o VULN-DISCLOSURE-POLICY.md: mention the not setting CVSS [23]
o VULN-DISCLOSURE-POLICY: on legacy dependencies [239]
o websocket: fix message send corruption [188]
o windows: drop dupe macros, detect `CURL_OS` for WinCE ARM, indentation [183]
o windows: drop redundant `USE_WIN32_SMALL_FILES` macro [145]
o windows: drop two missed `buildconf.bat` references
o windows: merge `config-win32ce.h` into `config-win32.h` [196]
o ws-docs: extend WebSocket documentation [206]
o ws-docs: remove the outdated texts saying ws support is experimental [15]
o ws: reject frames with unknown reserved bits set [230]
o x509asn1: add parse recursion limit [197]
This release includes the following known bugs: This release includes the following known bugs:
See docs/KNOWN_BUGS (https://curl.se/docs/knownbugs.html) See https://curl.se/docs/knownbugs.html
For all changes ever done in curl: For all changes ever done in curl:
@ -275,268 +139,135 @@ For all changes ever done in curl:
Planned upcoming removals include: Planned upcoming removals include:
o Support for the msh3 HTTP/3 backend o Support for the msh3 HTTP/3 backend
o The winbuild build system
o TLS libraries not supporting TLS 1.3 o TLS libraries not supporting TLS 1.3
See https://curl.se/dev/deprecate.html for details See https://curl.se/dev/deprecate.html
This release would not have looked like this without help, code, reports and This release would not have looked like this without help, code, reports and
advice from friends like these: advice from friends like these:
9cel, Aleksander Mazur, Andrew Kaster, Andy Pan, Asger Hautop Drewsen, Anthony Hu, Dan Fandrich, Daniel Stenberg, dependabot[bot], Derek Huang,
baranyaib90 on github, Ben Zanin, Brad House, Calvin Ruocco, Dexter Gerig, Harry Sintonen, Jeremy Drake, John Bampton, Joseph Chen,
Christian Heusel, Christian Schmitz, Christopher Dannemiller, Dan Fandrich, kayrus on github, kriztalz, Laurențiu Nicola, lf- on github, Marcel Raad,
Daniel Stenberg, Darren Banfi, Deniz Sökmen, dependabot[bot], Derek Huang, Mark Phillips, qhill on github, Ray Satiro, renovate[bot], rmg-x on github,
Dexter Gerig, Donguk Kim, dwickr, Edoardo Lolletti, Ganesh Viswanathan, RubisetCie on github, Sergey, Stefan Eissing, Tianyi Song, Timo Tijhof,
Harry Sintonen, Hermes Zhang, IcedCoffeee on github, Igor Todorovski, Viktor Szakats, Yedaya Katsman, Zenju on github
Jakub Jelen, Jeroen Ooms, Jiri Stary, Kai Pastor, Kevin Sun, Kuan-Wei Chiu, (28 contributors)
Leon Timmermans, MacKenzie, Manuel Einfalt, Marcel Raad, Martin Harrigan,
mauke, Michael Schuster, Milon Renatus, Mohammed Sadiq,
na-trium-144 on github, Neil Horman, Neil Johari, Nicolás San Martín,
Patrick Monnerat, prpr19xx on Github, Qriist on github, ralfjunker on github,
Ralph Sennhauser, Randall S. Becker, Ray Satiro, renovate[bot],
Rudi Heitbaum, Samuel Henrique, Stefan Eissing, Stephen Farrell, Tal Regev,
Tamás Bálint Misius, Tamir Duberstein, Viktor Szakats, Yedaya Katsman,
Yihang Zhou, z2_
(65 contributors)
References to bug reports and discussions on issues: References to bug reports and discussions on issues:
[1] = https://curl.se/bug/?i=15720 [1] = https://curl.se/bug/?i=16315
[2] = https://curl.se/bug/?i=15714 [2] = https://curl.se/bug/?i=16316
[3] = https://curl.se/bug/?i=15709 [3] = https://curl.se/bug/?i=16311
[4] = https://curl.se/bug/?i=15708 [4] = https://curl.se/bug/?i=16334
[5] = https://curl.se/bug/?i=15729 [5] = https://curl.se/bug/?i=16335
[6] = https://curl.se/bug/?i=15734 [6] = https://curl.se/bug/?i=16323
[7] = https://curl.se/bug/?i=15687 [7] = https://curl.se/bug/?i=16336
[8] = https://curl.se/bug/?i=15692 [8] = https://curl.se/bug/?i=16338
[9] = https://curl.se/bug/?i=15725 [9] = https://curl.se/bug/?i=16339
[10] = https://curl.se/bug/?i=15711 [10] = https://curl.se/bug/?i=16337
[11] = https://curl.se/bug/?i=15723 [11] = https://curl.se/bug/?i=16400
[12] = https://curl.se/bug/?i=15721 [12] = https://curl.se/bug/?i=16346
[13] = https://curl.se/bug/?i=15752 [13] = https://curl.se/bug/?i=16319
[14] = https://curl.se/bug/?i=15753 [14] = https://curl.se/bug/?i=16319
[15] = https://curl.se/bug/?i=15749 [15] = https://curl.se/bug/?i=16327
[16] = https://issues.oss-fuzz.com/issues/383911309 [16] = https://curl.se/bug/?i=16279
[17] = https://curl.se/bug/?i=15495 [17] = https://curl.se/bug/?i=16331
[18] = https://curl.se/bug/?i=15743 [18] = https://curl.se/bug/?i=16320
[19] = https://curl.se/bug/?i=15742 [19] = https://curl.se/bug/?i=16325
[20] = https://curl.se/bug/?i=15741 [20] = https://curl.se/bug/?i=16321
[21] = https://curl.se/bug/?i=15740 [21] = https://curl.se/bug/?i=16241
[22] = https://curl.se/bug/?i=15737 [22] = https://curl.se/bug/?i=16305
[23] = https://curl.se/bug/?i=15779 [23] = https://curl.se/bug/?i=16307
[24] = https://curl.se/bug/?i=15778 [24] = https://curl.se/bug/?i=16306
[25] = https://curl.se/bug/?i=15776 [25] = https://curl.se/bug/?i=16310
[26] = https://curl.se/bug/?i=15775 [26] = https://curl.se/bug/?i=16318
[27] = https://curl.se/bug/?i=15772 [27] = https://curl.se/bug/?i=16314
[28] = https://curl.se/bug/?i=15767 [28] = https://curl.se/bug/?i=16313
[29] = https://curl.se/bug/?i=15769 [29] = https://curl.se/bug/?i=16274
[30] = https://curl.se/bug/?i=15770 [30] = https://curl.se/bug/?i=16345
[31] = https://curl.se/bug/?i=15730 [31] = https://curl.se/bug/?i=16344
[32] = https://curl.se/bug/?i=15763 [32] = https://curl.se/bug/?i=16354
[33] = https://curl.se/bug/?i=15761 [33] = https://curl.se/bug/?i=16382
[34] = https://curl.se/bug/?i=15596 [34] = https://curl.se/bug/?i=16391
[35] = https://curl.se/bug/?i=15764 [35] = https://curl.se/bug/?i=16349
[36] = https://curl.se/bug/?i=15431 [36] = https://curl.se/bug/?i=16347
[37] = https://curl.se/bug/?i=15408 [37] = https://curl.se/bug/?i=16381
[38] = https://curl.se/bug/?i=15543 [38] = https://curl.se/bug/?i=16238
[39] = https://curl.se/bug/?i=15796 [39] = https://curl.se/bug/?i=16287
[40] = https://curl.se/bug/?i=15450 [40] = https://curl.se/bug/?i=16340
[41] = https://curl.se/bug/?i=15498 [41] = https://curl.se/bug/?i=16324
[42] = https://curl.se/bug/?i=15478 [42] = https://curl.se/bug/?i=15841
[43] = https://curl.se/bug/?i=15255 [43] = https://curl.se/bug/?i=16342
[44] = https://curl.se/bug/?i=15787 [44] = https://curl.se/bug/?i=16132
[45] = https://curl.se/bug/?i=15464 [45] = https://curl.se/bug/?i=16100
[46] = https://curl.se/bug/?i=15273 [46] = https://curl.se/bug/?i=16375
[47] = https://curl.se/bug/?i=15523 [47] = https://curl.se/bug/?i=16357
[48] = https://curl.se/bug/?i=15280 [48] = https://curl.se/bug/?i=16436
[49] = https://curl.se/bug/?i=15465 [49] = https://curl.se/bug/?i=16352
[50] = https://curl.se/bug/?i=15562 [50] = https://curl.se/bug/?i=16167
[51] = https://curl.se/bug/?i=15577 [51] = https://curl.se/bug/?i=16409
[52] = https://curl.se/bug/?i=15813 [52] = https://curl.se/bug/?i=16443
[53] = https://curl.se/bug/?i=15815 [53] = https://curl.se/bug/?i=16367
[54] = https://curl.se/bug/?i=15788 [54] = https://curl.se/bug/?i=16384
[55] = https://curl.se/bug/?i=15512 [55] = https://curl.se/bug/?i=16366
[56] = https://curl.se/bug/?i=15739 [56] = https://curl.se/bug/?i=16322
[57] = https://curl.se/bug/?i=15120 [57] = https://curl.se/bug/?i=16351
[58] = https://curl.se/bug/?i=15789 [58] = https://curl.se/bug/?i=16362
[59] = https://curl.se/bug/?i=15785 [59] = https://curl.se/bug/?i=16360
[60] = https://curl.se/bug/?i=15774 [60] = https://curl.se/bug/?i=16363
[61] = https://curl.se/bug/?i=15667 [61] = https://curl.se/bug/?i=16280
[62] = https://curl.se/bug/?i=15786 [62] = https://curl.se/bug/?i=16252
[63] = https://curl.se/bug/?i=15777 [63] = https://curl.se/bug/?i=16356
[64] = https://curl.se/bug/?i=15773 [64] = https://curl.se/bug/?i=16117
[65] = https://curl.se/bug/?i=15812 [65] = https://curl.se/bug/?i=16417
[66] = https://curl.se/bug/?i=15805 [66] = https://curl.se/bug/?i=16396
[67] = https://curl.se/bug/?i=15814 [67] = https://curl.se/bug/?i=16399
[68] = https://curl.se/bug/?i=15855 [68] = https://curl.se/bug/?i=16398
[69] = https://curl.se/bug/?i=15807 [69] = https://curl.se/bug/?i=16441
[70] = https://curl.se/bug/?i=15808 [70] = https://curl.se/bug/?i=16205
[71] = https://curl.se/bug/?i=15806 [71] = https://curl.se/bug/?i=16385
[72] = https://curl.se/bug/?i=15784 [72] = https://curl.se/bug/?i=16373
[73] = https://curl.se/bug/?i=15146 [73] = https://curl.se/bug/?i=16435
[74] = https://curl.se/bug/?i=15748 [74] = https://curl.se/bug/?i=16308
[75] = https://curl.se/bug/?i=15468 [76] = https://curl.se/bug/?i=16426
[76] = https://curl.se/bug/?i=13522 [77] = https://curl.se/bug/?i=16434
[77] = https://curl.se/bug/?i=15587 [78] = https://curl.se/bug/?i=16330
[78] = https://curl.se/bug/?i=15850 [79] = https://curl.se/bug/?i=15956
[79] = https://curl.se/bug/?i=15845 [80] = https://curl.se/bug/?i=16423
[80] = https://curl.se/bug/?i=15842 [81] = https://curl.se/bug/?i=16427
[81] = https://curl.se/bug/?i=15840 [82] = https://curl.se/bug/?i=16494
[82] = https://curl.se/bug/?i=15928 [84] = https://curl.se/bug/?i=16482
[83] = https://curl.se/bug/?i=15884 [85] = https://curl.se/bug/?i=16407
[84] = https://curl.se/bug/?i=15826 [86] = https://curl.se/bug/?i=16377
[85] = https://curl.se/bug/?i=15883 [87] = https://curl.se/bug/?i=15975
[86] = https://curl.se/bug/?i=15832 [88] = https://curl.se/bug/?i=16419
[87] = https://curl.se/bug/?i=15800 [89] = https://curl.se/bug/?i=16487
[88] = https://curl.se/bug/?i=15829 [90] = https://curl.se/bug/?i=16488
[89] = https://curl.se/bug/?i=15827 [91] = https://curl.se/bug/?i=16420
[90] = https://curl.se/bug/?i=15828 [92] = https://curl.se/bug/?i=16393
[91] = https://curl.se/bug/?i=15882 [93] = https://curl.se/bug/?i=16277
[92] = https://curl.se/bug/?i=15765 [94] = https://curl.se/bug/?i=16134
[93] = https://curl.se/bug/?i=15809 [95] = https://curl.se/bug/?i=16104
[94] = https://curl.se/bug/?i=15822 [96] = https://curl.se/bug/?i=16004
[95] = https://curl.se/bug/?i=15820 [97] = https://curl.se/bug/?i=16217
[96] = https://curl.se/bug/?i=15915 [98] = https://curl.se/bug/?i=16408
[97] = https://curl.se/bug/?i=15871 [99] = https://curl.se/bug/?i=16478
[98] = https://curl.se/bug/?i=15876 [100] = https://curl.se/bug/?i=16464
[99] = https://curl.se/bug/?i=15906 [101] = https://curl.se/bug/?i=16329
[100] = https://curl.se/bug/?i=15854 [102] = https://curl.se/bug/?i=16467
[101] = https://curl.se/bug/?i=15945 [103] = https://curl.se/bug/?i=16466
[102] = https://curl.se/bug/?i=15873 [104] = https://curl.se/bug/?i=16099
[103] = https://curl.se/bug/?i=15869 [105] = https://curl.se/bug/?i=16468
[104] = https://curl.se/bug/?i=15868 [106] = https://curl.se/bug/?i=16459
[105] = https://curl.se/bug/?i=15867 [107] = https://curl.se/bug/?i=16460
[106] = https://curl.se/bug/?i=15844 [108] = https://curl.se/bug/?i=16461
[107] = https://curl.se/bug/?i=15833 [109] = https://curl.se/bug/?i=16462
[108] = https://curl.se/bug/?i=15908 [111] = https://curl.se/bug/?i=16446
[109] = https://curl.se/bug/?i=15903 [112] = https://curl.se/bug/?i=16457
[110] = https://curl.se/bug/?i=15861 [113] = https://curl.se/bug/?i=16456
[111] = https://curl.se/bug/?i=15937 [114] = https://curl.se/bug/?i=16455
[112] = https://curl.se/bug/?i=15902 [115] = https://curl.se/bug/?i=16453
[113] = https://curl.se/bug/?i=15898 [116] = https://curl.se/bug/?i=16452
[114] = https://curl.se/bug/?i=15900 [119] = https://curl.se/bug/?i=16448
[115] = https://curl.se/bug/?i=15863
[116] = https://curl.se/bug/?i=15801
[117] = https://curl.se/bug/?i=15835
[118] = https://curl.se/bug/?i=15836
[119] = https://curl.se/bug/?i=15897
[120] = https://curl.se/bug/?i=15899
[121] = https://curl.se/bug/?i=15893
[122] = https://curl.se/bug/?i=15895
[123] = https://curl.se/bug/?i=15892
[124] = https://curl.se/bug/?i=15894
[125] = https://curl.se/bug/?i=15891
[126] = https://curl.se/bug/?i=15889
[127] = https://curl.se/bug/?i=15954
[128] = https://curl.se/bug/?i=15881
[129] = https://curl.se/bug/?i=15982
[130] = https://curl.se/bug/?i=15983
[131] = https://curl.se/bug/?i=15981
[132] = https://curl.se/bug/?i=15980
[133] = https://curl.se/bug/?i=15946
[134] = https://curl.se/bug/?i=15979
[135] = https://curl.se/bug/?i=15978
[136] = https://curl.se/bug/?i=15973
[137] = https://curl.se/bug/?i=15939
[138] = https://curl.se/bug/?i=15971
[139] = https://curl.se/bug/?i=15909
[140] = https://curl.se/bug/?i=15941
[141] = https://curl.se/bug/?i=15924
[142] = https://curl.se/bug/?i=15974
[143] = https://curl.se/bug/?i=15958
[144] = https://curl.se/bug/?i=15969
[145] = https://curl.se/bug/?i=15968
[146] = https://curl.se/bug/?i=15967
[147] = https://curl.se/bug/?i=15929
[148] = https://curl.se/bug/?i=15960
[149] = https://curl.se/bug/?i=15925
[150] = https://curl.se/bug/?i=16006
[151] = https://curl.se/bug/?i=15923
[152] = https://curl.se/bug/?i=16012
[153] = https://curl.se/bug/?i=15966
[154] = https://curl.se/bug/?i=15857
[155] = https://curl.se/bug/?i=15957
[156] = https://curl.se/bug/?i=15962
[157] = https://curl.se/bug/?i=15920
[158] = https://curl.se/bug/?i=15955
[159] = https://curl.se/bug/?i=15953
[160] = https://curl.se/bug/?i=16007
[161] = https://curl.se/bug/?i=16007
[162] = https://curl.se/bug/?i=16050
[163] = https://curl.se/bug/?i=16003
[164] = https://curl.se/bug/?i=16002
[165] = https://curl.se/bug/?i=15992
[166] = https://curl.se/bug/?i=16039
[167] = https://curl.se/bug/?i=15990
[168] = https://curl.se/bug/?i=15156
[169] = https://curl.se/bug/?i=16000
[170] = https://curl.se/bug/?i=15996
[171] = https://curl.se/bug/?i=15984
[172] = https://curl.se/bug/?i=15997
[173] = https://curl.se/bug/?i=15988
[174] = https://curl.se/bug/?i=16032
[175] = https://curl.se/bug/?i=16040
[176] = https://curl.se/bug/?i=16037
[177] = https://curl.se/bug/?i=15987
[178] = https://curl.se/bug/?i=15986
[179] = https://curl.se/bug/?i=16022
[180] = https://curl.se/bug/?i=16036
[181] = https://curl.se/bug/?i=16034
[182] = https://curl.se/bug/?i=16033
[183] = https://curl.se/bug/?i=16029
[184] = https://curl.se/bug/?i=16027
[185] = https://curl.se/bug/?i=16014
[186] = https://curl.se/bug/?i=16028
[187] = https://curl.se/bug/?i=16091
[188] = https://curl.se/bug/?i=15865
[189] = https://curl.se/bug/?i=16057
[190] = https://curl.se/bug/?i=16015
[191] = https://curl.se/bug/?i=16048
[192] = https://curl.se/bug/?i=16020
[193] = https://curl.se/bug/?i=16141
[194] = https://curl.se/bug/?i=16019
[195] = https://curl.se/bug/?i=16009
[196] = https://curl.se/bug/?i=16038
[197] = https://curl.se/bug/?i=16135
[198] = https://curl.se/bug/?i=16053
[199] = https://curl.se/bug/?i=16051
[200] = https://curl.se/bug/?i=16081
[201] = https://curl.se/bug/?i=16041
[202] = https://curl.se/bug/?i=16074
[203] = https://curl.se/bug/?i=16089
[204] = https://curl.se/bug/?i=16052
[205] = https://curl.se/bug/?i=16054
[206] = https://curl.se/bug/?i=16118
[207] = https://curl.se/bug/?i=16128
[208] = https://curl.se/bug/?i=16087
[209] = https://curl.se/bug/?i=16131
[210] = https://curl.se/bug/?i=16079
[211] = https://curl.se/bug/?i=16079
[212] = https://curl.se/bug/?i=16075
[213] = https://curl.se/bug/?i=16073
[214] = https://curl.se/bug/?i=16062
[215] = https://curl.se/bug/?i=16068
[216] = https://curl.se/bug/?i=16063
[217] = https://curl.se/bug/?i=16067
[219] = https://curl.se/bug/?i=16044
[220] = https://curl.se/bug/?i=16123
[221] = https://curl.se/bug/?i=16120
[222] = https://curl.se/bug/?i=16121
[223] = https://curl.se/bug/?i=16114
[224] = https://curl.se/bug/?i=16152
[225] = https://curl.se/bug/?i=16113
[226] = https://curl.se/bug/?i=16110
[227] = https://curl.se/bug/?i=16105
[228] = https://curl.se/bug/?i=16103
[229] = https://curl.se/bug/?i=16109
[230] = https://curl.se/bug/?i=16069
[231] = https://curl.se/bug/?i=16076
[232] = https://curl.se/mail/lib-2025-01/0044.html
[233] = https://curl.se/bug/?i=16107
[235] = https://curl.se/bug/?i=16102
[236] = https://curl.se/bug/?i=16101
[237] = https://curl.se/bug/?i=16094
[239] = https://curl.se/bug/?i=16086
[240] = https://curl.se/bug/?i=16097
[241] = https://curl.se/bug/?i=16084
[242] = https://curl.se/bug/?i=16095

View File

@ -48,7 +48,7 @@ AC_DEFUN([CURL_CHECK_DEF], [
tmp_exp="" tmp_exp=""
AC_PREPROC_IFELSE([ AC_PREPROC_IFELSE([
AC_LANG_SOURCE( AC_LANG_SOURCE(
ifelse($2,,,[$2])[[ ifelse($2,,,[$2])[[
#ifdef $1 #ifdef $1
CURL_DEF_TOKEN $1 CURL_DEF_TOKEN $1
#endif #endif
@ -88,14 +88,13 @@ AC_DEFUN([CURL_CHECK_DEF_CC], [
ifelse($3,,[AC_MSG_CHECKING([for compiler definition of $1])]) ifelse($3,,[AC_MSG_CHECKING([for compiler definition of $1])])
AC_COMPILE_IFELSE([ AC_COMPILE_IFELSE([
AC_LANG_SOURCE( AC_LANG_SOURCE(
ifelse($2,,,[$2])[[ ifelse($2,,,[$2])[[
int main(void) int main(void)
{ {
#ifdef $1 #ifndef $1
return 0;
#else
#error force compilation error #error force compilation error
#endif #endif
return 0;
} }
]]) ]])
],[ ],[
@ -126,12 +125,11 @@ AC_DEFUN([CURL_CHECK_LIB_XNET], [
int main(void) int main(void)
{ {
#if defined(__hpux) && defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 600) #if defined(__hpux) && defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 600)
return 0;
#elif defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED) #elif defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)
return 0;
#else #else
#error force compilation error #error force compilation error
#endif #endif
return 0;
} }
]]) ]])
],[ ],[
@ -180,7 +178,8 @@ AC_DEFUN([CURL_CHECK_NATIVE_WINDOWS], [
AC_LANG_PROGRAM([[ AC_LANG_PROGRAM([[
]],[[ ]],[[
#ifdef _WIN32 #ifdef _WIN32
int dummy=1; int dummy = 1;
(void)dummy;
#else #else
#error Not a native Windows build target. #error Not a native Windows build target.
#endif #endif
@ -306,6 +305,7 @@ AC_DEFUN([CURL_CHECK_HEADER_LDAP], [
]],[[ ]],[[
LDAP *ldp = ldap_init("0.0.0.0", LDAP_PORT); LDAP *ldp = ldap_init("0.0.0.0", LDAP_PORT);
int res = ldap_unbind(ldp); int res = ldap_unbind(ldp);
(void)res;
]]) ]])
],[ ],[
curl_cv_header_ldap_h="yes" curl_cv_header_ldap_h="yes"
@ -354,6 +354,7 @@ AC_DEFUN([CURL_CHECK_HEADER_LDAP_SSL], [
#include <ldap_ssl.h> #include <ldap_ssl.h>
]],[[ ]],[[
LDAP *ldp = ldapssl_init("0.0.0.0", LDAPS_PORT, 1); LDAP *ldp = ldapssl_init("0.0.0.0", LDAPS_PORT, 1);
(void)ldp;
]]) ]])
],[ ],[
curl_cv_header_ldap_ssl_h="yes" curl_cv_header_ldap_ssl_h="yes"
@ -433,6 +434,7 @@ AC_DEFUN([CURL_CHECK_LIBS_WINLDAP], [
LDAP *ldp = ldap_init("0.0.0.0", LDAP_PORT); LDAP *ldp = ldap_init("0.0.0.0", LDAP_PORT);
ULONG res = ldap_unbind(ldp); ULONG res = ldap_unbind(ldp);
ber_free(bep, 1); ber_free(bep, 1);
(void)res;
]]) ]])
],[ ],[
curl_cv_ldap_LIBS="$x_nlibs" curl_cv_ldap_LIBS="$x_nlibs"
@ -543,6 +545,7 @@ AC_DEFUN([CURL_CHECK_LIBS_LDAP], [
LDAP *ldp = ldap_init("0.0.0.0", LDAP_PORT); LDAP *ldp = ldap_init("0.0.0.0", LDAP_PORT);
int res = ldap_unbind(ldp); int res = ldap_unbind(ldp);
ber_free(bep, 1); ber_free(bep, 1);
(void)res;
]]) ]])
],[ ],[
curl_cv_ldap_LIBS="$x_nlibs" curl_cv_ldap_LIBS="$x_nlibs"
@ -686,7 +689,8 @@ AC_DEFUN([CURL_CHECK_FUNC_SEND], [
#endif #endif
#endif #endif
]],[[ ]],[[
send(0, 0, 0, 0); char s[] = "";
send(0, (void *)s, 0, 0);
]]) ]])
],[ ],[
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
@ -729,7 +733,8 @@ AC_DEFUN([CURL_CHECK_MSG_NOSIGNAL], [
#endif #endif
#endif #endif
]],[[ ]],[[
int flag=MSG_NOSIGNAL; int flag = MSG_NOSIGNAL;
(void)flag;
]]) ]])
],[ ],[
curl_cv_msg_nosignal="yes" curl_cv_msg_nosignal="yes"
@ -777,6 +782,7 @@ AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [
struct timeval ts; struct timeval ts;
ts.tv_sec = 0; ts.tv_sec = 0;
ts.tv_usec = 0; ts.tv_usec = 0;
(void)ts;
]]) ]])
],[ ],[
curl_cv_struct_timeval="yes" curl_cv_struct_timeval="yes"
@ -793,84 +799,6 @@ AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [
]) ])
dnl TYPE_IN_ADDR_T
dnl -------------------------------------------------
dnl Check for in_addr_t: it is used to receive the return code of inet_addr()
dnl and a few other things.
AC_DEFUN([TYPE_IN_ADDR_T], [
AC_CHECK_TYPE([in_addr_t], ,[
dnl in_addr_t not available
AC_CACHE_CHECK([for in_addr_t equivalent],
[curl_cv_in_addr_t_equiv], [
curl_cv_in_addr_t_equiv="unknown"
for t in "unsigned long" int size_t unsigned long; do
if test "$curl_cv_in_addr_t_equiv" = "unknown"; then
AC_LINK_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
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#endif
]],[[
$t data = inet_addr ("1.2.3.4");
]])
],[
curl_cv_in_addr_t_equiv="$t"
])
fi
done
])
case "$curl_cv_in_addr_t_equiv" in
unknown)
AC_MSG_ERROR([Cannot find a type to use in place of in_addr_t])
;;
*)
AC_DEFINE_UNQUOTED(in_addr_t, $curl_cv_in_addr_t_equiv,
[Type to use in place of in_addr_t when system does not provide it.])
;;
esac
],[
#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
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#endif
])
])
dnl CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC dnl CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC
dnl ------------------------------------------------- dnl -------------------------------------------------
dnl Check if monotonic clock_gettime is available. dnl Check if monotonic clock_gettime is available.
@ -892,6 +820,7 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC], [
]],[[ ]],[[
struct timespec ts; struct timespec ts;
(void)clock_gettime(CLOCK_MONOTONIC, &ts); (void)clock_gettime(CLOCK_MONOTONIC, &ts);
(void)ts;
]]) ]])
],[ ],[
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
@ -926,6 +855,7 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW], [
]],[[ ]],[[
struct timespec ts; struct timespec ts;
(void)clock_gettime(CLOCK_MONOTONIC_RAW, &ts); (void)clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
(void)ts;
]]) ]])
],[ ],[
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
@ -972,6 +902,7 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
]],[[ ]],[[
struct timespec ts; struct timespec ts;
(void)clock_gettime(CLOCK_MONOTONIC, &ts); (void)clock_gettime(CLOCK_MONOTONIC, &ts);
(void)ts;
]]) ]])
],[ ],[
curl_cv_gclk_LIBS="$x_xlibs" curl_cv_gclk_LIBS="$x_xlibs"
@ -1018,10 +949,10 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
#include <time.h> #include <time.h>
]],[[ ]],[[
struct timespec ts; struct timespec ts;
if (0 == clock_gettime(CLOCK_MONOTONIC, &ts)) if(0 == clock_gettime(CLOCK_MONOTONIC, &ts))
exit(0); return 0;
else (void)ts;
exit(1); return 1;
]]) ]])
],[ ],[
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
@ -1168,7 +1099,7 @@ AC_DEFUN([CURL_VERIFY_RUNTIMELIBS], [
dnl point also is available run-time! dnl point also is available run-time!
AC_MSG_CHECKING([run-time libs availability]) AC_MSG_CHECKING([run-time libs availability])
CURL_RUN_IFELSE([ CURL_RUN_IFELSE([
int main() int main(void)
{ {
return 0; return 0;
} }
@ -1380,16 +1311,13 @@ AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
if test "$curl_cv_native_windows" = 'yes'; then if test "$curl_cv_native_windows" = 'yes'; then
AC_MSG_CHECKING([whether build target supports Win32 large files]) AC_MSG_CHECKING([whether build target supports Win32 large files])
case $host_os in if test "$curl_cv_wince" = 'yes'; then
mingw32ce*|cegcc*) dnl Windows CE does not support large files
dnl Windows CE does not support large files curl_win32_has_largefile='no'
curl_win32_has_largefile='no' else
;; dnl All mingw-w64 versions support large files
*) curl_win32_has_largefile='yes'
dnl All mingw-w64 versions support large files fi
curl_win32_has_largefile='yes'
;;
esac
case "$curl_win32_has_largefile" in case "$curl_win32_has_largefile" in
yes) yes)
if test x"$enable_largefile" = 'xno'; then if test x"$enable_largefile" = 'xno'; then
@ -1523,9 +1451,9 @@ dnl Save build info for test runner to pick up and log
AC_DEFUN([CURL_PREPARE_BUILDINFO], [ AC_DEFUN([CURL_PREPARE_BUILDINFO], [
curl_pflags="" curl_pflags=""
case $host in if test "$curl_cv_apple" = 'yes'; then
*-apple-*) curl_pflags="${curl_pflags} APPLE";; curl_pflags="${curl_pflags} APPLE"
esac fi
case $host in case $host in
*-*-*bsd*|*-*-aix*|*-*-hpux*|*-*-interix*|*-*-irix*|*-*-linux*|*-*-solaris*|*-*-sunos*|*-apple-*|*-*-cygwin*|*-*-msys*) *-*-*bsd*|*-*-aix*|*-*-hpux*|*-*-interix*|*-*-irix*|*-*-linux*|*-*-solaris*|*-*-sunos*|*-apple-*|*-*-cygwin*|*-*-msys*)
curl_pflags="${curl_pflags} UNIX";; curl_pflags="${curl_pflags} UNIX";;
@ -1546,14 +1474,24 @@ AC_DEFUN([CURL_PREPARE_BUILDINFO], [
if test "$curl_cv_native_windows" = 'yes'; then if test "$curl_cv_native_windows" = 'yes'; then
curl_pflags="${curl_pflags} WIN32" curl_pflags="${curl_pflags} WIN32"
fi 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" curl_pflags="${curl_pflags} UWP"
fi fi
case $host in
*-*-*bsd*|*-*-aix*|*-*-hpux*|*-*-interix*|*-*-irix*|*-*-linux*|*-*-solaris*|*-*-sunos*|*-apple-*|*-*-cygwin*|*-*-msys*)
curl_pflags="${curl_pflags} UNIX";;
esac
case $host in
*-*-*bsd*)
curl_pflags="${curl_pflags} BSD";;
esac
if test "$curl_cv_cygwin" = 'yes'; then if test "$curl_cv_cygwin" = 'yes'; then
curl_pflags="${curl_pflags} CYGWIN" curl_pflags="${curl_pflags} CYGWIN"
fi fi
case $host_os in case $host_os in
msys*) curl_pflags="${curl_pflags} MSYS";;
msdos*) curl_pflags="${curl_pflags} DOS";; msdos*) curl_pflags="${curl_pflags} DOS";;
amiga*) curl_pflags="${curl_pflags} AMIGA";; amiga*) curl_pflags="${curl_pflags} AMIGA";;
esac esac
@ -1639,27 +1577,13 @@ dnl with very low deployment targets.
dnl dnl
AC_DEFUN([CURL_DARWIN_CFLAGS], [ AC_DEFUN([CURL_DARWIN_CFLAGS], [
old_CFLAGS=$CFLAGS
tst_cflags="no" CFLAGS="$CFLAGS -Werror=partial-availability"
case $host in AC_MSG_CHECKING([whether $CC accepts -Werror=partial-availability])
*-apple-*) AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
tst_cflags="yes" [AC_MSG_RESULT([yes])],
;; [AC_MSG_RESULT([no])
esac CFLAGS=$old_CFLAGS])
AC_MSG_CHECKING([for good-to-use Darwin CFLAGS])
AC_MSG_RESULT([$tst_cflags]);
if test "$tst_cflags" = "yes"; then
old_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Werror=partial-availability"
AC_MSG_CHECKING([whether $CC accepts -Werror=partial-availability])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
CFLAGS=$old_CFLAGS])
fi
]) ])

View File

@ -28,45 +28,75 @@ set -eux; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o pipefail
# build # build
case "${TARGET:-}" in
*Win32) openssl_suffix='-Win32';;
*) openssl_suffix='-Win64';;
esac
if [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2022' ]; then if [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2022' ]; then
openssl_root_win='C:/OpenSSL-v34-Win64' openssl_root_win="C:/OpenSSL-v34${openssl_suffix}"
elif [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2019' ]; then
openssl_root_win="C:/OpenSSL-v11${openssl_suffix}"
elif [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2013' ]; then
openssl_root_win="C:/OpenSSL${openssl_suffix}"
else else
openssl_root_win='C:/OpenSSL-v111-Win64' openssl_root_win="C:/OpenSSL-v111${openssl_suffix}"
fi fi
openssl_root="$(cygpath "${openssl_root_win}")" openssl_root="$(cygpath "${openssl_root_win}")"
if [ "${BUILD_SYSTEM}" = 'CMake' ]; then if [ "${BUILD_SYSTEM}" = 'CMake' ]; then
options='' # Set env CHKPREFILL to the value '_chkprefill' to compare feature detection
[[ "${TARGET:-}" = *'ARM64'* ]] && SKIP_RUN='ARM64 architecture' # results with and without the pre-fill feature. They have to match.
[ -n "${TOOLSET:-}" ] && options+=" -T ${TOOLSET}" for _chkprefill in '' ${CHKPREFILL:-}; do
[ "${OPENSSL}" = 'ON' ] && options+=" -DOPENSSL_ROOT_DIR=${openssl_root_win}" options=''
[ -n "${CURLDEBUG:-}" ] && options+=" -DENABLE_CURLDEBUG=${CURLDEBUG}" [ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF'
[ "${PRJ_CFG}" = 'Debug' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=' [[ "${TARGET}" = *'ARM64'* ]] && SKIP_RUN='ARM64 architecture'
[ "${PRJ_CFG}" = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=' [ -n "${TOOLSET:-}" ] && options+=" -T ${TOOLSET}"
[[ "${PRJ_GEN}" = *'Visual Studio'* ]] && options+=' -DCMAKE_VS_GLOBALS=TrackFileAccess=false' [ "${OPENSSL}" = 'ON' ] && options+=" -DOPENSSL_ROOT_DIR=${openssl_root_win}"
# shellcheck disable=SC2086 [ -n "${CURLDEBUG:-}" ] && options+=" -DENABLE_CURLDEBUG=${CURLDEBUG}"
cmake -B _bld "-G${PRJ_GEN}" ${TARGET:-} ${options} \ if [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2013' ]; then
"-DCURL_USE_OPENSSL=${OPENSSL}" \ mkdir "_bld${_chkprefill}"
"-DCURL_USE_SCHANNEL=${SCHANNEL}" \ cd "_bld${_chkprefill}"
"-DHTTP_ONLY=${HTTP_ONLY}" \ options+=' ..'
"-DBUILD_SHARED_LIBS=${SHARED}" \ root='..'
"-DCMAKE_UNITY_BUILD=${UNITY}" \ else
'-DCURL_TEST_BUNDLES=ON' \ options+=" -B _bld${_chkprefill}"
'-DCURL_WERROR=ON' \ options+=' -DCMAKE_VS_GLOBALS=TrackFileAccess=false'
"-DENABLE_DEBUG=${DEBUG}" \ options+=" -DCMAKE_UNITY_BUILD=${UNITY}"
"-DENABLE_UNICODE=${ENABLE_UNICODE}" \ root='.'
'-DCMAKE_INSTALL_PREFIX=C:/curl' \ fi
"-DCMAKE_BUILD_TYPE=${PRJ_CFG}" \ # shellcheck disable=SC2086
'-DCURL_USE_LIBPSL=OFF' time cmake -G "${PRJ_GEN}" ${TARGET} \
if false; then -DCURL_TEST_BUNDLES=ON \
cat _bld/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true -DCURL_WERROR=ON \
-DBUILD_SHARED_LIBS="${SHARED}" \
-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 \
${options} \
|| { cat ${root}/_bld/CMakeFiles/CMake* 2>/dev/null; false; }
[ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2013' ] && cd ..
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 fi
echo 'curl_config.h'; grep -F '#define' _bld/lib/curl_config.h | sort || true echo 'curl_config.h'; grep -F '#define' _bld/lib/curl_config.h | sort || true
# shellcheck disable=SC2086 # shellcheck disable=SC2086
cmake --build _bld --config "${PRJ_CFG}" --parallel 2 -- ${BUILD_OPT:-} if ! time cmake --build _bld --config "${PRJ_CFG}" --parallel 2 -- ${BUILD_OPT:-}; then
[ "${SHARED}" = 'ON' ] && PATH="$PWD/_bld/lib:$PATH" if [ "${PRJ_GEN}" = 'Visual Studio 9 2008' ]; then
[ "${OPENSSL}" = 'ON' ] && PATH="${openssl_root}:$PATH" find . -name BuildLog.htm -exec dos2unix '{}' +
curl='_bld/src/curl.exe' find . -name BuildLog.htm -exec cat '{}' +
fi
false
fi
[ "${SHARED}" = 'ON' ] && PATH="$PWD/_bld/lib/${PRJ_CFG}:$PATH"
[ "${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 elif [ "${BUILD_SYSTEM}" = 'VisualStudioSolution' ]; then
( (
cd projects cd projects
@ -99,7 +129,7 @@ EOF
curl="builds/libcurl-vc14.10-x64-${PATHPART}-dll-ssl-dll-ipv6-sspi/bin/curl.exe" curl="builds/libcurl-vc14.10-x64-${PATHPART}-dll-ssl-dll-ipv6-sspi/bin/curl.exe"
fi fi
find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' \) -exec file '{}' \; find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' -o -name '*.pdb' \) -exec file '{}' \;
if [ -z "${SKIP_RUN:-}" ]; then if [ -z "${SKIP_RUN:-}" ]; then
"${curl}" --disable --version "${curl}" --disable --version
else else
@ -110,13 +140,14 @@ fi
if [ "${TFLAGS}" != 'skipall' ] && \ if [ "${TFLAGS}" != 'skipall' ] && \
[ "${BUILD_SYSTEM}" = 'CMake' ]; then [ "${BUILD_SYSTEM}" = 'CMake' ]; then
cmake --build _bld --config "${PRJ_CFG}" --parallel 2 --target testdeps time cmake --build _bld --config "${PRJ_CFG}" --parallel 2 --target testdeps
fi fi
# run tests # run tests
if [ "${TFLAGS}" != 'skipall' ] && \ if [ "${TFLAGS}" != 'skipall' ] && \
[ "${TFLAGS}" != 'skiprun' ]; then [ "${TFLAGS}" != 'skiprun' ]; then
export CURL_DIRSUFFIX="${PRJ_CFG}"
if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")" TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
elif [ -x "$(cygpath 'C:/msys64/usr/bin/curl.exe')" ]; then elif [ -x "$(cygpath 'C:/msys64/usr/bin/curl.exe')" ]; then
@ -124,12 +155,12 @@ if [ "${TFLAGS}" != 'skipall' ] && \
fi fi
TFLAGS+=' -j0' TFLAGS+=' -j0'
if [ "${BUILD_SYSTEM}" = 'CMake' ]; then if [ "${BUILD_SYSTEM}" = 'CMake' ]; then
cmake --build _bld --config "${PRJ_CFG}" --target test-ci time cmake --build _bld --config "${PRJ_CFG}" --target test-ci
else else
( (
TFLAGS="-a -p !flaky -r -rm ${TFLAGS}" TFLAGS="-a -p !flaky -r -rm ${TFLAGS}"
cd _bld/tests cd _bld/tests
./runtests.pl time ./runtests.pl
) )
fi fi
fi fi
@ -138,5 +169,5 @@ fi
if [ "${EXAMPLES}" = 'ON' ] && \ if [ "${EXAMPLES}" = 'ON' ] && \
[ "${BUILD_SYSTEM}" = 'CMake' ]; then [ "${BUILD_SYSTEM}" = 'CMake' ]; then
cmake --build _bld --config "${PRJ_CFG}" --parallel 2 --target curl-examples time cmake --build _bld --config "${PRJ_CFG}" --parallel 2 --target curl-examples
fi fi

View File

@ -31,8 +31,11 @@
version: 7.50.0.{build} version: 7.50.0.{build}
environment: environment:
BUILD_SYSTEM: CMake
UNITY: 'ON' UNITY: 'ON'
OPENSSL: 'OFF' OPENSSL: 'OFF'
SCHANNEL: 'OFF'
ENABLE_UNICODE: 'OFF'
DEBUG: 'ON' DEBUG: 'ON'
SHARED: 'OFF' SHARED: 'OFF'
HTTP_ONLY: 'OFF' HTTP_ONLY: 'OFF'
@ -45,89 +48,77 @@ environment:
- job_name: 'CMake, VS2022, Release, x64, OpenSSL 3.4, Shared, Build-tests' - job_name: 'CMake, VS2022, Release, x64, OpenSSL 3.4, Shared, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
BUILD_SYSTEM: CMake
PRJ_GEN: 'Visual Studio 17 2022' PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64' TARGET: '-A x64'
PRJ_CFG: Release PRJ_CFG: Release
OPENSSL: 'ON' OPENSSL: 'ON'
SCHANNEL: 'OFF'
ENABLE_UNICODE: 'OFF'
SHARED: 'ON' SHARED: 'ON'
- job_name: 'CMake, VS2022, Release, arm64, Schannel, Static, Build-tests' - job_name: 'CMake, VS2022, Release, arm64, Schannel, Static, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
BUILD_SYSTEM: CMake
PRJ_GEN: 'Visual Studio 17 2022' PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A ARM64' TARGET: '-A ARM64'
PRJ_CFG: Release PRJ_CFG: Release
SCHANNEL: 'ON' SCHANNEL: 'ON'
ENABLE_UNICODE: 'OFF'
DEBUG: 'OFF' DEBUG: 'OFF'
CURLDEBUG: 'ON' CURLDEBUG: 'ON'
- job_name: 'CMake, VS2010, Release, x86, Schannel, Static, Build-tests' - job_name: 'CMake, VS2008, Debug, x86, OpenSSL 1.0.2 + Schannel, Shared, Build-tests & examples'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2013'
BUILD_SYSTEM: CMake PRJ_GEN: 'Visual Studio 9 2008'
PRJ_GEN: 'Visual Studio 10 2010'
TARGET: '-A Win32' TARGET: '-A Win32'
PRJ_CFG: Release
SCHANNEL: 'ON'
ENABLE_UNICODE: 'OFF'
SHARED: 'ON'
- job_name: 'CMake, VS2010, Debug, x64, Schannel, Static, Build-tests & examples'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
BUILD_SYSTEM: CMake
PRJ_GEN: 'Visual Studio 10 2010'
TARGET: '-A x64'
PRJ_CFG: Debug
SCHANNEL: 'ON'
ENABLE_UNICODE: 'OFF'
SHARED: 'ON'
EXAMPLES: 'ON'
- job_name: 'CMake, VS2012, Debug, x64, OpenSSL 1.1.1, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
BUILD_SYSTEM: CMake
PRJ_GEN: 'Visual Studio 11 2012'
TARGET: '-A x64'
PRJ_CFG: Debug PRJ_CFG: Debug
OPENSSL: 'ON' OPENSSL: 'ON'
SCHANNEL: 'OFF' SCHANNEL: 'ON'
ENABLE_UNICODE: 'OFF'
SHARED: 'ON' SHARED: 'ON'
- job_name: 'CMake, VS2013, Debug, x64, OpenSSL 1.1.1, Build-only' EXAMPLES: 'ON'
- job_name: 'CMake, VS2010, Debug, x64, Schannel, Shared, Build-tests & examples'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
PRJ_GEN: 'Visual Studio 10 2010'
TARGET: '-A x64'
PRJ_CFG: Debug
SCHANNEL: 'ON'
SHARED: 'ON'
EXAMPLES: 'ON'
- job_name: 'CMake, VS2012, Release, x86, OpenSSL 1.1.1 + Schannel, Shared, Build-tests'
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'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
BUILD_SYSTEM: CMake
PRJ_GEN: 'Visual Studio 12 2013' PRJ_GEN: 'Visual Studio 12 2013'
TARGET: '-A x64' TARGET: '-A x64'
PRJ_CFG: Debug PRJ_CFG: Debug
OPENSSL: 'ON' OPENSSL: 'ON'
SCHANNEL: 'OFF'
ENABLE_UNICODE: 'OFF'
SHARED: 'ON' SHARED: 'ON'
TFLAGS: 'skipall' TFLAGS: 'skipall'
- job_name: 'CMake, VS2015, Debug, x64, OpenSSL 1.1.1, Build-only' - job_name: 'CMake, VS2015, Debug, x64, OpenSSL 1.1.1, Static, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
BUILD_SYSTEM: CMake
PRJ_GEN: 'Visual Studio 14 2015' PRJ_GEN: 'Visual Studio 14 2015'
TARGET: '-A x64' TARGET: '-A x64'
PRJ_CFG: Debug PRJ_CFG: Debug
OPENSSL: 'ON' OPENSSL: 'ON'
SCHANNEL: 'OFF'
ENABLE_UNICODE: 'OFF'
SHARED: 'ON'
TFLAGS: 'skipall' TFLAGS: 'skipall'
- job_name: 'CMake, VS2017, Debug, x64, OpenSSL 1.1.1, Build-only' - job_name: 'CMake, VS2017, Debug, x64, OpenSSL 1.1.1, Shared, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017'
BUILD_SYSTEM: CMake
PRJ_GEN: 'Visual Studio 15 2017' PRJ_GEN: 'Visual Studio 15 2017'
TARGET: '-A x64' TARGET: '-A x64'
PRJ_CFG: Debug PRJ_CFG: Debug
OPENSSL: 'ON' OPENSSL: 'ON'
SCHANNEL: 'OFF'
ENABLE_UNICODE: 'OFF'
SHARED: 'ON' SHARED: 'ON'
TFLAGS: 'skipall' TFLAGS: 'skipall'
- job_name: 'CMake, VS2019, Debug, x64, OpenSSL 1.1.0 + Schannel, Shared, 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, Schannel, Static, Unicode, Build-tests & examples, clang-cl' - job_name: 'CMake, VS2022, Debug, x64, Schannel, Static, Unicode, Build-tests & examples, clang-cl'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
BUILD_SYSTEM: CMake
PRJ_GEN: 'Visual Studio 17 2022' PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64' TARGET: '-A x64'
PRJ_CFG: Debug PRJ_CFG: Debug
@ -137,7 +128,6 @@ environment:
TOOLSET: 'ClangCl' TOOLSET: 'ClangCl'
- job_name: 'CMake, VS2022, Debug, x64, Schannel, Static, Unicode, Build-tests' - job_name: 'CMake, VS2022, Debug, x64, Schannel, Static, Unicode, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
BUILD_SYSTEM: CMake
PRJ_GEN: 'Visual Studio 17 2022' PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64' TARGET: '-A x64'
PRJ_CFG: Debug PRJ_CFG: Debug
@ -145,7 +135,6 @@ environment:
ENABLE_UNICODE: 'ON' ENABLE_UNICODE: 'ON'
- job_name: 'CMake, VS2022, Release, x64, Schannel, Shared, Unicode, DEBUGBUILD, no-CURLDEBUG, Build-tests' - job_name: 'CMake, VS2022, Release, x64, Schannel, Shared, Unicode, DEBUGBUILD, no-CURLDEBUG, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
BUILD_SYSTEM: CMake
PRJ_GEN: 'Visual Studio 17 2022' PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64' TARGET: '-A x64'
PRJ_CFG: Release PRJ_CFG: Release
@ -155,20 +144,14 @@ environment:
CURLDEBUG: 'OFF' CURLDEBUG: 'OFF'
- job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, Build-tests' - job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
BUILD_SYSTEM: CMake
PRJ_GEN: 'Visual Studio 17 2022' PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64' TARGET: '-A x64'
PRJ_CFG: Debug PRJ_CFG: Debug
SCHANNEL: 'OFF'
ENABLE_UNICODE: 'OFF'
- job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, HTTP only, Build-tests' - job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, HTTP only, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
BUILD_SYSTEM: CMake
PRJ_GEN: 'Visual Studio 17 2022' PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64' TARGET: '-A x64'
PRJ_CFG: Debug PRJ_CFG: Debug
SCHANNEL: 'OFF'
ENABLE_UNICODE: 'OFF'
HTTP_ONLY: 'ON' HTTP_ONLY: 'ON'
# winbuild-based builds # winbuild-based builds
@ -254,5 +237,5 @@ skip_commits:
#artifacts: #artifacts:
# - path: '**/curl.exe' # - path: '**/curl.exe'
# name: curl # name: curl
# - path: '**/*curl*.dll' # - path: '**/*.dll'
# name: libcurl dll # name: libcurl dll

View File

@ -493,8 +493,12 @@ dnl **********************************************************************
CURL_CHECK_COMPILER CURL_CHECK_COMPILER
CURL_CHECK_NATIVE_WINDOWS CURL_CHECK_NATIVE_WINDOWS
curl_cv_wince='no'
curl_cv_winuwp='no' curl_cv_winuwp='no'
if test "$curl_cv_native_windows" = "yes"; then if test "$curl_cv_native_windows" = "yes"; then
case $host_os in
mingw32ce*) curl_cv_wince='yes';;
esac
case "$CPPFLAGS" in case "$CPPFLAGS" in
*-DWINSTORECOMPAT*) curl_cv_winuwp='yes';; *-DWINSTORECOMPAT*) curl_cv_winuwp='yes';;
esac esac
@ -591,14 +595,16 @@ dnl **********************************************************************
CURL_CHECK_WIN32_LARGEFILE CURL_CHECK_WIN32_LARGEFILE
CURL_CHECK_WIN32_CRYPTO CURL_CHECK_WIN32_CRYPTO
CURL_DARWIN_CFLAGS curl_cv_apple='no'
case $host in case $host in
*-apple-*) *-apple-*) curl_cv_apple='yes';;
CURL_SUPPORTS_BUILTIN_AVAILABLE
;;
esac esac
if test "$curl_cv_apple" = 'yes'; then
CURL_DARWIN_CFLAGS
CURL_SUPPORTS_BUILTIN_AVAILABLE
fi
curl_cv_cygwin='no' curl_cv_cygwin='no'
case $host_os in case $host_os in
cygwin*|msys*) curl_cv_cygwin='yes';; cygwin*|msys*) curl_cv_cygwin='yes';;
@ -881,7 +887,7 @@ AS_HELP_STRING([--disable-telnet],[Disable TELNET support]),
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
) )
if test "$curl_cv_winuwp" = 'yes'; then if test "$curl_cv_winuwp" = 'yes' -o "$curl_cv_wince" = 'yes'; then
AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET]) AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
CURL_DISABLE_TELNET=1 CURL_DISABLE_TELNET=1
fi fi
@ -1159,11 +1165,42 @@ if test "$HAVE_GETHOSTBYNAME" != "1"; then
]) ])
fi fi
if test "$HAVE_GETHOSTBYNAME" != "1"; then
if test "$curl_cv_wince" = 'yes'; then
dnl This is for Windows CE systems
winsock_LIB="-lws2"
if test ! -z "$winsock_LIB"; then
my_ac_save_LIBS=$LIBS
LIBS="$winsock_LIB $LIBS"
AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
#endif
]],[[
gethostbyname("localhost");
]])
],[
AC_MSG_RESULT([yes])
HAVE_GETHOSTBYNAME="1"
],[
AC_MSG_RESULT([no])
winsock_LIB=""
LIBS=$my_ac_save_LIBS
])
fi
fi
fi
# In UWP mode gethostbyname gets detected via the core libs, but some # In UWP mode gethostbyname gets detected via the core libs, but some
# code (in6addr_any) still need ws2_32, so let us detect and add it. # code (in6addr_any) still need ws2_32, so let us detect and add it.
if test "$HAVE_GETHOSTBYNAME" != "1" -o "$curl_cv_winuwp" = "yes"; then if test "$HAVE_GETHOSTBYNAME" != "1" -o "$curl_cv_winuwp" = "yes"; then
dnl This is for Winsock systems
if test "$curl_cv_native_windows" = "yes"; then if test "$curl_cv_native_windows" = "yes"; then
dnl This is for Winsock systems
winsock_LIB="-lws2_32" winsock_LIB="-lws2_32"
if test ! -z "$winsock_LIB"; then if test ! -z "$winsock_LIB"; then
my_ac_save_LIBS=$LIBS my_ac_save_LIBS=$LIBS
@ -1241,7 +1278,8 @@ if test "$HAVE_GETHOSTBYNAME" != "1" -o "${with_amissl+set}" = set; then
struct Library *SocketBase = NULL; struct Library *SocketBase = NULL;
#endif #endif
]],[[ ]],[[
gethostbyname("localhost"); unsigned char host[] = "localhost";
gethostbyname(host);
]]) ]])
],[ ],[
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
@ -1715,12 +1753,11 @@ AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
#include <netinet/in6.h> #include <netinet/in6.h>
#endif #endif
#endif #endif
int main(void) int main(void)
{ {
struct sockaddr_in6 s; int s = (int)sizeof(struct sockaddr_in6);
(void)s; (void)s;
return socket(AF_INET6, SOCK_STREAM, 0) < 0; return socket(AF_INET6, SOCK_STREAM, 0) > 0;
} }
]]) ]])
], ],
@ -1731,6 +1768,10 @@ AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
) )
) )
if test "$curl_cv_wince" = 'yes'; then
ipv6=no
fi
if test "$ipv6" = yes; then if test "$ipv6" = yes; then
curl_ipv6_msg="enabled" curl_ipv6_msg="enabled"
AC_DEFINE(USE_IPV6, 1, [Define if you want to enable IPv6 support]) AC_DEFINE(USE_IPV6, 1, [Define if you want to enable IPv6 support])
@ -1752,6 +1793,7 @@ if test "$ipv6" = yes; then
]], [[ ]], [[
struct sockaddr_in6 s; struct sockaddr_in6 s;
s.sin6_scope_id = 0; s.sin6_scope_id = 0;
(void)s;
]]) ]])
],[ ],[
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
@ -1788,6 +1830,9 @@ int main(int argc, char **argv)
],[ ],[
curl_cv_writable_argv=cross curl_cv_writable_argv=cross
]) ])
if test "$curl_cv_writable_argv" = 'cross' -a "$curl_cv_apple" = 'yes'; then
curl_cv_writable_argv=yes
fi
case $curl_cv_writable_argv in case $curl_cv_writable_argv in
yes) yes)
AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv]) AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
@ -1933,51 +1978,48 @@ if test x"$want_gss" = xyes; then
LIBS="-lgss $LIBS" LIBS="-lgss $LIBS"
link_pkgconfig=1 link_pkgconfig=1
elif test -z "$GSSAPI_LIB_DIR"; then elif test -z "$GSSAPI_LIB_DIR"; then
case $host in if test "$curl_cv_apple" = 'yes'; then
*-apple-*) LIBS="-lgssapi_krb5 -lresolv $LIBS"
LIBS="-lgssapi_krb5 -lresolv $LIBS" else
;; if test $GSSAPI_ROOT != "/usr"; then
*) CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig)
if test $GSSAPI_ROOT != "/usr"; then else
CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig) CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
else fi
CURL_CHECK_PKGCONFIG(mit-krb5-gssapi) if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
fi dnl krb5-config doesn't have --libs-only-L or similar, put everything
if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then dnl into LIBS
dnl krb5-config doesn't have --libs-only-L or similar, put everything gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
dnl into LIBS LIBS="$gss_libs $LIBS"
gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi` elif test "$PKGCONFIG" != "no"; then
LIBS="$gss_libs $LIBS" gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi`
elif test "$PKGCONFIG" != "no"; then LIBS="$gss_libs $LIBS"
gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi` link_pkgconfig=1
LIBS="$gss_libs $LIBS" elif test -f "$KRB5CONFIG"; then
link_pkgconfig=1 dnl krb5-config doesn't have --libs-only-L or similar, put everything
elif test -f "$KRB5CONFIG"; then dnl into LIBS
dnl krb5-config doesn't have --libs-only-L or similar, put everything gss_libs=`$KRB5CONFIG --libs gssapi`
dnl into LIBS LIBS="$gss_libs $LIBS"
gss_libs=`$KRB5CONFIG --libs gssapi` link_pkgconfig=1
LIBS="$gss_libs $LIBS" else
link_pkgconfig=1 case $host in
else *-hp-hpux*)
case $host in gss_libname="gss"
*-hp-hpux*) ;;
gss_libname="gss" *)
;; gss_libname="gssapi"
*) ;;
gss_libname="gssapi" esac
;;
esac
if test "$GSSAPI_ROOT" != "yes"; then if test "$GSSAPI_ROOT" != "yes"; then
LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff" LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
LDFLAGSPC="$LDFLAGSPC -L$GSSAPI_ROOT/lib$libsuff" LDFLAGSPC="$LDFLAGSPC -L$GSSAPI_ROOT/lib$libsuff"
LIBS="-l$gss_libname $LIBS" LIBS="-l$gss_libname $LIBS"
else else
LIBS="-l$gss_libname $LIBS" LIBS="-l$gss_libname $LIBS"
fi
fi fi
;; fi
esac fi
else else
LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
LDFLAGSPC="$LDFLAGSPC $GSSAPI_LIB_DIR" LDFLAGSPC="$LDFLAGSPC $GSSAPI_LIB_DIR"
@ -2059,11 +2101,14 @@ CURL_WITH_RUSTLS
dnl link required libraries for USE_WIN32_CRYPTO or SCHANNEL_ENABLED dnl link required libraries for USE_WIN32_CRYPTO or SCHANNEL_ENABLED
if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$SCHANNEL_ENABLED" = "x1"; then if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$SCHANNEL_ENABLED" = "x1"; then
LIBS="-ladvapi32 -lcrypt32 $LIBS" LIBS="-lcrypt32 $LIBS"
if test "$curl_cv_wince" = 'no'; then
LIBS="-ladvapi32 $LIBS"
fi
fi fi
dnl link bcrypt for BCryptGenRandom() (used when building for Vista or newer) dnl link bcrypt for BCryptGenRandom() (used when building for Vista or newer)
if test "x$curl_cv_native_windows" = "xyes"; then if test "x$curl_cv_native_windows" = "xyes" -a "$curl_cv_wince" = 'no'; then
LIBS="-lbcrypt $LIBS" LIBS="-lbcrypt $LIBS"
fi fi
@ -2329,8 +2374,8 @@ if test X"$OPT_LIBSSH2" != Xno; then
CPPFLAGS="$CPPFLAGS $CPP_SSH2" CPPFLAGS="$CPPFLAGS $CPP_SSH2"
LIBS="$LIB_SSH2 $LIBS" LIBS="$LIB_SSH2 $LIBS"
dnl check for function added in libssh2 version 1.0 dnl check for function added in libssh2 version 1.2.8
AC_CHECK_LIB(ssh2, libssh2_session_block_directions) AC_CHECK_LIB(ssh2, libssh2_free)
AC_CHECK_HEADER(libssh2.h, AC_CHECK_HEADER(libssh2.h,
curl_ssh_msg="enabled (libssh2)" curl_ssh_msg="enabled (libssh2)"
@ -2608,7 +2653,11 @@ dnl ----------------------------
dnl check Windows Unicode option dnl check Windows Unicode option
dnl ---------------------------- dnl ----------------------------
want_winuni="no" if test "$curl_cv_wince" = 'yes'; then
want_winuni="yes"
else
want_winuni="no"
fi
if test "$curl_cv_native_windows" = "yes"; then if test "$curl_cv_native_windows" = "yes"; then
if test "$curl_cv_winuwp" = 'yes'; then if test "$curl_cv_winuwp" = 'yes'; then
want_winuni="yes" want_winuni="yes"
@ -2732,36 +2781,34 @@ dnl Check for the presence of AppleIDN
dnl ********************************************************************** dnl **********************************************************************
tst_links_appleidn='no' tst_links_appleidn='no'
case $host in if test "$curl_cv_apple" = 'yes'; then
*-apple-*) AC_MSG_CHECKING([whether to build with Apple IDN])
AC_MSG_CHECKING([whether to build with Apple IDN]) OPT_IDN="default"
OPT_IDN="default" AC_ARG_WITH(apple-idn,
AC_ARG_WITH(apple-idn,
AS_HELP_STRING([--with-apple-idn],[Enable AppleIDN]) AS_HELP_STRING([--with-apple-idn],[Enable AppleIDN])
AS_HELP_STRING([--without-apple-idn],[Disable AppleIDN]), AS_HELP_STRING([--without-apple-idn],[Disable AppleIDN]),
[OPT_IDN=$withval]) [OPT_IDN=$withval])
case "$OPT_IDN" in case "$OPT_IDN" in
yes) yes)
dnl --with-apple-idn option used dnl --with-apple-idn option used
AC_MSG_RESULT([yes, check]) AC_MSG_RESULT([yes, check])
AC_CHECK_LIB(icucore, uidna_openUTS46, AC_CHECK_LIB(icucore, uidna_openUTS46,
[ [
AC_CHECK_HEADERS(unicode/uidna.h, AC_CHECK_HEADERS(unicode/uidna.h,
curl_idn_msg="enabled (AppleIDN)" curl_idn_msg="enabled (AppleIDN)"
AC_DEFINE(USE_APPLE_IDN, 1, [if AppleIDN]) AC_DEFINE(USE_APPLE_IDN, 1, [if AppleIDN])
USE_APPLE_IDN=1 USE_APPLE_IDN=1
IDN_ENABLED=1 IDN_ENABLED=1
LIBS="-licucore -liconv $LIBS" LIBS="-licucore -liconv $LIBS"
tst_links_appleidn='yes' tst_links_appleidn='yes'
) )
]) ])
;; ;;
*) *)
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
;; ;;
esac esac
;; fi
esac
dnl ********************************************************************** dnl **********************************************************************
dnl Check for the presence of libidn2 dnl Check for the presence of libidn2
@ -4005,8 +4052,6 @@ case $host_os in
;; ;;
esac esac
TYPE_IN_ADDR_T
TYPE_SOCKADDR_STORAGE TYPE_SOCKADDR_STORAGE
CURL_CHECK_FUNC_SELECT CURL_CHECK_FUNC_SELECT
@ -4044,8 +4089,6 @@ CURL_CHECK_FUNC_SOCKET
CURL_CHECK_FUNC_SOCKETPAIR CURL_CHECK_FUNC_SOCKETPAIR
CURL_CHECK_FUNC_STRDUP CURL_CHECK_FUNC_STRDUP
CURL_CHECK_FUNC_STRERROR_R CURL_CHECK_FUNC_STRERROR_R
CURL_CHECK_FUNC_STRTOK_R
CURL_CHECK_FUNC_STRTOLL
case $host in case $host in
*msdosdjgpp) *msdosdjgpp)
@ -4065,14 +4108,12 @@ AC_CHECK_FUNCS([\
getpwuid_r \ getpwuid_r \
getrlimit \ getrlimit \
gettimeofday \ gettimeofday \
if_nametoindex \
mach_absolute_time \ mach_absolute_time \
pipe \ pipe \
poll \ poll \
sendmsg \ sendmsg \
sendmmsg \ sendmmsg \
setlocale \ setlocale \
setmode \
setrlimit \ setrlimit \
snprintf \ snprintf \
utime \ utime \
@ -4080,14 +4121,21 @@ AC_CHECK_FUNCS([\
]) ])
if test "$curl_cv_native_windows" != 'yes'; then if test "$curl_cv_native_windows" != 'yes'; then
AC_CHECK_FUNCS([sched_yield]) AC_CHECK_FUNCS([\
if_nametoindex \
realpath \
sched_yield \
])
CURL_CHECK_FUNC_STRCASECMP CURL_CHECK_FUNC_STRCASECMP
CURL_CHECK_FUNC_STRCMPI CURL_CHECK_FUNC_STRCMPI
CURL_CHECK_FUNC_STRICMP CURL_CHECK_FUNC_STRICMP
fi fi
if test "$curl_cv_native_windows" = 'yes' -o "$curl_cv_cygwin" = 'yes'; then if test "$curl_cv_wince" = 'no'; then
AC_CHECK_FUNCS([_setmode]) AC_CHECK_FUNCS([setmode])
if test "$curl_cv_native_windows" = 'yes' -o "$curl_cv_cygwin" = 'yes'; then
AC_CHECK_FUNCS([_setmode])
fi
fi fi
if test -z "$ssl_backends"; then if test -z "$ssl_backends"; then
@ -4136,7 +4184,7 @@ AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
CURL_CHECK_LIB_ARES CURL_CHECK_LIB_ARES
CURL_CHECK_OPTION_THREADED_RESOLVER CURL_CHECK_OPTION_THREADED_RESOLVER
if test "$ipv6" = yes; then if test "$ipv6" = yes -a "$curl_cv_apple" = 'yes'; then
CURL_DARWIN_SYSTEMCONFIGURATION CURL_DARWIN_SYSTEMCONFIGURATION
fi fi
@ -4467,7 +4515,7 @@ AS_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
want_unix_sockets=auto want_unix_sockets=auto
] ]
) )
if test "x$want_unix_sockets" != "xno"; then if test "x$want_unix_sockets" != "xno" -a "$curl_cv_wince" = 'no'; then
if test "x$curl_cv_native_windows" = "xyes"; then if test "x$curl_cv_native_windows" = "xyes"; then
USE_UNIX_SOCKETS=1 USE_UNIX_SOCKETS=1
AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets]) AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
@ -5017,7 +5065,7 @@ if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \
-o "x$USE_THREADS_WIN32" = "x1"; then -o "x$USE_THREADS_WIN32" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS" SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
fi fi
if test "x$USE_ARES" = "x1" -a "$want_threaded_resolver" = "yes"; then if test "x$USE_ARES" = "x1" -a "$want_threaded_resolver" = "yes" -a "x$want_httpsrr" != "xno"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES asyn-rr" SUPPORT_FEATURES="$SUPPORT_FEATURES asyn-rr"
fi fi
if test "x$IDN_ENABLED" = "x1"; then if test "x$IDN_ENABLED" = "x1"; then

View File

@ -137,7 +137,7 @@ for a list of these algorithms. Also, (since curl 7.77.0)
[documentation for the Windows version in [documentation for the Windows version in
use](https://learn.microsoft.com/en-us/windows/win32/secauthn/cipher-suites-in-schannel) use](https://learn.microsoft.com/en-us/windows/win32/secauthn/cipher-suites-in-schannel)
to see how that affects the cipher suite selection. When not specifying the to see how that affects the cipher suite selection. When not specifying the
`--chiphers` and `--tl13-ciphers` options curl passes this flag by default. `--ciphers` and `--tls13-ciphers` options curl passes this flag by default.
## Examples ## Examples

View File

@ -43,15 +43,19 @@ To fix before we remove the experimental label:
Building curl with ngtcp2 involves 3 components: `ngtcp2` itself, `nghttp3` and a QUIC supporting TLS library. The supported TLS libraries are covered below. Building curl with ngtcp2 involves 3 components: `ngtcp2` itself, `nghttp3` and a QUIC supporting TLS library. The supported TLS libraries are covered below.
* `ngtcp2`: v1.2.0 While any version of `ngtcp2` and `nghttp3` from v1.0.0 on are expected to
* `nghttp3`: v1.1.0 work, using the latest versions often brings functional and performance
improvements.
The build examples use `$NGHTTP3_VERION` and `$NGTCP2_VERION` as placeholders
for the version you build.
## Build with quictls ## Build with quictls
OpenSSL does not offer the required APIs for building a QUIC client. You need OpenSSL does not offer the required APIs for building a QUIC client. You need
to use a TLS library that has such APIs and that works with *ngtcp2*. to use a TLS library that has such APIs and that works with *ngtcp2*.
Build quictls: Build quictls (any `+quic` tagged version works):
% git clone --depth 1 -b openssl-3.1.4+quic https://github.com/quictls/openssl % git clone --depth 1 -b openssl-3.1.4+quic https://github.com/quictls/openssl
% cd openssl % cd openssl
@ -62,7 +66,7 @@ Build quictls:
Build nghttp3: Build nghttp3:
% cd .. % cd ..
% git clone -b v1.1.0 https://github.com/ngtcp2/nghttp3 % git clone -b $NGHTTP3_VERION https://github.com/ngtcp2/nghttp3
% cd nghttp3 % cd nghttp3
% git submodule update --init % git submodule update --init
% autoreconf -fi % autoreconf -fi
@ -73,7 +77,7 @@ Build nghttp3:
Build ngtcp2: Build ngtcp2:
% cd .. % cd ..
% git clone -b v1.2.0 https://github.com/ngtcp2/ngtcp2 % git clone -b $NGTCP2_VERION https://github.com/ngtcp2/ngtcp2
% cd ngtcp2 % cd ngtcp2
% autoreconf -fi % autoreconf -fi
% ./configure PKG_CONFIG_PATH=<somewhere1>/lib/pkgconfig:<somewhere2>/lib/pkgconfig LDFLAGS="-Wl,-rpath,<somewhere1>/lib" --prefix=<somewhere3> --enable-lib-only % ./configure PKG_CONFIG_PATH=<somewhere1>/lib/pkgconfig:<somewhere2>/lib/pkgconfig LDFLAGS="-Wl,-rpath,<somewhere1>/lib" --prefix=<somewhere3> --enable-lib-only
@ -106,7 +110,7 @@ Build GnuTLS:
Build nghttp3: Build nghttp3:
% cd .. % cd ..
% git clone -b v1.1.0 https://github.com/ngtcp2/nghttp3 % git clone -b $NGHTTP3_VERION https://github.com/ngtcp2/nghttp3
% cd nghttp3 % cd nghttp3
% git submodule update --init % git submodule update --init
% autoreconf -fi % autoreconf -fi
@ -117,7 +121,7 @@ Build nghttp3:
Build ngtcp2: Build ngtcp2:
% cd .. % cd ..
% git clone -b v1.2.0 https://github.com/ngtcp2/ngtcp2 % git clone -b $NGTCP2_VERION https://github.com/ngtcp2/ngtcp2
% cd ngtcp2 % cd ngtcp2
% autoreconf -fi % autoreconf -fi
% ./configure PKG_CONFIG_PATH=<somewhere1>/lib/pkgconfig:<somewhere2>/lib/pkgconfig LDFLAGS="-Wl,-rpath,<somewhere1>/lib" --prefix=<somewhere3> --enable-lib-only --with-gnutls % ./configure PKG_CONFIG_PATH=<somewhere1>/lib/pkgconfig:<somewhere2>/lib/pkgconfig LDFLAGS="-Wl,-rpath,<somewhere1>/lib" --prefix=<somewhere3> --enable-lib-only --with-gnutls
@ -148,7 +152,7 @@ Build wolfSSL:
Build nghttp3: Build nghttp3:
% cd .. % cd ..
% git clone -b v1.1.0 https://github.com/ngtcp2/nghttp3 % git clone -b $NGHTTP3_VERION https://github.com/ngtcp2/nghttp3
% cd nghttp3 % cd nghttp3
% git submodule update --init % git submodule update --init
% autoreconf -fi % autoreconf -fi
@ -159,7 +163,7 @@ Build nghttp3:
Build ngtcp2: Build ngtcp2:
% cd .. % cd ..
% git clone -b v1.2.0 https://github.com/ngtcp2/ngtcp2 % git clone -b $NGTCP2_VERION https://github.com/ngtcp2/ngtcp2
% cd ngtcp2 % cd ngtcp2
% autoreconf -fi % autoreconf -fi
% ./configure PKG_CONFIG_PATH=<somewhere1>/lib/pkgconfig:<somewhere2>/lib/pkgconfig LDFLAGS="-Wl,-rpath,<somewhere1>/lib" --prefix=<somewhere3> --enable-lib-only --with-wolfssl % ./configure PKG_CONFIG_PATH=<somewhere1>/lib/pkgconfig:<somewhere2>/lib/pkgconfig LDFLAGS="-Wl,-rpath,<somewhere1>/lib" --prefix=<somewhere3> --enable-lib-only --with-wolfssl
@ -210,10 +214,12 @@ Build curl:
QUIC support is **EXPERIMENTAL** QUIC support is **EXPERIMENTAL**
Build OpenSSL 3.3.1: Use OpenSSL 3.3.1 or newer (QUIC support was added in 3.3.0, with
shortcomings on some platforms like macOS). 3.4.1 or newer is recommended.
Build via:
% cd .. % cd ..
% git clone -b openssl-3.3.1 https://github.com/openssl/openssl % git clone -b $OPENSSL_VERSION https://github.com/openssl/openssl
% cd openssl % cd openssl
% ./config enable-tls1_3 --prefix=<somewhere> --libdir=lib % ./config enable-tls1_3 --prefix=<somewhere> --libdir=lib
% make % make
@ -222,7 +228,7 @@ Build OpenSSL 3.3.1:
Build nghttp3: Build nghttp3:
% cd .. % cd ..
% git clone -b v1.1.0 https://github.com/ngtcp2/nghttp3 % git clone -b $NGHTTP3_VERION https://github.com/ngtcp2/nghttp3
% cd nghttp3 % cd nghttp3
% git submodule update --init % git submodule update --init
% autoreconf -fi % autoreconf -fi
@ -245,7 +251,7 @@ You can build curl with cmake:
% cd .. % cd ..
% git clone https://github.com/curl/curl % git clone https://github.com/curl/curl
% cd curl % cd curl
% cmake . -B bld -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON % cmake -B bld -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON
% cmake --build bld % cmake --build bld
% cmake --install bld % cmake --install bld

View File

@ -21,6 +21,12 @@ CMake's GUIs.
A CMake configuration of curl is similar to the autotools build of curl. A CMake configuration of curl is similar to the autotools build of curl.
It consists of the following steps after you have unpacked the source. It consists of the following steps after you have unpacked the source.
We recommend building with CMake on Windows. For instructions on migrating
from the `projects/Windows` Visual Studio solution files, see
[this section](#migrating-from-visual-studio-ide-project-files). For
instructions on migrating from the winbuild builds, see
[the following section](#migrating-from-winbuild-builds).
## Using `cmake` ## Using `cmake`
You can configure for in source tree builds or for a build tree You can configure for in source tree builds or for a build tree
@ -31,10 +37,14 @@ that is apart from the source tree.
$ cmake -B . $ cmake -B .
- Build in a separate directory (parallel to the curl source tree in this - Build in a separate directory (parallel to the curl source tree in this
example). The build directory is created for you. example). The build directory is created for you. This is recommended over
building in the source tree to separate source and build artifacts.
$ cmake -B ../curl-build $ cmake -B ../curl-build
For the full list of CMake build configuration variables see
[the corresponding section](#cmake-build-options).
### Fallback for CMake before version 3.13 ### Fallback for CMake before version 3.13
CMake before version 3.13 does not support the `-B` option. In that case, CMake before version 3.13 does not support the `-B` option. In that case,
@ -129,6 +139,12 @@ Install to default location (you have to specify the build directory).
$ cmake --install ../curl-build $ cmake --install ../curl-build
Do not use `--prefix` to change the installation prefix as the output produced
by the `curl-config` script is determined at CMake configure time. If you want
to set a custom install prefix for curl, set
[`CMAKE_INSTALL_PREFIX`](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html)
when configuring the CMake build.
### Fallback for CMake before version 3.15 ### Fallback for CMake before version 3.15
CMake before version 3.15 does not support the `--install` option. In that CMake before version 3.15 does not support the `--install` option. In that
@ -139,6 +155,68 @@ assumes that CMake generates `Makefile`:
$ cd ../curl-build $ cd ../curl-build
$ make install $ make install
# CMake usage
Just as curl can be built and installed using CMake, it can also be used from
CMake.
## Using `find_package`
To locate libcurl from CMake, one can use the standard
[`find_package`](https://cmake.org/cmake/help/latest/command/find_package.html)
command in the typical fashion:
```cmake
find_package(CURL 8.12.0 REQUIRED) # FATAL_ERROR if CURL is not found
```
This invokes the CMake-provided
[FindCURL](https://cmake.org/cmake/help/latest/module/FindCURL.html) find module,
which first performs a search using the `find_package`
[config mode](https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure).
This is supported by the `CURLConfig.cmake` CMake config script which is
available if the given CURL was built and installed using CMake.
### Detecting CURL features/protocols
Since version 8.12.0, `CURLConfig.cmake` publishes the supported CURL features
and protocols (see [release notes](https://curl.se/ch/8.12.0.html)). These can
be specified using the `find_package` keywords `COMPONENTS` and
`OPTIONAL_COMPONENTS`, with protocols in all caps, e.g. `HTTPS`, `LDAP`, while
features should be in their original sentence case, e.g. `AsynchDNS`,
`UnixSockets`. If any of the `COMPONENTS` are missing, then CURL is considered
as *not* found.
Here is an example of using `COMPONENTS` and `OPTIONAL_COMPONENTS` in
`find_package` with CURL:
```cmake
# CURL_FOUND is FALSE if no HTTPS but brotli and zstd can be missing
find_package(CURL 8.12.0 COMPONENTS HTTPS OPTIONAL_COMPONENTS brotli zstd)
```
One can also check the defined `CURL_SUPPORTS_<feature-or-protocol>` variables
if a particular feature/protocol is supported. For example:
```cmake
# check HTTPS
if(CURL_SUPPORTS_HTTPS)
message(STATUS "CURL supports HTTPS")
else()
message(STATUS "CURL does NOT support HTTPS")
endif()
```
### Linking against libcurl
To link a CMake target against libcurl one can use
[`target_link_libraries`](https://cmake.org/cmake/help/latest/command/target_link_libraries.html)
as usual:
```cmake
target_link_libraries(my_target PRIVATE CURL::libcurl)
```
# CMake build options # CMake build options
- `BUILD_CURL_EXE`: Build curl executable. Default: `ON` - `BUILD_CURL_EXE`: Build curl executable. Default: `ON`
@ -160,16 +238,17 @@ assumes that CMake generates `Makefile`:
- `CURL_LIBCURL_VERSIONED_SYMBOLS`: Enable libcurl versioned symbols. Default: `OFF` - `CURL_LIBCURL_VERSIONED_SYMBOLS`: Enable libcurl versioned symbols. Default: `OFF`
- `CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX`: Override default versioned symbol prefix. Default: `<TLS-BACKEND>_` or `MULTISSL_` - `CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX`: Override default versioned symbol prefix. Default: `<TLS-BACKEND>_` or `MULTISSL_`
- `CURL_LTO`: Enable compiler Link Time Optimizations. Default: `OFF` - `CURL_LTO`: Enable compiler Link Time Optimizations. Default: `OFF`
- `CURL_STATIC_CRT`: Build libcurl with static CRT with MSVC (`/MT`). Default: `OFF` - `CURL_STATIC_CRT`: Build libcurl with static CRT with MSVC (`/MT`) (requires static or no curl executable). Default: `OFF`
- `CURL_TARGET_WINDOWS_VERSION`: Minimum target Windows version as hex string. - `CURL_TARGET_WINDOWS_VERSION`: Minimum target Windows version as hex string.
- `CURL_TEST_BUNDLES`: Bundle `libtest` and `unittest` tests into single binaries. Default: `OFF` - `CURL_TEST_BUNDLES`: Bundle `libtest` and `unittest` tests into single binaries. Default: `OFF`
- `CURL_WERROR`: Turn compiler warnings into errors. Default: `OFF` - `CURL_WERROR`: Turn compiler warnings into errors. Default: `OFF`
- `ENABLE_CURLDEBUG`: Enable TrackMemory debug feature. Default: =`ENABLE_DEBUG` - `ENABLE_CURLDEBUG`: Enable TrackMemory debug feature. Default: =`ENABLE_DEBUG`
- `ENABLE_CURL_MANUAL`: Build the man page for curl and enable its `-M`/`--manual` option. Default: `ON` - `ENABLE_CURL_MANUAL`: Build the man page for curl and enable its `-M`/`--manual` option. Default: `ON`
- `ENABLE_DEBUG`: Enable curl debug features (for developing curl itself). Default: `OFF` - `ENABLE_DEBUG`: Enable curl debug features (for developing curl itself). Default: `OFF`
- `IMPORT_LIB_SUFFIX`: Import library suffix. Default: `_imp` - `IMPORT_LIB_SUFFIX`: Import library suffix. Default: `_imp` for MSVC-like toolchains, otherwise empty.
- `LIBCURL_OUTPUT_NAME`: Basename of the curl library. Default: `libcurl` - `LIBCURL_OUTPUT_NAME`: Basename of the curl library. Default: `libcurl`
- `PICKY_COMPILER`: Enable picky compiler options. Default: `ON` - `PICKY_COMPILER`: Enable picky compiler options. Default: `ON`
- `SHARE_LIB_OBJECT`: Build shared and static libcurl in a single pass (requires CMake 3.12 or newer). Default: `ON` for Windows
- `STATIC_LIB_SUFFIX`: Static library suffix. Default: (empty) - `STATIC_LIB_SUFFIX`: Static library suffix. Default: (empty)
## CA bundle options ## CA bundle options
@ -305,6 +384,7 @@ Details via CMake
- `OPENSSL_USE_STATIC_LIBS`: Look for static OpenSSL libraries. - `OPENSSL_USE_STATIC_LIBS`: Look for static OpenSSL libraries.
- `ZLIB_INCLUDE_DIR`: The zlib include directory. - `ZLIB_INCLUDE_DIR`: The zlib include directory.
- `ZLIB_LIBRARY`: Path to `zlib` library. - `ZLIB_LIBRARY`: Path to `zlib` library.
- `ZLIB_USE_STATIC_LIBS`: Look for static ZLIB library (requires CMake v3.24).
## Dependency options ## Dependency options
@ -378,7 +458,7 @@ Details via CMake
# Migrating from Visual Studio IDE Project Files # Migrating from Visual Studio IDE Project Files
We recommend CMake to build curl with MSVC. We recommend using CMake to build curl with MSVC.
The project build files reside in project/Windows/VC\* for VS2010, VS2010 and The project build files reside in project/Windows/VC\* for VS2010, VS2010 and
VS2013 respectively. VS2013 respectively.
@ -398,8 +478,8 @@ Configuration element | Equivalent CMake options
`Win32` | `-A Win32` `Win32` | `-A Win32`
`DLL` | `BUILD_SHARED_LIBS=ON`, `BUILD_STATIC_LIBS=OFF`, (default) `DLL` | `BUILD_SHARED_LIBS=ON`, `BUILD_STATIC_LIBS=OFF`, (default)
`LIB` | `BUILD_SHARED_LIBS=OFF`, `BUILD_STATIC_LIBS=ON` `LIB` | `BUILD_SHARED_LIBS=OFF`, `BUILD_STATIC_LIBS=ON`
`Debug` | `CMAKE_BUILD_TYPE=Debug` `Debug` | `CMAKE_BUILD_TYPE=Debug` (`-G "NMake Makefiles"` only)
`Release` | `CMAKE_BUILD_TYPE=Release` `Release` | `CMAKE_BUILD_TYPE=Release` (`-G "NMake Makefiles"` only)
`DLL Windows SSPI` | `CURL_USE_SCHANNEL=ON` (with SSPI enabled by default) `DLL Windows SSPI` | `CURL_USE_SCHANNEL=ON` (with SSPI enabled by default)
`DLL OpenSSL` | `CURL_USE_OPENSSL=ON`, optional: `OPENSSL_ROOT_DIR`, `OPENSSL_USE_STATIC_LIBS=ON` `DLL OpenSSL` | `CURL_USE_OPENSSL=ON`, optional: `OPENSSL_ROOT_DIR`, `OPENSSL_USE_STATIC_LIBS=ON`
`DLL libssh2` | `CURL_USE_LIBSSH2=ON`, optional: `LIBSSH2_INCLUDE_DIR`, `LIBSSH2_LIBRARY` `DLL libssh2` | `CURL_USE_LIBSSH2=ON`, optional: `LIBSSH2_INCLUDE_DIR`, `LIBSSH2_LIBRARY`
@ -413,7 +493,13 @@ For example these commands:
translate to: translate to:
> cmake . -G "Visual Studio 12 2013" -A x64 -DCMAKE_BUILD_TYPE=Debug -DCURL_USE_SCHANNEL=ON -DUSE_WIN32_IDN=ON -DCURL_USE_LIBPSL=OFF > cmake . -G "Visual Studio 12 2013" -A x64 -DCURL_USE_SCHANNEL=ON -DUSE_WIN32_IDN=ON -DCURL_USE_LIBPSL=OFF
> cmake --build . --config Debug --parallel
We do *not* specify `-DCMAKE_BUILD_TYPE=Debug` here as we might do for the
`"NMake Makefiles"` generator because the Visual Studio generators are
[multi-config generators](https://cmake.org/cmake/help/latest/prop_gbl/GENERATOR_IS_MULTI_CONFIG.html)
and therefore ignore the value of `CMAKE_BUILD_TYPE`.
# Migrating from winbuild builds # Migrating from winbuild builds
@ -436,7 +522,7 @@ winbuild options | Equivalent CMake options
`DEBUG` | `CMAKE_BUILD_TYPE=Debug` `DEBUG` | `CMAKE_BUILD_TYPE=Debug`
`GEN_PDB` | `CMAKE_EXE_LINKER_FLAGS=/Fd<path>`, `CMAKE_SHARED_LINKER_FLAGS=/Fd<path>` `GEN_PDB` | `CMAKE_EXE_LINKER_FLAGS=/Fd<path>`, `CMAKE_SHARED_LINKER_FLAGS=/Fd<path>`
`LIB_NAME_DLL`, `LIB_NAME_STATIC` | `IMPORT_LIB_SUFFIX`, `LIBCURL_OUTPUT_NAME`, `STATIC_LIB_SUFFIX` `LIB_NAME_DLL`, `LIB_NAME_STATIC` | `IMPORT_LIB_SUFFIX`, `LIBCURL_OUTPUT_NAME`, `STATIC_LIB_SUFFIX`
`VC` | see CMake `-G` [options](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html) `VC`: `<N>` | see the CMake [Visual Studio generators](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#visual-studio-generators)
`MACHINE`: `x64`, `x86` | `-A x64`, `-A Win32` `MACHINE`: `x64`, `x86` | `-A x64`, `-A Win32`
`MODE`: `dll`, `static` | `BUILD_SHARED_LIBS=ON/OFF`, `BUILD_STATIC_LIBS=ON/OFF`, `BUILD_STATIC_CURL=ON/OFF` (default: dll) `MODE`: `dll`, `static` | `BUILD_SHARED_LIBS=ON/OFF`, `BUILD_STATIC_LIBS=ON/OFF`, `BUILD_STATIC_CURL=ON/OFF` (default: dll)
`RTLIBCFG`: `static` | `CURL_STATIC_CRT=ON` `RTLIBCFG`: `static` | `CURL_STATIC_CRT=ON`
@ -466,4 +552,8 @@ For example this command-line:
translates to: translates to:
> cmake . -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON -DOPENSSL_ROOT_DIR=C:\OpenSSL -DCURL_USE_OPENSSL=ON -DENABLE_UNICODE=ON -DCURL_USE_LIBPSL=OFF > cmake . -G "Visual Studio 17 2022" -A x64 -DBUILD_SHARED_LIBS=ON -DOPENSSL_ROOT_DIR=C:\OpenSSL -DCURL_USE_OPENSSL=ON -DENABLE_UNICODE=ON -DCURL_USE_LIBPSL=OFF
> cmake --build . --config Debug
We use `--config` with `cmake --build` because the Visual Studio CMake
generators are multi-config and therefore ignore `CMAKE_BUILD_TYPE`.

View File

@ -24,11 +24,13 @@ versions of libs and build tools.
We aim to support these or later versions. We aim to support these or later versions.
- OpenSSL 0.9.7 - OpenSSL 1.0.2a
- LibreSSL 2.9.1
- GnuTLS 3.1.10 - GnuTLS 3.1.10
- zlib 1.2.0.4 - zlib 1.2.0.4
- libssh2 1.0 - libssh2 1.2.8
- c-ares 1.16.0 - c-ares 1.6.0
- libssh 0.9.0
- libidn2 2.0.0 - libidn2 2.0.0
- wolfSSL 3.4.6 - wolfSSL 3.4.6
- OpenLDAP 2.0 - OpenLDAP 2.0

View File

@ -17,7 +17,6 @@ problems may have been fixed or changed somewhat since this was written.
2.1 IMAPS connection fails with Rustls error 2.1 IMAPS connection fails with Rustls error
2.3 Unable to use PKCS12 certificate with Secure Transport 2.3 Unable to use PKCS12 certificate with Secure Transport
2.4 Secure Transport does not import PKCS#12 client certificates without a password 2.4 Secure Transport does not import PKCS#12 client certificates without a password
2.5 Client cert handling with Issuer DN differs between backends
2.7 Client cert (MTLS) issues with Schannel 2.7 Client cert (MTLS) issues with Schannel
2.11 Schannel TLS 1.2 handshake bug in old Windows versions 2.11 Schannel TLS 1.2 handshake bug in old Windows versions
2.13 CURLOPT_CERTINFO results in CURLE_OUT_OF_MEMORY with Schannel 2.13 CURLOPT_CERTINFO results in CURLE_OUT_OF_MEMORY with Schannel
@ -68,7 +67,8 @@ problems may have been fixed or changed somewhat since this was written.
9.4 libssh blocking and infinite loop problem 9.4 libssh blocking and infinite loop problem
9.5 Cygwin: "WARNING: UNPROTECTED PRIVATE KEY FILE!" 9.5 Cygwin: "WARNING: UNPROTECTED PRIVATE KEY FILE!"
10. SOCKS 10. Connection
10.1 --interface with link-scoped IPv6 address
11. Internals 11. Internals
11.1 gssapi library name + version is missing in curl_version_info() 11.1 gssapi library name + version is missing in curl_version_info()
@ -136,14 +136,6 @@ problems may have been fixed or changed somewhat since this was written.
function rejects certificates that do not have a password. function rejects certificates that do not have a password.
https://github.com/curl/curl/issues/1308 https://github.com/curl/curl/issues/1308
2.5 Client cert handling with Issuer DN differs between backends
When the specified client certificate does not match any of the
server-specified DNs, the OpenSSL and GnuTLS backends behave differently.
The github discussion may contain a solution.
See https://github.com/curl/curl/issues/1411
2.7 Client cert (MTLS) issues with Schannel 2.7 Client cert (MTLS) issues with Schannel
See https://github.com/curl/curl/issues/3145 See https://github.com/curl/curl/issues/3145
@ -445,7 +437,23 @@ problems may have been fixed or changed somewhat since this was written.
https://github.com/curl/curl/issues/11244 https://github.com/curl/curl/issues/11244
10. SOCKS 10. Connection
10.1 --interface with link-scoped IPv6 address
When you give the `--interface` option telling curl to use a specific
interface for its outgoing traffic in combination with a IPv6 address in the
URL that uses a link-local scope, curl might pick the wrong address from the
named interface and the subsequent transfer fails.
Example command line:
curl --interface eth0 'http://[fe80:928d:xxff:fexx:xxxx]/'
The fact that the given IP address is link-scoped should probably be used as
input to somehow make curl make a better choice for this.
https://github.com/curl/curl/issues/14782
11. Internals 11. Internals
@ -625,7 +633,7 @@ problems may have been fixed or changed somewhat since this was written.
17.4 HTTP/2 + TLS spends a lot of time in recv 17.4 HTTP/2 + TLS spends a lot of time in recv
It has been observered that by making the speed limit less accurate we could It has been observed that by making the speed limit less accurate we could
improve this performance. (by reverting improve this performance. (by reverting
https://github.com/curl/curl/commit/db5c9f4f9e0779b49624752b135281a0717b277b) https://github.com/curl/curl/commit/db5c9f4f9e0779b49624752b135281a0717b277b)
Can we find a golden middle ground? Can we find a golden middle ground?

View File

@ -582,7 +582,7 @@ Example, set default time out and proxy in a config file:
# We want a 30 minute timeout: # We want a 30 minute timeout:
-m 1800 -m 1800
# ... and we use a proxy for all accesses: # ... and we use a proxy for all accesses:
proxy = proxy.our.domain.com:8080 proxy = proxy.our.domain.example.com:8080
Whitespaces ARE significant at the end of lines, but all whitespace leading Whitespaces ARE significant at the end of lines, but all whitespace leading
up to the first characters of each line are ignored. up to the first characters of each line are ignored.

View File

@ -52,6 +52,7 @@ INTERNALDOCS = \
internals/HASH.md \ internals/HASH.md \
internals/LLIST.md \ internals/LLIST.md \
internals/MQTT.md \ internals/MQTT.md \
internals/MULTI-EV.md \
internals/NEW-PROTOCOL.md \ internals/NEW-PROTOCOL.md \
internals/README.md \ internals/README.md \
internals/SPLAY.md \ internals/SPLAY.md \

View File

@ -9,7 +9,7 @@ SPDX-License-Identifier: curl
[Rustls is a TLS backend written in Rust](https://docs.rs/rustls/). curl can [Rustls is a TLS backend written in Rust](https://docs.rs/rustls/). curl can
be built to use it as an alternative to OpenSSL or other TLS backends. We use be built to use it as an alternative to OpenSSL or other TLS backends. We use
the [rustls-ffi C bindings](https://github.com/rustls/rustls-ffi/). This the [rustls-ffi C bindings](https://github.com/rustls/rustls-ffi/). This
version of curl depends on version v0.14.0 of rustls-ffi. version of curl is compatible with `rustls-ffi` v0.14.x.
# Building with Rustls # Building with Rustls
@ -17,7 +17,7 @@ First, [install Rust](https://rustup.rs/).
Next, check out, build, and install the appropriate version of rustls-ffi: Next, check out, build, and install the appropriate version of rustls-ffi:
% git clone https://github.com/rustls/rustls-ffi -b v0.14.0 % git clone https://github.com/rustls/rustls-ffi -b v0.14.1
% cd rustls-ffi % cd rustls-ffi
% make % make
% make DESTDIR=${HOME}/rustls-ffi-built/ install % make DESTDIR=${HOME}/rustls-ffi-built/ install

View File

@ -25,7 +25,8 @@ named sponsor level: **Silver**, **Gold**, **Platinum** or **Top**.
Sponsors on a named level can provide their logo image and preferred URL and Sponsors on a named level can provide their logo image and preferred URL and
get recognition on the curl website's [sponsor get recognition on the curl website's [sponsor
page](https://curl.se/sponsors.html). page](https://curl.se/sponsors.html), assuming they meet the project's
standards and requirements.
- **Silver Sponsor** at least 100 USD/month - **Silver Sponsor** at least 100 USD/month
- **Gold Sponsor** at least 500 USD/month - **Gold Sponsor** at least 500 USD/month
@ -45,3 +46,10 @@ gambling, pornography, social media manipulation etc.
Sponsors that stop paying are considered *Past Sponsors* and are not displayed Sponsors that stop paying are considered *Past Sponsors* and are not displayed
on the sponsor page anymore. We thank you for your contributions. on the sponsor page anymore. We thank you for your contributions.
## Donations
Please note that sponsorship and donations are exactly that: donations to the
curl project. They are used to help and further the project as the project
leadership deems best. No goods or services are expected or promised in
return. Requests for refunds for such purposes are rejected.

View File

@ -182,6 +182,7 @@ Andrei Benea
Andrei Bica Andrei Bica
Andrei Cipu Andrei Cipu
Andrei Karas Andrei Karas
Andrei Korshikov
Andrei Kurushin Andrei Kurushin
Andrei Neculau Andrei Neculau
Andrei Rybak Andrei Rybak
@ -259,6 +260,7 @@ arainchik on github
Archangel_SDY on github Archangel_SDY on github
Arjan van de Ven Arjan van de Ven
Arkadiusz Miskiewicz Arkadiusz Miskiewicz
arlt on github
Armel Asselin Armel Asselin
Arnaud Compan Arnaud Compan
Arnaud Ebalard Arnaud Ebalard
@ -596,6 +598,7 @@ Cris Bailiff
Cristian Greco Cristian Greco
Cristian Morales Vega Cristian Morales Vega
Cristian Rodríguez Cristian Rodríguez
CueXXIII on Github
Curt Bogmine Curt Bogmine
Cynthia Coan Cynthia Coan
Cyril B Cyril B
@ -738,6 +741,7 @@ dbrowndan on github
dEajL3kA on github dEajL3kA on github
Deal(一线灵) Deal(一线灵)
dekerser on github dekerser on github
deliciouslytyped on github
delogicsreal on github delogicsreal on github
dengjfzh on github dengjfzh on github
Dengminwen Dengminwen
@ -975,6 +979,7 @@ farazrbx on github
Farzin on github Farzin on github
Fata Nugraha Fata Nugraha
Fawad Mirza Fawad Mirza
Fay Stegerman
FC Stegerman FC Stegerman
fds242 on github fds242 on github
Federico Bianchi Federico Bianchi
@ -2162,6 +2167,7 @@ Mostyn Bramley-Moore
Moti Avrahami Moti Avrahami
MrdUkk on github MrdUkk on github
MrSorcus on github MrSorcus on github
mschroeder-fzj on github
Muhammad Herdiansyah Muhammad Herdiansyah
Muhammad Hussein Ammari Muhammad Hussein Ammari
Muhammed Yavuz Nuzumlalı Muhammed Yavuz Nuzumlalı
@ -2258,6 +2264,7 @@ nobedee on github
NobodyXu on github NobodyXu on github
Nobuhiro Ban Nobuhiro Ban
Nodak Sodak Nodak Sodak
nono303 on github
nopjmp on github nopjmp on github
Norbert Frese Norbert Frese
Norbert Kett Norbert Kett
@ -2485,6 +2492,7 @@ pszlazak on github
puckipedia on github puckipedia on github
Puneet Pawaia Puneet Pawaia
Pēteris Caune Pēteris Caune
qhill
qiandu2006 on github qiandu2006 on github
Qriist on github Qriist on github
Quagmire Quagmire
@ -2513,6 +2521,7 @@ RainRat
Raito Bezarius Raito Bezarius
Rajesh Naganathan Rajesh Naganathan
Rajkumar Mandal Rajkumar Mandal
Ralf A. Timmermann
Ralf S. Engelschall Ralf S. Engelschall
ralfjunker on github ralfjunker on github
Ralph Beckmann Ralph Beckmann
@ -2968,6 +2977,7 @@ tbugfinder on github
Ted Lyngmo Ted Lyngmo
Teemu Yli-Elsila Teemu Yli-Elsila
Temprimus Temprimus
Terence Eden
Terri Oda Terri Oda
Terry Wu Terry Wu
thanhchungbtc on github thanhchungbtc on github
@ -2978,6 +2988,7 @@ Theo
Theodore Dubois Theodore Dubois
therealhirudo on github therealhirudo on github
Thiago Suchorski Thiago Suchorski
thisisgk on github
tholin on github tholin on github
Thomas Thomas
Thomas Bouzerar Thomas Bouzerar

View File

@ -156,3 +156,5 @@ s/Testclutch//
s/edmcln\z/edmcln on github/ s/edmcln\z/edmcln on github/
s/andrewkirillov-ibm/Andrew Kirillov/ s/andrewkirillov-ibm/Andrew Kirillov/
s/\(.*\) via #[0-9]*// s/\(.*\) via #[0-9]*//
s/jethrogb$/jethrogb on github/
s/on github/on github/i

View File

@ -247,11 +247,11 @@ local system or network, the bar is raised. If a local user wrongfully has
elevated rights on your system enough to attack curl, they can probably elevated rights on your system enough to attack curl, they can probably
already do much worse harm and the problem is not really in curl. already do much worse harm and the problem is not really in curl.
## Experiments ## Debug & Experiments
Vulnerabilities in features which are off by default (in the build) and Vulnerabilities in features which are off by default (in the build) and
documented as experimental, are not eligible for a reward and we do not documented as experimental, or exist only in debug mode, are not eligible for a
consider them security problems. reward and we do not consider them security problems.
## URL inconsistencies ## URL inconsistencies

View File

@ -27,10 +27,10 @@ set:
When expanding variables, curl supports a set of functions that can make the When expanding variables, curl supports a set of functions that can make the
variable contents more convenient to use. It can trim leading and trailing variable contents more convenient to use. It can trim leading and trailing
white space with `trim`, it can output the contents as a JSON quoted string white space with `trim`, it can output the contents as a JSON quoted string
with `json`, URL encode the string with `url` or base64 encode it with `b64`. with `json`, URL encode the string with `url`, base64 encode it with `b64` and
To apply functions to a variable expansion, add them colon separated to the base64 decode it with `64dec`. To apply functions to a variable expansion, add
right side of the variable. Variable content holding null bytes that are not them colon separated to the right side of the variable. Variable content
encoded when expanded cause error. holding null bytes that are not encoded when expanded cause error.
Example: get the contents of a file called $HOME/.secret into a variable Example: get the contents of a file called $HOME/.secret into a variable
called "fix". Make sure that the content is trimmed and percent-encoded when called "fix". Make sure that the content is trimmed and percent-encoded when

View File

@ -12,18 +12,27 @@ See-also:
- capath - capath
- dump-ca-embed - dump-ca-embed
- insecure - insecure
- proxy-ca-native
Example: Example:
- --ca-native $URL - --ca-native $URL
--- ---
# `--ca-native` # `--ca-native`
Use the CA store from the native operating system to verify the peer. By Use the operating system's native CA store for certificate verification.
default, curl otherwise uses a CA store provided in a single file or
directory, but when using this option it interfaces the operating system's own
vault.
This option works for curl on Windows when built to use OpenSSL, wolfSSL This option is independent of other CA certificate locations set at run time or
(added in 8.3.0) or GnuTLS (added in 8.5.0). When curl on Windows is built to build time. Those locations are searched in addition to the native CA store.
use Schannel, this feature is implied and curl then only uses the native CA
store. This option works with OpenSSL and its forks (LibreSSL, BoringSSL, etc) on
Windows. (Added in 7.71.0)
This option works with wolfSSL on Windows, Linux (Debian, Ubuntu, Gentoo,
Fedora, RHEL), macOS, Android and iOS. (Added in 8.3.0)
This option works with GnuTLS. (Added in 8.5.0)
This option currently has no effect for Schannel or Secure Transport. Those are
native TLS libraries from Microsoft and Apple, respectively, that by default
use the native CA store for verification unless overridden by a CA certificate
location setting.

View File

@ -55,10 +55,14 @@ among others and should be added with this option.
You need --proxy-header to send custom headers intended for an HTTP proxy. You need --proxy-header to send custom headers intended for an HTTP proxy.
(Added in 7.37.0) (Added in 7.37.0)
Passing on a "Transfer-Encoding: chunked" header when doing an HTTP request Passing on a `Transfer-Encoding: chunked` header when doing an HTTP request
with a request body, makes curl send the data using chunked encoding. with a request body, makes curl send the data using chunked encoding.
**WARNING**: headers set with this option are set in all HTTP requests - even **WARNING**: headers set with this option are set in all HTTP requests - even
after redirects are followed, like when told with --location. This can lead to after redirects are followed, like when told with --location. This can lead to
the header being sent to other hosts than the original host, so sensitive the header being sent to other hosts than the original host, so sensitive
headers should be used with caution combined with following redirects. headers should be used with caution combined with following redirects.
`Authorization:` and `Cookie:` headers are explicitly *not* passed on in HTTP
requests when following redirects to other origins, unless --location-trusted
is used.

View File

@ -30,9 +30,9 @@ On Windows two filenames in the home directory are checked: *.netrc* and
only. only.
A quick and simple example of how to setup a *.netrc* to allow curl to FTP to A quick and simple example of how to setup a *.netrc* to allow curl to FTP to
the machine host.domain.com with username 'myself' and password 'secret' could the machine host.example.com with username 'myself' and password 'secret' could
look similar to: look similar to:
machine host.domain.com machine host.example.com
login myself login myself
password secret password secret

View File

@ -8,6 +8,7 @@ Category: tls
Added: 8.2.0 Added: 8.2.0
Multi: boolean Multi: boolean
See-also: See-also:
- ca-native
- cacert - cacert
- capath - capath
- dump-ca-embed - dump-ca-embed
@ -18,11 +19,12 @@ Example:
# `--proxy-ca-native` # `--proxy-ca-native`
Use the CA store from the native operating system to verify the HTTPS proxy. Use the operating system's native CA store for certificate verification of the
By default, curl uses a CA store provided in a single file or directory, but HTTPS proxy.
when using this option it interfaces the operating system's own vault.
This option works for curl on Windows when built to use OpenSSL, wolfSSL This option is independent of other HTTPS proxy CA certificate locations set at
(added in 8.3.0) or GnuTLS (added in 8.5.0). When curl on Windows is built to run time or build time. Those locations are searched in addition to the native
use Schannel, this feature is implied and curl then only uses the native CA CA store.
store.
Equivalent to --ca-native but used in HTTPS proxy context. Refer to --ca-native
for TLS backend limitations.

View File

@ -22,7 +22,7 @@ Use the specified proxy.
The proxy string can be specified with a protocol:// prefix. No protocol The proxy string can be specified with a protocol:// prefix. No protocol
specified or http:// it is treated as an HTTP proxy. Use socks4://, specified or http:// it is treated as an HTTP proxy. Use socks4://,
socks4a://, socks5:// or socks5h:// to request a specific SOCKS version to be socks4a://, socks5:// or socks5h:// to request a specific SOCKS version to be
used. (Added in 7.21.7) used. (Added in 7.21.7)
Unix domain sockets are supported for socks proxy. Set localhost for the host Unix domain sockets are supported for socks proxy. Set localhost for the host
part. e.g. socks5h://localhost/path/to/socket.sock part. e.g. socks5h://localhost/path/to/socket.sock
@ -59,4 +59,4 @@ used.
Doing FTP over an HTTP proxy without --proxytunnel makes curl do HTTP with an Doing FTP over an HTTP proxy without --proxytunnel makes curl do HTTP with an
FTP URL over the proxy. For such transfers, common FTP specific options do not FTP URL over the proxy. For such transfers, common FTP specific options do not
work, including --ftp-ssl-reqd and --ftp-ssl-control. work, including --ssl-reqd and --ftp-ssl-control.

View File

@ -41,9 +41,10 @@ specifies two separate 100-byte ranges(*) (HTTP)
## ##
(*) = NOTE that these make the server reply with a multipart response, which (*) = NOTE that if specifying multiple ranges and the server supports it then
is returned as-is by curl. Parsing or otherwise transforming this response is it replies with a multiple part response that curl returns as-is. It
the responsibility of the caller. contains meta information in addition to the requested bytes. Parsing or
otherwise transforming this response is the responsibility of the caller.
Only digit characters (0-9) are valid in the 'start' and 'stop' fields of the Only digit characters (0-9) are valid in the 'start' and 'stop' fields of the
'start-stop' range syntax. If a non-digit character is given in the range, the 'start-stop' range syntax. If a non-digit character is given in the range, the

View File

@ -12,6 +12,7 @@ See-also:
- alt-svc - alt-svc
Example: Example:
- --resolve example.com:443:127.0.0.1 $URL - --resolve example.com:443:127.0.0.1 $URL
- --resolve example.com:443:[2001:db8::252f:efd6] $URL
--- ---
# `--resolve` # `--resolve`
@ -20,8 +21,8 @@ Provide a custom address for a specific host and port pair. Using this, you
can make the curl requests(s) use a specified address and prevent the can make the curl requests(s) use a specified address and prevent the
otherwise normally resolved address to be used. Consider it a sort of otherwise normally resolved address to be used. Consider it a sort of
/etc/hosts alternative provided on the command line. The port number should be /etc/hosts alternative provided on the command line. The port number should be
the number used for the specific protocol the host is used for. It means the number used for the specific protocol the host is used for. It means you
you need several entries if you want to provide address for the same host but need several entries if you want to provide addresses for the same host but
different ports. different ports.
By specifying `*` as host you can tell curl to resolve any host and specific By specifying `*` as host you can tell curl to resolve any host and specific
@ -37,9 +38,13 @@ parallel transfers with a lot of files. In such cases, if this option is used
curl tries to resolve the host as it normally would once the timeout has curl tries to resolve the host as it normally would once the timeout has
expired. expired.
Provide IPv6 addresses within [brackets].
To redirect connects from a specific hostname or any hostname, independently To redirect connects from a specific hostname or any hostname, independently
of port number, consider the --connect-to option. of port number, consider the --connect-to option.
Support for resolving with wildcard was added in 7.64.0. Support for resolving with wildcard was added in 7.64.0.
Support for the '+' prefix was added in 7.75.0. Support for the '+' prefix was added in 7.75.0.
Support for specifying the host component as an IPv6 address was added in 8.13.0.

View File

@ -38,5 +38,8 @@ for you, it is probably not a good idea to use early data for it. curl
cannot deduce what the security implications of your requests actually cannot deduce what the security implications of your requests actually
are and make this decision for you. are and make this decision for you.
The amount of early data sent can be inspected by using the `--write-out`
variable `tls_earlydata`.
**WARNING**: this option has security implications. See above for more **WARNING**: this option has security implications. See above for more
details. details.

View File

@ -2,16 +2,19 @@
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl SPDX-License-Identifier: curl
Long: url Long: url
Arg: <url> Arg: <url/file>
Help: URL to work with Help: URL(s) to work with
Category: curl Category: curl
Added: 7.5 Added: 7.5
Multi: append Multi: append
See-also: See-also:
- next - next
- config - config
- path-as-is
- disallow-username-in-url
Example: Example:
- --url $URL - --url $URL
- --url @file
--- ---
# `--url` # `--url`
@ -32,3 +35,15 @@ destination option unless --remote-name-all is used.
On Windows, `file://` accesses can be converted to network accesses by the On Windows, `file://` accesses can be converted to network accesses by the
operating system. operating system.
Starting in curl 8.13.0, curl can be told to download URLs provided in a text
file, one URL per line. It is done by with `--url @filename`: so instead of a
URL, you specify a filename prefixed with the `@` symbol. It can be told to
load the list of URLs from stdin by providing an argument like `@-`.
When downloading URLs given in a file, it implies using --remote-name for each
provided URL. The URLs are full, there is no globbing applied or done on
these. Features such as --skip-existing work fine in combination with this.
Lines in the URL file that start with `#` are treated as comments and are
skipped.

View File

@ -66,30 +66,45 @@ error.
Available functions: Available functions:
## trim ## `trim`
removes all leading and trailing white space. removes all leading and trailing white space.
Example: Example:
curl --expand-url https.//example.com/{{url:trim}} curl --expand-url https://example.com/{{var:trim}}
## `json`
## json
outputs the content using JSON string quoting rules. outputs the content using JSON string quoting rules.
Example: Example:
curl --expand-data {{data:json}} https://example.com curl --expand-data {{data:json}} https://example.com
## url ## `url`
shows the content URL (percent) encoded. shows the content URL (percent) encoded.
Example: Example:
curl --expand-url https://example.com/{{path:url}} curl --expand-url https://example.com/{{path:url}}
## b64 ## `b64`
expands the variable base64 encoded expands the variable base64 encoded
Example: Example:
curl --expand-url https://example.com/{{var:b64}} curl --expand-url https://example.com/{{var:b64}}
## `64dec`
decodes a base64 encoded character sequence. If the sequence is not possible
to decode, it instead outputs `[64dec-fail]`
Example:
curl --expand-url https://example.com/{{var:64dec}}
(Added in 8.13.0)

View File

@ -53,3 +53,8 @@ to trace the specific components you wish to see.
Note that verbose output of curl activities and network traffic might contain Note that verbose output of curl activities and network traffic might contain
sensitive data, including usernames, credentials or secret data content. Be sensitive data, including usernames, credentials or secret data content. Be
aware and be careful when sharing trace logs with others. aware and be careful when sharing trace logs with others.
When the output contains protocol headers, those lines might include carriage
return (ASCII code 13) characters, even on platforms that otherwise normally
only use linefeed to signify line separations - as curl shows the exact
contents arriving from the server.

View File

@ -32,10 +32,11 @@ output a newline by using \n, a carriage return with \r and a tab space with
The output is by default written to standard output, but can be changed with The output is by default written to standard output, but can be changed with
%{stderr} and %output{}. %{stderr} and %output{}.
Output HTTP headers from the most recent request by using *%header{name}* Output HTTP header values from the transfer's most recent server response by
where *name* is the case insensitive name of the header (without the trailing using *%header{name}* where *name* is the case insensitive name of the header
colon). The header contents are exactly as sent over the network, with leading (without the trailing colon). The header contents are exactly as delivered over
and trailing whitespace trimmed (added in 7.84.0). the network but with leading and trailing whitespace and newlines stripped off
(added in 7.84.0).
Select a specific target destination file to write the output to, by using Select a specific target destination file to write the output to, by using
*%output{name}* (added in curl 8.3.0) where *name* is the full filename. The *%output{name}* (added in curl 8.3.0) where *name* is the full filename. The
@ -61,7 +62,7 @@ The variables available are:
## `certs` ## `certs`
Output the certificate chain with details. Supported only by the OpenSSL, Output the certificate chain with details. Supported only by the OpenSSL,
GnuTLS, Schannel and Secure Transport backends. (Added in 7.88.0) GnuTLS, Schannel, Rustls, and Secure Transport backends. (Added in 7.88.0)
## `conn_id` ## `conn_id`
The connection identifier last used by the transfer. The connection id is The connection identifier last used by the transfer. The connection id is
@ -87,6 +88,11 @@ most useful in combination with the --remote-header-name option.
The initial path curl ended up in when logging on to the remote FTP The initial path curl ended up in when logging on to the remote FTP
server. (Added in 7.15.4) server. (Added in 7.15.4)
## `header{name}`
The value of header `name` from the transfer's most recent server response.
Unlike other variables, the variable name `header` is not in braces. For
example `%header{date}`. Refer to --write-out remarks. (Added in 7.84.0)
## `header_json` ## `header_json`
A JSON object with all HTTP response headers from the recent transfer. Values A JSON object with all HTTP response headers from the recent transfer. Values
are provided as arrays, since in the case of multiple headers there can be are provided as arrays, since in the case of multiple headers there can be
@ -122,7 +128,7 @@ The http method used in the most recent HTTP request. (Added in 7.72.0)
## `num_certs` ## `num_certs`
Number of server certificates received in the TLS handshake. Supported only by Number of server certificates received in the TLS handshake. Supported only by
the OpenSSL, GnuTLS, Schannel and Secure Transport backends. the OpenSSL, GnuTLS, Schannel, Rustls and Secure Transport backends.
(Added in 7.88.0) (Added in 7.88.0)
## `num_connects` ## `num_connects`
@ -143,6 +149,12 @@ Number of retries actually performed when `--retry` has been used.
The rest of the output is only shown if the transfer returned a non-zero error. The rest of the output is only shown if the transfer returned a non-zero error.
(Added in 7.75.0) (Added in 7.75.0)
## `output{filename}`
From this point on, the --write-out output is written to the filename specified
in braces. The filename can be prefixed with `>>` to append to the file. Unlike
other variables, the variable name `output` is not in braces. For example
`%output{>>stats.txt}`. Refer to --write-out remarks. (Added in 8.3.0)
## `proxy_ssl_verify_result` ## `proxy_ssl_verify_result`
The result of the HTTPS proxy's SSL peer certificate verification that was The result of the HTTPS proxy's SSL peer certificate verification that was
requested. 0 means the verification was successful. (Added in 7.52.0) requested. 0 means the verification was successful. (Added in 7.52.0)
@ -250,6 +262,12 @@ the result.
## `time_total` ## `time_total`
The total time, in seconds, that the full operation lasted. The total time, in seconds, that the full operation lasted.
## `tls_earlydata`
The amount of bytes that were sent as TLSv1.3 early data. This is 0
if this TLS feature was not used and negative if the data sent had
been rejected by the server. The use of early data is enabled via
the command line option `--tls-earlydata`. (Added in 8.12.0)
## `url` ## `url`
The URL that was fetched. (Added in 7.75.0) The URL that was fetched. (Added in 7.75.0)

View File

@ -24,53 +24,53 @@ displays information about the curl and libcurl installation.
# OPTIONS # OPTIONS
## --ca ## `--ca`
Displays the built-in path to the CA cert bundle this libcurl uses. Displays the built-in path to the CA cert bundle this libcurl uses.
## --cc ## `--cc`
Displays the compiler used to build libcurl. Displays the compiler used to build libcurl.
## --cflags ## `--cflags`
Set of compiler options (CFLAGS) to use when compiling files that use Set of compiler options (CFLAGS) to use when compiling files that use
libcurl. Currently that is only the include path to the curl include files. libcurl. Currently that is only the include path to the curl include files.
## --checkfor [version] ## `--checkfor [version]`
Specify the oldest possible libcurl version string you want, and this script Specify the oldest possible libcurl version string you want, and this script
returns 0 if the current installation is new enough or it returns 1 and returns 0 if the current installation is new enough or it returns 1 and
outputs a text saying that the current version is not new enough. (Added in outputs a text saying that the current version is not new enough. (Added in
7.15.4) 7.15.4)
## --configure ## `--configure`
Displays the arguments given to configure when building curl. Displays the arguments given to configure when building curl.
## --feature ## `--feature`
Lists what particular main features the installed libcurl was built with. At Lists what particular main features the installed libcurl was built with. At
the time of writing, this list may include SSL, KRB4 or IPv6. Do not assume the time of writing, this list may include SSL, KRB4 or IPv6. Do not assume
any particular order. The keywords are separated by newlines. There may be any particular order. The keywords are separated by newlines. There may be
none, one, or several keywords in the list. none, one, or several keywords in the list.
## --help ## `--help`
Displays the available options. Displays the available options.
## --libs ## `--libs`
Shows the complete set of libs and other linker options you need in order to Shows the complete set of libs and other linker options you need in order to
link your application with libcurl. link your application with libcurl.
## --prefix ## `--prefix`
This is the prefix used when libcurl was installed. libcurl is then installed This is the prefix used when libcurl was installed. libcurl is then installed
in $prefix/lib and its header files are installed in $prefix/include and so in $prefix/lib and its header files are installed in $prefix/include and so
on. The prefix is set with "configure --prefix". on. The prefix is set with `configure --prefix`.
## --protocols ## `--protocols`
Lists what particular protocols the installed libcurl was built to support. At Lists what particular protocols the installed libcurl was built to support. At
the time of writing, this list may include HTTP, HTTPS, FTP, FTPS, FILE, the time of writing, this list may include HTTP, HTTPS, FTP, FTPS, FILE,
@ -78,22 +78,22 @@ TELNET, LDAP, DICT and many more. Do not assume any particular order. The
protocols are listed using uppercase and are separated by newlines. There may protocols are listed using uppercase and are separated by newlines. There may
be none, one, or several protocols in the list. (Added in 7.13.0) be none, one, or several protocols in the list. (Added in 7.13.0)
## --ssl-backends ## `--ssl-backends`
Lists the SSL backends that were enabled when libcurl was built. It might be Lists the SSL backends that were enabled when libcurl was built. It might be
no, one or several names. If more than one name, they appear comma-separated. no, one or several names. If more than one name, they appear comma-separated.
(Added in 7.58.0) (Added in 7.58.0)
## --static-libs ## `--static-libs`
Shows the complete set of libs and other linker options you need in order to Shows the complete set of libs and other linker options you need in order to
link your application with libcurl statically. (Added in 7.17.1) link your application with libcurl statically. (Added in 7.17.1)
## --version ## `--version`
Outputs version information about the installed libcurl. Outputs version information about the installed libcurl.
## --vernum ## `--vernum`
Outputs version information about the installed libcurl, in numerical mode. Outputs version information about the installed libcurl, in numerical mode.
This shows the version number, in hexadecimal, using 8 bits for each part: This shows the version number, in hexadecimal, using 8 bits for each part:
@ -104,22 +104,21 @@ omitted. (This option was broken in the 7.15.0 release.)
# EXAMPLES # EXAMPLES
What linker options do I need when I link with libcurl? What linker options do I need when I link with libcurl?
~~~
$ curl-config --libs $ curl-config --libs
~~~
What compiler options do I need when I compile using libcurl functions? What compiler options do I need when I compile using libcurl functions?
~~~
$ curl-config --cflags $ curl-config --cflags
~~~
How do I know if libcurl was built with SSL support? How do I know if libcurl was built with SSL support?
~~~
$ curl-config --feature | grep SSL $ curl-config --feature | grep SSL
~~~
What's the installed libcurl version? What's the installed libcurl version?
~~~
$ curl-config --version $ curl-config --version
~~~
How do I build a single file with a one-line command? How do I build a single file with a one-line command?
~~~
$ `curl-config --cc --cflags` -o example source.c `curl-config --libs` $ `curl-config --cc --cflags` -o example source.c `curl-config --libs`
~~~

View File

@ -44,6 +44,9 @@ AM_CPPFLAGS += -DCURL_NO_OLDIES
if USE_CPPFLAG_CURL_STATICLIB if USE_CPPFLAG_CURL_STATICLIB
AM_CPPFLAGS += -DCURL_STATICLIB AM_CPPFLAGS += -DCURL_STATICLIB
endif endif
if DOING_NATIVE_WINDOWS
AM_CPPFLAGS += -DWIN32_LEAN_AND_MEAN
endif
# Prevent LIBS from being used for all link targets # Prevent LIBS from being used for all link targets
LIBS = $(BLANK_AT_MAKETIME) LIBS = $(BLANK_AT_MAKETIME)

View File

@ -103,7 +103,11 @@ int main(int argc, char **argv)
if(!fp) if(!fp)
return 2; return 2;
#ifdef UNDER_CE
stat(file, &file_info);
#else
fstat(fileno(fp), &file_info); fstat(fileno(fp), &file_info);
#endif
/* In Windows, this inits the Winsock stuff */ /* In Windows, this inits the Winsock stuff */
curl_global_init(CURL_GLOBAL_ALL); curl_global_init(CURL_GLOBAL_ALL);

View File

@ -29,9 +29,9 @@
* filter IP addresses. * filter IP addresses.
*/ */
#ifdef __AMIGA__ #if defined(__AMIGA__) || defined(UNDER_CE)
#include <stdio.h> #include <stdio.h>
int main(void) { printf("AmigaOS is not supported.\n"); return 1; } int main(void) { printf("Platform not supported.\n"); return 1; }
#else #else
#ifdef _WIN32 #ifdef _WIN32
@ -298,14 +298,19 @@ int main(void)
filter = (struct connection_filter *)calloc(1, sizeof(*filter)); filter = (struct connection_filter *)calloc(1, sizeof(*filter));
if(!filter) if(!filter)
exit(1); return 1;
if(curl_global_init(CURL_GLOBAL_DEFAULT)) if(curl_global_init(CURL_GLOBAL_DEFAULT)) {
exit(1); free(filter);
return 1;
}
curl = curl_easy_init(); curl = curl_easy_init();
if(!curl) if(!curl) {
exit(1); curl_global_cleanup();
free(filter);
return 1;
}
/* Set the target URL */ /* Set the target URL */
curl_easy_setopt(curl, CURLOPT_URL, "http://localhost"); curl_easy_setopt(curl, CURLOPT_URL, "http://localhost");

View File

@ -79,12 +79,12 @@ int main(int argc, char *argv[])
fprintf(stderr, fprintf(stderr,
"\rUsage: %s [-m=1|2|5|10|20|50|100] [-t] [-x] [url]\n", "\rUsage: %s [-m=1|2|5|10|20|50|100] [-t] [-x] [url]\n",
appname); appname);
exit(1); return 1;
case 'v': case 'v':
case 'V': case 'V':
fprintf(stderr, "\r%s %s - %s\n", fprintf(stderr, "\r%s %s - %s\n",
appname, CHKSPEED_VERSION, curl_version()); appname, CHKSPEED_VERSION, curl_version());
exit(1); return 1;
case 'a': case 'a':
case 'A': case 'A':
prtall = 1; prtall = 1;

View File

@ -34,8 +34,7 @@
#include <curl/curl.h> #include <curl/curl.h>
#include <curl/mprintf.h> #include <curl/mprintf.h>
static void static int print_cookies(CURL *curl)
print_cookies(CURL *curl)
{ {
CURLcode res; CURLcode res;
struct curl_slist *cookies; struct curl_slist *cookies;
@ -47,7 +46,7 @@ print_cookies(CURL *curl)
if(res != CURLE_OK) { if(res != CURLE_OK) {
fprintf(stderr, "Curl curl_easy_getinfo failed: %s\n", fprintf(stderr, "Curl curl_easy_getinfo failed: %s\n",
curl_easy_strerror(res)); curl_easy_strerror(res));
exit(1); return 1;
} }
nc = cookies; nc = cookies;
i = 1; i = 1;
@ -60,6 +59,8 @@ print_cookies(CURL *curl)
printf("(none)\n"); printf("(none)\n");
} }
curl_slist_free_all(cookies); curl_slist_free_all(cookies);
return 0;
} }
int int

View File

@ -418,22 +418,22 @@ static int init_fifo(GlobalInfo *g)
struct epoll_event epev; struct epoll_event epev;
fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo); fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo);
if(lstat (fifo, &st) == 0) { if(lstat(fifo, &st) == 0) {
if((st.st_mode & S_IFMT) == S_IFREG) { if((st.st_mode & S_IFMT) == S_IFREG) {
errno = EEXIST; errno = EEXIST;
perror("lstat"); perror("lstat");
exit(1); return 1;
} }
} }
unlink(fifo); unlink(fifo);
if(mkfifo (fifo, 0600) == -1) { if(mkfifo(fifo, 0600) == -1) {
perror("mkfifo"); perror("mkfifo");
exit(1); return 1;
} }
sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0); sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0);
if(sockfd == -1) { if(sockfd == -1) {
perror("open"); perror("open");
exit(1); return 1;
} }
g->fifofd = sockfd; g->fifofd = sockfd;
@ -449,9 +449,9 @@ static int init_fifo(GlobalInfo *g)
static void clean_fifo(GlobalInfo *g) static void clean_fifo(GlobalInfo *g)
{ {
epoll_ctl(g->epfd, EPOLL_CTL_DEL, g->fifofd, NULL); epoll_ctl(g->epfd, EPOLL_CTL_DEL, g->fifofd, NULL);
fclose(g->input); fclose(g->input);
unlink(fifo); unlink(fifo);
} }
@ -478,13 +478,13 @@ int main(int argc, char **argv)
g.epfd = epoll_create1(EPOLL_CLOEXEC); g.epfd = epoll_create1(EPOLL_CLOEXEC);
if(g.epfd == -1) { if(g.epfd == -1) {
perror("epoll_create1 failed"); perror("epoll_create1 failed");
exit(1); return 1;
} }
g.tfd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK | TFD_CLOEXEC); g.tfd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK | TFD_CLOEXEC);
if(g.tfd == -1) { if(g.tfd == -1) {
perror("timerfd_create failed"); perror("timerfd_create failed");
exit(1); return 1;
} }
memset(&its, 0, sizeof(struct itimerspec)); memset(&its, 0, sizeof(struct itimerspec));
@ -496,7 +496,8 @@ int main(int argc, char **argv)
ev.data.fd = g.tfd; ev.data.fd = g.tfd;
epoll_ctl(g.epfd, EPOLL_CTL_ADD, g.tfd, &ev); epoll_ctl(g.epfd, EPOLL_CTL_ADD, g.tfd, &ev);
init_fifo(&g); if(init_fifo(&g))
return 1;
g.multi = curl_multi_init(); g.multi = curl_multi_init();
/* setup the generic multi interface options we want */ /* setup the generic multi interface options we want */
@ -521,7 +522,7 @@ int main(int argc, char **argv)
} }
else { else {
perror("epoll_wait"); perror("epoll_wait");
exit(1); return 1;
} }
} }

View File

@ -402,22 +402,22 @@ static int init_fifo(GlobalInfo *g)
curl_socket_t sockfd; curl_socket_t sockfd;
fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo); fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo);
if(lstat (fifo, &st) == 0) { if(lstat(fifo, &st) == 0) {
if((st.st_mode & S_IFMT) == S_IFREG) { if((st.st_mode & S_IFMT) == S_IFREG) {
errno = EEXIST; errno = EEXIST;
perror("lstat"); perror("lstat");
exit(1); return 1;
} }
} }
unlink(fifo); unlink(fifo);
if(mkfifo (fifo, 0600) == -1) { if(mkfifo(fifo, 0600) == -1) {
perror("mkfifo"); perror("mkfifo");
exit(1); return 1;
} }
sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0); sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0);
if(sockfd == -1) { if(sockfd == -1) {
perror("open"); perror("open");
exit(1); return 1;
} }
g->input = fdopen(sockfd, "r"); g->input = fdopen(sockfd, "r");
@ -436,7 +436,8 @@ int main(int argc, char **argv)
memset(&g, 0, sizeof(GlobalInfo)); memset(&g, 0, sizeof(GlobalInfo));
g.loop = ev_default_loop(0); g.loop = ev_default_loop(0);
init_fifo(&g); if(init_fifo(&g))
return 1;
g.multi = curl_multi_init(); g.multi = curl_multi_init();
ev_timer_init(&g.timer_event, timer_cb, 0., 0.); ev_timer_init(&g.timer_event, timer_cb, 0., 0.);

View File

@ -25,7 +25,7 @@
* Pass in a custom socket for libcurl to use. * Pass in a custom socket for libcurl to use.
* </DESC> * </DESC>
*/ */
#ifdef _WIN32 #ifdef _MSC_VER
#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS #ifndef _WINSOCK_DEPRECATED_NO_WARNINGS
#define _WINSOCK_DEPRECATED_NO_WARNINGS /* for inet_addr() */ #define _WINSOCK_DEPRECATED_NO_WARNINGS /* for inet_addr() */
#endif #endif
@ -46,7 +46,11 @@
#include <unistd.h> /* misc. Unix functions */ #include <unistd.h> /* misc. Unix functions */
#endif #endif
#ifdef UNDER_CE
#define strerror(e) "?"
#else
#include <errno.h> #include <errno.h>
#endif
/* The IP address and port number to connect to */ /* The IP address and port number to connect to */
#define IPADDR "127.0.0.1" #define IPADDR "127.0.0.1"

View File

@ -51,7 +51,11 @@ int main(void)
return 1; /* cannot continue */ return 1; /* cannot continue */
/* to get the file size */ /* to get the file size */
#ifdef UNDER_CE
if(stat("debugit", &file_info) != 0) {
#else
if(fstat(fileno(fd), &file_info) != 0) { if(fstat(fileno(fd), &file_info) != 0) {
#endif
fclose(fd); fclose(fd);
return 1; /* cannot continue */ return 1; /* cannot continue */
} }

View File

@ -28,7 +28,11 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#ifdef UNDER_CE
#define strerror(e) "?"
#else
#include <errno.h> #include <errno.h>
#endif
#ifdef _WIN32 #ifdef _WIN32
#include <io.h> #include <io.h>
#undef stat #undef stat

View File

@ -77,7 +77,9 @@ static int upload(CURL *curlhandle, const char *remotepath,
f = fopen(localpath, "rb"); f = fopen(localpath, "rb");
if(!f) { if(!f) {
#ifndef UNDER_CE
perror(NULL); perror(NULL);
#endif
return 0; return 0;
} }

View File

@ -392,21 +392,21 @@ int init_fifo(void)
if((st.st_mode & S_IFMT) == S_IFREG) { if((st.st_mode & S_IFMT) == S_IFREG) {
errno = EEXIST; errno = EEXIST;
perror("lstat"); perror("lstat");
exit(1); return CURL_SOCKET_BAD;
} }
} }
unlink(fifo); unlink(fifo);
if(mkfifo (fifo, 0600) == -1) { if(mkfifo(fifo, 0600) == -1) {
perror("mkfifo"); perror("mkfifo");
exit(1); return CURL_SOCKET_BAD;
} }
socket = open(fifo, O_RDWR | O_NONBLOCK, 0); socket = open(fifo, O_RDWR | O_NONBLOCK, 0);
if(socket == -1) { if(socket == CURL_SOCKET_BAD) {
perror("open"); perror("open");
exit(1); return socket;
} }
MSG_OUT("Now, pipe some URL's into > %s\n", fifo); MSG_OUT("Now, pipe some URL's into > %s\n", fifo);
@ -421,6 +421,8 @@ int main(void)
GIOChannel* ch; GIOChannel* ch;
fd = init_fifo(); fd = init_fifo();
if(fd == CURL_SOCKET_BAD)
return 1;
ch = g_io_channel_unix_new(fd); ch = g_io_channel_unix_new(fd);
g_io_add_watch(ch, G_IO_IN, fifo_cb, g); g_io_add_watch(ch, G_IO_IN, fifo_cb, g);
gmain = g_main_loop_new(NULL, FALSE); gmain = g_main_loop_new(NULL, FALSE);

View File

@ -399,22 +399,22 @@ static int init_fifo(GlobalInfo *g)
curl_socket_t sockfd; curl_socket_t sockfd;
fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo); fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo);
if(lstat (fifo, &st) == 0) { if(lstat(fifo, &st) == 0) {
if((st.st_mode & S_IFMT) == S_IFREG) { if((st.st_mode & S_IFMT) == S_IFREG) {
errno = EEXIST; errno = EEXIST;
perror("lstat"); perror("lstat");
exit(1); return 1;
} }
} }
unlink(fifo); unlink(fifo);
if(mkfifo (fifo, 0600) == -1) { if(mkfifo (fifo, 0600) == -1) {
perror("mkfifo"); perror("mkfifo");
exit(1); return 1;
} }
sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0); sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0);
if(sockfd == -1) { if(sockfd == -1) {
perror("open"); perror("open");
exit(1); return 1;
} }
g->input = fdopen(sockfd, "r"); g->input = fdopen(sockfd, "r");
@ -440,7 +440,8 @@ int main(int argc, char **argv)
memset(&g, 0, sizeof(GlobalInfo)); memset(&g, 0, sizeof(GlobalInfo));
g.evbase = event_base_new(); g.evbase = event_base_new();
init_fifo(&g); if(init_fifo(&g))
return 1;
g.multi = curl_multi_init(); g.multi = curl_multi_init();
evtimer_assign(&g.timer_event, g.evbase, timer_cb, &g); evtimer_assign(&g.timer_event, g.evbase, timer_cb, &g);

View File

@ -94,7 +94,7 @@ static bool init(CURL *&conn, const char *url)
if(conn == NULL) { if(conn == NULL) {
fprintf(stderr, "Failed to create CURL connection\n"); fprintf(stderr, "Failed to create CURL connection\n");
exit(EXIT_FAILURE); return false;
} }
code = curl_easy_setopt(conn, CURLOPT_ERRORBUFFER, errorBuffer); code = curl_easy_setopt(conn, CURLOPT_ERRORBUFFER, errorBuffer);
@ -270,7 +270,7 @@ int main(int argc, char *argv[])
if(argc != 2) { if(argc != 2) {
fprintf(stderr, "Usage: %s <url>\n", argv[0]); fprintf(stderr, "Usage: %s <url>\n", argv[0]);
exit(EXIT_FAILURE); return EXIT_FAILURE;
} }
curl_global_init(CURL_GLOBAL_DEFAULT); curl_global_init(CURL_GLOBAL_DEFAULT);
@ -279,7 +279,7 @@ int main(int argc, char *argv[])
if(!init(conn, argv[1])) { if(!init(conn, argv[1])) {
fprintf(stderr, "Connection initialization failed\n"); fprintf(stderr, "Connection initialization failed\n");
exit(EXIT_FAILURE); return EXIT_FAILURE;
} }
// Retrieve content for the URL // Retrieve content for the URL
@ -289,7 +289,7 @@ int main(int argc, char *argv[])
if(code != CURLE_OK) { if(code != CURLE_OK) {
fprintf(stderr, "Failed to get '%s' [%s]\n", argv[1], errorBuffer); fprintf(stderr, "Failed to get '%s' [%s]\n", argv[1], errorBuffer);
exit(EXIT_FAILURE); return EXIT_FAILURE;
} }
// Parse the (assumed) HTML code // Parse the (assumed) HTML code

View File

@ -28,7 +28,11 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef UNDER_CE
#define strerror(e) "?"
#else
#include <errno.h> #include <errno.h>
#endif
/* curl stuff */ /* curl stuff */
#include <curl/curl.h> #include <curl/curl.h>
@ -138,7 +142,7 @@ int my_trace(CURL *handle, curl_infotype type,
return 0; return 0;
} }
static void setup(struct transfer *t, int num) static int setup(struct transfer *t, int num)
{ {
char filename[128]; char filename[128];
CURL *hnd; CURL *hnd;
@ -151,7 +155,7 @@ static void setup(struct transfer *t, int num)
if(!t->out) { if(!t->out) {
fprintf(stderr, "error: could not open file %s for writing: %s\n", fprintf(stderr, "error: could not open file %s for writing: %s\n",
filename, strerror(errno)); filename, strerror(errno));
exit(1); return 1;
} }
/* write to this file */ /* write to this file */
@ -175,6 +179,7 @@ static void setup(struct transfer *t, int num)
/* wait for pipe connection to confirm */ /* wait for pipe connection to confirm */
curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L); curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L);
#endif #endif
return 0;
} }
/* /*
@ -200,7 +205,8 @@ int main(int argc, char **argv)
multi_handle = curl_multi_init(); multi_handle = curl_multi_init();
for(i = 0; i < num_transfers; i++) { for(i = 0; i < num_transfers; i++) {
setup(&trans[i], i); if(setup(&trans[i], i))
return 1;
/* add the individual transfer */ /* add the individual transfer */
curl_multi_add_handle(multi_handle, trans[i].easy); curl_multi_add_handle(multi_handle, trans[i].easy);

View File

@ -30,7 +30,11 @@
#include <string.h> #include <string.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
#ifdef UNDER_CE
#define strerror(e) "?"
#else
#include <errno.h> #include <errno.h>
#endif
/* somewhat Unix-specific */ /* somewhat Unix-specific */
#ifndef _MSC_VER #ifndef _MSC_VER
@ -196,7 +200,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp)
return retcode; return retcode;
} }
static void setup(struct input *i, int num, const char *upload) static int setup(struct input *i, int num, const char *upload)
{ {
FILE *out; FILE *out;
char url[256]; char url[256];
@ -205,14 +209,15 @@ static void setup(struct input *i, int num, const char *upload)
curl_off_t uploadsize; curl_off_t uploadsize;
CURL *hnd; CURL *hnd;
hnd = i->hnd = curl_easy_init(); hnd = i->hnd = NULL;
i->num = num; i->num = num;
curl_msnprintf(filename, 128, "dl-%d", num); curl_msnprintf(filename, 128, "dl-%d", num);
out = fopen(filename, "wb"); out = fopen(filename, "wb");
if(!out) { if(!out) {
fprintf(stderr, "error: could not open file %s for writing: %s\n", upload, fprintf(stderr, "error: could not open file %s for writing: %s\n", upload,
strerror(errno)); strerror(errno));
exit(1); return 1;
} }
curl_msnprintf(url, 256, "https://localhost:8443/upload-%d", num); curl_msnprintf(url, 256, "https://localhost:8443/upload-%d", num);
@ -221,7 +226,8 @@ static void setup(struct input *i, int num, const char *upload)
if(stat(upload, &file_info)) { if(stat(upload, &file_info)) {
fprintf(stderr, "error: could not stat file %s: %s\n", upload, fprintf(stderr, "error: could not stat file %s: %s\n", upload,
strerror(errno)); strerror(errno));
exit(1); fclose(out);
return 1;
} }
uploadsize = file_info.st_size; uploadsize = file_info.st_size;
@ -230,9 +236,12 @@ static void setup(struct input *i, int num, const char *upload)
if(!i->in) { if(!i->in) {
fprintf(stderr, "error: could not open file %s for reading: %s\n", upload, fprintf(stderr, "error: could not open file %s for reading: %s\n", upload,
strerror(errno)); strerror(errno));
exit(1); fclose(out);
return 1;
} }
hnd = i->hnd = curl_easy_init();
/* write to this file */ /* write to this file */
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, out); curl_easy_setopt(hnd, CURLOPT_WRITEDATA, out);
@ -265,6 +274,7 @@ static void setup(struct input *i, int num, const char *upload)
/* wait for pipe connection to confirm */ /* wait for pipe connection to confirm */
curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L); curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L);
#endif #endif
return 0;
} }
/* /*
@ -297,7 +307,8 @@ int main(int argc, char **argv)
multi_handle = curl_multi_init(); multi_handle = curl_multi_init();
for(i = 0; i < num_transfers; i++) { for(i = 0; i < num_transfers; i++) {
setup(&trans[i], i, filename); if(setup(&trans[i], i, filename))
return 1;
/* add the individual transfer */ /* add the individual transfer */
curl_multi_add_handle(multi_handle, trans[i].hnd); curl_multi_add_handle(multi_handle, trans[i].hnd);

View File

@ -90,7 +90,9 @@ static int sftpResumeUpload(CURL *curlhandle, const char *remotepath,
f = fopen(localpath, "rb"); f = fopen(localpath, "rb");
if(!f) { if(!f) {
#ifndef UNDER_CE
perror(NULL); perror(NULL);
#endif
return 0; return 0;
} }
@ -99,7 +101,7 @@ static int sftpResumeUpload(CURL *curlhandle, const char *remotepath,
curl_easy_setopt(curlhandle, CURLOPT_READFUNCTION, readfunc); curl_easy_setopt(curlhandle, CURLOPT_READFUNCTION, readfunc);
curl_easy_setopt(curlhandle, CURLOPT_READDATA, f); curl_easy_setopt(curlhandle, CURLOPT_READDATA, f);
#ifdef _WIN32 #if defined(_WIN32) && !defined(UNDER_CE)
_fseeki64(f, remoteFileSizeByte, SEEK_SET); _fseeki64(f, remoteFileSizeByte, SEEK_SET);
#else #else
fseek(f, (long)remoteFileSizeByte, SEEK_SET); fseek(f, (long)remoteFileSizeByte, SEEK_SET);

View File

@ -82,7 +82,7 @@ int main(void)
curl = curl_easy_init(); curl = curl_easy_init();
if(curl) { if(curl) {
/* what call to write: */ /* what call to write: */
curl_easy_setopt(curl, CURLOPT_URL, "HTTPS://your.favourite.ssl.site"); curl_easy_setopt(curl, CURLOPT_URL, "HTTPS://secure.site.example");
curl_easy_setopt(curl, CURLOPT_HEADERDATA, headerfile); curl_easy_setopt(curl, CURLOPT_HEADERDATA, headerfile);
#ifdef _MSC_VER #ifdef _MSC_VER

View File

@ -27,6 +27,14 @@ We also work hard on writing code that are warning-free on all the major
platforms and in general on as many platforms as possible. Code that obviously platforms and in general on as many platforms as possible. Code that obviously
causes warnings is not accepted as-is. causes warnings is not accepted as-is.
## Readability
A primary characteristic for code is readability. The intent and meaning of
the code should be visible to the reader. Being clear and unambiguous beats
being clever and saving two lines of code. Write simple code. You and others
who come back to this code over the coming decades want to be able to quickly
understand it when debugging.
## Naming ## Naming
Try using a non-confusing naming scheme for your new functions and variable Try using a non-confusing naming scheme for your new functions and variable
@ -314,3 +322,42 @@ typedef struct {
} something; } something;
something instance; something instance;
``` ```
## Banned functions
To avoid footguns and unintended consequences we forbid the use of a number of
C functions. The `checksrc` script finds and yells about them if used. This
makes us write better code.
This is the full list of functions generally banned.
_access
_mbscat
_mbsncat
_tcscat
_tcsncat
_waccess
_wcscat
_wcsncat
access
gets
gmtime
LoadLibrary
LoadLibraryA
LoadLibraryEx
LoadLibraryExA
LoadLibraryExW
LoadLibraryW
localtime
snprintf
sprintf
sscanf
strcat
strerror
strncat
strncpy
strtok
strtol
strtoul
vsnprint
vsprintf

127
docs/internals/MULTI-EV.md Normal file
View File

@ -0,0 +1,127 @@
<!--
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
# Multi Event Based
A libcurl multi is operating "event based" when the application uses
and event library like `libuv` to monitor the sockets and file descriptors
libcurl uses to trigger transfer operations. How that works from the
applications point of view is described in libcurl-multi(3).
This documents is about the internal handling.
## Source Locations
All code related to event based handling is found in `lib/multi_ev.c`
and `lib/multi_ev.h`. The header defines a set of internal functions
and `struct curl_multi_ev` that is embedded in each multi handle.
There is `Curl_multi_ev_init()` and `Curl_multi_ev_cleanup()` to manage
the overall life cycle, call on creation and destruction of the multi
handle.
## Tracking Events
First, the various functions in `lib/multi_ev.h` only ever really do
something when the libcurl application has registered its callback
in `multi->socket_cb`.
This is important as this callback gets informed about *changes* to sockets.
When a new socket is added, an existing is removed, or the `POLLIN/OUT`
flags change, `multi->socket_cb` needs to be invoked. `multi_ev` has to
track what it already reported to detect changes.
Most applications are expected to go "event based" right from the start,
but the libcurl API does not prohibit an application to start another
way and then go for events later on, even in the middle of a transfer.
### Transfer Events
Most event that happen are in connection with a transfer. A transfer
opens a connection, which opens a socket, and waits for this socket
to become writable (`POLLOUT`) when using TCP, for example.
The multi then calls `Curl_multi_ev_assess_xfer(multi, data)` to
let the multi event code detect what sockets the transfer is interested in.
If indeed a `multi->socket_cb` is set, the *current* transfer pollset is
retrieved via `Curl_multi_getsock()`. This current pollset is then
compared to the *previous* pollset. If relevant changes are detected,
`multi->socket_cb` gets informed about those. These can be:
* a socket is in the current set, but not the previous one
* a socket was also in the previous one, but IN/OUT flags changed
* a socket in the previous one is no longer part of the current
`multi_ev.c` keeps a `struct mev_sh_entry` for each sockets in a hash
with the socket as key. It tracks in each entry which transfers are
interested in this particular socket. How many transfer want to read
and/or write and what the summarized `POLLIN/POLLOUT` action, that
had been reported to `multi->socket_cb` was.
This is necessary as a socket may be in use by several transfers
at the same time (think HTTP/2 on the same connection). When a transfer
is done and gets removed from the socket entry, it decrements
the reader and/or writer count (depending on what it was last
interested in). This *may* result in the entry's summarized action
to change, or not.
### Connection Events
There are also events not connected to any transfer that need to be tracked.
The multi connection cache, concerned with clean shutdowns of connections,
is interested in socket events during the shutdown.
To allow use of the libcurl infrastructure, the connection cache operates
using an *internal* easy handle that is not a transfer as such. The
internal handle is used for all connection shutdown operations, being tied
to a particular connection only for a short time. This means tracking
the last pollset for an internal handle is useless.
Instead, the connection cache uses `Curl_multi_ev_assess_conn()` to have
multi event handling check the connection and track a "last pollset"
for the connection alone.
## Event Processing
When the libcurl application is informed by the event library that
a particular socket has an event, it calls `curl_multi_socket_action()`
to make libcurl react to it. This internally invokes
`Curl_multi_ev_expire_xfers()` which expires all transfers that
are interested in the given socket, so the multi handle runs them.
In addition `Curl_multi_ev_expire_xfers()` returns a `bool` to let
the multi know that connections are also interested in the socket, so
the connection pool should be informed as well.
## All Things Pass
When a transfer is done, e.g. removed from its multi handle, the
multi calls `Curl_multi_ev_xfer_done()`. This cleans up the pollset
tracking for the transfer.
When a connection is done, and before it is destroyed,
`Curl_multi_ev_conn_done()` is called. This cleans up the pollset
tracking for this connection.
When a socket is about to be closed, `Curl_multi_ev_socket_done()`
is called to cleanup the socket entry and all information kept there.
These calls do not have to happen in any particular order. A transfer's
socket may be around while the transfer is ongoing. Or it might disappear
in the middle of things. Also, a transfer might be interested in several
sockets at the same time (resolving, eye balling, ftp are all examples of
those).
### And Come Again
While transfer and connection identifier are practically unique in a
libcurl application, sockets are not. Operating systems are keen on reusing
their resources, and the next socket may get the same identifier as
one just having been closed with high likelihood.
This means that multi event handling needs to be informed *before* a close,
clean up all its tracking and be ready to see that same socket identifier
again right after.

View File

@ -30,6 +30,19 @@ struct Curl_str {
}; };
~~~ ~~~
Access the struct fields with `Curl_str()` for the pointer and `Curl_strlen()`
for the length rather than using the struct fields directly.
## `Curl_str_init`
~~~c
void Curl_str_init(struct Curl_str *out)
~~~
This initiates a string struct. The parser functions that store info in
strings always init the string themselves, so this stand-alone use is often
not necessary.
## `Curl_str_word` ## `Curl_str_word`
~~~c ~~~c
@ -94,11 +107,32 @@ Advance over a single ASCII space. Return non-zero on error.
## `Curl_str_number` ## `Curl_str_number`
~~~c ~~~c
int Curl_str_number(char **linep, size_t *nump, size_t max); int Curl_str_number(char **linep, curl_size_t *nump, size_t max);
~~~ ~~~
Get an unsigned decimal number. Leading zeroes are just swallowed. Return Get an unsigned decimal number not larger than `max`. Leading zeroes are just
non-zero on error. swallowed. Return non-zero on error. Returns error if there was not a single
digit.
## `Curl_str_hex`
~~~c
int Curl_str_hex(char **linep, curl_size_t *nump, size_t max);
~~~
Get an unsigned hexadecimal number not larger than `max`. Leading zeroes are
just swallowed. Return non-zero on error. Returns error if there was not a
single digit. Does *not* handled `0x` prefix.
## `Curl_str_octal`
~~~c
int Curl_str_octal(char **linep, curl_size_t *nump, size_t max);
~~~
Get an unsigned octal number not larger than `max`. Leading zeroes are just
swallowed. Return non-zero on error. Returns error if there was not a single
digit.
## `Curl_str_newline` ## `Curl_str_newline`
@ -107,3 +141,30 @@ int Curl_str_newline(char **linep);
~~~ ~~~
Check for a single CR or LF. Return non-zero on error */ Check for a single CR or LF. Return non-zero on error */
## `Curl_str_casecompare`
~~~c
int Curl_str_casecompare(struct Curl_str *str, const char *check);
~~~
Returns true if the provided string in the `str` argument matches the `check`
string case insensitively.
## `Curl_str_cmp`
~~~c
int Curl_str_cmp(struct Curl_str *str, const char *check);
~~~
Returns true if the provided string in the `str` argument matches the `check`
string case sensitively. This is *not* the same return code as `strcmp`.
## `Curl_str_nudge`
~~~c
int Curl_str_nudge(struct Curl_str *str, size_t num);
~~~
Removes `num` bytes from the beginning (left) of the string kept in `str`. If
`num` is larger than the string, it instead returns an error.

View File

@ -28,11 +28,10 @@ const struct curl_easyoption *curl_easy_option_by_id(CURLoption id);
# DESCRIPTION # DESCRIPTION
Given a *CURLoption* **id**, this function returns a pointer to the Given a *CURLoption* **id**, this function returns a pointer to the
*curl_easyoption* struct, holding information about the *curl_easyoption* struct, holding information about the curl_easy_setopt(3)
curl_easy_setopt(3) option using that id. The option id is the CURLOPT_ option using that id. The option id is the `CURLOPT_` prefixed ones provided
prefix ones provided in the standard curl/curl.h header file. This function in the standard curl/curl.h header file. This function returns the non-alias
returns the non-alias version of the cases where there is an alias function as version of the cases where there is an alias function as well.
well.
If libcurl has no option with the given id, this function returns NULL. If libcurl has no option with the given id, this function returns NULL.

View File

@ -27,11 +27,10 @@ const struct curl_easyoption *curl_easy_option_by_name(const char *name);
# DESCRIPTION # DESCRIPTION
Given a **name**, this function returns a pointer to the Given a **name**, this function returns a pointer to the *curl_easyoption*
*curl_easyoption* struct, holding information about the struct, holding information about the curl_easy_setopt(3) option using that
curl_easy_setopt(3) option using that name. The name should be specified name. The name should be specified without the `CURLOPT_` prefix and the name
without the "CURLOPT_" prefix and the name comparison is made case comparison is made case insensitive.
insensitive.
If libcurl has no option with the given name, this function returns NULL. If libcurl has no option with the given name, this function returns NULL.

View File

@ -316,4 +316,4 @@ filenames are now escaped before transmission.
# RETURN VALUE # RETURN VALUE
0 means everything was OK, non-zero means an error occurred corresponding to a 0 means everything was OK, non-zero means an error occurred corresponding to a
CURL_FORMADD_* constant defined in *\<curl/curl.h\>*. `CURL_FORMADD_*` constant defined in *\<curl/curl.h\>*.

View File

@ -38,9 +38,9 @@ first argument to the curl_formget_callback function.
size_t len);" size_t len);"
~~~ ~~~
The curl_formget_callback is invoked for each part of the HTTP POST chain. The The *curl_formget_callback* is invoked for each part of the HTTP POST chain.
character buffer passed to the callback must not be freed. The callback should The character buffer passed to the callback must not be freed. The callback
return the buffer length passed to it on success. should return the buffer length passed to it on success.
If the **CURLFORM_STREAM** option is used in the formpost, it prevents If the **CURLFORM_STREAM** option is used in the formpost, it prevents
curl_formget(3) from working until you have performed the actual HTTP request. curl_formget(3) from working until you have performed the actual HTTP request.

View File

@ -64,16 +64,17 @@ If this is not thread-safe, you must not call this function when any other
thread in the program (i.e. a thread sharing the same memory) is running. thread in the program (i.e. a thread sharing the same memory) is running.
This does not just mean no other thread that is using libcurl. This does not just mean no other thread that is using libcurl.
# OpenSSL # Names
SSL backend names (case-insensitive): BearSSL, GnuTLS, mbedTLS, OpenSSL,
Rustls, Schannel, Secure-Transport, wolfSSL
The name "OpenSSL" is used for all versions of OpenSSL and its associated The name "OpenSSL" is used for all versions of OpenSSL and its associated
forks/flavors in this function. OpenSSL, BoringSSL, LibreSSL, quictls and forks/flavors in this function. OpenSSL, BoringSSL, LibreSSL, quictls and
AmiSSL are all supported by libcurl, but in the eyes of AmiSSL are all supported by libcurl, but in the eyes of
curl_global_sslset(3) they are all just "OpenSSL". They all mostly curl_global_sslset(3) they are all just "OpenSSL". They all mostly
provide the same API. provide the same API. curl_version_info(3) can return more specific info about
the exact OpenSSL flavor and version number in use.
curl_version_info(3) can return more specific info about the exact
OpenSSL flavor and version number is use.
# struct # struct

View File

@ -97,13 +97,38 @@ In order to find out all components involved in a transfer, run it with "all"
configured. You can then see all names involved in your libcurl version in the configured. You can then see all names involved in your libcurl version in the
trace. trace.
## `dns`
Tracing of DNS operations to resolve hostnames and HTTPS records.
## `lib-ids`
Adds transfer and connection identifiers as prefix to every call to
CURLOPT_DEBUGFUNCTION(3). The format is `[n-m]` where `n` is the identifier
of the transfer and `m` is the identifier of the connection. A literal `x`
is used for internal transfers or when no connection is assigned.
For example, `[5-x]` is the prefix for transfer 5 that has no
connection. The command line tool `curl`uses the same format for its
`--trace-ids` option.
`lib-ids` is intended for libcurl applications that handle multiple
transfers but have no own way to identify in trace output which transfer
a trace event is connected to.
## `doh` ## `doh`
Tracing of DNS-over-HTTP operations to resolve hostnames. Former name for DNS-over-HTTP operations. Now an alias for `dns`.
## `multi`
Traces multi operations managing transfers' state changes and sockets poll
states.
## `read` ## `read`
Traces reading of upload data from the application in order to send it to the server. Traces reading of upload data from the application in order to send it to the
server.
## `ssls` ## `ssls`

View File

@ -100,6 +100,10 @@ int main(void)
/* call curl_multi_perform() */ /* call curl_multi_perform() */
FD_ZERO(&fdread);
FD_ZERO(&fdwrite);
FD_ZERO(&fdexcep);
/* get file descriptors from the transfers */ /* get file descriptors from the transfers */
mc = curl_multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd); mc = curl_multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd);

Some files were not shown because too many files have changed in this diff Show More