aboutsummaryrefslogtreecommitdiff
path: root/lib/hostasyn.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/hostasyn.c')
-rw-r--r--lib/hostasyn.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/lib/hostasyn.c b/lib/hostasyn.c
index ed9190f4c..f7d99ce9a 100644
--- a/lib/hostasyn.c
+++ b/lib/hostasyn.c
@@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -50,7 +50,6 @@
#include "hostip.h"
#include "hash.h"
#include "share.h"
-#include "strerror.h"
#include "url.h"
#include "curl_memory.h"
/* The last #include file should be: */
@@ -66,25 +65,23 @@
*
* The storage operation locks and unlocks the DNS cache.
*/
-CURLcode Curl_addrinfo_callback(struct connectdata *conn,
+CURLcode Curl_addrinfo_callback(struct Curl_easy *data,
int status,
struct Curl_addrinfo *ai)
{
struct Curl_dns_entry *dns = NULL;
CURLcode result = CURLE_OK;
- conn->async.status = status;
+ data->state.async.status = status;
if(CURL_ASYNC_SUCCESS == status) {
if(ai) {
- struct Curl_easy *data = conn->data;
-
if(data->share)
Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
dns = Curl_cache_addr(data, ai,
- conn->async.hostname,
- conn->async.port);
+ data->state.async.hostname,
+ data->state.async.port);
if(data->share)
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
@@ -99,12 +96,12 @@ CURLcode Curl_addrinfo_callback(struct connectdata *conn,
}
}
- conn->async.dns = dns;
+ data->state.async.dns = dns;
/* Set async.done TRUE last in this function since it may be used multi-
threaded and once this is TRUE the other thread may read fields from the
async struct */
- conn->async.done = TRUE;
+ data->state.async.done = TRUE;
/* IPv4: The input hostent struct will be freed by ares when we return from
this function */
@@ -117,12 +114,12 @@ CURLcode Curl_addrinfo_callback(struct connectdata *conn,
* name resolve layers (selected at build-time). They all take this same set
* of arguments
*/
-struct Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
+struct Curl_addrinfo *Curl_getaddrinfo(struct Curl_easy *data,
const char *hostname,
int port,
int *waitp)
{
- return Curl_resolver_getaddrinfo(conn, hostname, port, waitp);
+ return Curl_resolver_getaddrinfo(data, hostname, port, waitp);
}
#endif /* CURLRES_ASYNCH */