aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2014-04-22 13:21:05 +0200
committerGravatar Christian Hesse <mail@eworm.de>2014-04-22 13:21:05 +0200
commit2790f410b553d63965b654a3248cbff51121e5e3 (patch)
treec2d4401a6112439e90be87cab117c4f219c0a4ef
parent84179e44c16b73b51600dfba703dfc2c83320a2e (diff)
downloadpacredir-2790f410b553d63965b654a3248cbff51121e5e3.tar.gz
pacredir-2790f410b553d63965b654a3248cbff51121e5e3.tar.zst
darkhttpd only serves IPv4, so limit curl to that
-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 ")");