Make the check as to whether any particular inbound AgentUpdate packet is significant much earlier in UDP processing (i.e. before we pointlessly place such packets on internal queues, etc.)

Appears to have some impact on cpu but needs testing.
This commit is contained in:
Justin Clark-Casey (justincc)
2013-07-19 00:51:13 +01:00
committed by Diva Canto
parent e5c677779b
commit 61eda1f441
3 changed files with 131 additions and 60 deletions

View File

@@ -1307,8 +1307,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
LogPacketHeader(true, udpClient.CircuitCode, 0, packet.Type, (ushort)packet.Length);
#endregion BinaryStats
if (m_discardAgentUpdates && packet.Type == PacketType.AgentUpdate)
return;
if (packet.Type == PacketType.AgentUpdate)
{
if (m_discardAgentUpdates)
return;
AgentUpdatePacket agentUpdate = (AgentUpdatePacket)packet;
if (agentUpdate.AgentData.SessionID != client.SessionId
|| agentUpdate.AgentData.AgentID != client.AgentId
|| !((LLClientView)client).CheckAgentUpdateSignificance(agentUpdate.AgentData))
{
PacketPool.Instance.ReturnPacket(packet);
return;
}
}
#region Ping Check Handling