read m_rpcHandlersKeepAlive under appropriate lock

bulletsim
Justin Clark-Casey (justincc) 2011-08-22 02:25:58 +01:00
parent c587b0a3a3
commit d74686fd51
1 changed files with 4 additions and 2 deletions

View File

@ -803,9 +803,12 @@ namespace OpenSim.Framework.Servers.HttpServer
XmlRpcMethod method;
bool methodWasFound;
bool keepAlive = false;
lock (m_rpcHandlers)
{
methodWasFound = m_rpcHandlers.TryGetValue(methodName, out method);
if (methodWasFound)
keepAlive = m_rpcHandlersKeepAlive[methodName];
}
if (methodWasFound)
@ -824,7 +827,6 @@ namespace OpenSim.Framework.Servers.HttpServer
}
xmlRprcRequest.Params.Add(request.Headers.Get(xff)); // Param[3]
try
{
xmlRpcResponse = method(xmlRprcRequest, request.RemoteIPEndPoint);
@ -846,7 +848,7 @@ namespace OpenSim.Framework.Servers.HttpServer
}
// if the method wasn't found, we can't determine KeepAlive state anyway, so lets do it only here
response.KeepAlive = m_rpcHandlersKeepAlive[methodName];
response.KeepAlive = keepAlive;
}
else
{