In case when 1 single byte is requested (yes viewer does this)
start of the ranges gets clamped with a wrong value. In case of a texture with 601 byte long texture the viewer request range 0-599 first, then 600- in which case both start and end should be 600. End can also be 0, valid request for the firt byte of the file is 0-0. Thanks to Thickbrick for explaining how HTTP range header works.viewer-2-initial-appearance
parent
96080dc492
commit
06d3a529a9
|
@ -187,8 +187,8 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
|
|||
int start, end;
|
||||
if (TryParseRange(range, out start, out end))
|
||||
{
|
||||
end = Utils.Clamp(end, 1, texture.Data.Length - 1);
|
||||
start = Utils.Clamp(start, 0, end - 1);
|
||||
end = Utils.Clamp(end, 0, texture.Data.Length - 1);
|
||||
start = Utils.Clamp(start, 0, end);
|
||||
int len = end - start + 1;
|
||||
|
||||
//m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
|
||||
|
|
Loading…
Reference in New Issue