aboutsummaryrefslogtreecommitdiffstats
path: root/pacredir.c
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2013-10-26 18:33:56 +0200
committerGravatar Christian Hesse <mail@eworm.de>2013-10-26 18:33:56 +0200
commit34fc1a5dfc7c6fe730ec554f9244f1e10a62c60d (patch)
tree72030f3af50ca1b7a6b30f092916f359e4b7d19a /pacredir.c
parent93a4491ac04c5930534e9ce8c3a37bbff663a935 (diff)
downloadpacredir-34fc1a5dfc7c6fe730ec554f9244f1e10a62c60d.tar.gz
pacredir-34fc1a5dfc7c6fe730ec554f9244f1e10a62c60d.tar.zst
set curl connection timeout to 2 seconds
Diffstat (limited to 'pacredir.c')
-rw-r--r--pacredir.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pacredir.c b/pacredir.c
index e4ce8ce..a197012 100644
--- a/pacredir.c
+++ b/pacredir.c
@@ -200,6 +200,9 @@ int get_http_code(const char * host, const uint16_t port, const char * url) {
curl_easy_setopt(curl, CURLOPT_USERAGENT, "pacredir/" VERSION);
/* do not receive body */
curl_easy_setopt(curl, CURLOPT_NOBODY, 1);
+ /* set connection timeout to 2 seconds
+ * if the host needs longer we do not want to use it anyway ;) */
+ curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 2);
/* get it! */
if (curl_easy_perform(curl) != CURLE_OK) {