aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDiva Canto2011-02-10 06:09:04 -0800
committerDiva Canto2011-02-10 06:09:04 -0800
commit89bb5c0941625542ce3fe364cf91a2e2fa60cbcf (patch)
tree5823823219c8bbeb986ef135c5477eac5f0ef782 /OpenSim
parentPut the Ack of UseCircuitCode back to where it used to be. Some ppl are repor... (diff)
downloadopensim-SC-89bb5c0941625542ce3fe364cf91a2e2fa60cbcf.zip
opensim-SC-89bb5c0941625542ce3fe364cf91a2e2fa60cbcf.tar.gz
opensim-SC-89bb5c0941625542ce3fe364cf91a2e2fa60cbcf.tar.bz2
opensim-SC-89bb5c0941625542ce3fe364cf91a2e2fa60cbcf.tar.xz
Revert "Hunting down mantis #5365"
This reverts commit ebeef02fef1a04b5b4cfe13dad588bcce7f9ba21.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs45
1 files changed, 15 insertions, 30 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
index d762bef..9d40688 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
@@ -141,46 +141,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP
141 private void ProcessQueues() 141 private void ProcessQueues()
142 { 142 {
143 // Process all the pending adds 143 // Process all the pending adds
144
145 OutgoingPacket pendingAdd; 144 OutgoingPacket pendingAdd;
146 if (m_pendingAdds != null) 145 while (m_pendingAdds.TryDequeue(out pendingAdd))
147 { 146 m_packets[pendingAdd.SequenceNumber] = pendingAdd;
148 while (m_pendingAdds.TryDequeue(out pendingAdd))
149 {
150 if (pendingAdd != null && m_packets != null)
151 {
152 m_packets[pendingAdd.SequenceNumber] = pendingAdd;
153 }
154 }
155 }
156 147
157 // Process all the pending removes, including updating statistics and round-trip times 148 // Process all the pending removes, including updating statistics and round-trip times
158 PendingAck pendingRemove; 149 PendingAck pendingRemove;
159 OutgoingPacket ackedPacket; 150 OutgoingPacket ackedPacket;
160 if (m_pendingRemoves != null) 151 while (m_pendingRemoves.TryDequeue(out pendingRemove))
161 { 152 {
162 while (m_pendingRemoves.TryDequeue(out pendingRemove)) 153 if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket))
163 { 154 {
164 if (m_pendingRemoves != null && m_packets != null) 155 m_packets.Remove(pendingRemove.SequenceNumber);
156
157 // Update stats
158 Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);
159
160 if (!pendingRemove.FromResend)
165 { 161 {
166 if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket)) 162 // Calculate the round-trip time for this packet and its ACK
167 { 163 int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount;
168 m_packets.Remove(pendingRemove.SequenceNumber); 164 if (rtt > 0)
169 165 ackedPacket.Client.UpdateRoundTrip(rtt);
170 // Update stats
171 Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);
172
173 if (!pendingRemove.FromResend)
174 {
175 // Calculate the round-trip time for this packet and its ACK
176 int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount;
177 if (rtt > 0)
178 ackedPacket.Client.UpdateRoundTrip(rtt);
179 }
180 }
181 } 166 }
182 } 167 }
183 } 168 }
184 } 169 }
185 } 170 }
186} 171} \ No newline at end of file