aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Capabilities/Handlers
diff options
context:
space:
mode:
authorubit2012-09-26 22:04:27 +0200
committerubit2012-09-26 22:04:27 +0200
commit810e24af49d1e8e2b4e6c8e10a60f9b5063e3d94 (patch)
tree5ddd22d4fccfa6f73f60a71c9ac740e6e1aca344 /OpenSim/Capabilities/Handlers
parentMerge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff)
parent don't send a partial contents report if we are sending all data (diff)
downloadopensim-SC-810e24af49d1e8e2b4e6c8e10a60f9b5063e3d94.zip
opensim-SC-810e24af49d1e8e2b4e6c8e10a60f9b5063e3d94.tar.gz
opensim-SC-810e24af49d1e8e2b4e6c8e10a60f9b5063e3d94.tar.bz2
opensim-SC-810e24af49d1e8e2b4e6c8e10a60f9b5063e3d94.tar.xz
Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
Diffstat (limited to 'OpenSim/Capabilities/Handlers')
-rw-r--r--OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs25
1 files changed, 15 insertions, 10 deletions
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
index 0df16d6..b3a4d61 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
@@ -217,17 +217,22 @@ namespace OpenSim.Capabilities.Handlers
217 217
218 //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);
219 219
220 // Always return PartialContent, even if the range covered the entire data length
221 // We were accidentally sending back 404 before in this situation
222 // https://issues.apache.org/bugzilla/show_bug.cgi?id=51878 supports sending 206 even if the
223 // entire range is requested, and viewer 3.2.2 (and very probably earlier) seems fine with this.
224 response["int_response_code"] = (int)System.Net.HttpStatusCode.PartialContent;
225 response["content-type"] = texture.Metadata.ContentType; 220 response["content-type"] = texture.Metadata.ContentType;
226 headers["Content-Range"] = String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length); 221
227 222 if (start == 0 && len == texture.Data.Length) // well redudante maybe
228 byte[] d = new byte[len]; 223 {
229 Array.Copy(texture.Data, start, d, 0, len); 224 response["int_response_code"] = (int)System.Net.HttpStatusCode.OK;
230 response["bin_response_data"] = d; 225 response["bin_response_data"] = texture.Data;
226 }
227 else
228 {
229 response["int_response_code"] = (int)System.Net.HttpStatusCode.PartialContent;
230 headers["Content-Range"] = String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length);
231
232 byte[] d = new byte[len];
233 Array.Copy(texture.Data, start, d, 0, len);
234 response["bin_response_data"] = d;
235 }
231// response.Body.Write(texture.Data, start, len); 236// response.Body.Write(texture.Data, start, len);
232 } 237 }
233 } 238 }