]> git.saurik.com Git - apt.git/blobdiff - methods/https.cc
* methods/https.cc:
[apt.git] / methods / https.cc
index fc649d6c217f800aad3ba147e9a8ff1320394f38..668a329e6ba12a8baca3fbd7247181da9457d4d8 100644 (file)
@@ -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;