aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs10
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs9
2 files changed, 14 insertions, 5 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
index 5a69851..7be8a0a 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
@@ -440,6 +440,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
440 OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category]; 440 OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category];
441 TokenBucket bucket = m_throttleCategories[category]; 441 TokenBucket bucket = m_throttleCategories[category];
442 442
443 // Don't send this packet if there is already a packet waiting in the queue
444 // even if we have the tokens to send it, tokens should go to the already
445 // queued packets
446 if (queue.Count > 0)
447 {
448 queue.Enqueue(packet);
449 return true;
450 }
451
452
443 if (!forceQueue && bucket.RemoveTokens(packet.Buffer.DataLength)) 453 if (!forceQueue && bucket.RemoveTokens(packet.Buffer.DataLength))
444 { 454 {
445 // Enough tokens were removed from the bucket, the packet will not be queued 455 // Enough tokens were removed from the bucket, the packet will not be queued
diff --git a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
index e4d59ff..07b0a1d 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
@@ -255,11 +255,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
255 // If we have enough tokens then remove them and return 255 // If we have enough tokens then remove them and return
256 if (m_tokenCount - amount >= 0) 256 if (m_tokenCount - amount >= 0)
257 { 257 {
258 if (m_parent == null || m_parent.RemoveTokens(amount)) 258 // we don't have to remove from the parent, the drip rate is already
259 { 259 // reflective of the drip rate limits in the parent
260 m_tokenCount -= amount; 260 m_tokenCount -= amount;
261 return true; 261 return true;
262 }
263 } 262 }
264 263
265 return false; 264 return false;