**********************************************************************/
#ifdef CURLRES_ASYNCH
/*
- * Curl_addrinfo_callback() gets called by ares/gethostbyname_thread() when we
- * got the name resolved (or not!).
+ * addrinfo_callback() gets called by ares, gethostbyname_thread() or
+ * getaddrinfo_thread() when we got the name resolved (or not!).
*
* If the status argument is CURL_ASYNC_SUCCESS, we might need to copy the
* address field since it might be freed when this function returns. This
#ifdef CURLRES_IPV6
void Curl_addrinfo6_callback(void *arg, /* "struct connectdata *" */
int status,
- struct addrinfo *hostent)
+ struct addrinfo *ai)
{
- addrinfo_callback(arg, status, hostent);
+ addrinfo_callback(arg, status, ai);
}
#endif
#if defined(CURLRES_IPV4)
/*
- * gethostbyname_thread() resolves a name, calls the Curl_addrinfo_callback
+ * gethostbyname_thread() resolves a name, calls the Curl_addrinfo4_callback
* and then exits.
*
* For builds without ARES/ENABLE_IPV6, create a resolver thread and wait on
#elif defined(CURLRES_IPV6)
/*
- * getaddrinfo_thread() resolves a name, calls Curl_addrinfo_callback and then
+ * getaddrinfo_thread() resolves a name, calls Curl_addrinfo6_callback and then
* exits.
*
* For builds without ARES, but with ENABLE_IPV6, create a resolver thread
#ifdef DEBUG_THREADING_GETADDRINFO
dump_addrinfo (conn, res);
#endif
- Curl_addrinfo_callback(conn, CURL_ASYNC_SUCCESS, res);
+ Curl_addrinfo6_callback(conn, CURL_ASYNC_SUCCESS, res);
}
else {
- Curl_addrinfo_callback(conn, (int)WSAGetLastError(), NULL);
+ Curl_addrinfo6_callback(conn, (int)WSAGetLastError(), NULL);
TRACE(("Winsock-error %d, no address\n", conn->async.status));
}
return (rc);
status = WaitForSingleObject(td->thread_hnd, 1000UL*timeout);
if (status == WAIT_OBJECT_0 || status == WAIT_ABANDONED) {
/* Thread finished before timeout; propagate Winsock error to this thread.
- * 'conn->async.done = TRUE' is set in Curl_addrinfo_callback().
+ * 'conn->async.done = TRUE' is set in Curl_addrinfo4/6_callback().
*/
WSASetLastError(conn->async.status);
GetExitCodeThread(td->thread_hnd, &td->thread_status);