Attempt to fix gray avatars on mobile networks.

Ported from
e879862791
This commit is contained in:
Aleric Inglewood
2014-06-16 21:02:27 +02:00
parent 53b8f70de8
commit 589035c1db
3 changed files with 17 additions and 2 deletions

View File

@@ -243,7 +243,9 @@ bool LLHTTPClient::getByteRange(std::string const& url, AIHTTPHeaders& headers,
{
if (offset > 0 || bytes > 0)
{
headers.addHeader("Range", llformat("bytes=%d-%d", offset, offset + bytes - 1));
int const range_end = offset + bytes - 1;
char const* const range_format = (range_end >= HTTP_REQUESTS_RANGE_END_MAX) ? "bytes=%d-" : "bytes=%d-%d";
headers.addHeader("Range", llformat(range_format, offset, range_end));
}
request(url, HTTP_GET, NULL, responder, headers, NULL/*,*/ DEBUG_CURLIO_PARAM(debug));
}