]> git.saurik.com Git - apt.git/blobdiff - methods/https.cc
* apt-pkg/contrib/configuration.cc:
[apt.git] / methods / https.cc
index 06a0e285aa2d5cbb594ea007ef043277288ef38a..709744ce335a7664c745e15e141e58aa737ff751 100644 (file)
@@ -271,14 +271,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;