mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Merge branch 'master' into careminster-presence-refactor
Also prevent god takes from ending up in Lost and Found
This commit is contained in:
@@ -400,7 +400,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
return data;
|
||||
}
|
||||
|
||||
public bool EnqueueOutgoing(OutgoingPacket packet)
|
||||
/// <summary>
|
||||
/// Queue an outgoing packet if appropriate.
|
||||
/// </summary>
|
||||
/// <param name="packet"></param>
|
||||
/// <param name="forceQueue">Always queue the packet if at all possible.</param>
|
||||
/// <returns>
|
||||
/// true if the packet has been queued,
|
||||
/// false if the packet has not been queued and should be sent immediately.
|
||||
/// </returns>
|
||||
public bool EnqueueOutgoing(OutgoingPacket packet, bool forceQueue)
|
||||
{
|
||||
int category = (int)packet.Category;
|
||||
|
||||
@@ -416,14 +425,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
TokenBucket bucket = m_throttleCategories[category];
|
||||
|
||||
if (bucket.RemoveTokens(packet.Buffer.DataLength))
|
||||
if (!forceQueue && bucket.RemoveTokens(packet.Buffer.DataLength))
|
||||
{
|
||||
// Enough tokens were removed from the bucket, the packet will not be queued
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not enough tokens in the bucket, queue this packet
|
||||
// Force queue specified or not enough tokens in the bucket, queue this packet
|
||||
queue.Enqueue(packet);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user