]> git.saurik.com Git - apt.git/commitdiff
* methods/https.cc:
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 20 Sep 2011 16:21:21 +0000 (18:21 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 20 Sep 2011 16:21:21 +0000 (18:21 +0200)
  - cleanup broken downloads properly

debian/changelog
methods/https.cc

index 4fe2cc4a6736870525ae0049582298fb9c7bd83a..1665d616ef55a75d586c6c98be1e1256ebe46307 100644 (file)
@@ -20,6 +20,8 @@ apt (0.8.16~exp5) experimental; urgency=low
     - ignore only the invalid regexp instead of all options
   * apt-pkg/acquire-item.h, apt-pkg/deb/debmetaindex.cc:
     - fix fetching language information by adding OptionalSubIndexTarget
     - ignore only the invalid regexp instead of all options
   * apt-pkg/acquire-item.h, apt-pkg/deb/debmetaindex.cc:
     - fix fetching language information by adding OptionalSubIndexTarget
+  * methods/https.cc:
+    - cleanup broken downloads properly
 
  -- Michael Vogt <mvo@debian.org>  Fri, 05 Aug 2011 10:57:08 +0200
 
 
  -- Michael Vogt <mvo@debian.org>  Fri, 05 Aug 2011 10:57:08 +0200
 
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);
 
    long curl_servdate;
    curl_easy_getinfo(curl, CURLINFO_FILETIME, &curl_servdate);
 
+   File->Close();
+
    // cleanup
    if(success != 0) 
    {
       _error->Error("%s", curl_errorstr);
    // 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;
    }
       Fail();
       return true;
    }
-   File->Close();
 
    // Timestamp
    struct utimbuf UBuf;
 
    // Timestamp
    struct utimbuf UBuf;