diff options
author | Justin Clark-Casey (justincc) | 2012-06-12 02:03:31 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-06-12 02:03:31 +0100 |
commit | c89db34fc4372be7ff94d92472131b2c33de8605 (patch) | |
tree | 8aa76d4a5be7e964bfdcf98317e1f0714e97c465 | |
parent | In PresenceDetector.OnConnectionClose(), use the IsChildAgent check already a... (diff) | |
download | opensim-SC_OLD-c89db34fc4372be7ff94d92472131b2c33de8605.zip opensim-SC_OLD-c89db34fc4372be7ff94d92472131b2c33de8605.tar.gz opensim-SC_OLD-c89db34fc4372be7ff94d92472131b2c33de8605.tar.bz2 opensim-SC_OLD-c89db34fc4372be7ff94d92472131b2c33de8605.tar.xz |
If the simulator closes a root agent due to ack timeout, then send the client a kick message with that reason, in case it is somehow still listening.
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 7f86491..2036f61 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -558,9 +558,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
558 | if (!client.IsLoggingOut && | 558 | if (!client.IsLoggingOut && |
559 | (Environment.TickCount & Int32.MaxValue) - udpClient.TickLastPacketReceived > timeoutTicks) | 559 | (Environment.TickCount & Int32.MaxValue) - udpClient.TickLastPacketReceived > timeoutTicks) |
560 | { | 560 | { |
561 | m_log.Warn("[LLUDPSERVER]: Ack timeout, disconnecting " + udpClient.AgentID); | 561 | m_log.WarnFormat( |
562 | "[LLUDPSERVER]: Ack timeout for {0} {1}, disconnecting", | ||
563 | client.Name, client.AgentId); | ||
564 | |||
562 | StatsManager.SimExtraStats.AddAbnormalClientThreadTermination(); | 565 | StatsManager.SimExtraStats.AddAbnormalClientThreadTermination(); |
563 | RemoveClient(client); | 566 | LogoutClientDueToTimeout(client); |
564 | 567 | ||
565 | return; | 568 | return; |
566 | } | 569 | } |
@@ -1121,6 +1124,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1121 | Util.FireAndForget(o => client.Close()); | 1124 | Util.FireAndForget(o => client.Close()); |
1122 | } | 1125 | } |
1123 | 1126 | ||
1127 | private void LogoutClientDueToTimeout(IClientAPI client) | ||
1128 | { | ||
1129 | // We must set IsLoggingOut synchronously so that we can stop the packet loop reinvoking this method. | ||
1130 | client.IsLoggingOut = true; | ||
1131 | |||
1132 | // Fire this out on a different thread so that we don't hold up outgoing packet processing for | ||
1133 | // everybody else if this is being called due to an ack timeout. | ||
1134 | // This is the same as processing as the async process of a logout request. | ||
1135 | Util.FireAndForget( | ||
1136 | o => | ||
1137 | { if (!client.SceneAgent.IsChildAgent) | ||
1138 | client.Kick("Simulator logged you out due to connection timeout"); | ||
1139 | client.Close(); }); | ||
1140 | } | ||
1141 | |||
1124 | private void IncomingPacketHandler() | 1142 | private void IncomingPacketHandler() |
1125 | { | 1143 | { |
1126 | // Set this culture for the thread that incoming packets are received | 1144 | // Set this culture for the thread that incoming packets are received |