aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-08-15 13:46:46 +0100
committerJustin Clark-Casey (justincc)2013-08-15 13:46:46 +0100
commit2231fcf5b45be9a2f5b6e1a2665ff7223e275b33 (patch)
tree7d473725fe4240a272eb30099f17fa9bc285eb3c /OpenSim/Region/Framework/Scenes/Scene.cs
parentActually implement the bot request object textures switch started in 225cf0d. (diff)
downloadopensim-SC_OLD-2231fcf5b45be9a2f5b6e1a2665ff7223e275b33.zip
opensim-SC_OLD-2231fcf5b45be9a2f5b6e1a2665ff7223e275b33.tar.gz
opensim-SC_OLD-2231fcf5b45be9a2f5b6e1a2665ff7223e275b33.tar.bz2
opensim-SC_OLD-2231fcf5b45be9a2f5b6e1a2665ff7223e275b33.tar.xz
Do not use the SP.DoNotCloseAfterTeleport flag for child agent connections.
This approach has problems if a client quits without sending a proper logout but then reconnects before the connection is closed due to inactivity. In this case, the DoNotCloseAfterTeleport was wrongly set. The simplest approach is to close child agents on teleport as quickly as possible so that races are very unlikely to occur Hence, this code now closes child agents as the first action after a sucessful teleport.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs31
1 files changed, 20 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index d187377..3e5ef10 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3703,21 +3703,30 @@ namespace OpenSim.Region.Framework.Scenes
3703 // In the case where, for example, an A B C D region layout, an avatar may 3703 // In the case where, for example, an A B C D region layout, an avatar may
3704 // teleport from A -> D, but then -> C before A has asked B to close its old child agent. When C 3704 // teleport from A -> D, but then -> C before A has asked B to close its old child agent. When C
3705 // renews the lease on the child agent at B, we must make sure that the close from A does not succeed. 3705 // renews the lease on the child agent at B, we must make sure that the close from A does not succeed.
3706 if (!acd.ChildrenCapSeeds.ContainsKey(RegionInfo.RegionHandle)) 3706 //
3707 { 3707 // XXX: In the end, this should not be necessary if child agents are closed without delay on
3708 m_log.DebugFormat( 3708 // teleport, since realistically, the close request should always be processed before any other
3709 "[SCENE]: Setting DoNotCloseAfterTeleport for child scene presence {0} in {1} because source will attempt close.", 3709 // region tried to re-establish a child agent. This is much simpler since the logic below is
3710 sp.Name, Name); 3710 // vulnerable to an issue when a viewer quits a region without sending a proper logout but then
3711 // re-establishes the connection on a relogin. This could wrongly set the DoNotCloseAfterTeleport
3712 // flag when no teleport had taken place (and hence no close was going to come).
3713// if (!acd.ChildrenCapSeeds.ContainsKey(RegionInfo.RegionHandle))
3714// {
3715// m_log.DebugFormat(
3716// "[SCENE]: Setting DoNotCloseAfterTeleport for child scene presence {0} in {1} because source will attempt close.",
3717// sp.Name, Name);
3718//
3719// sp.DoNotCloseAfterTeleport = true;
3720// }
3721// else if (EntityTransferModule.IsInTransit(sp.UUID))
3711 3722
3712 sp.DoNotCloseAfterTeleport = true; 3723 if (EntityTransferModule.IsInTransit(sp.UUID))
3713 }
3714 else if (EntityTransferModule.IsInTransit(sp.UUID))
3715 { 3724 {
3725 sp.DoNotCloseAfterTeleport = true;
3726
3716 m_log.DebugFormat( 3727 m_log.DebugFormat(
3717 "[SCENE]: Setting DoNotCloseAfterTeleport for child scene presence {0} in {1} because this region will attempt previous end-of-teleport close.", 3728 "[SCENE]: Set DoNotCloseAfterTeleport for child scene presence {0} in {1} because this region will attempt previous end-of-teleport close.",
3718 sp.Name, Name); 3729 sp.Name, Name);
3719
3720 sp.DoNotCloseAfterTeleport = true;
3721 } 3730 }
3722 } 3731 }
3723 } 3732 }