summaryrefslogtreecommitdiff
path: root/methods/https.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2009-12-10 23:05:23 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2009-12-10 23:05:23 +0100
commitf932cd7c75cd7b0da99c97064f8d112075ccd7f5 (patch)
tree6018c4ae9c4f4c3d2cd0abb8b3f0fb7b4094524b /methods/https.cc
parentc6474fb6ff482b0457674986a82afab0a3749af2 (diff)
parent43be0ac4b37f3a82ae4a16e473c3d8e44637ce1b (diff)
merge with lp:~mvo/apt/debian-sid : move all my ABI break changes
to the "new" 0.7.26 version
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 4daa04e32..726f53c44 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>
@@ -110,8 +111,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);
@@ -119,7 +122,6 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, false);
curl_easy_setopt(curl, CURLOPT_FAILONERROR, true);
curl_easy_setopt(curl, CURLOPT_FILETIME, true);
- curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
// SSL parameters are set by default to the common (non mirror-specific) value
// if available (or a default one) and gets overload by mirror-specific ones.
@@ -207,6 +209,9 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
_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->FindB("Acquire::https::AllowRedirect",