summaryrefslogtreecommitdiff
path: root/indra/llmessage/llcurl.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-05-02 10:37:51 -0700
committerMerov Linden <merov@lindenlab.com>2012-05-02 10:37:51 -0700
commitefd19dddd93117688afe7de24c890c5a4b30bada (patch)
tree777e9159d5ec05bcd81e53f5749cd3de2862ff21 /indra/llmessage/llcurl.cpp
parent2c0774302b11b1be9e5a41b10c5ec518669792e3 (diff)
SH-3126 : Improve curl byte range call, test implementation in lltexturefetch (not final)
Diffstat (limited to 'indra/llmessage/llcurl.cpp')
-rw-r--r--indra/llmessage/llcurl.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 4d92cfd32f..095d8cd28b 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -1074,7 +1074,9 @@ void LLCurlRequest::get(const std::string& url, LLCurl::ResponderPtr responder)
{
getByteRange(url, headers_t(), 0, -1, responder);
}
-
+
+// Note: (length==0) is interpreted as "the rest of the file", i.e. the whole file if (offset==0) or
+// the remainder of the file if not.
bool LLCurlRequest::getByteRange(const std::string& url,
const headers_t& headers,
S32 offset, S32 length,
@@ -1092,6 +1094,11 @@ bool LLCurlRequest::getByteRange(const std::string& url,
std::string range = llformat("Range: bytes=%d-%d", offset,offset+length-1);
easy->slist_append(range.c_str());
}
+ else if (offset > 0)
+ {
+ std::string range = llformat("Range: bytes=%d-", offset);
+ easy->slist_append(range.c_str());
+ }
easy->setHeaders();
bool res = addEasy(easy);
return res;