* 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 followprioritization
parent
3ba36bb4d8
commit
9b342d3e0d
|
@ -3131,26 +3131,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unlike the other timers, this one is only started after
|
|
||||||
// the first request is seen.
|
|
||||||
|
|
||||||
void HandleQueueEmpty(ThrottleOutPacketType queue)
|
void HandleQueueEmpty(ThrottleOutPacketType queue)
|
||||||
{
|
{
|
||||||
switch (queue)
|
switch (queue)
|
||||||
{
|
{
|
||||||
case ThrottleOutPacketType.Texture:
|
case ThrottleOutPacketType.Texture:
|
||||||
ProcessTextureRequests();
|
ProcessTextureRequests();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcessTextureRequests()
|
void ProcessTextureRequests()
|
||||||
{
|
{
|
||||||
if (m_imageManager != null)
|
if (m_imageManager != null)
|
||||||
{
|
m_imageManager.ProcessImageQueue(m_textureSendLimit, m_textureDataLimit);
|
||||||
m_imageManager.ProcessImageQueue(m_textureSendLimit,
|
|
||||||
m_textureDataLimit);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcessPrimFullUpdates(object sender, ElapsedEventArgs e)
|
void ProcessPrimFullUpdates(object sender, ElapsedEventArgs e)
|
||||||
|
|
|
@ -776,10 +776,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
QueueEmpty handlerQueueEmpty = OnQueueEmpty;
|
QueueEmpty handlerQueueEmpty = OnQueueEmpty;
|
||||||
|
|
||||||
if (handlerQueueEmpty == null)
|
if (handlerQueueEmpty != null)
|
||||||
return;
|
handlerQueueEmpty(queue);
|
||||||
|
|
||||||
handlerQueueEmpty(queue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert the packet to bytes and stuff it onto the send queue
|
// Convert the packet to bytes and stuff it onto the send queue
|
||||||
|
|
|
@ -273,55 +273,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
lock (this)
|
lock (this)
|
||||||
{
|
{
|
||||||
while (PacketsWaiting())
|
// These categories do not contain transactional packets so we can safely drop any pending data in them
|
||||||
|
LandOutgoingPacketQueue.Clear();
|
||||||
|
WindOutgoingPacketQueue.Clear();
|
||||||
|
CloudOutgoingPacketQueue.Clear();
|
||||||
|
TextureOutgoingPacketQueue.Clear();
|
||||||
|
AssetOutgoingPacketQueue.Clear();
|
||||||
|
|
||||||
|
// Now comes the fun part.. we dump all remaining resend and task packets into the send queue
|
||||||
|
while (ResendOutgoingPacketQueue.Count > 0 || TaskOutgoingPacketQueue.Count > 0 || TaskLowpriorityPacketQueue.Count > 0)
|
||||||
{
|
{
|
||||||
//Now comes the fun part.. we dump all our elements into m_packetQueue that we've saved up.
|
|
||||||
if (ResendOutgoingPacketQueue.Count > 0)
|
if (ResendOutgoingPacketQueue.Count > 0)
|
||||||
{
|
|
||||||
SendQueue.Enqueue(ResendOutgoingPacketQueue.Dequeue());
|
SendQueue.Enqueue(ResendOutgoingPacketQueue.Dequeue());
|
||||||
}
|
|
||||||
if (LandOutgoingPacketQueue.Count > 0)
|
|
||||||
{
|
|
||||||
SendQueue.Enqueue(LandOutgoingPacketQueue.Dequeue());
|
|
||||||
TriggerOnQueueEmpty(ThrottleOutPacketType.Land);
|
|
||||||
}
|
|
||||||
if (WindOutgoingPacketQueue.Count > 0)
|
|
||||||
{
|
|
||||||
SendQueue.Enqueue(WindOutgoingPacketQueue.Dequeue());
|
|
||||||
TriggerOnQueueEmpty(ThrottleOutPacketType.Wind);
|
|
||||||
}
|
|
||||||
if (CloudOutgoingPacketQueue.Count > 0)
|
|
||||||
{
|
|
||||||
SendQueue.Enqueue(CloudOutgoingPacketQueue.Dequeue());
|
|
||||||
TriggerOnQueueEmpty(ThrottleOutPacketType.Cloud);
|
|
||||||
}
|
|
||||||
bool tasksSent = false;
|
|
||||||
if (TaskOutgoingPacketQueue.Count > 0)
|
if (TaskOutgoingPacketQueue.Count > 0)
|
||||||
{
|
|
||||||
tasksSent = true;
|
|
||||||
SendQueue.PriorityEnqueue(TaskOutgoingPacketQueue.Dequeue());
|
SendQueue.PriorityEnqueue(TaskOutgoingPacketQueue.Dequeue());
|
||||||
}
|
|
||||||
if (TaskLowpriorityPacketQueue.Count > 0)
|
if (TaskLowpriorityPacketQueue.Count > 0)
|
||||||
{
|
|
||||||
tasksSent = true;
|
|
||||||
SendQueue.Enqueue(TaskLowpriorityPacketQueue.Dequeue());
|
SendQueue.Enqueue(TaskLowpriorityPacketQueue.Dequeue());
|
||||||
}
|
|
||||||
if (tasksSent)
|
|
||||||
{
|
|
||||||
TriggerOnQueueEmpty(ThrottleOutPacketType.Task);
|
|
||||||
}
|
|
||||||
if (TextureOutgoingPacketQueue.Count > 0)
|
|
||||||
{
|
|
||||||
SendQueue.Enqueue(TextureOutgoingPacketQueue.Dequeue());
|
|
||||||
TriggerOnQueueEmpty(ThrottleOutPacketType.Texture);
|
|
||||||
}
|
|
||||||
if (AssetOutgoingPacketQueue.Count > 0)
|
|
||||||
{
|
|
||||||
SendQueue.Enqueue(AssetOutgoingPacketQueue.Dequeue());
|
|
||||||
TriggerOnQueueEmpty(ThrottleOutPacketType.Asset);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// m_log.Info("[THROTTLE]: Processed " + throttleLoops + " packets");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -530,10 +500,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
QueueEmpty handlerQueueEmpty = OnQueueEmpty;
|
QueueEmpty handlerQueueEmpty = OnQueueEmpty;
|
||||||
|
|
||||||
if (handlerQueueEmpty == null)
|
if (handlerQueueEmpty != null)
|
||||||
return;
|
handlerQueueEmpty(queue);
|
||||||
|
|
||||||
handlerQueueEmpty(queue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ThrottleTimerElapsed(object sender, ElapsedEventArgs e)
|
private void ThrottleTimerElapsed(object sender, ElapsedEventArgs e)
|
||||||
|
|
Loading…
Reference in New Issue