aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-10-01 17:18:20 +0000
committerJustin Clarke Casey2008-10-01 17:18:20 +0000
commit95a3d6372d5cb6d0b702ecc26f2433b19b69c323 (patch)
tree1e4b6e9bbbdf9bc46d376cd1afa499bc8f43ff2e
parentadd delete prim tests. Found and fixed bugs where region (diff)
downloadopensim-SC-95a3d6372d5cb6d0b702ecc26f2433b19b69c323.zip
opensim-SC-95a3d6372d5cb6d0b702ecc26f2433b19b69c323.tar.gz
opensim-SC-95a3d6372d5cb6d0b702ecc26f2433b19b69c323.tar.bz2
opensim-SC-95a3d6372d5cb6d0b702ecc26f2433b19b69c323.tar.xz
* Fix bug in LLPacketHandler where the tickcount when a packet was approximately sent was not being stored in the ack record
* This meant that acks were being sent out every 250ms when the ack timer fired, rather than when they had actually aged past m_ResendTimeout
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs28
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs2
2 files changed, 21 insertions, 9 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
index d57321e..0608b7f 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
@@ -78,8 +78,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
78 78
79 public class LLPacketHandler : IPacketHandler 79 public class LLPacketHandler : IPacketHandler
80 { 80 {
81// private static readonly ILog m_log = 81 //private static readonly ILog m_log =
82// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 82 // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
83 83
84 // Packet queues 84 // Packet queues
85 // 85 //
@@ -102,10 +102,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
102 // 102 //
103 private class AckData 103 private class AckData
104 { 104 {
105 public AckData(Packet packet, Object identifier) 105 public AckData(Packet packet, Object identifier, int tickCount)
106 { 106 {
107 Packet = packet; 107 Packet = packet;
108 Identifier = identifier; 108 Identifier = identifier;
109 TickCount = tickCount;
109 } 110 }
110 111
111 public Packet Packet; 112 public Packet Packet;
@@ -355,7 +356,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
355 { 356 {
356 // Resend the packet. Set the packet's tick count to 357 // Resend the packet. Set the packet's tick count to
357 // now, and keep it marked as resent. 358 // now, and keep it marked as resent.
358 // 359 //m_log.DebugFormat(
360 // "[CLIENT]: Resending unacked packet number {0} after {1}ms",
361 // packet.Header.Sequence, now - data.TickCount);
362
359 packet.Header.Resent = true; 363 packet.Header.Resent = true;
360 QueuePacket(packet, ThrottleOutPacketType.Resend, 364 QueuePacket(packet, ThrottleOutPacketType.Resend,
361 data.Identifier); 365 data.Identifier);
@@ -372,7 +376,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
372 if (!m_ReliableIsImportant || !packet.Header.Reliable) 376 if (!m_ReliableIsImportant || !packet.Header.Reliable)
373 { 377 {
374 if (!m_ImportantPackets.Contains(packet.Type)) 378 if (!m_ImportantPackets.Contains(packet.Type))
379 {
375 m_NeedAck.Remove(packet.Header.Sequence); 380 m_NeedAck.Remove(packet.Header.Sequence);
381
382 //m_log.DebugFormat(
383 // "[CLIENT]: Discarding ack requirement for packet number {0}",
384 // packet.Header.Sequence);
385 }
376 386
377 TriggerOnPacketDrop(packet, data.Identifier); 387 TriggerOnPacketDrop(packet, data.Identifier);
378 388
@@ -611,6 +621,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
611 621
612 lock (m_NeedAck) 622 lock (m_NeedAck)
613 { 623 {
624 //m_log.DebugFormat("[CLIENT]: Received ack for packet sequence number {0}", id);
625
614 if (!m_NeedAck.TryGetValue(id, out data)) 626 if (!m_NeedAck.TryGetValue(id, out data))
615 return; 627 return;
616 628
@@ -691,7 +703,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
691 { 703 {
692 } 704 }
693 705
694 m_NeedAck.Add(key, new AckData(packet, null)); 706 m_NeedAck.Add(key, new AckData(packet, null, System.Environment.TickCount));
695 } 707 }
696 708
697 m_Sequence = info.sequence; 709 m_Sequence = info.sequence;
@@ -741,8 +753,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
741 { 753 {
742 Packet packet = item.Packet; 754 Packet packet = item.Packet;
743 755
744 // Keep track of when this packet was sent out
745 item.TickCount = System.Environment.TickCount;
746 756
747 // Assign sequence number here to prevent out of order packets 757 // Assign sequence number here to prevent out of order packets
748 if (packet.Header.Sequence == 0) 758 if (packet.Header.Sequence == 0)
@@ -755,8 +765,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
755 if (packet.Header.Reliable) 765 if (packet.Header.Reliable)
756 { 766 {
757 m_UnackedBytes += packet.ToBytes().Length; 767 m_UnackedBytes += packet.ToBytes().Length;
768
769 // Keep track of when this packet was sent out
758 m_NeedAck[packet.Header.Sequence] = new AckData(packet, 770 m_NeedAck[packet.Header.Sequence] = new AckData(packet,
759 item.Identifier); 771 item.Identifier, System.Environment.TickCount);
760 } 772 }
761 } 773 }
762 } 774 }
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs
index 5020558..1713755 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs
@@ -137,7 +137,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
137 } 137 }
138 138
139 /// <summary> 139 /// <summary>
140 /// 140 /// Send a packet to the given circuit
141 /// </summary> 141 /// </summary>
142 /// <param name="buffer"></param> 142 /// <param name="buffer"></param>
143 /// <param name="size"></param> 143 /// <param name="size"></param>