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 ffa3be4..c951071 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 |
@@ -439,6 +440,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
439 | if (category >= 0 && category < m_packetOutboxes.Length) | 440 | if (category >= 0 && category < m_packetOutboxes.Length) |
440 | { | 441 | { |
441 | OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category]; | 442 | OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category]; |
443 | |||
444 | if (m_deliverPackets == false) | ||
445 | { | ||
446 | queue.Enqueue(packet); | ||
447 | return true; | ||
448 | } | ||
449 | |||
442 | TokenBucket bucket = m_throttleCategories[category]; | 450 | TokenBucket bucket = m_throttleCategories[category]; |
443 | 451 | ||
444 | // Don't send this packet if there is already a packet waiting in the queue | 452 | // Don't send this packet if there is already a packet waiting in the queue |
@@ -488,6 +496,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
488 | /// <returns>True if any packets were sent, otherwise false</returns> | 496 | /// <returns>True if any packets were sent, otherwise false</returns> |
489 | public bool DequeueOutgoing() | 497 | public bool DequeueOutgoing() |
490 | { | 498 | { |
499 | if (m_deliverPackets == false) return false; | ||
500 | |||
491 | OutgoingPacket packet; | 501 | OutgoingPacket packet; |
492 | OpenSim.Framework.LocklessQueue<OutgoingPacket> queue; | 502 | OpenSim.Framework.LocklessQueue<OutgoingPacket> queue; |
493 | TokenBucket bucket; | 503 | TokenBucket bucket; |
@@ -520,7 +530,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
520 | // No dequeued packet waiting to be sent, try to pull one off | 530 | // No dequeued packet waiting to be sent, try to pull one off |
521 | // this queue | 531 | // this queue |
522 | queue = m_packetOutboxes[i]; | 532 | queue = m_packetOutboxes[i]; |
523 | if (queue.Dequeue(out packet)) | 533 | if (queue != null && queue.Dequeue(out packet)) |
524 | { | 534 | { |
525 | // A packet was pulled off the queue. See if we have | 535 | // A packet was pulled off the queue. See if we have |
526 | // enough tokens in the bucket to send it out | 536 | // enough tokens in the bucket to send it out |