From 2790f410b553d63965b654a3248cbff51121e5e3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 22 Apr 2014 13:21:05 +0200 Subject: darkhttpd only serves IPv4, so limit curl to that --- pacredir.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pacredir.c b/pacredir.c index 1914131..21223ec 100644 --- a/pacredir.c +++ b/pacredir.c @@ -228,7 +228,9 @@ static void * get_http_code(void * data) { if ((curl = curl_easy_init()) != NULL) { curl_easy_setopt(curl, CURLOPT_URL, request->url); - /* example.com is redirected, so we tell libcurl to follow redirection */ + /* darkhttpd only serves IPv4, so limit curl to that */ + curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); + /* tell libcurl to follow redirection */ curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); /* set user agent */ curl_easy_setopt(curl, CURLOPT_USERAGENT, "pacredir/" VERSION " (" ARCH ")"); -- cgit v1.2.3-70-g09d2