aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
diff options
context:
space:
mode:
authorUbitUmarov2019-02-27 10:07:25 +0000
committerUbitUmarov2019-02-27 10:07:25 +0000
commitbcf05afd64d3b38c66d6d117a51e336a7e98dfc3 (patch)
tree86e40c3780aa30a1bb2559a30ff4f48d38d02fd3 /OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
parentavoid packet split on terseupdates (diff)
downloadopensim-SC-bcf05afd64d3b38c66d6d117a51e336a7e98dfc3.zip
opensim-SC-bcf05afd64d3b38c66d6d117a51e336a7e98dfc3.tar.gz
opensim-SC-bcf05afd64d3b38c66d6d117a51e336a7e98dfc3.tar.bz2
opensim-SC-bcf05afd64d3b38c66d6d117a51e336a7e98dfc3.tar.xz
direct encode terseupdates
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs11
1 files changed, 5 insertions, 6 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
index fca7943..d0d2152 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
@@ -575,22 +575,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
575 { 575 {
576 DoubleLocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category]; 576 DoubleLocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category];
577 577
578 if (m_deliverPackets == false) 578 if (forceQueue || m_deliverPackets == false)
579 { 579 {
580 queue.Enqueue(packet, highPriority); 580 queue.Enqueue(packet, highPriority);
581 return true; 581 return true;
582 } 582 }
583 583
584 TokenBucket bucket = m_throttleCategories[category]; 584 // need to enqueue if queue is not empty
585
586 // Don't send this packet if queue is not empty
587 if (queue.Count > 0 || m_nextPackets[category] != null) 585 if (queue.Count > 0 || m_nextPackets[category] != null)
588 { 586 {
589 queue.Enqueue(packet, highPriority); 587 queue.Enqueue(packet, highPriority);
590 return true; 588 return true;
591 } 589 }
592 590
593 if (!forceQueue && bucket.CheckTokens(packet.Buffer.DataLength)) 591 // check bandwidth
592 TokenBucket bucket = m_throttleCategories[category];
593 if (bucket.CheckTokens(packet.Buffer.DataLength))
594 { 594 {
595 // enough tokens so it can be sent imediatly by caller 595 // enough tokens so it can be sent imediatly by caller
596 bucket.RemoveTokens(packet.Buffer.DataLength); 596 bucket.RemoveTokens(packet.Buffer.DataLength);
@@ -608,7 +608,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
608 // We don't have a token bucket for this category, so it will not be queued 608 // We don't have a token bucket for this category, so it will not be queued
609 return false; 609 return false;
610 } 610 }
611
612 } 611 }
613 612
614 /// <summary> 613 /// <summary>