Brute-force debug -- mantis #5365
parent
117462cba1
commit
585473aade
|
@ -463,12 +463,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
bool packetSent = false;
|
bool packetSent = false;
|
||||||
ThrottleOutPacketTypeFlags emptyCategories = 0;
|
ThrottleOutPacketTypeFlags emptyCategories = 0;
|
||||||
|
|
||||||
//string queueDebugOutput = String.Empty; // Serious debug business
|
string queueDebugOutput = String.Empty; // Serious debug business
|
||||||
|
|
||||||
for (int i = 0; i < THROTTLE_CATEGORY_COUNT; i++)
|
for (int i = 0; i < THROTTLE_CATEGORY_COUNT; i++)
|
||||||
{
|
{
|
||||||
bucket = m_throttleCategories[i];
|
bucket = m_throttleCategories[i];
|
||||||
//queueDebugOutput += m_packetOutboxes[i].Count + " "; // Serious debug business
|
if (i == 4)
|
||||||
|
queueDebugOutput += m_packetOutboxes[i].Count + " "; // Serious debug business
|
||||||
|
|
||||||
if (m_nextPackets[i] != null)
|
if (m_nextPackets[i] != null)
|
||||||
{
|
{
|
||||||
|
@ -476,13 +477,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
// leaving a dequeued packet still waiting to be sent out. Try to
|
// leaving a dequeued packet still waiting to be sent out. Try to
|
||||||
// send it again
|
// send it again
|
||||||
OutgoingPacket nextPacket = m_nextPackets[i];
|
OutgoingPacket nextPacket = m_nextPackets[i];
|
||||||
|
if (i == 4) queueDebugOutput += "m_nextPackets[i] != null, " + nextPacket.Buffer.DataLength;
|
||||||
if (bucket.RemoveTokens(nextPacket.Buffer.DataLength))
|
if (bucket.RemoveTokens(nextPacket.Buffer.DataLength))
|
||||||
{
|
{
|
||||||
|
if (i == 4) queueDebugOutput += " removed tokens ";
|
||||||
// Send the packet
|
// Send the packet
|
||||||
m_udpServer.SendPacketFinal(nextPacket);
|
m_udpServer.SendPacketFinal(nextPacket);
|
||||||
m_nextPackets[i] = null;
|
m_nextPackets[i] = null;
|
||||||
packetSent = true;
|
packetSent = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
if (i == 4) queueDebugOutput += " did not remove tokens ";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -491,6 +496,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
queue = m_packetOutboxes[i];
|
queue = m_packetOutboxes[i];
|
||||||
if (queue.Dequeue(out packet))
|
if (queue.Dequeue(out packet))
|
||||||
{
|
{
|
||||||
|
if (i == 4) queueDebugOutput += "m_nextPackets[i] == null, dq ok " + packet.Buffer.DataLength;
|
||||||
// A packet was pulled off the queue. See if we have
|
// A packet was pulled off the queue. See if we have
|
||||||
// enough tokens in the bucket to send it out
|
// enough tokens in the bucket to send it out
|
||||||
if (bucket.RemoveTokens(packet.Buffer.DataLength))
|
if (bucket.RemoveTokens(packet.Buffer.DataLength))
|
||||||
|
@ -498,11 +504,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
// Send the packet
|
// Send the packet
|
||||||
m_udpServer.SendPacketFinal(packet);
|
m_udpServer.SendPacketFinal(packet);
|
||||||
packetSent = true;
|
packetSent = true;
|
||||||
|
if (i == 4) queueDebugOutput += " removed tokens ";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Save the dequeued packet for the next iteration
|
// Save the dequeued packet for the next iteration
|
||||||
m_nextPackets[i] = packet;
|
m_nextPackets[i] = packet;
|
||||||
|
if (i == 4) queueDebugOutput += " did not remove tokens ";
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the queue is empty after this dequeue, fire the queue
|
// If the queue is empty after this dequeue, fire the queue
|
||||||
|
@ -513,17 +521,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (i == 4) queueDebugOutput += "m_nextPackets[i] == null, dq nok ";
|
||||||
// No packets in this queue. Fire the queue empty callback
|
// No packets in this queue. Fire the queue empty callback
|
||||||
// if it has not been called recently
|
// if it has not been called recently
|
||||||
emptyCategories |= CategoryToFlag(i);
|
emptyCategories |= CategoryToFlag(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (emptyCategories != 0)
|
if (emptyCategories != 0)
|
||||||
BeginFireQueueEmpty(emptyCategories);
|
BeginFireQueueEmpty(emptyCategories);
|
||||||
|
|
||||||
//m_log.Info("[LLUDPCLIENT]: Queues: " + queueDebugOutput); // Serious debug business
|
if (m_udpServer.EmergencyMonitoring)
|
||||||
|
m_log.Info("[LLUDPCLIENT]: Queues: " + queueDebugOutput); // Serious debug business
|
||||||
|
|
||||||
return packetSent;
|
return packetSent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1133,6 +1133,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
private int npacksSent = 0;
|
private int npacksSent = 0;
|
||||||
private int npackNotSent = 0;
|
private int npackNotSent = 0;
|
||||||
|
|
||||||
|
public bool EmergencyMonitoring
|
||||||
|
{
|
||||||
|
get { return m_scene.EmergencyMonitoring; }
|
||||||
|
}
|
||||||
|
|
||||||
private void MonitoredClientOutgoingPacketHandler(IClientAPI client)
|
private void MonitoredClientOutgoingPacketHandler(IClientAPI client)
|
||||||
{
|
{
|
||||||
nticks++;
|
nticks++;
|
||||||
|
|
Loading…
Reference in New Issue