summaryrefslogtreecommitdiff
path: root/methods/https.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-01-20 10:27:03 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2012-01-20 10:27:03 +0100
commit2c384bb626cbaa682c20b94beb14589611847191 (patch)
tree5a0afc2503e334bebdc13ce80ab832d88e289281 /methods/https.cc
parenta7025171ea8bb49975f98dd4c3c6c7d89335cd30 (diff)
parent809cf6d22a9bb72061aedf2670c78b57d9da6999 (diff)
merged from bzr+ssh://bazaar.launchpad.net/~donkult/apt/experimental/
Diffstat (limited to 'methods/https.cc')
-rw-r--r--methods/https.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/methods/https.cc b/methods/https.cc
index 317c8a587..6de18b8e0 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -100,7 +100,6 @@ void HttpsMethod::SetupProxy() /*{{{*/
depth. */
bool HttpsMethod::Fetch(FetchItem *Itm)
{
- stringstream ss;
struct stat SBuf;
struct curl_slist *headers=NULL;
char curl_errorstr[CURL_ERROR_SIZE];
@@ -199,6 +198,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
if (_config->FindB("Acquire::https::No-Store",
_config->FindB("Acquire::http::No-Store",false)) == true)
headers = curl_slist_append(headers,"Cache-Control: no-store");
+ stringstream ss;
ioprintf(ss, "Cache-Control: max-age=%u", _config->FindI("Acquire::https::Max-Age",
_config->FindI("Acquire::http::Max-Age",0)));
headers = curl_slist_append(headers, ss.str().c_str());
@@ -246,11 +246,11 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
if (stat(Itm->DestFile.c_str(),&SBuf) >= 0 && SBuf.st_size > 0)
{
char Buf[1000];
- sprintf(Buf,"Range: bytes=%li-\r\nIf-Range: %s\r\n",
- (long)SBuf.st_size - 1,
- TimeRFC1123(SBuf.st_mtime).c_str());
+ sprintf(Buf, "Range: bytes=%li-", (long) SBuf.st_size - 1);
headers = curl_slist_append(headers, Buf);
- }
+ sprintf(Buf, "If-Range: %s", TimeRFC1123(SBuf.st_mtime).c_str());
+ headers = curl_slist_append(headers, Buf);
+ }
else if(Itm->LastModified > 0)
{
curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);