summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2013-05-08 17:48:31 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2013-05-08 17:48:31 +0200
commit597341fe0f0a87c3888a62ce02631db8b25aeb4b (patch)
tree6565f0a8cca0cd8fe7be4bb4149edfbfb62c7ce2 /methods
parentb5595da902e62af7c295f1603ae5b43ba4cef281 (diff)
parentdec5b117052b77e4366efd8234e0cec09989b700 (diff)
downloadapt-597341fe0f0a87c3888a62ce02631db8b25aeb4b.tar.gz
merged from the debian-wheezy branch
Diffstat (limited to 'methods')
-rw-r--r--methods/https.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/methods/https.cc b/methods/https.cc
index 11d4ba8aa..b44642ab2 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -285,6 +285,11 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
long curl_servdate;
curl_easy_getinfo(curl, CURLINFO_FILETIME, &curl_servdate);
+ // If the server returns 200 OK but the If-Modified-Since condition is not
+ // met, CURLINFO_CONDITION_UNMET will be set to 1
+ long curl_condition_unmet = 0;
+ curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &curl_condition_unmet);
+
File->Close();
// cleanup
@@ -312,7 +317,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
Res.Filename = File->Name();
Res.LastModified = Buf.st_mtime;
Res.IMSHit = false;
- if (curl_responsecode == 304)
+ if (curl_responsecode == 304 || curl_condition_unmet)
{
unlink(File->Name().c_str());
Res.IMSHit = true;