Fix UnackedBytes client stack statistic as seen in "show queues"

Bytes were being wrongly added again on a resend
viewer-2-initial-appearance
Justin Clark-Casey (justincc) 2011-01-17 23:45:25 +00:00
parent 37837850d3
commit 81552099d6
2 changed files with 3 additions and 3 deletions

View File

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

View File

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