aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
diff options
context:
space:
mode:
authorJonathan Freedman2010-12-05 11:49:15 -0800
committerJonathan Freedman2010-12-05 11:49:15 -0800
commit45cd2e3ef93cc8ab880cb5b1742e33d441e7d01a (patch)
tree0351fb2c756a46d522fe41798c3969e020a3258d /OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
parentMerge branch 'master-core' into mantis5110 (diff)
parentMerge branch 'master' of /var/git/opensim/ (diff)
downloadopensim-SC_OLD-45cd2e3ef93cc8ab880cb5b1742e33d441e7d01a.zip
opensim-SC_OLD-45cd2e3ef93cc8ab880cb5b1742e33d441e7d01a.tar.gz
opensim-SC_OLD-45cd2e3ef93cc8ab880cb5b1742e33d441e7d01a.tar.bz2
opensim-SC_OLD-45cd2e3ef93cc8ab880cb5b1742e33d441e7d01a.tar.xz
Merge branch 'master-core' into mantis5110
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs15
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 }