summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/hostip4.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libcurl/src/hostip4.c')
-rw-r--r--libs/libcurl/src/hostip4.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/libs/libcurl/src/hostip4.c b/libs/libcurl/src/hostip4.c
index 10d91471a1..bdce12f5d5 100644
--- a/libs/libcurl/src/hostip4.c
+++ b/libs/libcurl/src/hostip4.c
@@ -54,24 +54,11 @@
#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)
-{
- (void)data;
- if(conn->ip_version == CURL_IPRESOLVE_V6)
- /* An IPv6 address was requested and we cannot get/use one */
- return FALSE;
-
- return TRUE; /* OK, proceed */
-}
#ifdef CURLRES_SYNCH
/*
- * Curl_getaddrinfo() - the IPv4 synchronous version.
+ * Curl_sync_getaddrinfo() - the IPv4 synchronous version.
*
* The original code to this function was from the Dancer source code, written
* by Bjorn Reese, it has since been patched and modified considerably.
@@ -86,19 +73,18 @@ bool Curl_ipvalid(struct Curl_easy *data, struct connectdata *conn)
* flavours have thread-safe versions of the plain gethostbyname() etc.
*
*/
-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 Curl_addrinfo *ai = NULL;
+ (void)ip_version;
#ifdef CURL_DISABLE_VERBOSE_STRINGS
(void)data;
#endif
- *waitp = 0; /* synchronous response only */
-
ai = Curl_ipv4_resolve_r(hostname, port);
if(!ai)
infof(data, "Curl_ipv4_resolve_r failed for %s", hostname);
@@ -286,7 +272,7 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname,
* getaddrinfo() nor gethostbyname_r() function or for which
* gethostbyname() is the preferred one.
*/
- h = gethostbyname((void *)hostname);
+ h = gethostbyname(CURL_UNCONST(hostname));
#endif /* (HAVE_GETADDRINFO && HAVE_GETADDRINFO_THREADSAFE) ||
HAVE_GETHOSTBYNAME_R */