diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 57ab23d575..527d02cb7a 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -98,7 +98,8 @@ namespace OpenSim.Framework.Servers.HttpServer protected Dictionary m_rpcHandlersKeepAlive = new Dictionary(); protected DefaultLLSDMethod m_defaultLlsdHandler = null; // <-- Moving away from the monolithic.. and going to /registered/ protected Dictionary m_llsdHandlers = new Dictionary(); - protected ConcurrentDictionary m_streamHandlers = new ConcurrentDictionary(); + protected ConcurrentDictionary m_streamHandlers = new ConcurrentDictionary(); + protected ConcurrentDictionary m_simpleStreamHandlers = new ConcurrentDictionary(); protected Dictionary m_HTTPHandlers = new Dictionary(); // protected Dictionary m_agentHandlers = new Dictionary(); protected ConcurrentDictionary m_pollHandlers = @@ -329,7 +330,7 @@ namespace OpenSim.Framework.Servers.HttpServer string path = handler.Path; string handlerKey = GetHandlerKey(httpMethod, path); - // m_log.DebugFormat("[BASE HTTP SERVER]: Adding handler key {0}", handlerKey); + // m_log.DebugFormat("[BASE HTTP SERVER]: Adding handler key {0}", handlerKey); m_streamHandlers.TryAdd(handlerKey, handler); } @@ -342,6 +343,12 @@ namespace OpenSim.Framework.Servers.HttpServer m_streamHandlers.TryAdd(handler.Path, handler); } + public void AddSimpleStreamHandler(ISimpleStreamHandler handler) + { + // m_log.DebugFormat("[BASE HTTP SERVER]: Adding handler key {0}", handlerKey); + m_simpleStreamHandlers.TryAdd(handler.Path, handler); + } + public void AddWebSocketHandler(string servicepath, WebSocketRequestDelegate handler) { lock (m_WebSocketHandlers) @@ -1054,6 +1061,10 @@ namespace OpenSim.Framework.Servers.HttpServer } } + private bool TryGetSimpleStreamHandler(string uripath, out ISimpleStreamHandler handler) + { + return m_simpleStreamHandlers.TryGetValue(uripath, out handler); + } // private bool TryGetAgentHandler(OSHttpRequest request, OSHttpResponse response, out IHttpAgentHandler agentHandler) // { // agentHandler = null; @@ -2117,6 +2128,11 @@ namespace OpenSim.Framework.Servers.HttpServer m_streamHandlers.TryRemove(path, out IRequestHandler dummy); } + public void RemoveSimpleStreamHandler(string path) + { + m_simpleStreamHandlers.TryRemove(path, out ISimpleStreamHandler dummy); + } + public void RemoveHTTPHandler(string httpMethod, string path) { if (path == null) return; // Caps module isn't loaded, tries to remove handler where path = null diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs index 2cfec4513d..7e80e12904 100644 --- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs @@ -78,7 +78,7 @@ namespace OpenSim.Framework.Servers.HttpServer /// bool AddHTTPHandler(string methodName, GenericHTTPMethod handler); - bool AddPollServiceHTTPHandler(string ulr, PollServiceEventArgs args); + bool AddPollServiceHTTPHandler(string uripath, PollServiceEventArgs args); bool AddPollServiceHTTPHandler(PollServiceEventArgs args); void RemovePollServiceHTTPHandler(string url, string path); diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpRequest.cs index 70f3199fc1..07fe37acfb 100644 --- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpRequest.cs +++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpRequest.cs @@ -58,6 +58,7 @@ namespace OpenSim.Framework.Servers.HttpServer IPEndPoint RemoteIPEndPoint { get; } IPEndPoint LocalIPEndPoint { get; } Uri Url { get; } + string UriPath { get; } string UserAgent { get; } } } \ No newline at end of file diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs index 0ba39a6630..5c7f74860b 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs @@ -181,6 +181,11 @@ namespace OpenSim.Framework.Servers.HttpServer get { return m_request.Uri; } } + public string UriPath + { + get { return m_request.UriPath; } + } + public string UserAgent { get { return m_userAgent; }