Rely on the Scene.IncomingCloseAgent() check as to whether the connection should be kept open after teleport-end rather than doing this in the ET Module

This is safer since the close check in IncomingCloseAgent() is done under lock conditions, which prevents a race between ETM and Scene.AddClient()
0.7.6-extended
Justin Clark-Casey (justincc) 2013-08-15 14:07:57 +01:00
parent 2231fcf5b4
commit 3f8d79024b
2 changed files with 7 additions and 15 deletions

View File

@ -1085,20 +1085,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// IN THE AVIE BEING PLACED IN INFINITY FOR A COUPLE OF SECONDS. // IN THE AVIE BEING PLACED IN INFINITY FOR A COUPLE OF SECONDS.
Thread.Sleep(15000); Thread.Sleep(15000);
if (!sp.DoNotCloseAfterTeleport) // OK, it got this agent. Let's close everything
{ // If we shouldn't close the agent due to some other region renewing the connection
// OK, it got this agent. Let's close everything // then this will be handled in IncomingCloseAgent under lock conditions
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Closing agent {0} in {1}", sp.Name, Scene.Name); m_log.DebugFormat(
sp.Scene.IncomingCloseAgent(sp.UUID, false); "[ENTITY TRANSFER MODULE]: Closing agent {0} in {1} after teleport", sp.Name, Scene.Name);
} sp.Scene.IncomingCloseAgent(sp.UUID, false);
else
{
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Connection for {0} in {1} has been re-established after teleport. Not closing.",
sp.Name, Scene.Name);
sp.DoNotCloseAfterTeleport = false;
}
} }
else else
{ {

View File

@ -3725,7 +3725,7 @@ namespace OpenSim.Region.Framework.Scenes
sp.DoNotCloseAfterTeleport = true; sp.DoNotCloseAfterTeleport = true;
m_log.DebugFormat( m_log.DebugFormat(
"[SCENE]: Set DoNotCloseAfterTeleport for child scene presence {0} in {1} because this region will attempt previous end-of-teleport close.", "[SCENE]: Set DoNotCloseAfterTeleport for child scene presence {0} in {1} because this region will attempt end-of-teleport close from a previous close.",
sp.Name, Name); sp.Name, Name);
} }
} }