summaryrefslogtreecommitdiff
path: root/methods/https.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-12-09 10:16:32 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2009-12-09 10:16:32 +0100
commit366cff695ae0a228300817e278c7ddf62ca52c34 (patch)
treef1516a044d5ae14f14bb0c19c8cadd1815407898 /methods/https.cc
parent864cf8e52aa37de28f2fc9a66236713f1ba34409 (diff)
parent777b4ac6882b40f63f1aa9b6f4da78b8fdc56cbe (diff)
merged from the mvo branch
Diffstat (limited to 'methods/https.cc')
-rw-r--r--methods/https.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/methods/https.cc b/methods/https.cc
index 37d93e308..86d7f3a6b 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -14,6 +14,7 @@
#include <apt-pkg/acquire-method.h>
#include <apt-pkg/error.h>
#include <apt-pkg/hashes.h>
+#include <apt-pkg/netrc.h>
#include <sys/stat.h>
#include <sys/time.h>
@@ -126,8 +127,10 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
curl_easy_reset(curl);
SetupProxy();
+ maybe_add_auth (Uri, _config->FindFile("Dir::Etc::netrc"));
+
// callbacks
- curl_easy_setopt(curl, CURLOPT_URL, Itm->Uri.c_str());
+ curl_easy_setopt(curl, CURLOPT_URL, static_cast<string>(Uri).c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, this);
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback);
@@ -212,8 +215,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);