aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs28
-rw-r--r--OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs23
-rw-r--r--bin/OpenSimDefaults.ini12
3 files changed, 17 insertions, 46 deletions
diff --git a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs
index 72769c2..506f9d2 100644
--- a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs
+++ b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs
@@ -157,25 +157,14 @@ namespace OpenSim.Capabilities.Handlers
157 int len = end - start + 1; 157 int len = end - start + 1;
158 158
159 //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); 159 //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
160 160 responsedata["int_response_code"] =
161 if (start == 0 && len == mesh.Data.Length) // well redudante maybe 161 (int)System.Net.HttpStatusCode.PartialContent;
162 { 162 headers["Content-Range"] = String.Format("bytes {0}-{1}/{2}", start, end, mesh.Data.Length);
163 responsedata["int_response_code"] = (int)System.Net.HttpStatusCode.OK; 163
164 responsedata["bin_response_data"] = mesh.Data; 164 byte[] d = new byte[len];
165 responsedata["int_bytes"] = mesh.Data.Length; 165 Array.Copy(mesh.Data, start, d, 0, len);
166 } 166 responsedata["bin_response_data"] = d;
167 else 167 responsedata["int_bytes"] = len;
168 {
169 responsedata["int_response_code"] =
170 (int)System.Net.HttpStatusCode.PartialContent;
171 headers["Content-Range"] = String.Format("bytes {0}-{1}/{2}", start, end,
172 mesh.Data.Length);
173
174 byte[] d = new byte[len];
175 Array.Copy(mesh.Data, start, d, 0, len);
176 responsedata["bin_response_data"] = d;
177 responsedata["int_bytes"] = len;
178 }
179 } 168 }
180 } 169 }
181 else 170 else
@@ -213,6 +202,7 @@ namespace OpenSim.Capabilities.Handlers
213 202
214 return responsedata; 203 return responsedata;
215 } 204 }
205
216 private bool TryParseRange(string header, out int start, out int end) 206 private bool TryParseRange(string header, out int start, out int end)
217 { 207 {
218 if (header.StartsWith("bytes=")) 208 if (header.StartsWith("bytes="))
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
index 2499ce4..57ec2f5 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
@@ -249,24 +249,13 @@ namespace OpenSim.Capabilities.Handlers
249// m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); 249// m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
250 250
251 response["content-type"] = texture.Metadata.ContentType; 251 response["content-type"] = texture.Metadata.ContentType;
252 response["int_response_code"] = (int)System.Net.HttpStatusCode.PartialContent;
253 headers["Content-Range"] = String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length);
252 254
253 if (start == 0 && len == texture.Data.Length) // well redudante maybe 255 byte[] d = new byte[len];
254 { 256 Array.Copy(texture.Data, start, d, 0, len);
255 response["int_response_code"] = (int)System.Net.HttpStatusCode.OK; 257 response["bin_response_data"] = d;
256 response["bin_response_data"] = texture.Data; 258 response["int_bytes"] = len;
257 response["int_bytes"] = texture.Data.Length;
258 }
259 else
260 {
261 response["int_response_code"] = (int)System.Net.HttpStatusCode.PartialContent;
262 headers["Content-Range"] = String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length);
263
264 byte[] d = new byte[len];
265 Array.Copy(texture.Data, start, d, 0, len);
266 response["bin_response_data"] = d;
267 response["int_bytes"] = len;
268 }
269// response.Body.Write(texture.Data, start, len);
270 } 259 }
271 } 260 }
272 else 261 else
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index 6429faf..23f96d5 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -57,16 +57,8 @@
57 ; ## 57 ; ##
58 58
59 ; Sets the method that OpenSim will use to fire asynchronous 59 ; Sets the method that OpenSim will use to fire asynchronous
60 ; events. Valid values are UnsafeQueueUserWorkItem, 60 ; events. Valid values are ,
61 ; QueueUserWorkItem, BeginInvoke, SmartThreadPool, and Thread. 61 ; QueueUserWorkItem, SmartThreadPool, and Thread.
62 ;
63 ; SmartThreadPool is reported to work well on Mono/Linux, but
64 ; UnsafeQueueUserWorkItem has been benchmarked with better
65 ; performance on .NET/Windows
66 ;
67 ; UnsafeQueueUserWorkItem refers to the fact that the code creating the event could elevate its security
68 ; privileges. However, as calling code is trusted anyway this is safe (if you set
69 ; TrustedBinaries = true in the [XEngine] section then you already have to trust that incoming code for other reasons).
70 async_call_method = SmartThreadPool 62 async_call_method = SmartThreadPool
71 63
72 ; Max threads to allocate on the FireAndForget thread pool 64 ; Max threads to allocate on the FireAndForget thread pool