diff options
author | Christian Hesse <mail@eworm.de> | 2013-10-26 18:33:56 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2013-10-26 18:33:56 +0200 |
commit | 34fc1a5dfc7c6fe730ec554f9244f1e10a62c60d (patch) | |
tree | 72030f3af50ca1b7a6b30f092916f359e4b7d19a | |
parent | 93a4491ac04c5930534e9ce8c3a37bbff663a935 (diff) | |
download | paccache-34fc1a5dfc7c6fe730ec554f9244f1e10a62c60d.tar.gz paccache-34fc1a5dfc7c6fe730ec554f9244f1e10a62c60d.tar.zst |
set curl connection timeout to 2 seconds
-rw-r--r-- | pacredir.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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) { |