if(tsd->hostname)
free(tsd->hostname);
-
+
if (tsd->res)
Curl_freeaddrinfo(tsd->res);
static
int init_thread_sync_data(struct thread_sync_data * tsd,
const char * hostname,
- int port,
- const struct addrinfo *hints)
+ int port,
+ const struct addrinfo *hints)
{
memset(tsd, 0, sizeof(*tsd));
tsd->sock_error = SOCKERRNO;
if (tsd->sock_error == 0)
tsd->sock_error = ENOMEM;
- }
+ }
Curl_mutex_acquire(tsd->mtx);
tsd->done = 1;
struct thread_sync_data *tsd = conn_thread_sync_data(conn);
int rc;
- rc = Curl_addrinfo_callback(conn, tsd->sock_error, tsd->res);
+ rc = Curl_addrinfo_callback(conn, tsd->sock_error, tsd->res);
/* The tsd->res structure has been copied to async.dns and perhaps the DNS cache.
Set our copy to NULL so destroy_thread_sync_data doesn't free it.
*/
if (td->thread_hnd != curl_thread_t_null)
Curl_thread_join(&td->thread_hnd);
-
+
destroy_thread_sync_data(&td->tsd);
-
+
free(async->os_specific);
}
async->hostname = NULL;
int err = ENOMEM;
conn->async.os_specific = (void*) td;
- if(!td)
+ if(!td)
goto err_exit;
conn->async.port = port;
td->dummy_sock = CURL_SOCKET_BAD;
td->thread_hnd = curl_thread_t_null;
- if (!init_thread_sync_data(&td->tsd, hostname, port, hints))
+ if (!init_thread_sync_data(&td->tsd, hostname, port, hints))
goto err_exit;
Curl_safefree(conn->async.hostname);
if (Curl_thread_join(&td->thread_hnd)) {
rc = getaddrinfo_complete(conn);
} else {
- DEBUGASSERT(0);
+ DEBUGASSERT(0);
}
conn->async.done = TRUE;
-
+
if(entry)
*entry = conn->async.dns;
struct SessionHandle *data = conn->data;
struct thread_data *td = (struct thread_data*) conn->async.os_specific;
int done = 0;
-
+
*entry = NULL;
if (!td) {
done = td->tsd.done;
Curl_mutex_release(td->tsd.mtx);
- if (done) {
+ if (done) {
getaddrinfo_complete(conn);
if (td->poll_interval != 0)
Curl_expire(conn->data, 0);