diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index ca5501d..758fd93 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | |||
@@ -158,6 +158,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
158 | 158 | ||
159 | private int m_defaultRTO = 1000; // 1sec is the recommendation in the RFC | 159 | private int m_defaultRTO = 1000; // 1sec is the recommendation in the RFC |
160 | private int m_maxRTO = 60000; | 160 | private int m_maxRTO = 60000; |
161 | public bool m_deliverPackets = true; | ||
161 | 162 | ||
162 | /// <summary> | 163 | /// <summary> |
163 | /// Default constructor | 164 | /// Default constructor |
@@ -430,6 +431,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
430 | if (category >= 0 && category < m_packetOutboxes.Length) | 431 | if (category >= 0 && category < m_packetOutboxes.Length) |
431 | { | 432 | { |
432 | OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category]; | 433 | OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category]; |
434 | |||
435 | if (m_deliverPackets == false) | ||
436 | { | ||
437 | queue.Enqueue(packet); | ||
438 | return true; | ||
439 | } | ||
440 | |||
433 | TokenBucket bucket = m_throttleCategories[category]; | 441 | TokenBucket bucket = m_throttleCategories[category]; |
434 | 442 | ||
435 | // Don't send this packet if there is already a packet waiting in the queue | 443 | // Don't send this packet if there is already a packet waiting in the queue |
@@ -479,6 +487,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
479 | /// <returns>True if any packets were sent, otherwise false</returns> | 487 | /// <returns>True if any packets were sent, otherwise false</returns> |
480 | public bool DequeueOutgoing() | 488 | public bool DequeueOutgoing() |
481 | { | 489 | { |
490 | if (m_deliverPackets == false) return false; | ||
491 | |||
482 | OutgoingPacket packet; | 492 | OutgoingPacket packet; |
483 | OpenSim.Framework.LocklessQueue<OutgoingPacket> queue; | 493 | OpenSim.Framework.LocklessQueue<OutgoingPacket> queue; |
484 | TokenBucket bucket; | 494 | TokenBucket bucket; |
@@ -511,7 +521,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
511 | // No dequeued packet waiting to be sent, try to pull one off | 521 | // No dequeued packet waiting to be sent, try to pull one off |
512 | // this queue | 522 | // this queue |
513 | queue = m_packetOutboxes[i]; | 523 | queue = m_packetOutboxes[i]; |
514 | if (queue.Dequeue(out packet)) | 524 | if (queue != null && queue.Dequeue(out packet)) |
515 | { | 525 | { |
516 | // A packet was pulled off the queue. See if we have | 526 | // A packet was pulled off the queue. See if we have |
517 | // enough tokens in the bucket to send it out | 527 | // enough tokens in the bucket to send it out |