summaryrefslogtreecommitdiff
path: root/lib/asyn-thread.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-07-06 10:22:28 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-07-06 11:49:50 +0200
commit6b0aa00abb8836bb4328f07cbe75421e21cd341e (patch)
tree49642f3845c14b1ac0409519be45e55e114f8a91 /lib/asyn-thread.c
parentb22f93dbb854efa8ab3af9c07d01bcd3664b255c (diff)
downloadcurl-6b0aa00abb8836bb4328f07cbe75421e21cd341e.tar.gz
asyn-thread.c: fix unused variable warnings on macOS
Diffstat (limited to 'lib/asyn-thread.c')
-rw-r--r--lib/asyn-thread.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c
index 65fa6c5be..4250e276a 100644
--- a/lib/asyn-thread.c
+++ b/lib/asyn-thread.c
@@ -594,28 +594,29 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
int *waitp)
{
struct addrinfo hints;
- struct in_addr in;
Curl_addrinfo *res;
int error;
char sbuf[12];
int pf = PF_INET;
-#ifdef CURLRES_IPV6
- struct in6_addr in6;
-#endif /* CURLRES_IPV6 */
*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 */
- return Curl_ip2addr(AF_INET, &in, hostname, port);
-
+ {
+ struct in_addr in;
+ /* 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 */
+ return Curl_ip2addr(AF_INET, &in, hostname, port);
+ }
#ifdef CURLRES_IPV6
- /* check if this is an IPv6 address string */
- if(Curl_inet_pton(AF_INET6, hostname, &in6) > 0)
- /* This is an IPv6 address literal */
- return Curl_ip2addr(AF_INET6, &in6, hostname, port);
+ {
+ struct in6_addr in6;
+ /* check if this is an IPv6 address string */
+ if(Curl_inet_pton(AF_INET6, hostname, &in6) > 0)
+ /* This is an IPv6 address literal */
+ return Curl_ip2addr(AF_INET6, &in6, hostname, port);
+ }
#endif /* CURLRES_IPV6 */
#endif /* !USE_RESOLVE_ON_IPS */