asyn-thread: use c-ares to resolve HTTPS RR

Allow building with c-ares and yet use threaded resolver for the main
host A/AAAA resolving:

  `--with-ares` provides the c-ares install path and defaults to use
  c-ares for name resolving

  `--with-threaded-resolver` still uses c-ares in the build (for HTTPS)
  but uses the threaded resolver for "normal" resolves.

It works similarly for cmake: ENABLE_ARES enables ares, and if
ENABLE_THREADED_RESOLVER also is set, c-ares is used for HTTPS RR and
the threaded resolver for "normal" resolves.

HTTPSRR and c-ares-rr are new features return by curl_version_info() and
thus shown by curl -V.

The c-ares-rr feature bit is there to make it possible to distinguish
between builds using c-ares for all name resolves and builds that use
the threaded resolves for the regular name resolves and c-ares for
HTTPSRR only. "c-ares-rr" means it does not use c-ares for "plain" name
resolves.

HTTPSRR support is EXPERIMENTAL only.

Closes #16054
This commit is contained in:
Daniel Stenberg 2025-01-21 11:42:20 +01:00
parent 520e67dd39
commit 0d4fdbf15d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
18 changed files with 470 additions and 421 deletions

View file

@ -434,7 +434,8 @@ Features testable here are:
- `AppleIDN`
- `bearssl`
- `brotli`
- `c-ares`
- `c-ares` - c-ares is used for (all) name resolves
- `c-ares-rr` - c-ares is used for additional records only
- `CharConv`
- `codeset-utf8`. If the running codeset is UTF-8 capable.
- `cookies`

View file

@ -28,7 +28,7 @@ Compare curl --version with curl-config --features
# Verify data after the test has been "shot"
<verify>
<postcheck>
%SRCDIR/libtest/test1013.pl ../curl-config %LOGDIR/stdout%TESTNUMBER features
%SRCDIR/libtest/test1013.pl ../curl-config %LOGDIR/stdout%TESTNUMBER features > %LOGDIR/result%TESTNUMBER
</postcheck>
<errorcode>
0

View file

@ -205,6 +205,6 @@ test_cleanup:
CURLcode test(char *URL)
{
(void)URL;
return 0;
return CURLE_OK;
}
#endif

View file

@ -698,6 +698,8 @@ sub checksystemfeatures {
$feature{"Unicode"} = $feat =~ /Unicode/i;
# Thread-safe init
$feature{"threadsafe"} = $feat =~ /threadsafe/i;
$feature{"HTTPSRR"} = $feat =~ /HTTPSRR/;
$feature{"c-ares-rr"} = $feat =~ /c-ares-rr/;
}
#
# Test harness currently uses a non-stunnel server in order to
@ -822,7 +824,6 @@ sub checksystemfeatures {
$feature{"large-time"} = 1;
$feature{"large-size"} = 1;
$feature{"sha512-256"} = 1;
$feature{"HTTPSRR"} = 1;
$feature{"local-http"} = servers::localhttp();
$feature{"codeset-utf8"} = lc(langinfo(CODESET())) eq "utf-8";

View file

@ -115,9 +115,6 @@ static const char *disabled[]={
#ifndef CURL_CA_SEARCH_SAFE
"win32-ca-search-safe",
#endif
#endif
#ifndef USE_HTTPSRR
"HTTPSRR",
#endif
NULL
};