* methods/https.cc:
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 17 Nov 2009 15:51:31 +0000 (09:51 -0600)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 17 Nov 2009 15:51:31 +0000 (09:51 -0600)
  - fix incorrect use of CURLOPT_TIMEOUT, closes: #497983, LP: #354972
    thanks to Brian Thomason for the patch

debian/changelog
methods/https.cc

index 15b6eb1..417cd24 100644 (file)
@@ -9,6 +9,9 @@ apt (0.7.22.4) unstable; urgency=low
   * apt-pkg/packagemanager.cc:
     - add output about pre-depends configuring when debug::pkgPackageManager
       is used
+  * methods/https.cc:
+    - fix incorrect use of CURLOPT_TIMEOUT, closes: #497983, LP: #354972
+      thanks to Brian Thomason for the patch
 
   [ Brian Murray ]
   * apt-pkg/depcache.cc, apt-pkg/indexcopy.cc:
index 37d93e3..3cbb008 100644 (file)
@@ -212,8 +212,11 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
 
    // set timeout
    int timeout = _config->FindI("Acquire::http::Timeout",120);
-   curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout);
    curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, timeout);
+   //set really low lowspeed timeout (see #497983)
+   int dlMin = 1;
+   curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, dlMin);
+   curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, timeout);
 
    // set redirect options and default to 10 redirects
    bool AllowRedirect = _config->FindI("Acquire::https::AllowRedirect", true);