aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLatif Khalifa2010-10-09 17:46:09 +0200
committerLatif Khalifa2010-10-09 17:46:09 +0200
commit06d3a529a9ea31de997f187bfa6a646e25b7a1cf (patch)
tree7af8d2abcc040a51d0ba04caa075eaf410d7b2e8
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC_OLD-06d3a529a9ea31de997f187bfa6a646e25b7a1cf.zip
opensim-SC_OLD-06d3a529a9ea31de997f187bfa6a646e25b7a1cf.tar.gz
opensim-SC_OLD-06d3a529a9ea31de997f187bfa6a646e25b7a1cf.tar.bz2
opensim-SC_OLD-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.
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs4
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);