From 54370169bc97cbfce5a8e4371710466a1b4e994e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 20 Jan 2020 16:01:21 +0000 Subject: [PATCH] remove usage of lludp highpriority send queue. It causes more issues than good --- .../ClientStack/Linden/UDP/LLClientView.cs | 18 ++++------- .../ClientStack/Linden/UDP/LLUDPClient.cs | 7 +--- .../ClientStack/Linden/UDP/LLUDPServer.cs | 32 +++---------------- 3 files changed, 12 insertions(+), 45 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 6a3e67025e..c9da539daa 100755 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -3594,7 +3594,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP Transfer.TransferInfo.Size = req.AssetInf.Data.Length; Transfer.TransferInfo.TransferID = req.TransferRequestID; Transfer.Header.Zerocoded = true; - OutPacket(Transfer, isWearable ? ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority : ThrottleOutPacketType.Asset); + OutPacket(Transfer, ThrottleOutPacketType.Asset); if (req.NumPackets == 1) { @@ -3605,7 +3605,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP TransferPacket.TransferData.Data = req.AssetInf.Data; TransferPacket.TransferData.Status = 1; TransferPacket.Header.Zerocoded = true; - OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority : ThrottleOutPacketType.Asset); + OutPacket(TransferPacket, ThrottleOutPacketType.Asset); } else { @@ -3638,7 +3638,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP TransferPacket.TransferData.Status = 1; } TransferPacket.Header.Zerocoded = true; - OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority : ThrottleOutPacketType.Asset); + OutPacket(TransferPacket, ThrottleOutPacketType.Asset); processedLength += chunkSize; packetNumber++; @@ -4435,7 +4435,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } - OutPacket(aw, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority); + OutPacket(aw, ThrottleOutPacketType.Task); } static private readonly byte[] AvatarAppearanceHeader = new byte[] { @@ -4487,7 +4487,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP Utils.FloatToBytesSafepos(hover, data, pos); pos += 4; buf.DataLength = pos; - m_udpServer.SendUDPPacket(m_udpClient, buf, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority, null, true); + m_udpServer.SendUDPPacket(m_udpClient, buf, ThrottleOutPacketType.Task, null, true); } static private readonly byte[] AvatarAnimationHeader = new byte[] { @@ -4562,7 +4562,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP data[pos++] = 0; // no physical avatar events buf.DataLength = pos; - m_udpServer.SendUDPPacket(m_udpClient, buf, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority); + m_udpServer.SendUDPPacket(m_udpClient, buf, ThrottleOutPacketType.Task); } public void SendObjectAnimations(UUID[] animations, int[] seqs, UUID senderId) @@ -4609,17 +4609,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP zc.AddByte(1); // block count - ThrottleOutPacketType ptype = ThrottleOutPacketType.Task; if (ent is ScenePresence) - { CreateAvatarUpdateBlock(ent as ScenePresence, zc); - ptype |= ThrottleOutPacketType.HighPriority; - } else CreatePrimUpdateBlock(ent as SceneObjectPart, (ScenePresence)SceneAgent, zc); buf.DataLength = zc.Finish(); - m_udpServer.SendUDPPacket(m_udpClient, buf, ptype); + m_udpServer.SendUDPPacket(m_udpClient, buf, ThrottleOutPacketType.Task); } public void SendEntityTerseUpdateImmediate(ISceneEntity ent) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index af62d9c48c..215b07f711 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs @@ -542,18 +542,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// false if the packet has not been queued and should be sent immediately. /// public bool EnqueueOutgoing(OutgoingPacket packet) - { - return EnqueueOutgoing(packet, false); - } - - public bool EnqueueOutgoing(OutgoingPacket packet, bool highPriority) { int category = (int)packet.Category; if (category >= 0 && category < m_packetOutboxes.Length) { DoubleLocklessQueue queue = m_packetOutboxes[category]; - queue.Enqueue(packet, highPriority); + queue.Enqueue(packet, false); return true; } else diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 6994efb85d..b09ab9e9ce 100755 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -863,14 +863,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP #region Queue or Send - bool highPriority = false; - - if (category != ThrottleOutPacketType.Unknown && (category & ThrottleOutPacketType.HighPriority) != 0) - { - category = (ThrottleOutPacketType)((int)category & 127); - highPriority = true; - } - OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category, null); // If we were not provided a method for handling unacked, use the UDPServer default method @@ -880,7 +872,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // If a Linden Lab 1.23.5 client receives an update packet after a kill packet for an object, it will // continue to display the deleted object until relog. Therefore, we need to always queue a kill object // packet so that it isn't sent before a queued update packet. - if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, highPriority)) + if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket)) { SendPacketFinal(outgoingPacket); return true; @@ -953,44 +945,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendUDPPacket( LLUDPClient udpClient, UDPPacketBuffer buffer, ThrottleOutPacketType category, UnackedPacketMethod method, bool zerocode) { - bool highPriority = false; - if (zerocode) buffer = ZeroEncode(buffer); - if (category != ThrottleOutPacketType.Unknown && (category & ThrottleOutPacketType.HighPriority) != 0) - { - category = (ThrottleOutPacketType)((int)category & 127); - highPriority = true; - } - OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category, null); // If we were not provided a method for handling unacked, use the UDPServer default method if ((outgoingPacket.Buffer.Data[0] & Helpers.MSG_RELIABLE) != 0) outgoingPacket.UnackedMethod = ((method == null) ? delegate (OutgoingPacket oPacket) { ResendUnacked(oPacket); } : method); - if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, highPriority)) + if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket)) SendPacketFinal(outgoingPacket); } public void SendUDPPacket(LLUDPClient udpClient, UDPPacketBuffer buffer, ThrottleOutPacketType category) { - bool highPriority = false; - - if (category != ThrottleOutPacketType.Unknown && (category & ThrottleOutPacketType.HighPriority) != 0) - { - category = (ThrottleOutPacketType)((int)category & 127); - highPriority = true; - } - OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category, null); // If we were not provided a method for handling unacked, use the UDPServer default method if ((outgoingPacket.Buffer.Data[0] & Helpers.MSG_RELIABLE) != 0) outgoingPacket.UnackedMethod = delegate (OutgoingPacket oPacket) { ResendUnacked(oPacket); }; - if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, highPriority)) + if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket)) SendPacketFinal(outgoingPacket); } @@ -1136,7 +1112,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Bump up the resend count on this packet Interlocked.Increment(ref outgoingPacket.ResendCount); // Requeue or resend the packet - if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, false)) + if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket)) SendPacketFinal(outgoingPacket); }