diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index 7c55b37..84c0d03 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | |||
@@ -217,6 +217,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
217 | m_maxRTO = maxRTO; | 217 | m_maxRTO = maxRTO; |
218 | 218 | ||
219 | // Create a token bucket throttle for this client that has the scene token bucket as a parent | 219 | // Create a token bucket throttle for this client that has the scene token bucket as a parent |
220 | // 2500000 bits/s max | ||
220 | m_throttleClient = new AdaptiveTokenBucket(parentThrottle, rates.Total, rates.AdaptiveThrottlesEnabled); | 221 | m_throttleClient = new AdaptiveTokenBucket(parentThrottle, rates.Total, rates.AdaptiveThrottlesEnabled); |
221 | // Create a token bucket throttle for the total categary with the client bucket as a throttle | 222 | // Create a token bucket throttle for the total categary with the client bucket as a throttle |
222 | m_throttleCategory = new TokenBucket(m_throttleClient, 0); | 223 | m_throttleCategory = new TokenBucket(m_throttleClient, 0); |
@@ -224,7 +225,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
224 | m_throttleCategories = new TokenBucket[THROTTLE_CATEGORY_COUNT]; | 225 | m_throttleCategories = new TokenBucket[THROTTLE_CATEGORY_COUNT]; |
225 | 226 | ||
226 | m_cannibalrate = rates.CannibalizeTextureRate; | 227 | m_cannibalrate = rates.CannibalizeTextureRate; |
227 | 228 | ||
229 | long totalrate = 0; | ||
230 | long catrate = 0; | ||
231 | |||
228 | for (int i = 0; i < THROTTLE_CATEGORY_COUNT; i++) | 232 | for (int i = 0; i < THROTTLE_CATEGORY_COUNT; i++) |
229 | { | 233 | { |
230 | ThrottleOutPacketType type = (ThrottleOutPacketType)i; | 234 | ThrottleOutPacketType type = (ThrottleOutPacketType)i; |
@@ -232,9 +236,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
232 | // Initialize the packet outboxes, where packets sit while they are waiting for tokens | 236 | // Initialize the packet outboxes, where packets sit while they are waiting for tokens |
233 | m_packetOutboxes[i] = new DoubleLocklessQueue<OutgoingPacket>(); | 237 | m_packetOutboxes[i] = new DoubleLocklessQueue<OutgoingPacket>(); |
234 | // Initialize the token buckets that control the throttling for each category | 238 | // Initialize the token buckets that control the throttling for each category |
235 | m_throttleCategories[i] = new TokenBucket(m_throttleCategory, rates.GetRate(type)); | 239 | catrate = rates.GetRate(type); |
240 | totalrate += catrate; | ||
241 | m_throttleCategories[i] = new TokenBucket(m_throttleCategory, catrate); | ||
236 | } | 242 | } |
237 | 243 | ||
244 | m_throttleCategory.RequestedDripRate = totalrate; | ||
245 | |||
238 | // Default the retransmission timeout to one second | 246 | // Default the retransmission timeout to one second |
239 | RTO = m_defaultRTO; | 247 | RTO = m_defaultRTO; |
240 | 248 | ||
@@ -380,7 +388,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
380 | task = task + (int)(m_cannibalrate * texture); | 388 | task = task + (int)(m_cannibalrate * texture); |
381 | texture = (int)((1 - m_cannibalrate) * texture); | 389 | texture = (int)((1 - m_cannibalrate) * texture); |
382 | 390 | ||
383 | // int total = resend + land + wind + cloud + task + texture + asset; | 391 | int total = resend + land + wind + cloud + task + texture + asset; |
384 | 392 | ||
385 | //m_log.DebugFormat("[LLUDPCLIENT]: {0} is setting throttles. Resend={1}, Land={2}, Wind={3}, Cloud={4}, Task={5}, Texture={6}, Asset={7}, Total={8}", | 393 | //m_log.DebugFormat("[LLUDPCLIENT]: {0} is setting throttles. Resend={1}, Land={2}, Wind={3}, Cloud={4}, Task={5}, Texture={6}, Asset={7}, Total={8}", |
386 | // AgentID, resend, land, wind, cloud, task, texture, asset, total); | 394 | // AgentID, resend, land, wind, cloud, task, texture, asset, total); |
@@ -409,6 +417,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
409 | bucket = m_throttleCategories[(int)ThrottleOutPacketType.Texture]; | 417 | bucket = m_throttleCategories[(int)ThrottleOutPacketType.Texture]; |
410 | bucket.RequestedDripRate = texture; | 418 | bucket.RequestedDripRate = texture; |
411 | 419 | ||
420 | m_throttleCategory.RequestedDripRate = total; | ||
421 | |||
412 | // Reset the packed throttles cached data | 422 | // Reset the packed throttles cached data |
413 | m_packedThrottles = null; | 423 | m_packedThrottles = null; |
414 | } | 424 | } |