aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs76
1 files changed, 38 insertions, 38 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index cedb9b4..ec51e28 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -222,7 +222,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
222 StatType.Pull, 222 StatType.Pull,
223 MeasuresOfInterest.None, 223 MeasuresOfInterest.None,
224 stat => stat.Value = m_udpServer.AverageReceiveTicksForLastSamplePeriod, 224 stat => stat.Value = m_udpServer.AverageReceiveTicksForLastSamplePeriod,
225// stat => 225// stat =>
226// stat.Value = Math.Round(m_udpServer.AverageReceiveTicksForLastSamplePeriod, 7), 226// stat.Value = Math.Round(m_udpServer.AverageReceiveTicksForLastSamplePeriod, 7),
227 StatVerbosity.Debug)); 227 StatVerbosity.Debug));
228 } 228 }
@@ -272,7 +272,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
272 /// <summary>The measured resolution of Environment.TickCount</summary> 272 /// <summary>The measured resolution of Environment.TickCount</summary>
273 public readonly float TickCountResolution; 273 public readonly float TickCountResolution;
274 274
275 /// <summary>Number of prim updates to put on the queue each time the 275 /// <summary>Number of prim updates to put on the queue each time the
276 /// OnQueueEmpty event is triggered for updates</summary> 276 /// OnQueueEmpty event is triggered for updates</summary>
277 public readonly int PrimUpdatesPerCallback; 277 public readonly int PrimUpdatesPerCallback;
278 278
@@ -289,7 +289,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
289 289
290 /// <summary>Bandwidth throttle for this UDP server</summary> 290 /// <summary>Bandwidth throttle for this UDP server</summary>
291 public TokenBucket Throttle { get; protected set; } 291 public TokenBucket Throttle { get; protected set; }
292 292
293 /// <summary>Per client throttle rates enforced by this server</summary> 293 /// <summary>Per client throttle rates enforced by this server</summary>
294 /// <remarks> 294 /// <remarks>
295 /// If the total rate is non-zero, then this is the maximum total throttle setting that any client can ever have. 295 /// If the total rate is non-zero, then this is the maximum total throttle setting that any client can ever have.
@@ -297,7 +297,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
297 /// do get changed immediately). They do not need to sum to the total. 297 /// do get changed immediately). They do not need to sum to the total.
298 /// </remarks> 298 /// </remarks>
299 public ThrottleRates ThrottleRates { get; protected set; } 299 public ThrottleRates ThrottleRates { get; protected set; }
300 300
301 /// <summary>Manages authentication for agent circuits</summary> 301 /// <summary>Manages authentication for agent circuits</summary>
302 protected AgentCircuitManager m_circuitManager; 302 protected AgentCircuitManager m_circuitManager;
303 303
@@ -436,8 +436,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
436 { 436 {
437 #region Environment.TickCount Measurement 437 #region Environment.TickCount Measurement
438 438
439 // Update the port with the one we actually got 439 // Update the port with the one we actually got
440 port = (uint)Port; 440 port = (uint)Port;
441 441
442 // Measure the resolution of Environment.TickCount 442 // Measure the resolution of Environment.TickCount
443 TickCountResolution = 0f; 443 TickCountResolution = 0f;
@@ -696,15 +696,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
696 696
697 Scene = (Scene)scene; 697 Scene = (Scene)scene;
698 m_location = new Location(Scene.RegionInfo.RegionHandle); 698 m_location = new Location(Scene.RegionInfo.RegionHandle);
699 699
700 IpahEngine 700 IpahEngine
701 = new JobEngine( 701 = new JobEngine(
702 string.Format("Incoming Packet Async Handling Engine ({0})", Scene.Name), 702 string.Format("Incoming Packet Async Handling Engine ({0})", Scene.Name),
703 "INCOMING PACKET ASYNC HANDLING ENGINE"); 703 "INCOMING PACKET ASYNC HANDLING ENGINE");
704 704
705 OqrEngine 705 OqrEngine
706 = new JobEngine( 706 = new JobEngine(
707 string.Format("Outgoing Queue Refill Engine ({0})", Scene.Name), 707 string.Format("Outgoing Queue Refill Engine ({0})", Scene.Name),
708 "OUTGOING QUEUE REFILL ENGINE"); 708 "OUTGOING QUEUE REFILL ENGINE");
709 709
710 StatsManager.RegisterStat( 710 StatsManager.RegisterStat(
@@ -730,9 +730,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
730 "clientstack", 730 "clientstack",
731 Scene.Name, 731 Scene.Name,
732 StatType.Pull, 732 StatType.Pull,
733 stat => 733 stat =>
734 { PercentageStat pstat = (PercentageStat)stat; 734 { PercentageStat pstat = (PercentageStat)stat;
735 pstat.Consequent = PacketPool.Instance.PacketsRequested; 735 pstat.Consequent = PacketPool.Instance.PacketsRequested;
736 pstat.Antecedent = PacketPool.Instance.PacketsReused; }, 736 pstat.Antecedent = PacketPool.Instance.PacketsReused; },
737 StatVerbosity.Debug)); 737 StatVerbosity.Debug));
738 738
@@ -745,8 +745,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
745 Scene.Name, 745 Scene.Name,
746 StatType.Pull, 746 StatType.Pull,
747 stat => 747 stat =>
748 { PercentageStat pstat = (PercentageStat)stat; 748 { PercentageStat pstat = (PercentageStat)stat;
749 pstat.Consequent = PacketPool.Instance.BlocksRequested; 749 pstat.Consequent = PacketPool.Instance.BlocksRequested;
750 pstat.Antecedent = PacketPool.Instance.BlocksReused; }, 750 pstat.Antecedent = PacketPool.Instance.BlocksReused; },
751 StatVerbosity.Debug)); 751 StatVerbosity.Debug));
752 752
@@ -799,7 +799,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
799 MeasuresOfInterest.None, 799 MeasuresOfInterest.None,
800 stat => stat.Value = IpahEngine.JobsWaiting, 800 stat => stat.Value = IpahEngine.JobsWaiting,
801 StatVerbosity.Debug)); 801 StatVerbosity.Debug));
802 802
803 StatsManager.RegisterStat( 803 StatsManager.RegisterStat(
804 new Stat( 804 new Stat(
805 "OQRERequestsWaiting", 805 "OQRERequestsWaiting",
@@ -812,7 +812,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
812 MeasuresOfInterest.None, 812 MeasuresOfInterest.None,
813 stat => stat.Value = OqrEngine.JobsWaiting, 813 stat => stat.Value = OqrEngine.JobsWaiting,
814 StatVerbosity.Debug)); 814 StatVerbosity.Debug));
815 815
816 // We delay enabling pool stats to AddScene() instead of Initialize() so that we can distinguish pool stats by 816 // We delay enabling pool stats to AddScene() instead of Initialize() so that we can distinguish pool stats by
817 // scene name 817 // scene name
818 if (UsePools) 818 if (UsePools)
@@ -1012,7 +1012,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1012 if ((outgoingPacket.Buffer.Data[0] & Helpers.MSG_RELIABLE) != 0) 1012 if ((outgoingPacket.Buffer.Data[0] & Helpers.MSG_RELIABLE) != 0)
1013 outgoingPacket.UnackedMethod = ((method == null) ? delegate(OutgoingPacket oPacket) { ResendUnacked(oPacket); } : method); 1013 outgoingPacket.UnackedMethod = ((method == null) ? delegate(OutgoingPacket oPacket) { ResendUnacked(oPacket); } : method);
1014 1014
1015 // If a Linden Lab 1.23.5 client receives an update packet after a kill packet for an object, it will 1015 // If a Linden Lab 1.23.5 client receives an update packet after a kill packet for an object, it will
1016 // continue to display the deleted object until relog. Therefore, we need to always queue a kill object 1016 // continue to display the deleted object until relog. Therefore, we need to always queue a kill object
1017 // packet so that it isn't sent before a queued update packet. 1017 // packet so that it isn't sent before a queued update packet.
1018 1018
@@ -1242,7 +1242,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1242 1242
1243 if ((IncomingMalformedPacketCount % 10000) == 0) 1243 if ((IncomingMalformedPacketCount % 10000) == 0)
1244 m_log.WarnFormat( 1244 m_log.WarnFormat(
1245 "[LLUDPSERVER]: Received {0} malformed packets so far, probable network attack. Last was from {1}", 1245 "[LLUDPSERVER]: Received {0} malformed packets so far, probable network attack. Last was from {1}",
1246 IncomingMalformedPacketCount, endPoint); 1246 IncomingMalformedPacketCount, endPoint);
1247 } 1247 }
1248 1248
@@ -1391,7 +1391,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1391 1391
1392 if ((IncomingOrphanedPacketCount % 10000) == 0) 1392 if ((IncomingOrphanedPacketCount % 10000) == 0)
1393 m_log.WarnFormat( 1393 m_log.WarnFormat(
1394 "[LLUDPSERVER]: Received {0} orphaned packets so far. Last was from {1}", 1394 "[LLUDPSERVER]: Received {0} orphaned packets so far. Last was from {1}",
1395 IncomingOrphanedPacketCount, endPoint); 1395 IncomingOrphanedPacketCount, endPoint);
1396 1396
1397 return; 1397 return;
@@ -1482,7 +1482,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1482 { 1482 {
1483 if (packet.Header.Resent) 1483 if (packet.Header.Resent)
1484 m_log.DebugFormat( 1484 m_log.DebugFormat(
1485 "[LLUDPSERVER]: Received a resend of already processed packet #{0}, type {1} from {2}", 1485 "[LLUDPSERVER]: Received a resend of already processed packet #{0}, type {1} from {2}",
1486 packet.Header.Sequence, packet.Type, client.Name); 1486 packet.Header.Sequence, packet.Type, client.Name);
1487 else 1487 else
1488 m_log.WarnFormat( 1488 m_log.WarnFormat(
@@ -1512,7 +1512,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1512 // We don't need to do anything else with ping checks 1512 // We don't need to do anything else with ping checks
1513 StartPingCheckPacket startPing = (StartPingCheckPacket)packet; 1513 StartPingCheckPacket startPing = (StartPingCheckPacket)packet;
1514 CompletePing(udpClient, startPing.PingID.PingID); 1514 CompletePing(udpClient, startPing.PingID.PingID);
1515 1515
1516 if ((Environment.TickCount - m_elapsedMSSinceLastStatReport) >= 3000) 1516 if ((Environment.TickCount - m_elapsedMSSinceLastStatReport) >= 3000)
1517 { 1517 {
1518 udpClient.SendPacketStats(); 1518 udpClient.SendPacketStats();
@@ -1677,7 +1677,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1677 m_log.DebugFormat( 1677 m_log.DebugFormat(
1678 "[LLUDPSERVER]: Handling UseCircuitCode request for circuit {0} to {1} from IP {2}", 1678 "[LLUDPSERVER]: Handling UseCircuitCode request for circuit {0} to {1} from IP {2}",
1679 uccp.CircuitCode.Code, Scene.RegionInfo.RegionName, endPoint); 1679 uccp.CircuitCode.Code, Scene.RegionInfo.RegionName, endPoint);
1680 1680
1681 AuthenticateResponse sessionInfo; 1681 AuthenticateResponse sessionInfo;
1682 if (IsClientAuthorized(uccp, out sessionInfo)) 1682 if (IsClientAuthorized(uccp, out sessionInfo))
1683 { 1683 {
@@ -1752,10 +1752,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1752 1752
1753 lock (m_pendingCache) 1753 lock (m_pendingCache)
1754 m_pendingCache.Remove(endPoint); 1754 m_pendingCache.Remove(endPoint);
1755 } 1755 }
1756 1756
1757 // m_log.DebugFormat( 1757 // m_log.DebugFormat(
1758 // "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms", 1758 // "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
1759 // buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds); 1759 // buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
1760 1760
1761 } 1761 }
@@ -1787,9 +1787,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1787 1787
1788 // Determine which agent this packet came from 1788 // Determine which agent this packet came from
1789 // We need to wait here because in when using the OpenSimulator V2 teleport protocol to travel to a destination 1789 // We need to wait here because in when using the OpenSimulator V2 teleport protocol to travel to a destination
1790 // simulator with no existing child presence, the viewer (at least LL 3.3.4) will send UseCircuitCode 1790 // simulator with no existing child presence, the viewer (at least LL 3.3.4) will send UseCircuitCode
1791 // and then CompleteAgentMovement immediately without waiting for an ack. As we are now handling these 1791 // and then CompleteAgentMovement immediately without waiting for an ack. As we are now handling these
1792 // packets asynchronously, we need to account for this thread proceeding more quickly than the 1792 // packets asynchronously, we need to account for this thread proceeding more quickly than the
1793 // UseCircuitCode thread. 1793 // UseCircuitCode thread.
1794 int count = 40; 1794 int count = 40;
1795 while (count-- > 0) 1795 while (count-- > 0)
@@ -1811,7 +1811,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1811 // manager but the SceneAgent has not yet been set in Scene.AddNewAgent(). If we are too 1811 // manager but the SceneAgent has not yet been set in Scene.AddNewAgent(). If we are too
1812 // eager, then the new ScenePresence may not have registered a listener for this messsage 1812 // eager, then the new ScenePresence may not have registered a listener for this messsage
1813 // before we try to process it. 1813 // before we try to process it.
1814 // XXX: A better long term fix may be to add the SceneAgent before the client is added to 1814 // XXX: A better long term fix may be to add the SceneAgent before the client is added to
1815 // the client manager 1815 // the client manager
1816 m_log.DebugFormat( 1816 m_log.DebugFormat(
1817 "[LLUDPSERVER]: Received a CompleteAgentMovement from {0} for {1} in {2} but client SceneAgent not set yet. Waiting.", 1817 "[LLUDPSERVER]: Received a CompleteAgentMovement from {0} for {1} in {2} but client SceneAgent not set yet. Waiting.",
@@ -1825,7 +1825,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1825 else 1825 else
1826 { 1826 {
1827 m_log.DebugFormat( 1827 m_log.DebugFormat(
1828 "[LLUDPSERVER]: Received a CompleteAgentMovement from {0} in {1} but no client exists yet. Waiting.", 1828 "[LLUDPSERVER]: Received a CompleteAgentMovement from {0} in {1} but no client exists yet. Waiting.",
1829 endPoint, Scene.Name); 1829 endPoint, Scene.Name);
1830 } 1830 }
1831 1831
@@ -1962,13 +1962,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1962 { 1962 {
1963 LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, Throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO); 1963 LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, Throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
1964 1964
1965 1965
1966 client = new LLClientView(Scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode); 1966 client = new LLClientView(Scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
1967 client.OnLogout += LogoutHandler; 1967 client.OnLogout += LogoutHandler;
1968 client.DebugPacketLevel = DefaultClientPacketDebugLevel; 1968 client.DebugPacketLevel = DefaultClientPacketDebugLevel;
1969 1969
1970 ((LLClientView)client).DisableFacelights = m_disableFacelights; 1970 ((LLClientView)client).DisableFacelights = m_disableFacelights;
1971 1971
1972 client.Start(); 1972 client.Start();
1973 } 1973 }
1974 } 1974 }
@@ -1988,7 +1988,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1988 protected void DeactivateClientDueToTimeout(LLClientView client, int timeoutTicks) 1988 protected void DeactivateClientDueToTimeout(LLClientView client, int timeoutTicks)
1989 { 1989 {
1990 lock (client.CloseSyncLock) 1990 lock (client.CloseSyncLock)
1991 { 1991 {
1992 ClientLogoutsDueToNoReceives++; 1992 ClientLogoutsDueToNoReceives++;
1993 1993
1994 if (client.SceneAgent != null) 1994 if (client.SceneAgent != null)
@@ -1996,7 +1996,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1996 m_log.WarnFormat( 1996 m_log.WarnFormat(
1997 "[LLUDPSERVER]: No packets received from {0} agent of {1} for {2}ms in {3}. Disconnecting.", 1997 "[LLUDPSERVER]: No packets received from {0} agent of {1} for {2}ms in {3}. Disconnecting.",
1998 client.SceneAgent.IsChildAgent ? "child" : "root", client.Name, timeoutTicks, Scene.Name); 1998 client.SceneAgent.IsChildAgent ? "child" : "root", client.Name, timeoutTicks, Scene.Name);
1999 1999
2000 if (!client.SceneAgent.IsChildAgent) 2000 if (!client.SceneAgent.IsChildAgent)
2001 client.Kick("Simulator logged you out due to connection timeout."); 2001 client.Kick("Simulator logged you out due to connection timeout.");
2002 } 2002 }
@@ -2020,11 +2020,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2020 try 2020 try
2021 { 2021 {
2022 incomingPacket = packetInbox.Dequeue(250); 2022 incomingPacket = packetInbox.Dequeue(250);
2023 2023
2024 if (incomingPacket != null && IsRunningInbound) 2024 if (incomingPacket != null && IsRunningInbound)
2025 { 2025 {
2026 ProcessInPacket(incomingPacket); 2026 ProcessInPacket(incomingPacket);
2027 2027
2028 if (UsePools) 2028 if (UsePools)
2029 { 2029 {
2030 incomingPacket.Client = null; 2030 incomingPacket.Client = null;
@@ -2192,7 +2192,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2192 /// </summary> 2192 /// </summary>
2193 public long IncomingPacketsProcessed { get; protected set; } 2193 public long IncomingPacketsProcessed { get; protected set; }
2194 2194
2195 #endregion 2195 #endregion
2196 2196
2197 protected void ProcessInPacket(IncomingPacket incomingPacket) 2197 protected void ProcessInPacket(IncomingPacket incomingPacket)
2198 { 2198 {