aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs25
1 files changed, 14 insertions, 11 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
index 5877779..9ded390 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
@@ -72,14 +72,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
72 m_imageManager = imageManager; 72 m_imageManager = imageManager;
73 } 73 }
74 74
75 public bool SendPackets(LLClientView client, int maxpack) 75 /// <summary>
76 /// Sends packets for this texture to a client until packetsToSend is
77 /// hit or the transfer completes
78 /// </summary>
79 /// <param name="client">Reference to the client that the packets are destined for</param>
80 /// <param name="packetsToSend">Maximum number of packets to send during this call</param>
81 /// <param name="packetsSent">Number of packets sent during this call</param>
82 /// <returns>True if the transfer completes at the current discard level, otherwise false</returns>
83 public bool SendPackets(LLClientView client, int packetsToSend, out int packetsSent)
76 { 84 {
77 if (client == null) 85 packetsSent = 0;
78 return false;
79 86
80 if (m_currentPacket <= m_stopPacket) 87 if (m_currentPacket <= m_stopPacket)
81 { 88 {
82 int count = 0;
83 bool sendMore = true; 89 bool sendMore = true;
84 90
85 if (!m_sentInfo || (m_currentPacket == 0)) 91 if (!m_sentInfo || (m_currentPacket == 0))
@@ -88,25 +94,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
88 94
89 m_sentInfo = true; 95 m_sentInfo = true;
90 ++m_currentPacket; 96 ++m_currentPacket;
91 ++count; 97 ++packetsSent;
92 } 98 }
93 if (m_currentPacket < 2) 99 if (m_currentPacket < 2)
94 { 100 {
95 m_currentPacket = 2; 101 m_currentPacket = 2;
96 } 102 }
97 103
98 while (sendMore && count < maxpack && m_currentPacket <= m_stopPacket) 104 while (sendMore && packetsSent < packetsToSend && m_currentPacket <= m_stopPacket)
99 { 105 {
100 sendMore = SendPacket(client); 106 sendMore = SendPacket(client);
101 ++m_currentPacket; 107 ++m_currentPacket;
102 ++count; 108 ++packetsSent;
103 } 109 }
104
105 if (m_currentPacket > m_stopPacket)
106 return true;
107 } 110 }
108 111
109 return false; 112 return (m_currentPacket > m_stopPacket);
110 } 113 }
111 114
112 public void RunUpdate() 115 public void RunUpdate()