aboutsummaryrefslogtreecommitdiff
path: root/lib/hostthre.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-11-06 17:19:56 +0000
committerYang Tse <yangsita@gmail.com>2008-11-06 17:19:56 +0000
commita0ef686c542bee30be0b20cd4d3243bec6b4f059 (patch)
treef2eeaa5b9920664defdd021eea0b98e9d6119f41 /lib/hostthre.c
parent2903a5c0500210f0a3934352fe29217b2b8e1dbf (diff)
Merged existing IPv4 and IPv6 Curl_ip2addr functions into a single one
which now also takes a protocol address family argument.
Diffstat (limited to 'lib/hostthre.c')
-rw-r--r--lib/hostthre.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/hostthre.c b/lib/hostthre.c
index 242c48699..3aa1ccbce 100644
--- a/lib/hostthre.c
+++ b/lib/hostthre.c
@@ -70,6 +70,7 @@
#include "strerror.h"
#include "url.h"
#include "multiif.h"
+#include "inet_pton.h"
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
@@ -665,14 +666,13 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
{
struct hostent *h = NULL;
struct SessionHandle *data = conn->data;
- in_addr_t in;
+ struct in_addr in;
*waitp = 0; /* don't wait, we act synchronously */
- in = inet_addr(hostname);
- if(in != CURL_INADDR_NONE)
+ if(Curl_inet_pton(AF_INET, hostname, &in) > 0)
/* This is a dotted IP address 123.123.123.123-style */
- return Curl_ip2addr(in, hostname, port);
+ return Curl_ip2addr(AF_INET, &in, hostname, port);
/* fire up a new resolver thread! */
if(init_resolve_thread(conn, hostname, port, NULL)) {