Merge branch 'avination' into ubitwork

avinationmerge
UbitUmarov 2012-07-15 23:33:06 +01:00
commit 15a1ad393c
1 changed files with 31 additions and 27 deletions

View File

@ -698,42 +698,46 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#region Packet to Client Mapping #region Packet to Client Mapping
// UseCircuitCode handling // If there is already a client for this endpoint, don't process UseCircuitCode
if (packet.Type == PacketType.UseCircuitCode) IClientAPI client = null;
if (!m_scene.TryGetClient(address, out client))
{ {
lock (m_pendingCache) // UseCircuitCode handling
if (packet.Type == PacketType.UseCircuitCode)
{ {
if (m_pendingCache.Contains(address)) // And if there is a UseCircuitCode pending, also drop it
return; lock (m_pendingCache)
{
if (m_pendingCache.Contains(address))
return;
m_pendingCache.AddOrUpdate(address, new Queue<UDPPacketBuffer>(), 60); m_pendingCache.AddOrUpdate(address, new Queue<UDPPacketBuffer>(), 60);
}
object[] array = new object[] { buffer, packet };
Util.FireAndForget(HandleUseCircuitCode, array);
return;
} }
}
object[] array = new object[] { buffer, packet }; // If this is a pending connection, enqueue, don't process yet
lock (m_pendingCache)
Util.FireAndForget(HandleUseCircuitCode, array); {
Queue<UDPPacketBuffer> queue;
return; if (m_pendingCache.TryGetValue(address, out queue))
{
//m_log.DebugFormat("[LLUDPSERVER]: Enqueued a {0} packet into the pending queue", packet.Type);
queue.Enqueue(buffer);
return;
}
} }
// Determine which agent this packet came from // Determine which agent this packet came from
IClientAPI client; if (client == null || !(client is LLClientView))
if (!m_scene.TryGetClient(address, out client) || !(client is LLClientView))
{ {
lock (m_pendingCache) //m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName);
{
Queue<UDPPacketBuffer> queue;
if (m_pendingCache.TryGetValue(address, out queue))
{
m_log.DebugFormat("[LLUDPSERVER]: Enqueued a {0} packet into the pending queue", packet.Type);
queue.Enqueue(buffer);
}
else
{
m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName);
}
}
return; return;
} }