summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2013-01-09 11:00:13 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2013-01-09 11:00:13 +0100
commitcc41811512ba00f70738b70f0448c9172b71daf2 (patch)
tree8d7e5af3a6fbd9039d0a5fe3fe82933d623214f2 /methods
parentd52f514fd380cdeef7ff68a54f81b82932d113cf (diff)
downloadapt-cc41811512ba00f70738b70f0448c9172b71daf2.tar.gz
* methods/https.cc:
- reuse connection in https, thanks to Thomas Bushnell, BSG for the patch. LP: #1087543, Closes: #695359
Diffstat (limited to 'methods')
-rw-r--r--methods/https.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/methods/https.cc b/methods/https.cc
index c1a49ba60..11d4ba8aa 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -124,7 +124,6 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback);
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, this);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, false);
- curl_easy_setopt(curl, CURLOPT_FAILONERROR, true);
curl_easy_setopt(curl, CURLOPT_FILETIME, true);
// SSL parameters are set by default to the common (non mirror-specific) value
@@ -240,6 +239,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
curl_easy_setopt(curl, CURLOPT_VERBOSE, true);
// error handling
+ curl_errorstr[0] = '\0';
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_errorstr);
// If we ask for uncompressed files servers might respond with content-
@@ -288,7 +288,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
File->Close();
// cleanup
- if(success != 0)
+ if(success != 0 || (curl_responsecode != 200 && curl_responsecode != 304))
{
_error->Error("%s", curl_errorstr);
// unlink, no need keep 401/404 page content in partial/