mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
Merge branch 'master' into httptests
This commit is contained in:
@@ -4632,28 +4632,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
void HandleQueueEmpty(ThrottleOutPacketTypeFlags categories)
|
||||
{
|
||||
// if (!m_udpServer.IsRunningOutbound)
|
||||
// return;
|
||||
|
||||
if ((categories & ThrottleOutPacketTypeFlags.Task) != 0)
|
||||
{
|
||||
// if (!m_udpServer.IsRunningOutbound)
|
||||
// return;
|
||||
/*
|
||||
if (m_maxUpdates == 0 || m_LastQueueFill == 0)
|
||||
{
|
||||
m_maxUpdates = m_udpServer.PrimUpdatesPerCallback;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Util.EnvironmentTickCountSubtract(m_LastQueueFill) < 200)
|
||||
m_maxUpdates += 5;
|
||||
else
|
||||
m_maxUpdates = m_maxUpdates >> 1;
|
||||
}
|
||||
m_maxUpdates = Util.Clamp<Int32>(m_maxUpdates,10,500);
|
||||
m_LastQueueFill = Util.EnvironmentTickCount();
|
||||
*/
|
||||
int maxUpdateBytes = m_udpClient.GetCatBytesCanSend(ThrottleOutPacketType.Task, 30);
|
||||
|
||||
if (m_entityUpdates.Count > 0)
|
||||
@@ -4669,23 +4649,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
internal bool HandleHasUpdates(ThrottleOutPacketTypeFlags categories)
|
||||
{
|
||||
bool hasUpdates = false;
|
||||
|
||||
if ((categories & ThrottleOutPacketTypeFlags.Task) != 0)
|
||||
{
|
||||
if (m_entityUpdates.Count > 0)
|
||||
hasUpdates = true;
|
||||
else if (m_entityProps.Count > 0)
|
||||
hasUpdates = true;
|
||||
return true;
|
||||
if (m_entityProps.Count > 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((categories & ThrottleOutPacketTypeFlags.Texture) != 0)
|
||||
{
|
||||
if (ImageManager.HasUpdates())
|
||||
hasUpdates = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
return hasUpdates;
|
||||
return false;
|
||||
}
|
||||
|
||||
public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID)
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// <summary>Total number of sent packets that we have reported to the OnPacketStats event(s)</summary>
|
||||
private int m_packetsSentReported;
|
||||
/// <summary>Holds the Environment.TickCount value of when the next OnQueueEmpty can be fired</summary>
|
||||
private int m_nextOnQueueEmpty = 1;
|
||||
private double m_nextOnQueueEmpty = 0;
|
||||
|
||||
/// <summary>Throttle bucket for this agent's connection</summary>
|
||||
private readonly AdaptiveTokenBucket m_throttleClient;
|
||||
@@ -771,7 +771,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
RTO = Math.Min(RTO * 2, m_maxRTO);
|
||||
}
|
||||
|
||||
const int MIN_CALLBACK_MS = 20;
|
||||
const double MIN_CALLBACK_MS = 20.0;
|
||||
private bool m_isQueueEmptyRunning;
|
||||
|
||||
/// <summary>
|
||||
/// Does an early check to see if this queue empty callback is already
|
||||
@@ -782,35 +783,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
if (!m_isQueueEmptyRunning)
|
||||
{
|
||||
int start = Environment.TickCount & Int32.MaxValue;
|
||||
if (!HasUpdates(categories))
|
||||
return;
|
||||
|
||||
double start = Util.GetTimeStampMS();
|
||||
if (start < m_nextOnQueueEmpty)
|
||||
return;
|
||||
|
||||
m_isQueueEmptyRunning = true;
|
||||
|
||||
m_nextOnQueueEmpty = start + MIN_CALLBACK_MS;
|
||||
if (m_nextOnQueueEmpty == 0)
|
||||
m_nextOnQueueEmpty = 1;
|
||||
|
||||
if (HasUpdates(categories))
|
||||
{
|
||||
if (!m_udpServer.OqrEngine.IsRunning)
|
||||
{
|
||||
// Asynchronously run the callback
|
||||
Util.FireAndForget(FireQueueEmpty, categories, "LLUDPClient.BeginFireQueueEmpty");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_udpServer.OqrEngine.QueueJob(AgentID.ToString(), () => FireQueueEmpty(categories));
|
||||
}
|
||||
}
|
||||
// Asynchronously run the callback
|
||||
if (m_udpServer.OqrEngine.IsRunning)
|
||||
m_udpServer.OqrEngine.QueueJob(AgentID.ToString(), () => FireQueueEmpty(categories));
|
||||
else
|
||||
m_isQueueEmptyRunning = false;
|
||||
Util.FireAndForget(FireQueueEmpty, categories, "LLUDPClient.BeginFireQueueEmpty");
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_isQueueEmptyRunning;
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -100,11 +100,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
BrustTime = (float)throttleConfig.GetInt("client_throttle_burtsTimeMS", 10);
|
||||
BrustTime *= 1e-3f;
|
||||
|
||||
AdaptiveThrottlesEnabled = throttleConfig.GetBoolean("enable_adaptive_throttles", false);
|
||||
// Adaptive is broken
|
||||
// AdaptiveThrottlesEnabled = throttleConfig.GetBoolean("enable_adaptive_throttles", false);
|
||||
AdaptiveThrottlesEnabled = false;
|
||||
MinimumAdaptiveThrottleRate = throttleConfig.GetInt("adaptive_throttle_min_bps", 32000);
|
||||
|
||||
CannibalizeTextureRate = (double)throttleConfig.GetFloat("CannibalizeTextureRate", 0.0f);
|
||||
CannibalizeTextureRate = Util.Clamp<double>(CannibalizeTextureRate,0.0, 0.9);
|
||||
// http textures do use udp bandwidth setting
|
||||
// CannibalizeTextureRate = (double)throttleConfig.GetFloat("CannibalizeTextureRate", 0.0f);
|
||||
// CannibalizeTextureRate = Util.Clamp<double>(CannibalizeTextureRate,0.0, 0.9);
|
||||
CannibalizeTextureRate = 0f;
|
||||
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user