summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2008-05-02 12:26:17 -0300
committerOtavio Salvador <otavio@ossystems.com.br>2008-05-02 12:26:17 -0300
commitcc615257a94918b737cb45f7e698b465e096a668 (patch)
tree3fc4edd4421eeb490ed4aa106583a2db248ac1ca
parentc7f2799bd0c9a665e9ff9b2e536abb4a04570185 (diff)
Add timeout support for https.
-rw-r--r--debian/changelog2
-rw-r--r--methods/https.cc6
2 files changed, 7 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index e82740f58..7144a3ad1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ apt (0.7.13) UNRELEASED; urgency=low
Closes: #478231
* Make cron script quiet if cache is locked. Thanks to Ted Percival
<ted@midg3t.net> for the patch. Closes: #459344
+ * Add timeout support for https. Thanks to Andrew Martens
+ <andrew.martens@strangeloopnetworks.com> for the patch.
[ Program translations ]
- Vietnamese updated. Closes: #479008
diff --git a/methods/https.cc b/methods/https.cc
index b2bbbddb1..b0b05a47e 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -110,7 +110,6 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
long curl_responsecode;
// TODO:
- // - http::Timeout
// - http::Pipeline-Depth
// - error checking/reporting
// - more debug options? (CURLOPT_DEBUGFUNCTION?)
@@ -169,6 +168,11 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
// set header
curl_easy_setopt(curl, CURLOPT_USERAGENT,"Debian APT-CURL/1.0 ("VERSION")");
+ // set timeout
+ int timeout = _config->FindI("Acquire::http::Timeout",120);
+ curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout);
+ curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, timeout);
+
// debug
if(_config->FindB("Debug::Acquire::https", false))
curl_easy_setopt(curl, CURLOPT_VERBOSE, true);