Procházet zdrojové kódy

* methods/https.cc:
- fix incorrect use of CURLOPT_TIMEOUT, closes: #497983, LP: #354972
thanks to Brian Thomason for the patch

Michael Vogt před 16 roky
rodič
revize
43cf55db7c
2 změnil soubory, kde provedl 7 přidání a 1 odebrání
  1. 3 0
      debian/changelog
  2. 4 1
      methods/https.cc

+ 3 - 0
debian/changelog

@@ -9,6 +9,9 @@ apt (0.7.22.4) unstable; urgency=low
   * apt-pkg/packagemanager.cc:
   * apt-pkg/packagemanager.cc:
     - add output about pre-depends configuring when debug::pkgPackageManager
     - add output about pre-depends configuring when debug::pkgPackageManager
       is used
       is used
+  * methods/https.cc:
+    - fix incorrect use of CURLOPT_TIMEOUT, closes: #497983, LP: #354972
+      thanks to Brian Thomason for the patch
 
 
   [ Brian Murray ]
   [ Brian Murray ]
   * apt-pkg/depcache.cc, apt-pkg/indexcopy.cc:
   * apt-pkg/depcache.cc, apt-pkg/indexcopy.cc:

+ 4 - 1
methods/https.cc

@@ -212,8 +212,11 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
 
 
    // set timeout
    // set timeout
    int timeout = _config->FindI("Acquire::http::Timeout",120);
    int timeout = _config->FindI("Acquire::http::Timeout",120);
-   curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout);
    curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 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
    // set redirect options and default to 10 redirects
    bool AllowRedirect = _config->FindI("Acquire::https::AllowRedirect", true);
    bool AllowRedirect = _config->FindI("Acquire::https::AllowRedirect", true);