check if a packet can be sent imediatly without accounting it as sent on throttles when it is enqueued for later send.

This commit is contained in:
UbitUmarov
2015-11-10 23:17:56 +00:00
parent 40cb83b555
commit e096b49dd7

View File

@@ -588,9 +588,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return true;
}
if (!forceQueue && bucket.RemoveTokens(packet.Buffer.DataLength))
if (!forceQueue && bucket.CheckTokens(packet.Buffer.DataLength))
{
// enough tokens so it can be sent imediatly by caller
bucket.RemoveTokens(packet.Buffer.DataLength);
return false;
}
else
@@ -605,6 +606,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// We don't have a token bucket for this category, so it will not be queued
return false;
}
}
/// <summary>