remove usage of lludp highpriority send queue. It causes more issues than good

master
UbitUmarov 2020-01-20 16:01:21 +00:00
parent ad6499cc09
commit 54370169bc
3 changed files with 12 additions and 45 deletions

View File

@ -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)

View File

@ -542,18 +542,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// false if the packet has not been queued and should be sent immediately.
/// </returns>
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<OutgoingPacket> queue = m_packetOutboxes[category];
queue.Enqueue(packet, highPriority);
queue.Enqueue(packet, false);
return true;
}
else

View File

@ -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);
}