async-threaded resolver: use ref counter

Allocate the data shared between a transfer and an aync resolver
thread separately and use a reference counter to determine its
release.

Closes #16847
This commit is contained in:
Stefan Eissing 2025-03-27 13:55:49 +01:00 committed by Daniel Stenberg
parent 23dfb47595
commit 19226f9bb1
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 140 additions and 102 deletions

View file

@ -2086,10 +2086,8 @@ static CURLMcode state_resolving(struct Curl_multi *multi,
dns = Curl_fetch_addr(data, hostname, conn->primary.remote_port);
if(dns) {
#ifdef USE_CURL_ASYNC
data->state.async.dns = dns;
data->state.async.done = TRUE;
#endif
/* Tell a possibly async resolver we no longer need the results. */
Curl_resolver_set_result(data, dns);
result = CURLE_OK;
infof(data, "Hostname '%s' was found in DNS cache", hostname);
}