aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs25
-rw-r--r--OpenSim/Framework/AssetBase.cs3
2 files changed, 17 insertions, 11 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 }
diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs
index ff240be..5da8e11 100644
--- a/OpenSim/Framework/AssetBase.cs
+++ b/OpenSim/Framework/AssetBase.cs
@@ -150,7 +150,8 @@ namespace OpenSim.Framework
150 Type == (sbyte)AssetType.SnapshotFolder || 150 Type == (sbyte)AssetType.SnapshotFolder ||
151 Type == (sbyte)AssetType.TrashFolder || 151 Type == (sbyte)AssetType.TrashFolder ||
152 Type == (sbyte)AssetType.ImageJPEG || 152 Type == (sbyte)AssetType.ImageJPEG ||
153 Type == (sbyte) AssetType.ImageTGA || 153 Type == (sbyte)AssetType.ImageTGA ||
154 Type == (sbyte)AssetType.Mesh ||
154 Type == (sbyte) AssetType.LSLBytecode); 155 Type == (sbyte) AssetType.LSLBytecode);
155 } 156 }
156 } 157 }