summaryrefslogtreecommitdiffstats
path: root/pacredir.c
diff options
context:
space:
mode:
Diffstat (limited to 'pacredir.c')
-rw-r--r--pacredir.c4
1 files changed, 3 insertions, 1 deletions
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 ")");