summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-04-24 10:49:41 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2014-04-26 09:51:05 +0200
commit062074cb519aa05110d24936d95747c59cc0ffc1 (patch)
tree4064eaf60d48c02e430dfa27f61fd3727ba3a382 /methods
parent2a4af2a0558783b1889ffc552ff0be36aad03f55 (diff)
enforce LFS for partial files in https range requests
Diffstat (limited to 'methods')
-rw-r--r--methods/https.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/methods/https.cc b/methods/https.cc
index c4aff8f38..e0348ab58 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -325,11 +325,11 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
// if we have the file send an if-range query with a range header
if (stat(Itm->DestFile.c_str(),&SBuf) >= 0 && SBuf.st_size > 0)
{
- char Buf[1000];
- sprintf(Buf, "Range: bytes=%li-", (long) SBuf.st_size);
- headers = curl_slist_append(headers, Buf);
- sprintf(Buf, "If-Range: %s", TimeRFC1123(SBuf.st_mtime).c_str());
- headers = curl_slist_append(headers, Buf);
+ std::string Buf;
+ strprintf(Buf, "Range: bytes=%lli-", (long long) SBuf.st_size);
+ headers = curl_slist_append(headers, Buf.c_str());
+ strprintf(Buf, "If-Range: %s", TimeRFC1123(SBuf.st_mtime).c_str());
+ headers = curl_slist_append(headers, Buf.c_str());
}
else if(Itm->LastModified > 0)
{