aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs55
1 files changed, 44 insertions, 11 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
index f66ef57..783c3de 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
@@ -222,11 +222,12 @@ namespace OpenSim.Region.ClientStack.Linden
222 new List<Hashtable>(); 222 new List<Hashtable>();
223 private Dictionary<UUID, aPollResponse> responses = 223 private Dictionary<UUID, aPollResponse> responses =
224 new Dictionary<UUID, aPollResponse>(); 224 new Dictionary<UUID, aPollResponse>();
225 private HashSet<UUID> dropedResponses = new HashSet<UUID>();
225 226
226 private Scene m_scene; 227 private Scene m_scene;
227 private MeshCapsDataThrottler m_throttler; 228 private MeshCapsDataThrottler m_throttler;
228 public PollServiceMeshEventArgs(string uri, UUID pId, Scene scene) : 229 public PollServiceMeshEventArgs(string uri, UUID pId, Scene scene) :
229 base(null, uri, null, null, null, pId, int.MaxValue) 230 base(null, uri, null, null, null, null, pId, int.MaxValue)
230 { 231 {
231 m_scene = scene; 232 m_scene = scene;
232 m_throttler = new MeshCapsDataThrottler(100000, 1400000, 10000, scene, pId); 233 m_throttler = new MeshCapsDataThrottler(100000, 1400000, 10000, scene, pId);
@@ -241,6 +242,17 @@ namespace OpenSim.Region.ClientStack.Linden
241 242
242 } 243 }
243 }; 244 };
245
246 Drop = (x, y) =>
247 {
248 lock (responses)
249 {
250 responses.Remove(x);
251 lock(dropedResponses)
252 dropedResponses.Add(x);
253 }
254 };
255
244 GetEvents = (x, y) => 256 GetEvents = (x, y) =>
245 { 257 {
246 lock (responses) 258 lock (responses)
@@ -298,26 +310,47 @@ namespace OpenSim.Region.ClientStack.Linden
298 if(m_scene.ShuttingDown) 310 if(m_scene.ShuttingDown)
299 return; 311 return;
300 312
301 // If the avatar is gone, don't bother to get the texture 313 lock(responses)
302 if (m_scene.GetScenePresence(Id) == null)
303 { 314 {
304 response = new Hashtable(); 315 lock(dropedResponses)
316 {
317 if(dropedResponses.Contains(requestID))
318 {
319 dropedResponses.Remove(requestID);
320 return;
321 }
322 }
323
324 // If the avatar is gone, don't bother to get the texture
325 if (m_scene.GetScenePresence(Id) == null)
326 {
327 response = new Hashtable();
305 328
306 response["int_response_code"] = 500; 329 response["int_response_code"] = 500;
307 response["str_response_string"] = "Script timeout"; 330 response["str_response_string"] = "Script timeout";
308 response["content_type"] = "text/plain"; 331 response["content_type"] = "text/plain";
309 response["keepalive"] = false; 332 response["keepalive"] = false;
310 response["reusecontext"] = false; 333 response["reusecontext"] = false;
311 334
312 lock (responses)
313 responses[requestID] = new aPollResponse() { bytes = 0, response = response, lod = 0 }; 335 responses[requestID] = new aPollResponse() { bytes = 0, response = response, lod = 0 };
314 336
315 return; 337 return;
338 }
316 } 339 }
317 340
318 response = m_getMeshHandler.Handle(requestinfo.request); 341 response = m_getMeshHandler.Handle(requestinfo.request);
342
319 lock (responses) 343 lock (responses)
320 { 344 {
345 lock(dropedResponses)
346 {
347 if(dropedResponses.Contains(requestID))
348 {
349 dropedResponses.Remove(requestID);
350 return;
351 }
352 }
353
321 responses[requestID] = new aPollResponse() 354 responses[requestID] = new aPollResponse()
322 { 355 {
323 bytes = (int)response["int_bytes"], 356 bytes = (int)response["int_bytes"],