mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
issues with udp buffers pool on heavy load
This commit is contained in:
@@ -650,6 +650,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// leaving a dequeued packet still waiting to be sent out. Try to
|
||||
// send it again
|
||||
OutgoingPacket nextPacket = m_nextPackets[i];
|
||||
if(nextPacket.Buffer == null)
|
||||
{
|
||||
if (m_packetOutboxes[i].Count < 5)
|
||||
emptyCategories |= CategoryToFlag(i);
|
||||
continue;
|
||||
}
|
||||
if (bucket.RemoveTokens(nextPacket.Buffer.DataLength))
|
||||
{
|
||||
// Send the packet
|
||||
@@ -681,21 +687,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
// A packet was pulled off the queue. See if we have
|
||||
// enough tokens in the bucket to send it out
|
||||
if (bucket.RemoveTokens(packet.Buffer.DataLength))
|
||||
if(packet.Buffer == null)
|
||||
{
|
||||
// Send the packet
|
||||
m_udpServer.SendPacketFinal(packet);
|
||||
packetSent = true;
|
||||
|
||||
// packet canceled elsewhere (by a ack for example)
|
||||
if (queue.Count < 5)
|
||||
emptyCategories |= CategoryToFlag(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Save the dequeued packet for the next iteration
|
||||
m_nextPackets[i] = packet;
|
||||
}
|
||||
if (bucket.RemoveTokens(packet.Buffer.DataLength))
|
||||
{
|
||||
// Send the packet
|
||||
m_udpServer.SendPacketFinal(packet);
|
||||
packetSent = true;
|
||||
|
||||
if (queue.Count < 5)
|
||||
emptyCategories |= CategoryToFlag(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Save the dequeued packet for the next iteration
|
||||
m_nextPackets[i] = packet;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user