diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps')
5 files changed, 190 insertions, 105 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 7c9a1c4..9ccfd5d 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | |||
@@ -30,7 +30,7 @@ using System.Collections; | |||
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Net; | 31 | using System.Net; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Threading; | 33 | using System.Text; |
34 | using log4net; | 34 | using log4net; |
35 | using Nini.Config; | 35 | using Nini.Config; |
36 | using Mono.Addins; | 36 | using Mono.Addins; |
@@ -292,8 +292,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
292 | Queue<OSD> queue; | 292 | Queue<OSD> queue; |
293 | Random rnd = new Random(Environment.TickCount); | 293 | Random rnd = new Random(Environment.TickCount); |
294 | int nrnd = rnd.Next(30000000); | 294 | int nrnd = rnd.Next(30000000); |
295 | if (nrnd < 0) | ||
296 | nrnd = -nrnd; | ||
297 | 295 | ||
298 | lock (queues) | 296 | lock (queues) |
299 | { | 297 | { |
@@ -307,21 +305,11 @@ namespace OpenSim.Region.ClientStack.Linden | |||
307 | queue = new Queue<OSD>(); | 305 | queue = new Queue<OSD>(); |
308 | queues[agentID] = queue; | 306 | queues[agentID] = queue; |
309 | 307 | ||
310 | // push markers to handle old responses still waiting | ||
311 | // this will cost at most viewer getting two forced noevents | ||
312 | // even being a new queue better be safe | ||
313 | queue.Enqueue(null); | ||
314 | queue.Enqueue(null); // one should be enough | ||
315 | |||
316 | lock (m_AvatarQueueUUIDMapping) | 308 | lock (m_AvatarQueueUUIDMapping) |
317 | { | 309 | { |
318 | eventQueueGetUUID = UUID.Random(); | 310 | eventQueueGetUUID = UUID.Random(); |
319 | if (m_AvatarQueueUUIDMapping.ContainsKey(agentID)) | 311 | while(m_AvatarQueueUUIDMapping.ContainsKey(agentID)) |
320 | { | 312 | eventQueueGetUUID = UUID.Random(); |
321 | // oops this should not happen ? | ||
322 | m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID without a queue"); | ||
323 | eventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID]; | ||
324 | } | ||
325 | m_AvatarQueueUUIDMapping.Add(agentID, eventQueueGetUUID); | 313 | m_AvatarQueueUUIDMapping.Add(agentID, eventQueueGetUUID); |
326 | } | 314 | } |
327 | lock (m_ids) | 315 | lock (m_ids) |
@@ -329,18 +317,14 @@ namespace OpenSim.Region.ClientStack.Linden | |||
329 | if (!m_ids.ContainsKey(agentID)) | 317 | if (!m_ids.ContainsKey(agentID)) |
330 | m_ids.Add(agentID, nrnd); | 318 | m_ids.Add(agentID, nrnd); |
331 | else | 319 | else |
332 | m_ids[agentID] = nrnd; | 320 | m_ids[agentID]++; |
333 | } | 321 | } |
334 | } | 322 | } |
335 | else | 323 | else |
336 | { | 324 | { |
337 | // push markers to handle old responses still waiting | ||
338 | // this will cost at most viewer getting two forced noevents | ||
339 | // even being a new queue better be safe | ||
340 | queue.Enqueue(null); | 325 | queue.Enqueue(null); |
341 | queue.Enqueue(null); // one should be enough | 326 | queue.Enqueue(null); // one should be enough |
342 | 327 | // reuse or not to reuse | |
343 | // reuse or not to reuse TODO FIX | ||
344 | lock (m_AvatarQueueUUIDMapping) | 328 | lock (m_AvatarQueueUUIDMapping) |
345 | { | 329 | { |
346 | // Reuse open queues. The client does! | 330 | // Reuse open queues. The client does! |
@@ -349,30 +333,39 @@ namespace OpenSim.Region.ClientStack.Linden | |||
349 | { | 333 | { |
350 | m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID!"); | 334 | m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID!"); |
351 | eventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID]; | 335 | eventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID]; |
336 | lock (m_ids) | ||
337 | { | ||
338 | // change to negative numbers so they are changed at end of sending first marker | ||
339 | // old data on a queue may be sent on a response for a new caps | ||
340 | // but at least will be sent with coerent IDs | ||
341 | if (!m_ids.ContainsKey(agentID)) | ||
342 | m_ids.Add(agentID, -nrnd); // should not happen | ||
343 | else | ||
344 | m_ids[agentID] = -m_ids[agentID]; | ||
345 | } | ||
352 | } | 346 | } |
353 | else | 347 | else |
354 | { | 348 | { |
355 | eventQueueGetUUID = UUID.Random(); | 349 | eventQueueGetUUID = UUID.Random(); |
350 | while(m_AvatarQueueUUIDMapping.ContainsKey(agentID)) | ||
351 | eventQueueGetUUID = UUID.Random(); | ||
356 | m_AvatarQueueUUIDMapping.Add(agentID, eventQueueGetUUID); | 352 | m_AvatarQueueUUIDMapping.Add(agentID, eventQueueGetUUID); |
357 | m_log.DebugFormat("[EVENTQUEUE]: Using random UUID!"); | 353 | m_log.DebugFormat("[EVENTQUEUE]: Using random UUID!"); |
354 | lock (m_ids) | ||
355 | { | ||
356 | if (!m_ids.ContainsKey(agentID)) | ||
357 | m_ids.Add(agentID, nrnd); | ||
358 | else | ||
359 | m_ids[agentID]++; | ||
360 | } | ||
358 | } | 361 | } |
359 | } | 362 | } |
360 | lock (m_ids) | ||
361 | { | ||
362 | // change to negative numbers so they are changed at end of sending first marker | ||
363 | // old data on a queue may be sent on a response for a new caps | ||
364 | // but at least will be sent with coerent IDs | ||
365 | if (!m_ids.ContainsKey(agentID)) | ||
366 | m_ids.Add(agentID, -nrnd); // should not happen | ||
367 | else | ||
368 | m_ids[agentID] = -m_ids[agentID]; | ||
369 | } | ||
370 | } | 363 | } |
371 | } | 364 | } |
372 | 365 | ||
373 | caps.RegisterPollHandler( | 366 | caps.RegisterPollHandler( |
374 | "EventQueueGet", | 367 | "EventQueueGet", |
375 | new PollServiceEventArgs(null, GenerateEqgCapPath(eventQueueGetUUID), HasEvents, GetEvents, NoEvents, agentID, SERVER_EQ_TIME_NO_EVENTS)); | 368 | new PollServiceEventArgs(null, GenerateEqgCapPath(eventQueueGetUUID), HasEvents, GetEvents, NoEvents, Drop, agentID, SERVER_EQ_TIME_NO_EVENTS)); |
376 | } | 369 | } |
377 | 370 | ||
378 | public bool HasEvents(UUID requestID, UUID agentID) | 371 | public bool HasEvents(UUID requestID, UUID agentID) |
@@ -448,7 +441,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
448 | if (DebugLevel > 0) | 441 | if (DebugLevel > 0) |
449 | LogOutboundDebugMessage(element, pAgentId); | 442 | LogOutboundDebugMessage(element, pAgentId); |
450 | array.Add(element); | 443 | array.Add(element); |
451 | thisID++; | ||
452 | } | 444 | } |
453 | } | 445 | } |
454 | 446 | ||
@@ -465,8 +457,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
465 | { | 457 | { |
466 | Random rnd = new Random(Environment.TickCount); | 458 | Random rnd = new Random(Environment.TickCount); |
467 | thisID = rnd.Next(30000000); | 459 | thisID = rnd.Next(30000000); |
468 | if (thisID < 0) | ||
469 | thisID = -thisID; | ||
470 | } | 460 | } |
471 | 461 | ||
472 | lock (m_ids) | 462 | lock (m_ids) |
@@ -474,16 +464,19 @@ namespace OpenSim.Region.ClientStack.Linden | |||
474 | m_ids[pAgentId] = thisID + 1; | 464 | m_ids[pAgentId] = thisID + 1; |
475 | } | 465 | } |
476 | 466 | ||
467 | Hashtable responsedata; | ||
477 | // if there where no elements before a marker send a NoEvents | 468 | // if there where no elements before a marker send a NoEvents |
478 | if (array.Count == 0) | 469 | if (events == null) |
479 | return NoEvents(requestID, pAgentId); | 470 | { |
480 | 471 | return NoEvents(requestID, pAgentId); | |
481 | Hashtable responsedata = new Hashtable(); | 472 | } |
482 | responsedata["int_response_code"] = 200; | 473 | else |
483 | responsedata["content_type"] = "application/xml"; | 474 | { |
484 | responsedata["keepalive"] = false; | 475 | responsedata = new Hashtable(); |
485 | responsedata["reusecontext"] = false; | 476 | responsedata["int_response_code"] = 200; |
486 | responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events); | 477 | responsedata["content_type"] = "application/xml"; |
478 | responsedata["bin_response_data"] = Encoding.UTF8.GetBytes(OSDParser.SerializeLLSDXmlString(events)); | ||
479 | } | ||
487 | //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", pAgentId, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); | 480 | //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", pAgentId, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); |
488 | return responsedata; | 481 | return responsedata; |
489 | } | 482 | } |
@@ -493,13 +486,13 @@ namespace OpenSim.Region.ClientStack.Linden | |||
493 | Hashtable responsedata = new Hashtable(); | 486 | Hashtable responsedata = new Hashtable(); |
494 | responsedata["int_response_code"] = 502; | 487 | responsedata["int_response_code"] = 502; |
495 | responsedata["content_type"] = "text/plain"; | 488 | responsedata["content_type"] = "text/plain"; |
496 | responsedata["keepalive"] = false; | ||
497 | responsedata["reusecontext"] = false; | ||
498 | responsedata["str_response_string"] = "<llsd></llsd>"; | 489 | responsedata["str_response_string"] = "<llsd></llsd>"; |
499 | responsedata["error_status_text"] = "<llsd></llsd>"; | 490 | responsedata["error_status_text"] = "<llsd></llsd>"; |
500 | responsedata["http_protocol_version"] = "HTTP/1.0"; | 491 | responsedata["http_protocol_version"] = "HTTP/1.0"; |
492 | responsedata["keepalive"] = false; | ||
501 | return responsedata; | 493 | return responsedata; |
502 | } | 494 | } |
495 | |||
503 | /* this is not a event message | 496 | /* this is not a event message |
504 | public void DisableSimulator(ulong handle, UUID avatarID) | 497 | public void DisableSimulator(ulong handle, UUID avatarID) |
505 | { | 498 | { |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs index ee3f4f1..b23bffc 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs | |||
@@ -59,13 +59,12 @@ namespace OpenSim.Region.ClientStack.Linden.Tests | |||
59 | base.SetUp(); | 59 | base.SetUp(); |
60 | 60 | ||
61 | uint port = 9999; | 61 | uint port = 9999; |
62 | uint sslPort = 9998; | ||
63 | 62 | ||
64 | // This is an unfortunate bit of clean up we have to do because MainServer manages things through static | 63 | // This is an unfortunate bit of clean up we have to do because MainServer manages things through static |
65 | // variables and the VM is not restarted between tests. | 64 | // variables and the VM is not restarted between tests. |
66 | MainServer.RemoveHttpServer(port); | 65 | MainServer.RemoveHttpServer(port); |
67 | 66 | ||
68 | BaseHttpServer server = new BaseHttpServer(port, false, sslPort, ""); | 67 | BaseHttpServer server = new BaseHttpServer(port, false, "","",""); |
69 | MainServer.AddHttpServer(server); | 68 | MainServer.AddHttpServer(server); |
70 | MainServer.Instance = server; | 69 | MainServer.Instance = server; |
71 | 70 | ||
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs index a721454..414b9bf 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 | ||
@@ -231,11 +230,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
231 | new List<Hashtable>(); | 230 | new List<Hashtable>(); |
232 | private Dictionary<UUID, aPollResponse> responses = | 231 | private Dictionary<UUID, aPollResponse> responses = |
233 | new Dictionary<UUID, aPollResponse>(); | 232 | new Dictionary<UUID, aPollResponse>(); |
233 | private HashSet<UUID> dropedResponses = new HashSet<UUID>(); | ||
234 | 234 | ||
235 | private Scene m_scene; | 235 | private Scene m_scene; |
236 | private MeshCapsDataThrottler m_throttler; | 236 | private MeshCapsDataThrottler m_throttler; |
237 | public PollServiceMeshEventArgs(string uri, UUID pId, Scene scene) : | 237 | public PollServiceMeshEventArgs(string uri, UUID pId, Scene scene) : |
238 | base(null, uri, null, null, null, pId, int.MaxValue) | 238 | base(null, uri, null, null, null, null, pId, int.MaxValue) |
239 | { | 239 | { |
240 | m_scene = scene; | 240 | m_scene = scene; |
241 | m_throttler = new MeshCapsDataThrottler(100000, 1400000, 10000, scene, pId); | 241 | m_throttler = new MeshCapsDataThrottler(100000, 1400000, 10000, scene, pId); |
@@ -250,6 +250,17 @@ namespace OpenSim.Region.ClientStack.Linden | |||
250 | 250 | ||
251 | } | 251 | } |
252 | }; | 252 | }; |
253 | |||
254 | Drop = (x, y) => | ||
255 | { | ||
256 | lock (responses) | ||
257 | { | ||
258 | responses.Remove(x); | ||
259 | lock(dropedResponses) | ||
260 | dropedResponses.Add(x); | ||
261 | } | ||
262 | }; | ||
263 | |||
253 | GetEvents = (x, y) => | 264 | GetEvents = (x, y) => |
254 | { | 265 | { |
255 | lock (responses) | 266 | lock (responses) |
@@ -307,30 +318,48 @@ namespace OpenSim.Region.ClientStack.Linden | |||
307 | if(m_scene.ShuttingDown) | 318 | if(m_scene.ShuttingDown) |
308 | return; | 319 | return; |
309 | 320 | ||
310 | // If the avatar is gone, don't bother to get the texture | 321 | lock(responses) |
311 | if (m_scene.GetScenePresence(Id) == null) | ||
312 | { | 322 | { |
313 | response = new Hashtable(); | 323 | lock(dropedResponses) |
314 | 324 | { | |
315 | response["int_response_code"] = 500; | 325 | if(dropedResponses.Contains(requestID)) |
316 | response["str_response_string"] = "Script timeout"; | 326 | { |
317 | response["content_type"] = "text/plain"; | 327 | dropedResponses.Remove(requestID); |
318 | response["keepalive"] = false; | 328 | return; |
319 | response["reusecontext"] = false; | 329 | } |
330 | } | ||
331 | |||
332 | // If the avatar is gone, don't bother to get the texture | ||
333 | if (m_scene.GetScenePresence(Id) == null) | ||
334 | { | ||
335 | response = new Hashtable(); | ||
320 | 336 | ||
321 | lock (responses) | 337 | response["int_response_code"] = 500; |
322 | responses[requestID] = new aPollResponse() { bytes = 0, response = response, lod = 0 }; | 338 | response["str_response_string"] = "Script timeout"; |
339 | response["content_type"] = "text/plain"; | ||
340 | response["keepalive"] = false; | ||
341 | responses[requestID] = new aPollResponse() { bytes = 0, response = response}; | ||
323 | 342 | ||
324 | return; | 343 | return; |
344 | } | ||
325 | } | 345 | } |
326 | 346 | ||
327 | response = m_getMeshHandler.Handle(requestinfo.request); | 347 | response = m_getMeshHandler.Handle(requestinfo.request); |
348 | |||
328 | lock (responses) | 349 | lock (responses) |
329 | { | 350 | { |
351 | lock(dropedResponses) | ||
352 | { | ||
353 | if(dropedResponses.Contains(requestID)) | ||
354 | { | ||
355 | dropedResponses.Remove(requestID); | ||
356 | return; | ||
357 | } | ||
358 | } | ||
359 | |||
330 | responses[requestID] = new aPollResponse() | 360 | responses[requestID] = new aPollResponse() |
331 | { | 361 | { |
332 | bytes = (int)response["int_bytes"], | 362 | bytes = (int)response["int_bytes"], |
333 | lod = (int)response["int_lod"], | ||
334 | response = response | 363 | response = response |
335 | }; | 364 | }; |
336 | 365 | ||
@@ -399,7 +428,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
399 | private volatile int lastTimeElapsed = 0; | 428 | private volatile int lastTimeElapsed = 0; |
400 | private volatile int BytesSent = 0; | 429 | private volatile int BytesSent = 0; |
401 | private int CapSetThrottle = 0; | 430 | private int CapSetThrottle = 0; |
402 | private float CapThrottleDistributon = 0.30f; | ||
403 | private readonly Scene m_scene; | 431 | private readonly Scene m_scene; |
404 | private ThrottleOutPacketType Throttle; | 432 | private ThrottleOutPacketType Throttle; |
405 | private readonly UUID User; | 433 | private readonly UUID User; |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs index ce9798b..1a31157 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs | |||
@@ -218,11 +218,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
218 | new List<Hashtable>(); | 218 | new List<Hashtable>(); |
219 | private Dictionary<UUID, aPollResponse> responses = | 219 | private Dictionary<UUID, aPollResponse> responses = |
220 | new Dictionary<UUID, aPollResponse>(); | 220 | new Dictionary<UUID, aPollResponse>(); |
221 | private HashSet<UUID> dropedResponses = new HashSet<UUID>(); | ||
221 | 222 | ||
222 | private Scene m_scene; | 223 | private Scene m_scene; |
223 | private CapsDataThrottler m_throttler = new CapsDataThrottler(100000, 1400000,10000); | 224 | private CapsDataThrottler m_throttler = new CapsDataThrottler(100000, 1400000,10000); |
224 | public PollServiceTextureEventArgs(UUID pId, Scene scene) : | 225 | public PollServiceTextureEventArgs(UUID pId, Scene scene) : |
225 | base(null, "", null, null, null, pId, int.MaxValue) | 226 | base(null, "", null, null, null, null, pId, int.MaxValue) |
226 | { | 227 | { |
227 | m_scene = scene; | 228 | m_scene = scene; |
228 | // x is request id, y is userid | 229 | // x is request id, y is userid |
@@ -236,6 +237,16 @@ namespace OpenSim.Region.ClientStack.Linden | |||
236 | 237 | ||
237 | } | 238 | } |
238 | }; | 239 | }; |
240 | |||
241 | Drop = (x, y) => | ||
242 | { | ||
243 | lock (responses) | ||
244 | { | ||
245 | responses.Remove(x); | ||
246 | dropedResponses.Add(x); | ||
247 | } | ||
248 | }; | ||
249 | |||
239 | GetEvents = (x, y) => | 250 | GetEvents = (x, y) => |
240 | { | 251 | { |
241 | lock (responses) | 252 | lock (responses) |
@@ -304,53 +315,72 @@ namespace OpenSim.Region.ClientStack.Linden | |||
304 | if(m_scene.ShuttingDown) | 315 | if(m_scene.ShuttingDown) |
305 | return; | 316 | return; |
306 | 317 | ||
307 | if (requestinfo.send503) | 318 | lock (responses) |
308 | { | 319 | { |
309 | response = new Hashtable(); | 320 | lock(dropedResponses) |
321 | { | ||
322 | if(dropedResponses.Contains(requestID)) | ||
323 | { | ||
324 | dropedResponses.Remove(requestID); | ||
325 | return; | ||
326 | } | ||
327 | } | ||
310 | 328 | ||
311 | response["int_response_code"] = 503; | 329 | if (requestinfo.send503) |
312 | response["str_response_string"] = "Throttled"; | 330 | { |
313 | response["content_type"] = "text/plain"; | 331 | response = new Hashtable(); |
314 | response["keepalive"] = false; | ||
315 | response["reusecontext"] = false; | ||
316 | 332 | ||
317 | Hashtable headers = new Hashtable(); | 333 | response["int_response_code"] = 503; |
318 | headers["Retry-After"] = 30; | 334 | response["str_response_string"] = "Throttled"; |
319 | response["headers"] = headers; | 335 | response["content_type"] = "text/plain"; |
336 | response["keepalive"] = false; | ||
337 | response["reusecontext"] = false; | ||
338 | |||
339 | Hashtable headers = new Hashtable(); | ||
340 | headers["Retry-After"] = 30; | ||
341 | response["headers"] = headers; | ||
320 | 342 | ||
321 | lock (responses) | ||
322 | responses[requestID] = new aPollResponse() {bytes = 0, response = response}; | 343 | responses[requestID] = new aPollResponse() {bytes = 0, response = response}; |
323 | 344 | ||
324 | return; | 345 | return; |
325 | } | 346 | } |
326 | 347 | ||
327 | // If the avatar is gone, don't bother to get the texture | 348 | // If the avatar is gone, don't bother to get the texture |
328 | if (m_scene.GetScenePresence(Id) == null) | 349 | if (m_scene.GetScenePresence(Id) == null) |
329 | { | 350 | { |
330 | response = new Hashtable(); | 351 | response = new Hashtable(); |
331 | 352 | ||
332 | response["int_response_code"] = 500; | 353 | response["int_response_code"] = 500; |
333 | response["str_response_string"] = "Script timeout"; | 354 | response["str_response_string"] = "Script timeout"; |
334 | response["content_type"] = "text/plain"; | 355 | response["content_type"] = "text/plain"; |
335 | response["keepalive"] = false; | 356 | response["keepalive"] = false; |
336 | response["reusecontext"] = false; | 357 | response["reusecontext"] = false; |
337 | 358 | ||
338 | lock (responses) | ||
339 | responses[requestID] = new aPollResponse() {bytes = 0, response = response}; | 359 | responses[requestID] = new aPollResponse() {bytes = 0, response = response}; |
340 | 360 | ||
341 | return; | 361 | return; |
362 | } | ||
342 | } | 363 | } |
343 | 364 | ||
344 | response = m_getTextureHandler.Handle(requestinfo.request); | 365 | response = m_getTextureHandler.Handle(requestinfo.request); |
366 | |||
345 | lock (responses) | 367 | lock (responses) |
346 | { | 368 | { |
369 | lock(dropedResponses) | ||
370 | { | ||
371 | if(dropedResponses.Contains(requestID)) | ||
372 | { | ||
373 | dropedResponses.Remove(requestID); | ||
374 | m_throttler.ProcessTime(); | ||
375 | return; | ||
376 | } | ||
377 | } | ||
347 | responses[requestID] = new aPollResponse() | 378 | responses[requestID] = new aPollResponse() |
348 | { | 379 | { |
349 | bytes = (int) response["int_bytes"], | 380 | bytes = (int) response["int_bytes"], |
350 | response = response | 381 | response = response |
351 | }; | 382 | }; |
352 | 383 | } | |
353 | } | ||
354 | m_throttler.ProcessTime(); | 384 | m_throttler.ProcessTime(); |
355 | } | 385 | } |
356 | 386 | ||
@@ -426,7 +456,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
426 | 456 | ||
427 | internal sealed class CapsDataThrottler | 457 | internal sealed class CapsDataThrottler |
428 | { | 458 | { |
429 | |||
430 | private volatile int currenttime = 0; | 459 | private volatile int currenttime = 0; |
431 | private volatile int lastTimeElapsed = 0; | 460 | private volatile int lastTimeElapsed = 0; |
432 | private volatile int BytesSent = 0; | 461 | private volatile int BytesSent = 0; |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index a367426..5011c44 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | |||
@@ -61,7 +61,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
61 | public UUID reqID; | 61 | public UUID reqID; |
62 | public Hashtable request; | 62 | public Hashtable request; |
63 | public ScenePresence presence; | 63 | public ScenePresence presence; |
64 | public List<UUID> folders; | ||
65 | } | 64 | } |
66 | 65 | ||
67 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 66 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -250,17 +249,28 @@ namespace OpenSim.Region.ClientStack.Linden | |||
250 | { | 249 | { |
251 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 250 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
252 | 251 | ||
253 | private Dictionary<UUID, Hashtable> responses = | 252 | private Dictionary<UUID, Hashtable> responses = new Dictionary<UUID, Hashtable>(); |
254 | new Dictionary<UUID, Hashtable>(); | 253 | private HashSet<UUID> dropedResponses = new HashSet<UUID>(); |
255 | 254 | ||
256 | private WebFetchInvDescModule m_module; | 255 | private WebFetchInvDescModule m_module; |
257 | 256 | ||
258 | public PollServiceInventoryEventArgs(WebFetchInvDescModule module, string url, UUID pId) : | 257 | public PollServiceInventoryEventArgs(WebFetchInvDescModule module, string url, UUID pId) : |
259 | base(null, url, null, null, null, pId, int.MaxValue) | 258 | base(null, url, null, null, null, null, pId, int.MaxValue) |
260 | { | 259 | { |
261 | m_module = module; | 260 | m_module = module; |
262 | 261 | ||
263 | HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); }; | 262 | HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); }; |
263 | |||
264 | Drop = (x, y) => | ||
265 | { | ||
266 | lock (responses) | ||
267 | { | ||
268 | responses.Remove(x); | ||
269 | lock(dropedResponses) | ||
270 | dropedResponses.Add(x); | ||
271 | } | ||
272 | }; | ||
273 | |||
264 | GetEvents = (x, y) => | 274 | GetEvents = (x, y) => |
265 | { | 275 | { |
266 | lock (responses) | 276 | lock (responses) |
@@ -285,8 +295,10 @@ namespace OpenSim.Region.ClientStack.Linden | |||
285 | reqinfo.reqID = x; | 295 | reqinfo.reqID = x; |
286 | reqinfo.request = y; | 296 | reqinfo.request = y; |
287 | reqinfo.presence = sp; | 297 | reqinfo.presence = sp; |
288 | reqinfo.folders = new List<UUID>(); | ||
289 | 298 | ||
299 | /* why where we doing this? just to get cof ? | ||
300 | List<UUID> folders = new List<UUID>(); | ||
301 | |||
290 | // Decode the request here | 302 | // Decode the request here |
291 | string request = y["body"].ToString(); | 303 | string request = y["body"].ToString(); |
292 | 304 | ||
@@ -322,11 +334,11 @@ namespace OpenSim.Region.ClientStack.Linden | |||
322 | UUID folderID; | 334 | UUID folderID; |
323 | if (UUID.TryParse(folder, out folderID)) | 335 | if (UUID.TryParse(folder, out folderID)) |
324 | { | 336 | { |
325 | if (!reqinfo.folders.Contains(folderID)) | 337 | if (!folders.Contains(folderID)) |
326 | { | 338 | { |
327 | if (sp.COF != UUID.Zero && sp.COF == folderID) | 339 | if (sp.COF != UUID.Zero && sp.COF == folderID) |
328 | highPriority = true; | 340 | highPriority = true; |
329 | reqinfo.folders.Add(folderID); | 341 | folders.Add(folderID); |
330 | } | 342 | } |
331 | } | 343 | } |
332 | } | 344 | } |
@@ -334,6 +346,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
334 | if (highPriority) | 346 | if (highPriority) |
335 | m_queue.PriorityEnqueue(reqinfo); | 347 | m_queue.PriorityEnqueue(reqinfo); |
336 | else | 348 | else |
349 | */ | ||
337 | m_queue.Enqueue(reqinfo); | 350 | m_queue.Enqueue(reqinfo); |
338 | }; | 351 | }; |
339 | 352 | ||
@@ -365,6 +378,19 @@ namespace OpenSim.Region.ClientStack.Linden | |||
365 | 378 | ||
366 | UUID requestID = requestinfo.reqID; | 379 | UUID requestID = requestinfo.reqID; |
367 | 380 | ||
381 | |||
382 | lock(responses) | ||
383 | { | ||
384 | lock(dropedResponses) | ||
385 | { | ||
386 | if(dropedResponses.Contains(requestID)) | ||
387 | { | ||
388 | dropedResponses.Remove(requestID); | ||
389 | return; | ||
390 | } | ||
391 | } | ||
392 | } | ||
393 | |||
368 | Hashtable response = new Hashtable(); | 394 | Hashtable response = new Hashtable(); |
369 | 395 | ||
370 | response["int_response_code"] = 200; | 396 | response["int_response_code"] = 200; |
@@ -377,11 +403,21 @@ namespace OpenSim.Region.ClientStack.Linden | |||
377 | 403 | ||
378 | lock (responses) | 404 | lock (responses) |
379 | { | 405 | { |
406 | lock(dropedResponses) | ||
407 | { | ||
408 | if(dropedResponses.Contains(requestID)) | ||
409 | { | ||
410 | dropedResponses.Remove(requestID); | ||
411 | requestinfo.request.Clear(); | ||
412 | WebFetchInvDescModule.ProcessedRequestsCount++; | ||
413 | return; | ||
414 | } | ||
415 | } | ||
416 | |||
380 | if (responses.ContainsKey(requestID)) | 417 | if (responses.ContainsKey(requestID)) |
381 | m_log.WarnFormat("[FETCH INVENTORY DESCENDENTS2 MODULE]: Caught in the act of loosing responses! Please report this on mantis #7054"); | 418 | m_log.WarnFormat("[FETCH INVENTORY DESCENDENTS2 MODULE]: Caught in the act of loosing responses! Please report this on mantis #7054"); |
382 | responses[requestID] = response; | 419 | responses[requestID] = response; |
383 | } | 420 | } |
384 | requestinfo.folders.Clear(); | ||
385 | requestinfo.request.Clear(); | 421 | requestinfo.request.Clear(); |
386 | WebFetchInvDescModule.ProcessedRequestsCount++; | 422 | WebFetchInvDescModule.ProcessedRequestsCount++; |
387 | } | 423 | } |