mirror of
https://github.com/curl/curl.git
synced 2026-08-24 16:33:33 +03:00
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:
parent
23dfb47595
commit
19226f9bb1
5 changed files with 140 additions and 102 deletions
12
lib/socks.c
12
lib/socks.c
|
|
@ -344,10 +344,8 @@ static CURLproxycode do_SOCKS4(struct Curl_cfilter *cf,
|
|||
dns = Curl_fetch_addr(data, sx->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);
|
||||
infof(data, "Hostname '%s' was found", sx->hostname);
|
||||
sxstate(sx, data, CONNECT_RESOLVED);
|
||||
}
|
||||
|
|
@ -814,10 +812,8 @@ CONNECT_REQ_INIT:
|
|||
dns = Curl_fetch_addr(data, sx->hostname, sx->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);
|
||||
infof(data, "SOCKS5: hostname '%s' found", sx->hostname);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue