aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-02 12:00:42 -0700
committerJohn Hurliman2009-10-02 12:00:42 -0700
commit9b342d3e0d85e64e143b9fe1010e4e27135e24ec (patch)
tree1bbf000b036f333cbe8fe10530c749ea6821a739 /OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
parentRestore the missing image handling to the image manager. The missing (diff)
downloadopensim-SC_OLD-9b342d3e0d85e64e143b9fe1010e4e27135e24ec.zip
opensim-SC_OLD-9b342d3e0d85e64e143b9fe1010e4e27135e24ec.tar.gz
opensim-SC_OLD-9b342d3e0d85e64e143b9fe1010e4e27135e24ec.tar.bz2
opensim-SC_OLD-9b342d3e0d85e64e143b9fe1010e4e27135e24ec.tar.xz
* Changed the flush logic to drop packets in non-transactional streams, and to not fire any "put more data in the queues" callbacks
* Minor tweaks to code formatting to make the callback chain for packet queuing easier to follow
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs58
1 files changed, 13 insertions, 45 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
index 8484846..0f1acb1 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
@@ -273,55 +273,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
273 { 273 {
274 lock (this) 274 lock (this)
275 { 275 {
276 while (PacketsWaiting()) 276 // These categories do not contain transactional packets so we can safely drop any pending data in them
277 LandOutgoingPacketQueue.Clear();
278 WindOutgoingPacketQueue.Clear();
279 CloudOutgoingPacketQueue.Clear();
280 TextureOutgoingPacketQueue.Clear();
281 AssetOutgoingPacketQueue.Clear();
282
283 // Now comes the fun part.. we dump all remaining resend and task packets into the send queue
284 while (ResendOutgoingPacketQueue.Count > 0 || TaskOutgoingPacketQueue.Count > 0 || TaskLowpriorityPacketQueue.Count > 0)
277 { 285 {
278 //Now comes the fun part.. we dump all our elements into m_packetQueue that we've saved up.
279 if (ResendOutgoingPacketQueue.Count > 0) 286 if (ResendOutgoingPacketQueue.Count > 0)
280 {
281 SendQueue.Enqueue(ResendOutgoingPacketQueue.Dequeue()); 287 SendQueue.Enqueue(ResendOutgoingPacketQueue.Dequeue());
282 } 288
283 if (LandOutgoingPacketQueue.Count > 0)
284 {
285 SendQueue.Enqueue(LandOutgoingPacketQueue.Dequeue());
286 TriggerOnQueueEmpty(ThrottleOutPacketType.Land);
287 }
288 if (WindOutgoingPacketQueue.Count > 0)
289 {
290 SendQueue.Enqueue(WindOutgoingPacketQueue.Dequeue());
291 TriggerOnQueueEmpty(ThrottleOutPacketType.Wind);
292 }
293 if (CloudOutgoingPacketQueue.Count > 0)
294 {
295 SendQueue.Enqueue(CloudOutgoingPacketQueue.Dequeue());
296 TriggerOnQueueEmpty(ThrottleOutPacketType.Cloud);
297 }
298 bool tasksSent = false;
299 if (TaskOutgoingPacketQueue.Count > 0) 289 if (TaskOutgoingPacketQueue.Count > 0)
300 {
301 tasksSent = true;
302 SendQueue.PriorityEnqueue(TaskOutgoingPacketQueue.Dequeue()); 290 SendQueue.PriorityEnqueue(TaskOutgoingPacketQueue.Dequeue());
303 } 291
304 if (TaskLowpriorityPacketQueue.Count > 0) 292 if (TaskLowpriorityPacketQueue.Count > 0)
305 {
306 tasksSent = true;
307 SendQueue.Enqueue(TaskLowpriorityPacketQueue.Dequeue()); 293 SendQueue.Enqueue(TaskLowpriorityPacketQueue.Dequeue());
308 }
309 if (tasksSent)
310 {
311 TriggerOnQueueEmpty(ThrottleOutPacketType.Task);
312 }
313 if (TextureOutgoingPacketQueue.Count > 0)
314 {
315 SendQueue.Enqueue(TextureOutgoingPacketQueue.Dequeue());
316 TriggerOnQueueEmpty(ThrottleOutPacketType.Texture);
317 }
318 if (AssetOutgoingPacketQueue.Count > 0)
319 {
320 SendQueue.Enqueue(AssetOutgoingPacketQueue.Dequeue());
321 TriggerOnQueueEmpty(ThrottleOutPacketType.Asset);
322 }
323 } 294 }
324 // m_log.Info("[THROTTLE]: Processed " + throttleLoops + " packets");
325 } 295 }
326 } 296 }
327 297
@@ -530,10 +500,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
530 { 500 {
531 QueueEmpty handlerQueueEmpty = OnQueueEmpty; 501 QueueEmpty handlerQueueEmpty = OnQueueEmpty;
532 502
533 if (handlerQueueEmpty == null) 503 if (handlerQueueEmpty != null)
534 return; 504 handlerQueueEmpty(queue);
535
536 handlerQueueEmpty(queue);
537 } 505 }
538 506
539 private void ThrottleTimerElapsed(object sender, ElapsedEventArgs e) 507 private void ThrottleTimerElapsed(object sender, ElapsedEventArgs e)