Happy Eyeballs: add resolution time delay

HEv3 describes conditions on when first connect attempts shall be
started.
https://www.ietf.org/archive/id/draft-ietf-happy-happyeyeballs-v3-01.html
Chapter 4.2

libcurl now waits 50ms for AAAA and HTTPS results (when requested) to
return before continuing with the connect.

Added HTTPS-RR to the "was resolved" information info message. Changed
logging of HTTPS-RR to a one-liner with RFC 9460 like formatting. This
way the user can see if/what was resolved and used in connecting.

Closes #21354
This commit is contained in:
Stefan Eissing 2026-04-17 10:26:25 +02:00 committed by Daniel Stenberg
parent 70a159527c
commit 809dda3a37
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
13 changed files with 272 additions and 158 deletions

View file

@ -136,6 +136,17 @@ CURLcode Curl_resolv_take_result(struct Curl_easy *data, uint32_t resolv_id,
void Curl_resolv_destroy(struct Curl_easy *data, uint32_t resolv_id);
/* How much time has gone by since start of resolve.
* Returns CURL_TIMEOUT_RESOLVE_MS if `resolv_id` is no longer valid. */
timediff_t Curl_resolv_elapsed_ms(struct Curl_easy *data,
uint32_t resolv_id);
/* Return TRUE if `resolv_id` has answers (positive or negative) to
* all queries in `dns_queries`.
* Queries not requested are considered answered. */
bool Curl_resolv_has_answers(struct Curl_easy *data,
uint32_t resolv_id, uint8_t dns_queries);
const struct Curl_addrinfo *Curl_resolv_get_ai(struct Curl_easy *data,
uint32_t resolv_id,
int ai_family,
@ -150,6 +161,8 @@ bool Curl_resolv_knows_https(struct Curl_easy *data, uint32_t resolv_id);
#define Curl_resolv_shutdown_all(x) Curl_nop_stmt
#define Curl_resolv_destroy_all(x) Curl_nop_stmt
#define Curl_resolv_take_result(x, y, z) CURLE_NOT_BUILT_IN
#define Curl_resolv_elapsed_ms(x, y) CURL_TIMEOUT_RESOLVE_MS
#define Curl_resolv_has_answers(x, y, z) TRUE
#define Curl_resolv_get_ai(x, y, z, a) NULL
#define Curl_resolv_get_https(x, y) NULL
#define Curl_resolv_knows_https(x, y) TRUE