summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-09-20 18:26:39 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-09-20 18:26:39 +0200
commit2bde2334b3be5279d044fe552d0ff5ce38db1763 (patch)
treeba4f9364a1a564682cd49498570a465ac1b39b15 /methods
parenta2dc2f07674298a4b615c41a1773d881a34f1153 (diff)
* methods/https.cc:
- cleanup broken downloads properly (just like http)
Diffstat (limited to 'methods')
-rw-r--r--methods/https.cc5
1 files changed, 4 insertions, 1 deletions
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;