mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
Fix UnackedBytes client stack statistic as seen in "show queues"
Bytes were being wrongly added again on a resend
This commit is contained in:
@@ -585,8 +585,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
// Stats tracking
|
||||
Interlocked.Increment(ref udpClient.PacketsSent);
|
||||
if (isReliable)
|
||||
Interlocked.Add(ref udpClient.UnackedBytes, outgoingPacket.Buffer.DataLength);
|
||||
|
||||
// Put the UDP payload on the wire
|
||||
AsyncBeginSend(buffer);
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
@@ -77,6 +78,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
public void Add(OutgoingPacket packet)
|
||||
{
|
||||
m_pendingAdds.Enqueue(packet);
|
||||
Interlocked.Add(ref packet.Client.UnackedBytes, packet.Buffer.DataLength);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -166,7 +168,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
m_packets.Remove(pendingRemove.SequenceNumber);
|
||||
|
||||
// Update stats
|
||||
System.Threading.Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);
|
||||
Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);
|
||||
|
||||
if (!pendingRemove.FromResend)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user