aboutsummaryrefslogtreecommitdiff
path: root/lib/asyn-thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/asyn-thread.c')
-rw-r--r--lib/asyn-thread.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c
index 81caedb09..0ca260334 100644
--- a/lib/asyn-thread.c
+++ b/lib/asyn-thread.c
@@ -279,6 +279,9 @@ static unsigned int CURL_STDCALL getaddrinfo_thread (void *arg)
if(tsd->sock_error == 0)
tsd->sock_error = RESOLVER_ENOMEM;
}
+ else {
+ Curl_addrinfo_set_port(tsd->res, tsd->port);
+ }
Curl_mutex_acquire(tsd->mtx);
if(tsd->done) {
@@ -602,6 +605,7 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
*waitp = 0; /* default to synchronous response */
+#ifndef USE_RESOLVE_ON_IPS
/* First check if this is an IPv4 address string */
if(Curl_inet_pton(AF_INET, hostname, &in) > 0)
/* This is a dotted IP address 123.123.123.123-style */
@@ -609,7 +613,7 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
#ifdef CURLRES_IPV6
/* check if this is an IPv6 address string */
- if(Curl_inet_pton (AF_INET6, hostname, &in6) > 0)
+ if(Curl_inet_pton(AF_INET6, hostname, &in6) > 0)
/* This is an IPv6 address literal */
return Curl_ip2addr(AF_INET6, &in6, hostname, port);
@@ -633,6 +637,7 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
pf = PF_INET;
#endif /* CURLRES_IPV6 */
+#endif /* USE_RESOLVE_ON_IPS */
memset(&hints, 0, sizeof(hints));
hints.ai_family = pf;
@@ -656,6 +661,10 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
hostname, port, Curl_strerror(conn, SOCKERRNO));
return NULL;
}
+ else {
+ Curl_addrinfo_set_port(res, port);
+ }
+
return res;
}