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.cs60
1 files changed, 44 insertions, 16 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
index 69ff713..f733972 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
@@ -76,7 +76,6 @@ namespace OpenSim.Region.ClientStack.Linden
76 { 76 {
77 public Hashtable response; 77 public Hashtable response;
78 public int bytes; 78 public int bytes;
79 public int lod;
80 } 79 }
81 80
82 81
@@ -228,11 +227,12 @@ namespace OpenSim.Region.ClientStack.Linden
228 new List<Hashtable>(); 227 new List<Hashtable>();
229 private Dictionary<UUID, aPollResponse> responses = 228 private Dictionary<UUID, aPollResponse> responses =
230 new Dictionary<UUID, aPollResponse>(); 229 new Dictionary<UUID, aPollResponse>();
230 private HashSet<UUID> dropedResponses = new HashSet<UUID>();
231 231
232 private Scene m_scene; 232 private Scene m_scene;
233 private MeshCapsDataThrottler m_throttler; 233 private MeshCapsDataThrottler m_throttler;
234 public PollServiceMeshEventArgs(string uri, UUID pId, Scene scene) : 234 public PollServiceMeshEventArgs(string uri, UUID pId, Scene scene) :
235 base(null, uri, null, null, null, pId, int.MaxValue) 235 base(null, uri, null, null, null, null, pId, int.MaxValue)
236 { 236 {
237 m_scene = scene; 237 m_scene = scene;
238 m_throttler = new MeshCapsDataThrottler(100000, 1400000, 10000, scene, pId); 238 m_throttler = new MeshCapsDataThrottler(100000, 1400000, 10000, scene, pId);
@@ -247,6 +247,17 @@ namespace OpenSim.Region.ClientStack.Linden
247 247
248 } 248 }
249 }; 249 };
250
251 Drop = (x, y) =>
252 {
253 lock (responses)
254 {
255 responses.Remove(x);
256 lock(dropedResponses)
257 dropedResponses.Add(x);
258 }
259 };
260
250 GetEvents = (x, y) => 261 GetEvents = (x, y) =>
251 { 262 {
252 lock (responses) 263 lock (responses)
@@ -304,30 +315,48 @@ namespace OpenSim.Region.ClientStack.Linden
304 if(m_scene.ShuttingDown) 315 if(m_scene.ShuttingDown)
305 return; 316 return;
306 317
307 // If the avatar is gone, don't bother to get the texture 318 lock(responses)
308 if (m_scene.GetScenePresence(Id) == null)
309 { 319 {
310 response = new Hashtable(); 320 lock(dropedResponses)
311 321 {
312 response["int_response_code"] = 500; 322 if(dropedResponses.Contains(requestID))
313 response["str_response_string"] = "Script timeout"; 323 {
314 response["content_type"] = "text/plain"; 324 dropedResponses.Remove(requestID);
315 response["keepalive"] = false; 325 return;
316 response["reusecontext"] = false; 326 }
327 }
328
329 // If the avatar is gone, don't bother to get the texture
330 if (m_scene.GetScenePresence(Id) == null)
331 {
332 response = new Hashtable();
317 333
318 lock (responses) 334 response["int_response_code"] = 500;
319 responses[requestID] = new aPollResponse() { bytes = 0, response = response, lod = 0 }; 335 response["str_response_string"] = "Script timeout";
336 response["content_type"] = "text/plain";
337 response["keepalive"] = false;
338 responses[requestID] = new aPollResponse() { bytes = 0, response = response};
320 339
321 return; 340 return;
341 }
322 } 342 }
323 343
324 response = m_getMeshHandler.Handle(requestinfo.request); 344 response = m_getMeshHandler.Handle(requestinfo.request);
345
325 lock (responses) 346 lock (responses)
326 { 347 {
348 lock(dropedResponses)
349 {
350 if(dropedResponses.Contains(requestID))
351 {
352 dropedResponses.Remove(requestID);
353 return;
354 }
355 }
356
327 responses[requestID] = new aPollResponse() 357 responses[requestID] = new aPollResponse()
328 { 358 {
329 bytes = (int)response["int_bytes"], 359 bytes = (int)response["int_bytes"],
330 lod = (int)response["int_lod"],
331 response = response 360 response = response
332 }; 361 };
333 362
@@ -396,7 +425,6 @@ namespace OpenSim.Region.ClientStack.Linden
396 private volatile int lastTimeElapsed = 0; 425 private volatile int lastTimeElapsed = 0;
397 private volatile int BytesSent = 0; 426 private volatile int BytesSent = 0;
398 private int CapSetThrottle = 0; 427 private int CapSetThrottle = 0;
399 private float CapThrottleDistributon = 0.30f;
400 private readonly Scene m_scene; 428 private readonly Scene m_scene;
401 private ThrottleOutPacketType Throttle; 429 private ThrottleOutPacketType Throttle;
402 private readonly UUID User; 430 private readonly UUID User;