diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index e0cca05..fca7943 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | |||
@@ -650,6 +650,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
650 | // leaving a dequeued packet still waiting to be sent out. Try to | 650 | // leaving a dequeued packet still waiting to be sent out. Try to |
651 | // send it again | 651 | // send it again |
652 | OutgoingPacket nextPacket = m_nextPackets[i]; | 652 | OutgoingPacket nextPacket = m_nextPackets[i]; |
653 | if(nextPacket.Buffer == null) | ||
654 | { | ||
655 | if (m_packetOutboxes[i].Count < 5) | ||
656 | emptyCategories |= CategoryToFlag(i); | ||
657 | continue; | ||
658 | } | ||
653 | if (bucket.RemoveTokens(nextPacket.Buffer.DataLength)) | 659 | if (bucket.RemoveTokens(nextPacket.Buffer.DataLength)) |
654 | { | 660 | { |
655 | // Send the packet | 661 | // Send the packet |
@@ -681,21 +687,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
681 | { | 687 | { |
682 | // A packet was pulled off the queue. See if we have | 688 | // A packet was pulled off the queue. See if we have |
683 | // enough tokens in the bucket to send it out | 689 | // enough tokens in the bucket to send it out |
684 | if (bucket.RemoveTokens(packet.Buffer.DataLength)) | 690 | if(packet.Buffer == null) |
685 | { | 691 | { |
686 | // Send the packet | 692 | // packet canceled elsewhere (by a ack for example) |
687 | m_udpServer.SendPacketFinal(packet); | ||
688 | packetSent = true; | ||
689 | |||
690 | if (queue.Count < 5) | 693 | if (queue.Count < 5) |
691 | emptyCategories |= CategoryToFlag(i); | 694 | emptyCategories |= CategoryToFlag(i); |
692 | } | 695 | } |
693 | else | 696 | else |
694 | { | 697 | { |
695 | // Save the dequeued packet for the next iteration | 698 | if (bucket.RemoveTokens(packet.Buffer.DataLength)) |
696 | m_nextPackets[i] = packet; | 699 | { |
700 | // Send the packet | ||
701 | m_udpServer.SendPacketFinal(packet); | ||
702 | packetSent = true; | ||
703 | |||
704 | if (queue.Count < 5) | ||
705 | emptyCategories |= CategoryToFlag(i); | ||
706 | } | ||
707 | else | ||
708 | { | ||
709 | // Save the dequeued packet for the next iteration | ||
710 | m_nextPackets[i] = packet; | ||
711 | } | ||
697 | } | 712 | } |
698 | |||
699 | } | 713 | } |
700 | else | 714 | else |
701 | { | 715 | { |