summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-09-20 18:21:21 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-09-20 18:21:21 +0200
commitdb1f14695ce3e5e49e05f67f3ae2225b6706ec66 (patch)
tree6e6f0c7be712554f2eb53a33b7ba3884b220921c
parentb36597e050beaca71a481590c3d287ac706f4309 (diff)
* methods/https.cc:
- cleanup broken downloads properly
-rw-r--r--debian/changelog2
-rw-r--r--methods/https.cc5
2 files changed, 6 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 4fe2cc4a6..1665d616e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,8 @@ apt (0.8.16~exp5) experimental; urgency=low
- ignore only the invalid regexp instead of all options
* apt-pkg/acquire-item.h, apt-pkg/deb/debmetaindex.cc:
- fix fetching language information by adding OptionalSubIndexTarget
+ * methods/https.cc:
+ - cleanup broken downloads properly
-- Michael Vogt <mvo@debian.org> Fri, 05 Aug 2011 10:57:08 +0200
diff --git a/methods/https.cc b/methods/https.cc
index fc649d6c2..668a329e6 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -270,14 +270,17 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
long curl_servdate;
curl_easy_getinfo(curl, CURLINFO_FILETIME, &curl_servdate);
+ File->Close();
+
// cleanup
if(success != 0)
{
_error->Error("%s", curl_errorstr);
+ // unlink, no need keep 401/404 page content in partial/
+ unlink(File->Name().c_str());
Fail();
return true;
}
- File->Close();
// Timestamp
struct utimbuf UBuf;