diff options
author | Latif Khalifa | 2010-10-09 17:46:09 +0200 |
---|---|---|
committer | Latif Khalifa | 2010-10-09 17:46:09 +0200 |
commit | 06d3a529a9ea31de997f187bfa6a646e25b7a1cf (patch) | |
tree | 7af8d2abcc040a51d0ba04caa075eaf410d7b2e8 | |
parent | Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC-06d3a529a9ea31de997f187bfa6a646e25b7a1cf.zip opensim-SC-06d3a529a9ea31de997f187bfa6a646e25b7a1cf.tar.gz opensim-SC-06d3a529a9ea31de997f187bfa6a646e25b7a1cf.tar.bz2 opensim-SC-06d3a529a9ea31de997f187bfa6a646e25b7a1cf.tar.xz |
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.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index a3238df..d564ee6 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | |||
@@ -187,8 +187,8 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps | |||
187 | int start, end; | 187 | int start, end; |
188 | if (TryParseRange(range, out start, out end)) | 188 | if (TryParseRange(range, out start, out end)) |
189 | { | 189 | { |
190 | end = Utils.Clamp(end, 1, texture.Data.Length - 1); | 190 | end = Utils.Clamp(end, 0, texture.Data.Length - 1); |
191 | start = Utils.Clamp(start, 0, end - 1); | 191 | start = Utils.Clamp(start, 0, end); |
192 | int len = end - start + 1; | 192 | int len = end - start + 1; |
193 | 193 | ||
194 | //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); | 194 | //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); |