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