diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 17e44004c5..276b36724d 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -4632,28 +4632,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP void HandleQueueEmpty(ThrottleOutPacketTypeFlags categories) { -// if (!m_udpServer.IsRunningOutbound) -// return; - if ((categories & ThrottleOutPacketTypeFlags.Task) != 0) { -// if (!m_udpServer.IsRunningOutbound) -// return; -/* - if (m_maxUpdates == 0 || m_LastQueueFill == 0) - { - m_maxUpdates = m_udpServer.PrimUpdatesPerCallback; - } - else - { - if (Util.EnvironmentTickCountSubtract(m_LastQueueFill) < 200) - m_maxUpdates += 5; - else - m_maxUpdates = m_maxUpdates >> 1; - } - m_maxUpdates = Util.Clamp(m_maxUpdates,10,500); - m_LastQueueFill = Util.EnvironmentTickCount(); -*/ int maxUpdateBytes = m_udpClient.GetCatBytesCanSend(ThrottleOutPacketType.Task, 30); if (m_entityUpdates.Count > 0) @@ -4669,23 +4649,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP internal bool HandleHasUpdates(ThrottleOutPacketTypeFlags categories) { - bool hasUpdates = false; - if ((categories & ThrottleOutPacketTypeFlags.Task) != 0) { if (m_entityUpdates.Count > 0) - hasUpdates = true; - else if (m_entityProps.Count > 0) - hasUpdates = true; + return true; + if (m_entityProps.Count > 0) + return true; } if ((categories & ThrottleOutPacketTypeFlags.Texture) != 0) { if (ImageManager.HasUpdates()) - hasUpdates = true; + return true; } - return hasUpdates; + return false; } public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index 4e68a9b1c8..246f003dd2 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs @@ -166,7 +166,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// Total number of sent packets that we have reported to the OnPacketStats event(s) private int m_packetsSentReported; /// Holds the Environment.TickCount value of when the next OnQueueEmpty can be fired - private int m_nextOnQueueEmpty = 1; + private double m_nextOnQueueEmpty = 0; /// Throttle bucket for this agent's connection private readonly AdaptiveTokenBucket m_throttleClient; @@ -771,7 +771,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP RTO = Math.Min(RTO * 2, m_maxRTO); } - const int MIN_CALLBACK_MS = 20; + const double MIN_CALLBACK_MS = 20.0; + private bool m_isQueueEmptyRunning; /// /// Does an early check to see if this queue empty callback is already @@ -782,35 +783,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP { if (!m_isQueueEmptyRunning) { - int start = Environment.TickCount & Int32.MaxValue; + if (!HasUpdates(categories)) + return; + double start = Util.GetTimeStampMS(); if (start < m_nextOnQueueEmpty) return; m_isQueueEmptyRunning = true; - m_nextOnQueueEmpty = start + MIN_CALLBACK_MS; - if (m_nextOnQueueEmpty == 0) - m_nextOnQueueEmpty = 1; - if (HasUpdates(categories)) - { - if (!m_udpServer.OqrEngine.IsRunning) - { - // Asynchronously run the callback - Util.FireAndForget(FireQueueEmpty, categories, "LLUDPClient.BeginFireQueueEmpty"); - } - else - { - m_udpServer.OqrEngine.QueueJob(AgentID.ToString(), () => FireQueueEmpty(categories)); - } - } + // Asynchronously run the callback + if (m_udpServer.OqrEngine.IsRunning) + m_udpServer.OqrEngine.QueueJob(AgentID.ToString(), () => FireQueueEmpty(categories)); else - m_isQueueEmptyRunning = false; + Util.FireAndForget(FireQueueEmpty, categories, "LLUDPClient.BeginFireQueueEmpty"); } } - private bool m_isQueueEmptyRunning; /// diff --git a/OpenSim/Region/OptionalModules/DataSnapshot/LandSnapshot.cs b/OpenSim/Region/OptionalModules/DataSnapshot/LandSnapshot.cs index b8c90cd5a1..5c791e6e76 100644 --- a/OpenSim/Region/OptionalModules/DataSnapshot/LandSnapshot.cs +++ b/OpenSim/Region/OptionalModules/DataSnapshot/LandSnapshot.cs @@ -120,12 +120,15 @@ namespace OpenSim.Region.DataSnapshot.Providers public XmlNode RequestSnapshotData(XmlDocument nodeFactory) { + XmlNode parent = nodeFactory.CreateNode(XmlNodeType.Element, "parceldata", ""); ILandChannel landChannel = m_scene.LandChannel; + if(landChannel == null) + return parent; + List parcels = landChannel.AllParcels(); IDwellModule dwellModule = m_scene.RequestModuleInterface(); - XmlNode parent = nodeFactory.CreateNode(XmlNodeType.Element, "parceldata", ""); if (parcels != null) {