From e9153e1d1aae50024d8cd05fe14a9bce34343a0e Mon Sep 17 00:00:00 2001 From: teravus Date: Thu, 15 Nov 2012 10:05:16 -0500 Subject: Revert "Merge master into teravuswork", it should have been avination, not master. This reverts commit dfac269032300872c4d0dc507f4f9062d102b0f4, reversing changes made to 619c39e5144f15aca129d6d999bcc5c34133ee64. --- .../Handlers/GetTexture/GetTextureHandler.cs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs') 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 int start, end; if (TryParseRange(range, out start, out end)) { + // Before clamping start make sure we can satisfy it in order to avoid // sending back the last byte instead of an error status if (start >= texture.Data.Length) { -// m_log.DebugFormat( -// "[GETTEXTURE]: Client requested range for texture {0} starting at {1} but texture has end of {2}", -// texture.ID, start, texture.Data.Length); - - // Stricly speaking, as per http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html, we should be sending back - // Requested Range Not Satisfiable (416) here. However, it appears that at least recent implementations - // of the Linden Lab viewer (3.2.1 and 3.3.4 and probably earlier), a viewer that has previously - // received a very small texture may attempt to fetch bytes from the server past the - // range of data that it received originally. Whether this happens appears to depend on whether - // the viewer's estimation of how large a request it needs to make for certain discard levels - // (http://wiki.secondlife.com/wiki/Image_System#Discard_Level_and_Mip_Mapping), chiefly discard - // level 2. If this estimate is greater than the total texture size, returning a RequestedRangeNotSatisfiable - // here will cause the viewer to treat the texture as bad and never display the full resolution - // However, if we return PartialContent (or OK) instead, the viewer will display that resolution. - // response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable; // viewers don't seem to handle RequestedRangeNotSatisfiable and keep retrying with same parameters response["int_response_code"] = (int)System.Net.HttpStatusCode.NotFound; @@ -229,7 +215,7 @@ namespace OpenSim.Capabilities.Handlers 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); + //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); response["content-type"] = texture.Metadata.ContentType; -- cgit v1.1