avoid c# fun things, plus cosmetics

This commit is contained in:
UbitUmarov
2020-07-14 17:54:58 +01:00
parent b2068fd39f
commit f32c0ead05
9 changed files with 112 additions and 50 deletions

View File

@@ -232,7 +232,6 @@ namespace OpenSim.Region.ClientStack.Linden
private HashSet<UUID> dropedResponses = new HashSet<UUID>();
private Scene m_scene;
private ScenePresence m_presence;
public PollServiceAssetEventArgs(string uri, UUID pId, Scene scene) :
base(null, uri, null, null, null, null, pId, int.MaxValue)
{
@@ -245,20 +244,19 @@ namespace OpenSim.Region.ClientStack.Linden
APollResponse response;
if (responses.TryGetValue(requestID, out response))
{
if (m_presence == null)
m_presence = m_scene.GetScenePresence(pId);
ScenePresence sp = m_scene.GetScenePresence(pId);
if (m_presence == null || m_presence.IsDeleted)
if (sp == null || sp.IsDeleted)
return true;
OSHttpResponse resp = response.osresponse;
if(Util.GetTimeStamp() - resp.RequestTS > (resp.RawBufferLen > 2000000 ? 200 : 90))
return m_presence.CapCanSendAsset(2, resp.RawBufferLen);
return sp.CapCanSendAsset(2, resp.RawBufferLen);
if (resp.Priority > 1)
return m_presence.CapCanSendAsset(1, resp.RawBufferLen);
return m_presence.CapCanSendAsset(2, resp.RawBufferLen);
return sp.CapCanSendAsset(1, resp.RawBufferLen);
return sp.CapCanSendAsset(2, resp.RawBufferLen);
}
return false;
}

View File

@@ -748,9 +748,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_nextOnQueueEmpty = start + MIN_CALLBACK_MS;
// Asynchronously run the callback
if (m_udpServer.OqrEngine.IsRunning)
m_udpServer.OqrEngine.QueueJob(AgentID.ToString(), () => FireQueueEmpty(categories));
else
// avoid stupid memory leak
//if (m_udpServer.OqrEngine.IsRunning)
// m_udpServer.OqrEngine.QueueJob(AgentID.ToString(), () => FireQueueEmpty(categories));
//else
Util.FireAndForget(FireQueueEmpty, categories, "LLUDPClient.BeginFireQueueEmpty");
}
}
@@ -764,16 +765,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// signature</param>
public void FireQueueEmpty(object o)
{
ThrottleOutPacketTypeFlags categories = (ThrottleOutPacketTypeFlags)o;
QueueEmpty callback = OnQueueEmpty;
if (callback != null)
{
// if (m_udpServer.IsRunningOutbound)
// {
ThrottleOutPacketTypeFlags categories = (ThrottleOutPacketTypeFlags)o;
try { callback(categories); }
catch (Exception e) { m_log.Error("[LLUDPCLIENT]: OnQueueEmpty(" + categories + ") threw an exception: " + e.Message, e); }
// }
}
m_isQueueEmptyRunning = false;