summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-12-02 17:22:32 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2009-12-02 17:22:32 +0100
commit16d7341fce96b089aa2a1c241acd0a72209bcd7f (patch)
treeb2bf899c035363fbc0b561f1006a787cb06527f0 /methods
parent7efded877fcf46f51b464fe4c5e053f26609f9d0 (diff)
parent5085e660679cdbb51783702898c42000d5db4fba (diff)
* 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 * apt-pkg/depcache.cc, apt-pkg/indexcopy.cc: - typo fix (LP: #462328) * cmdline/apt-key: - Emit a warning if removed keys keyring is missing and skip associated checks (LP: #218971)
Diffstat (limited to 'methods')
-rw-r--r--methods/https.cc4
-rw-r--r--methods/https.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/methods/https.cc b/methods/https.cc
index 79e6fea3f..47988970b 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -213,8 +213,10 @@ 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)
+ 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
bool AllowRedirect = _config->FindI("Acquire::https::AllowRedirect", true);
diff --git a/methods/https.h b/methods/https.h
index 2c33d95ee..3f0c416b6 100644
--- a/methods/https.h
+++ b/methods/https.h
@@ -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);