diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs index 86e7aa0..6437d0b 100644 --- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs | |||
@@ -200,11 +200,25 @@ 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 | |||
204 | // Before clamping start make sure we can satisfy it in order to avoid | 203 | // Before clamping start make sure we can satisfy it in order to avoid |
205 | // sending back the last byte instead of an error status | 204 | // sending back the last byte instead of an error status |
206 | if (start >= texture.Data.Length) | 205 | if (start >= texture.Data.Length) |
207 | { | 206 | { |
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 | |||
208 | // response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable; | 222 | // response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable; |
209 | // viewers don't seem to handle RequestedRangeNotSatisfiable and keep retrying with same parameters | 223 | // viewers don't seem to handle RequestedRangeNotSatisfiable and keep retrying with same parameters |
210 | response["int_response_code"] = (int)System.Net.HttpStatusCode.NotFound; | 224 | response["int_response_code"] = (int)System.Net.HttpStatusCode.NotFound; |
@@ -215,7 +229,7 @@ namespace OpenSim.Capabilities.Handlers | |||
215 | start = Utils.Clamp(start, 0, end); | 229 | start = Utils.Clamp(start, 0, end); |
216 | int len = end - start + 1; | 230 | int len = end - start + 1; |
217 | 231 | ||
218 | //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); | 232 | // m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); |
219 | 233 | ||
220 | response["content-type"] = texture.Metadata.ContentType; | 234 | response["content-type"] = texture.Metadata.ContentType; |
221 | 235 | ||