* The rest of this file is copied from hostip4.c. (needed for the
* combination USE_ARES and ENABLE_IPV6).
*/
+/*
+ * This is a function for freeing name information in a protocol independent
+ * way.
+ */
+void Curl_freeaddrinfo(Curl_addrinfo *ai)
+{
+ Curl_addrinfo *next;
+
+ /* walk over the list and free all entries */
+ while(ai) {
+ next = ai->ai_next;
+ free(ai);
+ ai = next;
+ }
+}
+
struct namebuf {
struct hostent hostentry;
char *h_addr_list[2];
* 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
(void) port;
return (Curl_addrinfo*)orig;
}
-#endif
+#endif /* CURLRES_ASYNCH */
+#endif /* CURLRES_ARES */
#ifdef CURLDEBUG
/* These are strictly for memory tracing and are using the same style as the
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,
fprintf(logfile, "ADDR %s:%d freeaddrinfo(%p)\n",
source, line, (void *)freethis);
}
-
-#endif
+#endif /* CURLDEBUG */
/*
* Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've
return TRUE;
}
-#if !defined(USE_THREADING_GETADDRINFO) && !defined(USE_ARES)
+#if !defined(USE_THREADING_GETADDRINFO) && !defined(CURLRES_ARES)
#ifdef DEBUG_ADDRINFO
static void dump_addrinfo(struct connectdata *conn, const struct addrinfo *ai)
return res;
}
-#endif /* !USE_THREADING_GETADDRINFO && !USE_ARES */
+#endif /* !USE_THREADING_GETADDRINFO && !CURLRES_ARES */
#endif /* ipv6 */