From 1e6056c24b1a474a3bd2f95544326db83558c691 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 19 Mar 2009 16:51:21 +0000 Subject: * Add necessary locking to BaseHttpServer.RemoveHTTPHandler() --- OpenSim/Framework/Servers/BaseHttpServer.cs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index 18b53b1..efa71f2 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs @@ -180,7 +180,7 @@ namespace OpenSim.Framework.Servers /// /// http://: /// - /// if the method starts with a slash. For example, AddHTTPHandler("/object/", ...) on a standalone region + /// if the method name starts with a slash. For example, AddHTTPHandler("/object/", ...) on a standalone region /// server will register a handler that can be invoked with either /// /// http://localhost:9000/?method=/object/ @@ -1504,15 +1504,23 @@ namespace OpenSim.Framework.Servers lock (m_streamHandlers) m_streamHandlers.Remove(handlerKey); } + /// + /// Remove an HTTP handler + /// + /// + /// public void RemoveHTTPHandler(string httpMethod, string path) { - if (httpMethod != null && httpMethod.Length == 0) + lock (m_HTTPHandlers) { - m_HTTPHandlers.Remove(path); - return; + if (httpMethod != null && httpMethod.Length == 0) + { + m_HTTPHandlers.Remove(path); + return; + } + + m_HTTPHandlers.Remove(GetHandlerKey(httpMethod, path)); } - - m_HTTPHandlers.Remove(GetHandlerKey(httpMethod, path)); } /// @@ -1540,7 +1548,6 @@ namespace OpenSim.Framework.Servers public bool RemoveLLSDHandler(string path, LLSDMethod handler) { - try { if (handler == m_llsdHandlers[path]) -- cgit v1.1