From c1beb85315aad09197ca7ffaa8ec194346af82cb Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Thu, 20 Mar 2008 20:04:45 +0000
Subject: * First draft resolution of mantis 777, 734, 389 - scripts do not
save in non-home regions * Should work in multi-region standalone and grid
modes * This should also solve other non-home region caps issues (map
requests, RC client inventory requests, etc) * We now pass CAPS information
on to the destination region on region crossing, and set up a CAPS object
when an agent becomes a master * Current limitation is that this will only
work if your http_listener_port is 9000 * This is a very early code cut (lots
of bad practice, hard coding and inefficiency). However, I wanted to get
this out there for feedback and my own sanity. Next few patches will clean
up the mess.
---
OpenSim/Framework/Servers/BaseHttpServer.cs | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Framework/Servers')
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs
index 0fb8314..0f6d79b 100644
--- a/OpenSim/Framework/Servers/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/BaseHttpServer.cs
@@ -70,13 +70,22 @@ namespace OpenSim.Framework.Servers
m_port = port;
}
+ ///
+ /// Add a stream handler to the http server. If the handler already exists, then nothing happens.
+ ///
+ ///
public void AddStreamHandler(IRequestHandler handler)
{
string httpMethod = handler.HttpMethod;
string path = handler.Path;
string handlerKey = GetHandlerKey(httpMethod, path);
- m_streamHandlers.Add(handlerKey, handler);
+
+ 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)
@@ -289,7 +298,7 @@ namespace OpenSim.Framework.Servers
}
else
{
- System.Console.WriteLine("Handler not found for http request " + request.RawUrl);
+ m_log.ErrorFormat("[BASE HTTP SERVER] Handler not found for http request {0}", request.RawUrl);
responseString = "Error";
}
}
@@ -589,7 +598,11 @@ namespace OpenSim.Framework.Servers
public void RemoveStreamHandler(string httpMethod, string path)
{
- m_streamHandlers.Remove(GetHandlerKey(httpMethod, path));
+ string handlerKey = GetHandlerKey(httpMethod, path);
+
+ //m_log.DebugFormat("[BASE HTTP SERVER]: Removing handler key {0}", handlerKey);
+
+ m_streamHandlers.Remove(handlerKey);
}
public void RemoveHTTPHandler(string httpMethod, string path)
--
cgit v1.1