summaryrefslogtreecommitdiff
path: root/lib/hostip6.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-10-30 13:45:25 +0000
committerYang Tse <yangsita@gmail.com>2008-10-30 13:45:25 +0000
commit0ce97f77e02acd2de15970270834a7011ce6cb38 (patch)
treef4126643e401db6323a14eba48d4611e9d95d4f6 /lib/hostip6.c
parent197ad60d219e33efcbf0ad28618ce88cfd4b9713 (diff)
downloadcurl-0ce97f77e02acd2de15970270834a7011ce6cb38.tar.gz
Use our Curl_addrinfo definition even when an addrinfo struct is available.
Use a wrapper function to call system's getaddrinfo().
Diffstat (limited to 'lib/hostip6.c')
-rw-r--r--lib/hostip6.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/lib/hostip6.c b/lib/hostip6.c
index 228352d26..7269e6100 100644
--- a/lib/hostip6.c
+++ b/lib/hostip6.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -77,18 +77,8 @@
* Only for ipv6-enabled builds
**********************************************************************/
#ifdef CURLRES_IPV6
-#ifndef CURLRES_ARES
-/*
- * This is a wrapper function for freeing name information in a protocol
- * independent way. This takes care of using the appropriate underlaying
- * function.
- */
-void Curl_freeaddrinfo(Curl_addrinfo *p)
-{
- if(p)
- freeaddrinfo(p);
-}
+#ifndef CURLRES_ARES
#ifdef CURLRES_ASYNCH
/*
* Curl_addrinfo_copy() is used by the asynch callback to copy a given
@@ -189,7 +179,7 @@ bool Curl_ipvalid(struct SessionHandle *data)
#if !defined(USE_THREADING_GETADDRINFO) && !defined(CURLRES_ARES)
#ifdef DEBUG_ADDRINFO
-static void dump_addrinfo(struct connectdata *conn, const struct addrinfo *ai)
+static void dump_addrinfo(struct connectdata *conn, const Curl_addrinfo *ai)
{
printf("dump_addrinfo:\n");
for ( ; ai; ai = ai->ai_next) {
@@ -221,7 +211,8 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
int port,
int *waitp)
{
- struct addrinfo hints, *res;
+ struct addrinfo hints;
+ Curl_addrinfo *res;
int error;
char sbuf[NI_MAXSERV];
char *sbufptr = NULL;
@@ -283,7 +274,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
snprintf(sbuf, sizeof(sbuf), "%d", port);
sbufptr=sbuf;
}
- error = getaddrinfo(hostname, sbufptr, &hints, &res);
+ error = Curl_getaddrinfo_ex(hostname, sbufptr, &hints, &res);
if(error) {
infof(data, "getaddrinfo(3) failed for %s:%d\n", hostname, port);
return NULL;