From a1aa362866fc59d331780ac799beee4a6d2613c6 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 28 Sep 2009 22:48:57 +0100 Subject: Allow the notation config_name@port/dll_name:class_name as a handler spec in OpenSim.Server.ini This allows things like "8003/AssetServirce.dll local@8004/InventoryService.dll" The config name is not yet supported by any modules --- OpenSim/Server/Base/HttpServerBase.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'OpenSim/Server/Base/HttpServerBase.cs') diff --git a/OpenSim/Server/Base/HttpServerBase.cs b/OpenSim/Server/Base/HttpServerBase.cs index 791e1ef..6a1f37c 100644 --- a/OpenSim/Server/Base/HttpServerBase.cs +++ b/OpenSim/Server/Base/HttpServerBase.cs @@ -26,6 +26,7 @@ */ using System; +using System.Collections.Generic; using System.Threading; using System.Reflection; using OpenSim.Framework; @@ -45,12 +46,27 @@ namespace OpenSim.Server.Base // The http server instance // protected BaseHttpServer m_HttpServer = null; + protected uint m_Port = 0; + protected Dictionary m_Servers = + new Dictionary(); public IHttpServer HttpServer { get { return m_HttpServer; } } + public IHttpServer GetHttpServer(uint port) + { + if (port == m_Port) + return HttpServer; + + if (m_Servers.ContainsKey(port)) + return m_Servers[port]; + + m_Servers[port] = new BaseHttpServer(port); + return m_Servers[port]; + } + // Handle all the automagical stuff // public HttpServerBase(string prompt, string[] args) : base(prompt, args) @@ -74,6 +90,8 @@ namespace OpenSim.Server.Base Thread.CurrentThread.Abort(); } + m_Port = port; + m_HttpServer = new BaseHttpServer(port); MainServer.Instance = m_HttpServer; -- cgit v1.1 From 1096103d66d7391943efa85553f46a633cf0d3ee Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 29 Sep 2009 09:44:12 +0100 Subject: Fix loading modules with alternate configurations and ports into ROBUST. Make all current modules support the configuration name option --- OpenSim/Server/Base/HttpServerBase.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'OpenSim/Server/Base/HttpServerBase.cs') diff --git a/OpenSim/Server/Base/HttpServerBase.cs b/OpenSim/Server/Base/HttpServerBase.cs index 6a1f37c..ed0210f 100644 --- a/OpenSim/Server/Base/HttpServerBase.cs +++ b/OpenSim/Server/Base/HttpServerBase.cs @@ -41,7 +41,7 @@ namespace OpenSim.Server.Base { // Logger // - // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // The http server instance // @@ -55,8 +55,14 @@ namespace OpenSim.Server.Base get { return m_HttpServer; } } + public uint DefaultPort + { + get { return m_Port; } + } + public IHttpServer GetHttpServer(uint port) { + m_Log.InfoFormat("[SERVER]: Requested port {0}", port); if (port == m_Port) return HttpServer; @@ -64,6 +70,8 @@ namespace OpenSim.Server.Base return m_Servers[port]; m_Servers[port] = new BaseHttpServer(port); + m_Servers[port].Start(); + return m_Servers[port]; } -- cgit v1.1