]> git.saurik.com Git - apt.git/commitdiff
* methods/https.cc:
authorMichael Vogt <michael.vogt@ubuntu.com>
Wed, 9 Jan 2013 10:00:13 +0000 (11:00 +0100)
committerMichael Vogt <michael.vogt@ubuntu.com>
Wed, 9 Jan 2013 10:00:13 +0000 (11:00 +0100)
  - reuse connection in https, thanks to Thomas Bushnell, BSG for the
    patch. LP: #1087543, Closes: #695359

debian/changelog
methods/https.cc

index 840d9ebd9bf85e807b8465da7027aebe4299a0d4..0b20b03deafd19822a01df5c7e928c913927f518 100644 (file)
@@ -17,6 +17,9 @@ apt (0.9.7.8) UNRELEASED; urgency=low
     - when reading from /dev/urandom, use less entropy and fix a rare
       bug when the random number chksum is less than 1000.
       Closes: #695285
+  * methods/https.cc:
+    - reuse connection in https, thanks to Thomas Bushnell, BSG for the
+      patch. LP: #1087543, Closes: #695359
 
  -- Christian Perrier <bubulle@debian.org>  Mon, 24 Dec 2012 07:01:20 +0100
 
index c1a49ba6093b621743dd2726f329d79f1f3eeff9..11d4ba8aa785377d0d4bcf4afc334c9aa9520fc2 100644 (file)
@@ -124,7 +124,6 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
    curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback);
    curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, this);
    curl_easy_setopt(curl, CURLOPT_NOPROGRESS, false);
-   curl_easy_setopt(curl, CURLOPT_FAILONERROR, true);
    curl_easy_setopt(curl, CURLOPT_FILETIME, true);
 
    // SSL parameters are set by default to the common (non mirror-specific) value
@@ -240,6 +239,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
       curl_easy_setopt(curl, CURLOPT_VERBOSE, true);
 
    // error handling
+   curl_errorstr[0] = '\0';
    curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_errorstr);
 
    // If we ask for uncompressed files servers might respond with content-
@@ -288,7 +288,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
    File->Close();
 
    // cleanup
-   if(success != 0
+   if(success != 0 || (curl_responsecode != 200 && curl_responsecode != 304))
    {
       _error->Error("%s", curl_errorstr);
       // unlink, no need keep 401/404 page content in partial/