hostip6: Fixed compilation warnings when verbose strings disabled
warning C4189: 'data': local variable is initialized but not referenced ...and some minor formatting/spacing changes.
This commit is contained in:
parent
2716350d1f
commit
f974ffdd4b
@ -5,7 +5,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -51,6 +51,7 @@
|
|||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
#include "curl_printf.h"
|
#include "curl_printf.h"
|
||||||
#include "curl_memory.h"
|
#include "curl_memory.h"
|
||||||
|
|
||||||
/* The last #include file should be: */
|
/* The last #include file should be: */
|
||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
|
|
||||||
@ -59,7 +60,6 @@
|
|||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
#ifdef CURLRES_IPV6
|
#ifdef CURLRES_IPV6
|
||||||
|
|
||||||
|
|
||||||
#if defined(CURLDEBUG) && defined(HAVE_GETNAMEINFO)
|
#if defined(CURLDEBUG) && defined(HAVE_GETNAMEINFO)
|
||||||
/* These are strictly for memory tracing and are using the same style as the
|
/* These are strictly for memory tracing and are using the same style as the
|
||||||
* family otherwise present in memdebug.c. I put these ones here since they
|
* family otherwise present in memdebug.c. I put these ones here since they
|
||||||
@ -124,6 +124,7 @@ bool Curl_ipvalid(struct connectdata *conn)
|
|||||||
{
|
{
|
||||||
if(conn->ip_version == CURL_IPRESOLVE_V6)
|
if(conn->ip_version == CURL_IPRESOLVE_V6)
|
||||||
return Curl_ipv6works();
|
return Curl_ipv6works();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,13 +170,13 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
|||||||
char *sbufptr = NULL;
|
char *sbufptr = NULL;
|
||||||
char addrbuf[128];
|
char addrbuf[128];
|
||||||
int pf;
|
int pf;
|
||||||
|
#if !defined(CURL_DISABLE_VERBOSE_STRINGS)
|
||||||
struct SessionHandle *data = conn->data;
|
struct SessionHandle *data = conn->data;
|
||||||
|
#endif
|
||||||
|
|
||||||
*waitp = 0; /* synchronous response only */
|
*waitp = 0; /* synchronous response only */
|
||||||
|
|
||||||
/*
|
/* Check if a limited name resolve has been requested */
|
||||||
* Check if a limited name resolve has been requested.
|
|
||||||
*/
|
|
||||||
switch(conn->ip_version) {
|
switch(conn->ip_version) {
|
||||||
case CURL_IPRESOLVE_V4:
|
case CURL_IPRESOLVE_V4:
|
||||||
pf = PF_INET;
|
pf = PF_INET;
|
||||||
@ -206,6 +207,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
|||||||
snprintf(sbuf, sizeof(sbuf), "%d", port);
|
snprintf(sbuf, sizeof(sbuf), "%d", port);
|
||||||
sbufptr=sbuf;
|
sbufptr=sbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = Curl_getaddrinfo_ex(hostname, sbufptr, &hints, &res);
|
error = Curl_getaddrinfo_ex(hostname, sbufptr, &hints, &res);
|
||||||
if(error) {
|
if(error) {
|
||||||
infof(data, "getaddrinfo(3) failed for %s:%d\n", hostname, port);
|
infof(data, "getaddrinfo(3) failed for %s:%d\n", hostname, port);
|
||||||
@ -217,5 +219,5 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
#endif /* CURLRES_SYNCH */
|
#endif /* CURLRES_SYNCH */
|
||||||
#endif /* CURLRES_IPV6 */
|
|
||||||
|
|
||||||
|
#endif /* CURLRES_IPV6 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user