diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs index c4db5da..e02783a 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs | |||
@@ -399,7 +399,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
399 | return data; | 399 | return data; |
400 | } | 400 | } |
401 | 401 | ||
402 | public bool EnqueueOutgoing(OutgoingPacket packet) | 402 | /// <summary> |
403 | /// Queue an outgoing packet if appropriate. | ||
404 | /// </summary> | ||
405 | /// <param name="packet"></param> | ||
406 | /// <param name="forceQueue">Always queue the packet if at all possible.</param> | ||
407 | /// <returns> | ||
408 | /// true if the packet has been queued, | ||
409 | /// false if the packet has not been queued and should be sent immediately. | ||
410 | /// </returns> | ||
411 | public bool EnqueueOutgoing(OutgoingPacket packet, bool forceQueue) | ||
403 | { | 412 | { |
404 | int category = (int)packet.Category; | 413 | int category = (int)packet.Category; |
405 | 414 | ||
@@ -408,14 +417,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
408 | OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category]; | 417 | OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category]; |
409 | TokenBucket bucket = m_throttleCategories[category]; | 418 | TokenBucket bucket = m_throttleCategories[category]; |
410 | 419 | ||
411 | if (bucket.RemoveTokens(packet.Buffer.DataLength)) | 420 | if (!forceQueue && bucket.RemoveTokens(packet.Buffer.DataLength)) |
412 | { | 421 | { |
413 | // Enough tokens were removed from the bucket, the packet will not be queued | 422 | // Enough tokens were removed from the bucket, the packet will not be queued |
414 | return false; | 423 | return false; |
415 | } | 424 | } |
416 | else | 425 | else |
417 | { | 426 | { |
418 | // Not enough tokens in the bucket, queue this packet | 427 | // Force queue specified or not enough tokens in the bucket, queue this packet |
419 | queue.Enqueue(packet); | 428 | queue.Enqueue(packet); |
420 | return true; | 429 | return true; |
421 | } | 430 | } |