Skip to content
Snippets Groups Projects
Commit 31b6bb6a authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

lock the DNS cache properly before adding an entry when using asynch DNS

parent b84607ff
No related branches found
No related tags found
No related merge requests found
......@@ -527,8 +527,16 @@ static void host_callback(void *arg, /* "struct connectdata *" */
/* pack_hostent() copies to and shrinks the target buffer */
struct hostent *he = pack_hostent(&bufp, hostent);
dns = cache_resolv_response(conn->data, he,
struct SessionHandle *data = conn->data;
if(data->share)
Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
dns = cache_resolv_response(data, he,
conn->async.hostname, conn->async.port);
if(data->share)
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment