diff options
Diffstat (limited to 'libs/libcurl/src/hostip6.c')
-rw-r--r-- | libs/libcurl/src/hostip6.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/libs/libcurl/src/hostip6.c b/libs/libcurl/src/hostip6.c index 8de74abf97..4a61ead046 100644 --- a/libs/libcurl/src/hostip6.c +++ b/libs/libcurl/src/hostip6.c @@ -49,25 +49,13 @@ #include "hash.h"
#include "share.h"
#include "url.h"
-#include "inet_pton.h"
+#include "curlx/inet_pton.h"
#include "connect.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
#include "curl_memory.h"
#include "memdebug.h"
-/*
- * Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've
- * been set and returns TRUE if they are OK.
- */
-bool Curl_ipvalid(struct Curl_easy *data, struct connectdata *conn)
-{
- if(conn->ip_version == CURL_IPRESOLVE_V6)
- return Curl_ipv6works(data);
-
- return TRUE;
-}
-
#if defined(CURLRES_SYNCH)
#ifdef DEBUG_ADDRINFO
@@ -87,7 +75,7 @@ static void dump_addrinfo(const struct Curl_addrinfo *ai) #endif
/*
- * Curl_getaddrinfo() when built IPv6-enabled (non-threading and
+ * Curl_sync_getaddrinfo() when built IPv6-enabled (non-threading and
* non-ares version).
*
* Returns name information about the given hostname and port number. If
@@ -95,10 +83,10 @@ static void dump_addrinfo(const struct Curl_addrinfo *ai) * to memory we need to free after use. That memory *MUST* be freed with
* Curl_freeaddrinfo(), nothing else.
*/
-struct Curl_addrinfo *Curl_getaddrinfo(struct Curl_easy *data,
- const char *hostname,
- int port,
- int *waitp)
+struct Curl_addrinfo *Curl_sync_getaddrinfo(struct Curl_easy *data,
+ const char *hostname,
+ int port,
+ int ip_version)
{
struct addrinfo hints;
struct Curl_addrinfo *res;
@@ -110,9 +98,7 @@ struct Curl_addrinfo *Curl_getaddrinfo(struct Curl_easy *data, #endif
int pf = PF_INET;
- *waitp = 0; /* synchronous response only */
-
- if((data->conn->ip_version != CURL_IPRESOLVE_V4) && Curl_ipv6works(data))
+ if((ip_version != CURL_IPRESOLVE_V4) && Curl_ipv6works(data))
/* The stack seems to be IPv6-enabled */
pf = PF_UNSPEC;
@@ -126,8 +112,8 @@ struct Curl_addrinfo *Curl_getaddrinfo(struct Curl_easy *data, * The AI_NUMERICHOST must not be set to get synthesized IPv6 address from
* an IPv4 address on iOS and macOS.
*/
- if((1 == Curl_inet_pton(AF_INET, hostname, addrbuf)) ||
- (1 == Curl_inet_pton(AF_INET6, hostname, addrbuf))) {
+ if((1 == curlx_inet_pton(AF_INET, hostname, addrbuf)) ||
+ (1 == curlx_inet_pton(AF_INET6, hostname, addrbuf))) {
/* the given address is numerical only, prevent a reverse lookup */
hints.ai_flags = AI_NUMERICHOST;
}
|