From c04775bf682866cfa4009c28a4152c6ad549cdb2 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Mon, 26 Oct 2009 13:38:07 -0700 Subject: Changed UseCircuitCode handling to be synchronous or asynchronous depending on the async_packet_handling config option, and added a debug log message when a UseCircuitCode packet is handled --- .../Region/ClientStack/LindenUDP/LLUDPServer.cs | 31 +++++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 82ae640..8c3c5be 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -570,18 +570,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP // UseCircuitCode handling if (packet.Type == PacketType.UseCircuitCode) { - Util.FireAndForget( - delegate(object o) - { - IPEndPoint remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint; + m_log.Debug("[LLUDPSERVER]: Handling UseCircuitCode packet from " + buffer.RemoteEndPoint); + object[] array = new object[] { buffer, packet }; - // Begin the process of adding the client to the simulator - AddNewClient((UseCircuitCodePacket)packet, remoteEndPoint); + if (m_asyncPacketHandling) + Util.FireAndForget(HandleUseCircuitCode, array); + else + HandleUseCircuitCode(array); - // Acknowledge the UseCircuitCode packet - SendAckImmediate(remoteEndPoint, packet.Header.Sequence); - } - ); return; } @@ -692,6 +688,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP packetInbox.Enqueue(new IncomingPacket(udpClient, packet)); } + private void HandleUseCircuitCode(object o) + { + object[] array = (object[])o; + UDPPacketBuffer buffer = (UDPPacketBuffer)array[0]; + UseCircuitCodePacket packet = (UseCircuitCodePacket)array[1]; + + IPEndPoint remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint; + + // Begin the process of adding the client to the simulator + AddNewClient((UseCircuitCodePacket)packet, remoteEndPoint); + + // Acknowledge the UseCircuitCode packet + SendAckImmediate(remoteEndPoint, packet.Header.Sequence); + } + private void SendAckImmediate(IPEndPoint remoteEndpoint, uint sequenceNumber) { PacketAckPacket ack = new PacketAckPacket(); -- cgit v1.1