From 062074cb519aa05110d24936d95747c59cc0ffc1 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 24 Apr 2014 10:49:41 +0200 Subject: enforce LFS for partial files in https range requests --- methods/https.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'methods') 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) { -- cgit v1.2.3