aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs18
1 files changed, 2 insertions, 16 deletions
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
index 6437d0b..86e7aa0 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
@@ -200,25 +200,11 @@ namespace OpenSim.Capabilities.Handlers
200 int start, end; 200 int start, end;
201 if (TryParseRange(range, out start, out end)) 201 if (TryParseRange(range, out start, out end))
202 { 202 {
203
203 // Before clamping start make sure we can satisfy it in order to avoid 204 // Before clamping start make sure we can satisfy it in order to avoid
204 // sending back the last byte instead of an error status 205 // sending back the last byte instead of an error status
205 if (start >= texture.Data.Length) 206 if (start >= texture.Data.Length)
206 { 207 {
207// m_log.DebugFormat(
208// "[GETTEXTURE]: Client requested range for texture {0} starting at {1} but texture has end of {2}",
209// texture.ID, start, texture.Data.Length);
210
211 // Stricly speaking, as per http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html, we should be sending back
212 // Requested Range Not Satisfiable (416) here. However, it appears that at least recent implementations
213 // of the Linden Lab viewer (3.2.1 and 3.3.4 and probably earlier), a viewer that has previously
214 // received a very small texture may attempt to fetch bytes from the server past the
215 // range of data that it received originally. Whether this happens appears to depend on whether
216 // the viewer's estimation of how large a request it needs to make for certain discard levels
217 // (http://wiki.secondlife.com/wiki/Image_System#Discard_Level_and_Mip_Mapping), chiefly discard
218 // level 2. If this estimate is greater than the total texture size, returning a RequestedRangeNotSatisfiable
219 // here will cause the viewer to treat the texture as bad and never display the full resolution
220 // However, if we return PartialContent (or OK) instead, the viewer will display that resolution.
221
222// response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable; 208// response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable;
223 // viewers don't seem to handle RequestedRangeNotSatisfiable and keep retrying with same parameters 209 // viewers don't seem to handle RequestedRangeNotSatisfiable and keep retrying with same parameters
224 response["int_response_code"] = (int)System.Net.HttpStatusCode.NotFound; 210 response["int_response_code"] = (int)System.Net.HttpStatusCode.NotFound;
@@ -229,7 +215,7 @@ namespace OpenSim.Capabilities.Handlers
229 start = Utils.Clamp(start, 0, end); 215 start = Utils.Clamp(start, 0, end);
230 int len = end - start + 1; 216 int len = end - start + 1;
231 217
232// m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); 218 //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
233 219
234 response["content-type"] = texture.Metadata.ContentType; 220 response["content-type"] = texture.Metadata.ContentType;
235 221