]> git.saurik.com Git - apt.git/blobdiff - methods/https.cc
merge with current debian apt/experimental
[apt.git] / methods / https.cc
index e70206dfbd1a6c4808573cedbec80258bdd63c32..335699907a8ee5f70bb3ee540df492b84c6b7ae3 100644 (file)
@@ -272,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;