diff options
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index a662092..a46c5ce 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -698,50 +698,61 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
698 | 698 | ||
699 | #region Packet to Client Mapping | 699 | #region Packet to Client Mapping |
700 | 700 | ||
701 | // UseCircuitCode handling | 701 | // If there is already a client for this endpoint, don't process UseCircuitCode |
702 | if (packet.Type == PacketType.UseCircuitCode) | 702 | IClientAPI client = null; |
703 | if (!m_scene.TryGetClient(address, out client)) | ||
703 | { | 704 | { |
704 | lock (m_pendingCache) | 705 | // UseCircuitCode handling |
706 | if (packet.Type == PacketType.UseCircuitCode) | ||
705 | { | 707 | { |
706 | if (m_pendingCache.Contains(address)) | 708 | // And if there is a UseCircuitCode pending, also drop it |
707 | return; | 709 | lock (m_pendingCache) |
710 | { | ||
711 | if (m_pendingCache.Contains(address)) | ||
712 | return; | ||
708 | 713 | ||
709 | m_pendingCache.AddOrUpdate(address, new Queue<UDPPacketBuffer>(), 60); | 714 | m_pendingCache.AddOrUpdate(address, new Queue<UDPPacketBuffer>(), 60); |
710 | } | 715 | } |
711 | 716 | ||
712 | object[] array = new object[] { buffer, packet }; | 717 | object[] array = new object[] { buffer, packet }; |
713 | 718 | ||
714 | Util.FireAndForget(HandleUseCircuitCode, array); | 719 | Util.FireAndForget(HandleUseCircuitCode, array); |
715 | 720 | ||
716 | return; | 721 | return; |
722 | } | ||
717 | } | 723 | } |
718 | 724 | ||
719 | // Determine which agent this packet came from | 725 | // If this is a pending connection, enqueue, don't process yet |
720 | IClientAPI client; | 726 | lock (m_pendingCache) |
721 | if (!m_scene.TryGetClient(address, out client) || !(client is LLClientView)) | ||
722 | { | 727 | { |
723 | <<<<<<< HEAD | 728 | <<<<<<< HEAD |
729 | <<<<<<< HEAD | ||
724 | m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName); | 730 | m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName); |
725 | ======= | 731 | ======= |
726 | lock (m_pendingCache) | 732 | lock (m_pendingCache) |
733 | ======= | ||
734 | Queue<UDPPacketBuffer> queue; | ||
735 | if (m_pendingCache.TryGetValue(address, out queue)) | ||
736 | >>>>>>> 15a1ad393c3748c5c911beac981945a9bd8b200d | ||
727 | { | 737 | { |
728 | Queue<UDPPacketBuffer> queue; | 738 | //m_log.DebugFormat("[LLUDPSERVER]: Enqueued a {0} packet into the pending queue", packet.Type); |
729 | if (m_pendingCache.TryGetValue(address, out queue)) | 739 | queue.Enqueue(buffer); |
730 | { | 740 | return; |
731 | m_log.DebugFormat("[LLUDPSERVER]: Enqueued a {0} packet into the pending queue", packet.Type); | ||
732 | queue.Enqueue(buffer); | ||
733 | } | ||
734 | else | ||
735 | { | ||
736 | m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName); | ||
737 | } | ||
738 | } | 741 | } |
742 | } | ||
739 | 743 | ||
740 | <<<<<<< HEAD | 744 | <<<<<<< HEAD |
745 | <<<<<<< HEAD | ||
741 | // m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName); | 746 | // m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName); |
742 | >>>>>>> 2606484e45138adef289386509b1e27552a32aee | 747 | >>>>>>> 2606484e45138adef289386509b1e27552a32aee |
743 | ======= | 748 | ======= |
744 | >>>>>>> 0baa1b557af20af3590737dc04294a9bdc8e8728 | 749 | >>>>>>> 0baa1b557af20af3590737dc04294a9bdc8e8728 |
750 | ======= | ||
751 | // Determine which agent this packet came from | ||
752 | if (client == null || !(client is LLClientView)) | ||
753 | { | ||
754 | //m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName); | ||
755 | >>>>>>> 15a1ad393c3748c5c911beac981945a9bd8b200d | ||
745 | return; | 756 | return; |
746 | } | 757 | } |
747 | 758 | ||