diff options
Diffstat (limited to '')
-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 |