]> git.saurik.com Git - apt.git/commitdiff
methods/https.cc: cleanup for CURLOPT_LOW_SPEED_TIME
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 17 Nov 2009 15:55:22 +0000 (09:55 -0600)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 17 Nov 2009 15:55:22 +0000 (09:55 -0600)
methods/https.cc
methods/https.h

index 3cbb0088ac7960a184a738fcf193200aa9c21965..dbc1cf52cde1643c59d93c310b9db168b6860f93 100644 (file)
@@ -214,8 +214,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
    int timeout = _config->FindI("Acquire::http::Timeout",120);
    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_LIMIT, DL_MIN_SPEED);
    curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, timeout);
 
    // set redirect options and default to 10 redirects
index 2c33d95ee10db3d6e0e1590b1e3cf7c1483639ad..3f0c416b6c9d5638faf9364a50c68cc932d0f8ae 100644 (file)
@@ -24,6 +24,8 @@ class HttpsMethod;
 
 class HttpsMethod : public pkgAcqMethod
 {
+   // minimum speed in bytes/se that triggers download timeout handling
+   static const int DL_MIN_SPEED = 10;
 
    virtual bool Fetch(FetchItem *);
    static size_t write_data(void *buffer, size_t size, size_t nmemb, void *userp);