summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/curl_addrinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libcurl/src/curl_addrinfo.c')
-rw-r--r--libs/libcurl/src/curl_addrinfo.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/libs/libcurl/src/curl_addrinfo.c b/libs/libcurl/src/curl_addrinfo.c
index 7f60477ed6..98b02d3050 100644
--- a/libs/libcurl/src/curl_addrinfo.c
+++ b/libs/libcurl/src/curl_addrinfo.c
@@ -50,8 +50,9 @@
#include <stddef.h>
#include "curl_addrinfo.h"
-#include "inet_pton.h"
-#include "warnless.h"
+#include "fake_addrinfo.h"
+#include "curlx/inet_pton.h"
+#include "curlx/warnless.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
#include "curl_memory.h"
@@ -508,6 +509,14 @@ curl_dbg_freeaddrinfo(struct addrinfo *freethis,
source, line, (void *)freethis);
#ifdef USE_LWIPSOCK
lwip_freeaddrinfo(freethis);
+#elif defined(USE_FAKE_GETADDRINFO)
+ {
+ const char *env = getenv("CURL_DNS_SERVER");
+ if(env)
+ r_freeaddrinfo(freethis);
+ else
+ freeaddrinfo(freethis);
+ }
#else
freeaddrinfo(freethis);
#endif
@@ -526,13 +535,20 @@ curl_dbg_freeaddrinfo(struct addrinfo *freethis,
int
curl_dbg_getaddrinfo(const char *hostname,
- const char *service,
- const struct addrinfo *hints,
- struct addrinfo **result,
- int line, const char *source)
+ const char *service,
+ const struct addrinfo *hints,
+ struct addrinfo **result,
+ int line, const char *source)
{
#ifdef USE_LWIPSOCK
int res = lwip_getaddrinfo(hostname, service, hints, result);
+#elif defined(USE_FAKE_GETADDRINFO)
+ int res;
+ const char *env = getenv("CURL_DNS_SERVER");
+ if(env)
+ res = r_getaddrinfo(hostname, service, hints, result);
+ else
+ res = getaddrinfo(hostname, service, hints, result);
#else
int res = getaddrinfo(hostname, service, hints, result);
#endif