X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/a0e07f3ec885c12c733c12805391646c202f3f31..a1e68c33ac15be454984b00d62c7fc331bd0b32b:/methods/https.cc diff --git a/methods/https.cc b/methods/https.cc index 06a0e285a..335699907 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -271,14 +272,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;