aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
diff options
context:
space:
mode:
authorMic Bowman2011-04-15 16:44:53 -0700
committerMic Bowman2011-04-15 16:44:53 -0700
commit3e0e1057acffa2c92a6f949cef0183193033d8c2 (patch)
treed699aa06b4c39aa10bed98a83b1641cd5bf183e8 /OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
parentMerge branch 'master' into queuetest (diff)
downloadopensim-SC_OLD-3e0e1057acffa2c92a6f949cef0183193033d8c2.zip
opensim-SC_OLD-3e0e1057acffa2c92a6f949cef0183193033d8c2.tar.gz
opensim-SC_OLD-3e0e1057acffa2c92a6f949cef0183193033d8c2.tar.bz2
opensim-SC_OLD-3e0e1057acffa2c92a6f949cef0183193033d8c2.tar.xz
Remove the call to remove tokens from the parent. Under heavy load
this appears to cause problems with the system timer resolution. This caused a problem with tokens going into the root throttle as bursts leading to some starvation. Also changed EnqueueOutgoing to always queue a packet if there are already packets in the queue. Ensures consistent ordering of packet sends.
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs9
1 files changed, 4 insertions, 5 deletions
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;