]> git.saurik.com Git - apt.git/commitdiff
Add timeout support for https.
authorOtavio Salvador <otavio@ossystems.com.br>
Fri, 2 May 2008 15:26:17 +0000 (12:26 -0300)
committerOtavio Salvador <otavio@ossystems.com.br>
Fri, 2 May 2008 15:26:17 +0000 (12:26 -0300)
debian/changelog
methods/https.cc

index e82740f58ec3f127bee2700ff905eae3e57edb16..7144a3ad19c3aca6703e89859dd6ee7708bcbcc3 100644 (file)
@@ -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
index b2bbbddb19870ef80bdb4f1963c8489d49a68141..b0b05a47e19bfe9845a2838da2fbb171551808fc 100644 (file)
@@ -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);