attempting to get to the bottom of unresponsive grids servers by
adding back in a few messages on exceptions.0.6.0-stable
parent
a84456c239
commit
22c7845e0c
|
@ -84,12 +84,14 @@ namespace OpenSim.Framework.Servers
|
|||
|
||||
string handlerKey = GetHandlerKey(httpMethod, path);
|
||||
|
||||
lock(m_streamHandlers) {
|
||||
if (!m_streamHandlers.ContainsKey(handlerKey))
|
||||
{
|
||||
//m_log.DebugFormat("[BASE HTTP SERVER]: Adding handler key {0}", handlerKey);
|
||||
m_streamHandlers.Add(handlerKey, handler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetHandlerKey(string httpMethod, string path)
|
||||
{
|
||||
|
@ -98,11 +100,13 @@ namespace OpenSim.Framework.Servers
|
|||
|
||||
public bool AddXmlRPCHandler(string method, XmlRpcMethod handler)
|
||||
{
|
||||
lock(m_rpcHandlers) {
|
||||
if (!m_rpcHandlers.ContainsKey(method))
|
||||
{
|
||||
m_rpcHandlers.Add(method, handler);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//must already have a handler for that path so return false
|
||||
return false;
|
||||
|
@ -110,11 +114,13 @@ namespace OpenSim.Framework.Servers
|
|||
|
||||
public bool AddHTTPHandler(string method, GenericHTTPMethod handler)
|
||||
{
|
||||
lock(m_HTTPHandlers) {
|
||||
if (!m_HTTPHandlers.ContainsKey(method))
|
||||
{
|
||||
m_HTTPHandlers.Add(method, handler);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//must already have a handler for that path so return false
|
||||
return false;
|
||||
|
@ -126,11 +132,13 @@ namespace OpenSim.Framework.Servers
|
|||
|
||||
public bool AddAgentHandler(string agent, IHttpAgentHandler handler)
|
||||
{
|
||||
lock(m_agentHandlers) {
|
||||
if (!m_agentHandlers.ContainsKey(agent))
|
||||
{
|
||||
m_agentHandlers.Add(agent, handler);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//must already have a handler for that path so return false
|
||||
return false;
|
||||
|
@ -156,18 +164,19 @@ namespace OpenSim.Framework.Servers
|
|||
OSHttpRequest request = new OSHttpRequest(context.Request);
|
||||
OSHttpResponse response = new OSHttpResponse(context.Response);
|
||||
|
||||
// user agent based requests? not sure where this actually gets used from
|
||||
if (request.UserAgent != null)
|
||||
{
|
||||
|
||||
IHttpAgentHandler agentHandler;
|
||||
|
||||
if (TryGetAgentHandler(request, response, out agentHandler))
|
||||
{
|
||||
// m_log.DebugFormat("[HTTP-AGENT] Handler located for {0}", request.UserAgent);
|
||||
if (HandleAgentRequest(agentHandler, request, response))
|
||||
if (HandleAgentRequest(agentHandler, request, response)) {
|
||||
m_log.DebugFormat("[HTTP-AGENT] Handler located for {0}", request.UserAgent);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IRequestHandler requestHandler;
|
||||
response.KeepAlive = false;
|
||||
|
@ -235,7 +244,7 @@ namespace OpenSim.Framework.Servers
|
|||
return;
|
||||
}
|
||||
}
|
||||
catch (SocketException)
|
||||
catch (SocketException e)
|
||||
{
|
||||
// At least on linux, it appears that if the client makes a request without requiring the response,
|
||||
// an unconnected socket exception is thrown when we close the response output stream. There's no
|
||||
|
@ -244,6 +253,7 @@ namespace OpenSim.Framework.Servers
|
|||
//
|
||||
// An alternative may be to turn off all response write exceptions on the HttpListener, but let's go
|
||||
// with the minimum first
|
||||
m_log.WarnFormat("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux", e);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -403,9 +413,10 @@ namespace OpenSim.Framework.Servers
|
|||
{
|
||||
response.OutputStream.Close();
|
||||
}
|
||||
catch (SocketException)
|
||||
catch (SocketException e)
|
||||
{
|
||||
// This has to be here to prevent a Linux/Mono crash
|
||||
m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue