diff options
author | John Hurliman | 2009-10-02 12:00:42 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-02 12:00:42 -0700 |
commit | 9b342d3e0d85e64e143b9fe1010e4e27135e24ec (patch) | |
tree | 1bbf000b036f333cbe8fe10530c749ea6821a739 /OpenSim | |
parent | Restore the missing image handling to the image manager. The missing (diff) | |
download | opensim-SC_OLD-9b342d3e0d85e64e143b9fe1010e4e27135e24ec.zip opensim-SC_OLD-9b342d3e0d85e64e143b9fe1010e4e27135e24ec.tar.gz opensim-SC_OLD-9b342d3e0d85e64e143b9fe1010e4e27135e24ec.tar.bz2 opensim-SC_OLD-9b342d3e0d85e64e143b9fe1010e4e27135e24ec.tar.xz |
* Changed the flush logic to drop packets in non-transactional streams, and to not fire any "put more data in the queues" callbacks
* Minor tweaks to code formatting to make the callback chain for packet queuing easier to follow
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 14 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs | 58 |
3 files changed, 19 insertions, 59 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index f05c490..43d29fd 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -3131,26 +3131,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3131 | } | 3131 | } |
3132 | } | 3132 | } |
3133 | 3133 | ||
3134 | // Unlike the other timers, this one is only started after | ||
3135 | // the first request is seen. | ||
3136 | |||
3137 | void HandleQueueEmpty(ThrottleOutPacketType queue) | 3134 | void HandleQueueEmpty(ThrottleOutPacketType queue) |
3138 | { | 3135 | { |
3139 | switch (queue) | 3136 | switch (queue) |
3140 | { | 3137 | { |
3141 | case ThrottleOutPacketType.Texture: | 3138 | case ThrottleOutPacketType.Texture: |
3142 | ProcessTextureRequests(); | 3139 | ProcessTextureRequests(); |
3143 | break; | 3140 | break; |
3144 | } | 3141 | } |
3145 | } | 3142 | } |
3146 | 3143 | ||
3147 | void ProcessTextureRequests() | 3144 | void ProcessTextureRequests() |
3148 | { | 3145 | { |
3149 | if (m_imageManager != null) | 3146 | if (m_imageManager != null) |
3150 | { | 3147 | m_imageManager.ProcessImageQueue(m_textureSendLimit, m_textureDataLimit); |
3151 | m_imageManager.ProcessImageQueue(m_textureSendLimit, | ||
3152 | m_textureDataLimit); | ||
3153 | } | ||
3154 | } | 3148 | } |
3155 | 3149 | ||
3156 | void ProcessPrimFullUpdates(object sender, ElapsedEventArgs e) | 3150 | void ProcessPrimFullUpdates(object sender, ElapsedEventArgs e) |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs index 37f6ca7..e98a360 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs | |||
@@ -776,10 +776,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
776 | { | 776 | { |
777 | QueueEmpty handlerQueueEmpty = OnQueueEmpty; | 777 | QueueEmpty handlerQueueEmpty = OnQueueEmpty; |
778 | 778 | ||
779 | if (handlerQueueEmpty == null) | 779 | if (handlerQueueEmpty != null) |
780 | return; | 780 | handlerQueueEmpty(queue); |
781 | |||
782 | handlerQueueEmpty(queue); | ||
783 | } | 781 | } |
784 | 782 | ||
785 | // Convert the packet to bytes and stuff it onto the send queue | 783 | // Convert the packet to bytes and stuff it onto the send queue |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index 8484846..0f1acb1 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs | |||
@@ -273,55 +273,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
273 | { | 273 | { |
274 | lock (this) | 274 | lock (this) |
275 | { | 275 | { |
276 | while (PacketsWaiting()) | 276 | // These categories do not contain transactional packets so we can safely drop any pending data in them |
277 | LandOutgoingPacketQueue.Clear(); | ||
278 | WindOutgoingPacketQueue.Clear(); | ||
279 | CloudOutgoingPacketQueue.Clear(); | ||
280 | TextureOutgoingPacketQueue.Clear(); | ||
281 | AssetOutgoingPacketQueue.Clear(); | ||
282 | |||
283 | // Now comes the fun part.. we dump all remaining resend and task packets into the send queue | ||
284 | while (ResendOutgoingPacketQueue.Count > 0 || TaskOutgoingPacketQueue.Count > 0 || TaskLowpriorityPacketQueue.Count > 0) | ||
277 | { | 285 | { |
278 | //Now comes the fun part.. we dump all our elements into m_packetQueue that we've saved up. | ||
279 | if (ResendOutgoingPacketQueue.Count > 0) | 286 | if (ResendOutgoingPacketQueue.Count > 0) |
280 | { | ||
281 | SendQueue.Enqueue(ResendOutgoingPacketQueue.Dequeue()); | 287 | SendQueue.Enqueue(ResendOutgoingPacketQueue.Dequeue()); |
282 | } | 288 | |
283 | if (LandOutgoingPacketQueue.Count > 0) | ||
284 | { | ||
285 | SendQueue.Enqueue(LandOutgoingPacketQueue.Dequeue()); | ||
286 | TriggerOnQueueEmpty(ThrottleOutPacketType.Land); | ||
287 | } | ||
288 | if (WindOutgoingPacketQueue.Count > 0) | ||
289 | { | ||
290 | SendQueue.Enqueue(WindOutgoingPacketQueue.Dequeue()); | ||
291 | TriggerOnQueueEmpty(ThrottleOutPacketType.Wind); | ||
292 | } | ||
293 | if (CloudOutgoingPacketQueue.Count > 0) | ||
294 | { | ||
295 | SendQueue.Enqueue(CloudOutgoingPacketQueue.Dequeue()); | ||
296 | TriggerOnQueueEmpty(ThrottleOutPacketType.Cloud); | ||
297 | } | ||
298 | bool tasksSent = false; | ||
299 | if (TaskOutgoingPacketQueue.Count > 0) | 289 | if (TaskOutgoingPacketQueue.Count > 0) |
300 | { | ||
301 | tasksSent = true; | ||
302 | SendQueue.PriorityEnqueue(TaskOutgoingPacketQueue.Dequeue()); | 290 | SendQueue.PriorityEnqueue(TaskOutgoingPacketQueue.Dequeue()); |
303 | } | 291 | |
304 | if (TaskLowpriorityPacketQueue.Count > 0) | 292 | if (TaskLowpriorityPacketQueue.Count > 0) |
305 | { | ||
306 | tasksSent = true; | ||
307 | SendQueue.Enqueue(TaskLowpriorityPacketQueue.Dequeue()); | 293 | SendQueue.Enqueue(TaskLowpriorityPacketQueue.Dequeue()); |
308 | } | ||
309 | if (tasksSent) | ||
310 | { | ||
311 | TriggerOnQueueEmpty(ThrottleOutPacketType.Task); | ||
312 | } | ||
313 | if (TextureOutgoingPacketQueue.Count > 0) | ||
314 | { | ||
315 | SendQueue.Enqueue(TextureOutgoingPacketQueue.Dequeue()); | ||
316 | TriggerOnQueueEmpty(ThrottleOutPacketType.Texture); | ||
317 | } | ||
318 | if (AssetOutgoingPacketQueue.Count > 0) | ||
319 | { | ||
320 | SendQueue.Enqueue(AssetOutgoingPacketQueue.Dequeue()); | ||
321 | TriggerOnQueueEmpty(ThrottleOutPacketType.Asset); | ||
322 | } | ||
323 | } | 294 | } |
324 | // m_log.Info("[THROTTLE]: Processed " + throttleLoops + " packets"); | ||
325 | } | 295 | } |
326 | } | 296 | } |
327 | 297 | ||
@@ -530,10 +500,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
530 | { | 500 | { |
531 | QueueEmpty handlerQueueEmpty = OnQueueEmpty; | 501 | QueueEmpty handlerQueueEmpty = OnQueueEmpty; |
532 | 502 | ||
533 | if (handlerQueueEmpty == null) | 503 | if (handlerQueueEmpty != null) |
534 | return; | 504 | handlerQueueEmpty(queue); |
535 | |||
536 | handlerQueueEmpty(queue); | ||
537 | } | 505 | } |
538 | 506 | ||
539 | private void ThrottleTimerElapsed(object sender, ElapsedEventArgs e) | 507 | private void ThrottleTimerElapsed(object sender, ElapsedEventArgs e) |