summaryrefslogtreecommitdiff
path: root/lib/hostip6.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-10-30 19:02:23 +0000
committerYang Tse <yangsita@gmail.com>2008-10-30 19:02:23 +0000
commitc2c800d8639b1f34a89548e6c26e6d805036dfdc (patch)
tree452693a63001821bc9e69aef8c835805ed53a939 /lib/hostip6.c
parent625c107c25815776bb2ee8df923638dd36f4ddd7 (diff)
downloadcurl-c2c800d8639b1f34a89548e6c26e6d805036dfdc.tar.gz
Move curl_dofreeaddrinfo() and curl_dofreeaddrinfo()
implementation from lib/hostip6.c to lib/curl_addrinfo.c and prototypes from lib/hostip.h to lib/curl_addrinfo.h
Diffstat (limited to 'lib/hostip6.c')
-rw-r--r--lib/hostip6.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/lib/hostip6.c b/lib/hostip6.c
index 7269e6100..833e50b93 100644
--- a/lib/hostip6.c
+++ b/lib/hostip6.c
@@ -93,36 +93,17 @@ Curl_addrinfo *Curl_addrinfo_copy(const void *orig, int port)
#endif /* CURLRES_ASYNCH */
#endif /* CURLRES_ARES */
-#ifdef CURLDEBUG
+#if defined(CURLDEBUG) && defined(HAVE_GETNAMEINFO)
/* 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
* require a bunch of structs I didn't wanna include in memdebug.c
*/
-int curl_dogetaddrinfo(const char *hostname, const char *service,
- struct addrinfo *hints,
- struct addrinfo **result,
- int line, const char *source)
-{
- int res=(getaddrinfo)(hostname, service, hints, result);
- if(0 == res) {
- /* success */
- if(logfile)
- fprintf(logfile, "ADDR %s:%d getaddrinfo() = %p\n",
- source, line, (void *)*result);
- }
- else {
- if(logfile)
- fprintf(logfile, "ADDR %s:%d getaddrinfo() failed\n",
- source, line);
- }
- return res;
-}
/*
* For CURLRES_ARS, this should be written using ares_gethostbyaddr()
* (ignoring the fact c-ares doesn't return 'serv').
*/
-#ifdef HAVE_GETNAMEINFO
+
int curl_dogetnameinfo(GETNAMEINFO_QUAL_ARG1 GETNAMEINFO_TYPE_ARG1 sa,
GETNAMEINFO_TYPE_ARG2 salen,
char *host, GETNAMEINFO_TYPE_ARG46 hostlen,
@@ -147,17 +128,7 @@ int curl_dogetnameinfo(GETNAMEINFO_QUAL_ARG1 GETNAMEINFO_TYPE_ARG1 sa,
}
return res;
}
-#endif
-
-void curl_dofreeaddrinfo(struct addrinfo *freethis,
- int line, const char *source)
-{
- (freeaddrinfo)(freethis);
- if(logfile)
- fprintf(logfile, "ADDR %s:%d freeaddrinfo(%p)\n",
- source, line, (void *)freethis);
-}
-#endif /* CURLDEBUG */
+#endif /* defined(CURLDEBUG) && defined(HAVE_GETNAMEINFO) */
/*
* Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've