aboutsummaryrefslogtreecommitdiff
path: root/lib/hostthre.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-01-22 06:36:52 +0000
committerYang Tse <yangsita@gmail.com>2010-01-22 06:36:52 +0000
commitbfc4c33985aa40557a7b48d8052577b0c8bd0c5c (patch)
tree20a119eb6fc7b0260a9a55dd75bf4ab4b9db9f06 /lib/hostthre.c
parent5af20c70e4ae23437378d92e162d3377d9666b1f (diff)
Constantine Sapuntzakis refactoring of async callbacks, allowing
removal of Curl_addrinfo_copy(), Curl_addrinfo6_callback(), and Curl_addrinfo4_callback()
Diffstat (limited to 'lib/hostthre.c')
-rw-r--r--lib/hostthre.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/hostthre.c b/lib/hostthre.c
index e41653b27..32e946ccb 100644
--- a/lib/hostthre.c
+++ b/lib/hostthre.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2010, 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
@@ -219,7 +219,7 @@ void release_thread_sync(struct thread_sync_data * tsd)
#if defined(CURLRES_IPV4)
/*
- * gethostbyname_thread() resolves a name, calls the Curl_addrinfo4_callback
+ * gethostbyname_thread() resolves a name, calls the Curl_addrinfo_callback
* and then exits.
*
* For builds without ARES/ENABLE_IPV6, create a resolver thread and wait on
@@ -254,14 +254,16 @@ static unsigned __stdcall gethostbyname_thread (void *arg)
/* is parent thread waiting for us and are we able to access conn members? */
if(acquire_thread_sync(&tsd)) {
+ Curl_addrinfo *ai = Curl_he2ai(he, conn->async.port);
+
/* Mark that we have obtained the information, and that we are calling
* back with it. */
SetEvent(td->event_resolved);
- if(he) {
- rc = Curl_addrinfo4_callback(conn, CURL_ASYNC_SUCCESS, he);
+ if(ai) {
+ rc = Curl_addrinfo_callback(conn, CURL_ASYNC_SUCCESS, ai);
}
else {
- rc = Curl_addrinfo4_callback(conn, SOCKERRNO, NULL);
+ rc = Curl_addrinfo_callback(conn, SOCKERRNO, NULL);
}
release_thread_sync(&tsd);
}
@@ -276,7 +278,7 @@ static unsigned __stdcall gethostbyname_thread (void *arg)
#elif defined(CURLRES_IPV6)
/*
- * getaddrinfo_thread() resolves a name, calls Curl_addrinfo6_callback and then
+ * getaddrinfo_thread() resolves a name, calls Curl_addrinfo_callback and then
* exits.
*
* For builds without ARES, but with ENABLE_IPV6, create a resolver thread
@@ -320,10 +322,10 @@ static unsigned __stdcall getaddrinfo_thread (void *arg)
SetEvent(td->event_resolved);
if(rc == 0) {
- rc = Curl_addrinfo6_callback(conn, CURL_ASYNC_SUCCESS, res);
+ rc = Curl_addrinfo_callback(conn, CURL_ASYNC_SUCCESS, res);
}
else {
- rc = Curl_addrinfo6_callback(conn, SOCKERRNO, NULL);
+ rc = Curl_addrinfo_callback(conn, SOCKERRNO, NULL);
}
release_thread_sync(&tsd);
}