From e6272b8d56dd7856faf374e7ac29460b4e74f1bb Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 7 Dec 2011 12:28:42 +0000 Subject: [PATCH] Stop also adding an ordinary http handler when we set up a poll http handler. It appears that this is entirely unnecessary since the poll http handlers are dealt with on a separate code path. --- OpenSim/Framework/Console/RemoteConsole.cs | 10 ++-------- .../Servers/HttpServer/BaseHttpServer.cs | 12 +++--------- .../HttpServer/Interfaces/IHttpServer.cs | 4 ++-- .../Caps/EventQueue/EventQueueGetModule.cs | 6 ------ .../CoreModules/Scripting/LSLHttp/UrlModule.cs | 17 ++++++----------- 5 files changed, 13 insertions(+), 36 deletions(-) diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs index 07de27a2fc..eabb62dd01 100644 --- a/OpenSim/Framework/Console/RemoteConsole.cs +++ b/OpenSim/Framework/Console/RemoteConsole.cs @@ -232,9 +232,8 @@ namespace OpenSim.Framework.Console string uri = "/ReadResponses/" + sessionID.ToString() + "/"; - m_Server.AddPollServiceHTTPHandler(uri, HandleHttpPoll, - new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, - sessionID)); + m_Server.AddPollServiceHTTPHandler( + uri, new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, sessionID)); XmlDocument xmldoc = new XmlDocument(); XmlNode xmlnode = xmldoc.CreateNode(XmlNodeType.XmlDeclaration, @@ -266,11 +265,6 @@ namespace OpenSim.Framework.Console return reply; } - private Hashtable HandleHttpPoll(Hashtable request) - { - return new Hashtable(); - } - private Hashtable HandleHttpCloseSession(Hashtable request) { DoExpire(); diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 6bffba511d..a8ece794cd 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -227,21 +227,17 @@ namespace OpenSim.Framework.Servers.HttpServer return new List(m_HTTPHandlers.Keys); } - public bool AddPollServiceHTTPHandler(string methodName, GenericHTTPMethod handler, PollServiceEventArgs args) + public bool AddPollServiceHTTPHandler(string methodName, PollServiceEventArgs args) { - bool pollHandlerResult = false; lock (m_pollHandlers) { if (!m_pollHandlers.ContainsKey(methodName)) { - m_pollHandlers.Add(methodName,args); - pollHandlerResult = true; + m_pollHandlers.Add(methodName, args); + return true; } } - if (pollHandlerResult) - return AddHTTPHandler(methodName, handler); - return false; } @@ -1848,8 +1844,6 @@ namespace OpenSim.Framework.Servers.HttpServer { lock (m_pollHandlers) m_pollHandlers.Remove(path); - - RemoveHTTPHandler(httpMethod, path); } public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler) diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs index fd77984c22..db58f6f468 100644 --- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs @@ -77,8 +77,8 @@ namespace OpenSim.Framework.Servers.HttpServer /// true if the handler was successfully registered, false if a handler with the same name already existed. /// bool AddHTTPHandler(string methodName, GenericHTTPMethod handler); - - bool AddPollServiceHTTPHandler(string methodName, GenericHTTPMethod handler, PollServiceEventArgs args); + + bool AddPollServiceHTTPHandler(string methodName, PollServiceEventArgs args); /// /// Adds a LLSD handler, yay. diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 9f27abc5e7..8ba6f61caa 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs @@ -361,7 +361,6 @@ namespace OpenSim.Region.ClientStack.Linden // This will persist this beyond the expiry of the caps handlers MainServer.Instance.AddPollServiceHTTPHandler( capsBase + EventQueueGetUUID.ToString() + "/", - EventQueuePoll, new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID)); Random rnd = new Random(Environment.TickCount); @@ -578,11 +577,6 @@ namespace OpenSim.Region.ClientStack.Linden // return responsedata; // } - public Hashtable EventQueuePoll(Hashtable request) - { - return new Hashtable(); - } - // public Hashtable EventQueuePath2(Hashtable request) // { // string capuuid = (string)request["uri"]; //path.Replace("/CAPS/EQG/",""); diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 7377ceb0a6..67d99e027a 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs @@ -90,11 +90,6 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp get { return null; } } - private Hashtable HandleHttpPoll(Hashtable request) - { - return new Hashtable(); - } - public string Name { get { return "UrlModule"; } @@ -171,9 +166,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp string uri = "/lslhttp/" + urlcode.ToString() + "/"; - m_HttpServer.AddPollServiceHTTPHandler(uri,HandleHttpPoll, - new PollServiceEventArgs(HttpRequestHandler,HasEvents, GetEvents, NoEvents, - urlcode)); + m_HttpServer.AddPollServiceHTTPHandler( + uri, + new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode)); engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); } @@ -213,9 +208,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp string uri = "/lslhttps/" + urlcode.ToString() + "/"; - m_HttpsServer.AddPollServiceHTTPHandler(uri,HandleHttpPoll, - new PollServiceEventArgs(HttpRequestHandler,HasEvents, GetEvents, NoEvents, - urlcode)); + m_HttpsServer.AddPollServiceHTTPHandler( + uri, + new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode)); engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); }