From c5be401d46dfbb1e47927b4123130c43c6a054b5 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 22 Sep 2009 05:24:22 +0100 Subject: [PATCH] Remove support for executing a handler on poll. It caused other issues --- .../Servers/HttpServer/BaseHttpServer.cs | 38 ++++++------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 5c9fa9bd0d..0198960498 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -337,24 +337,19 @@ namespace OpenSim.Framework.Servers.HttpServer // handled //m_log.Debug("[BASE HTTP SERVER]: Handling Request" + request.RawUrl); - // If the response is null, then we're not going to respond here. This case - // triggers when we're at the head of a HTTP poll - // - if (response != null) + IHttpAgentHandler agentHandler; + + if (TryGetAgentHandler(request, response, out agentHandler)) { - IHttpAgentHandler agentHandler; - - if (TryGetAgentHandler(request, response, out agentHandler)) + if (HandleAgentRequest(agentHandler, request, response)) { - if (HandleAgentRequest(agentHandler, request, response)) - { - return; - } + return; } - - //response.KeepAlive = true; - response.SendChunked = false; } + + //response.KeepAlive = true; + response.SendChunked = false; + IRequestHandler requestHandler; string path = request.RawUrl; @@ -368,8 +363,7 @@ namespace OpenSim.Framework.Servers.HttpServer // Okay, so this is bad, but should be considered temporary until everything is IStreamHandler. byte[] buffer = null; - if (response != null) - response.ContentType = requestHandler.ContentType; // Lets do this defaulting before in case handler has varying content type. + response.ContentType = requestHandler.ContentType; // Lets do this defaulting before in case handler has varying content type. if (requestHandler is IStreamedRequestHandler) @@ -425,12 +419,7 @@ namespace OpenSim.Framework.Servers.HttpServer //m_log.Warn("[HTTP]: " + requestBody); } - // If we're not responding, we dont' care about the reply - // - if (response == null) - HTTPRequestHandler.Handle(path, keysvals); - else - DoHTTPGruntWork(HTTPRequestHandler.Handle(path, keysvals), response); + DoHTTPGruntWork(HTTPRequestHandler.Handle(path, keysvals), response); return; } else @@ -445,11 +434,6 @@ namespace OpenSim.Framework.Servers.HttpServer } } - // The handler has run and we're not yet ready to respond, bail - // - if (response == null) - return; - request.InputStream.Close(); // HTTP IN support. The script engine taes it from here