From cc615257a94918b737cb45f7e698b465e096a668 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Fri, 2 May 2008 12:26:17 -0300 Subject: Add timeout support for https. --- methods/https.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'methods') 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); -- cgit v1.2.3