]> git.saurik.com Git - apt.git/commitdiff
enforce LFS for partial files in https range requests
authorDavid Kalnischkies <david@kalnischkies.de>
Thu, 24 Apr 2014 08:49:41 +0000 (10:49 +0200)
committerDavid Kalnischkies <david@kalnischkies.de>
Sat, 26 Apr 2014 07:51:05 +0000 (09:51 +0200)
methods/https.cc

index c4aff8f38f09fd9f0557498d81f85b3ea956a5cd..e0348ab58f7fd36b96e8c140f4eaf2bd31ff0cf1 100644 (file)
@@ -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)
    {