aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server
diff options
context:
space:
mode:
authorMelanie2009-09-28 22:48:57 +0100
committerMelanie2009-09-28 22:48:57 +0100
commita1aa362866fc59d331780ac799beee4a6d2613c6 (patch)
tree61b52240126221a612c22d155ce9446359b503fd /OpenSim/Server
parentBump main version to 0.6.8-Dev (diff)
downloadopensim-SC-a1aa362866fc59d331780ac799beee4a6d2613c6.zip
opensim-SC-a1aa362866fc59d331780ac799beee4a6d2613c6.tar.gz
opensim-SC-a1aa362866fc59d331780ac799beee4a6d2613c6.tar.bz2
opensim-SC-a1aa362866fc59d331780ac799beee4a6d2613c6.tar.xz
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
Diffstat (limited to 'OpenSim/Server')
-rw-r--r--OpenSim/Server/Base/HttpServerBase.cs18
-rw-r--r--OpenSim/Server/ServerMain.cs52
2 files changed, 64 insertions, 6 deletions
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 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic;
29using System.Threading; 30using System.Threading;
30using System.Reflection; 31using System.Reflection;
31using OpenSim.Framework; 32using OpenSim.Framework;
@@ -45,12 +46,27 @@ namespace OpenSim.Server.Base
45 // The http server instance 46 // The http server instance
46 // 47 //
47 protected BaseHttpServer m_HttpServer = null; 48 protected BaseHttpServer m_HttpServer = null;
49 protected uint m_Port = 0;
50 protected Dictionary<uint, BaseHttpServer> m_Servers =
51 new Dictionary<uint, BaseHttpServer>();
48 52
49 public IHttpServer HttpServer 53 public IHttpServer HttpServer
50 { 54 {
51 get { return m_HttpServer; } 55 get { return m_HttpServer; }
52 } 56 }
53 57
58 public IHttpServer GetHttpServer(uint port)
59 {
60 if (port == m_Port)
61 return HttpServer;
62
63 if (m_Servers.ContainsKey(port))
64 return m_Servers[port];
65
66 m_Servers[port] = new BaseHttpServer(port);
67 return m_Servers[port];
68 }
69
54 // Handle all the automagical stuff 70 // Handle all the automagical stuff
55 // 71 //
56 public HttpServerBase(string prompt, string[] args) : base(prompt, args) 72 public HttpServerBase(string prompt, string[] args) : base(prompt, args)
@@ -74,6 +90,8 @@ namespace OpenSim.Server.Base
74 Thread.CurrentThread.Abort(); 90 Thread.CurrentThread.Abort();
75 } 91 }
76 92
93 m_Port = port;
94
77 m_HttpServer = new BaseHttpServer(port); 95 m_HttpServer = new BaseHttpServer(port);
78 96
79 MainServer.Instance = m_HttpServer; 97 MainServer.Instance = m_HttpServer;
diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs
index 77dfebb..8851894 100644
--- a/OpenSim/Server/ServerMain.cs
+++ b/OpenSim/Server/ServerMain.cs
@@ -30,6 +30,7 @@ using log4net;
30using System.Reflection; 30using System.Reflection;
31using System; 31using System;
32using System.Collections.Generic; 32using System.Collections.Generic;
33using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Server.Base; 34using OpenSim.Server.Base;
34using OpenSim.Server.Handlers.Base; 35using OpenSim.Server.Handlers.Base;
35 36
@@ -60,22 +61,61 @@ namespace OpenSim.Server
60 string connList = serverConfig.GetString("ServiceConnectors", String.Empty); 61 string connList = serverConfig.GetString("ServiceConnectors", String.Empty);
61 string[] conns = connList.Split(new char[] {',', ' '}); 62 string[] conns = connList.Split(new char[] {',', ' '});
62 63
63 foreach (string conn in conns) 64 foreach (string c in conns)
64 { 65 {
65 if (conn == String.Empty) 66 if (c == String.Empty)
66 continue; 67 continue;
67 68
69 string configName = String.Empty;
70 string conn = c;
71 uint port = 0;
72
73 string[] split1 = conn.Split(new char[] {'/'});
74 if (split1.Length > 1)
75 {
76 conn = split1[1];
77
78 string[] split2 = split1[0].Split(new char[] {'@'});
79 if (split2.Length > 1)
80 {
81 configName = split2[0];
82 port = Convert.ToUInt32(split2[1]);
83 }
84 else
85 {
86 port = Convert.ToUInt32(split1[0]);
87 }
88 }
68 string[] parts = conn.Split(new char[] {':'}); 89 string[] parts = conn.Split(new char[] {':'});
69 string friendlyName = parts[0]; 90 string friendlyName = parts[0];
70 if (parts.Length > 1) 91 if (parts.Length > 1)
71 friendlyName = parts[1]; 92 friendlyName = parts[1];
72 93
94 IHttpServer server = m_Server.HttpServer;
95 if (port != 0)
96 server = m_Server.GetHttpServer(port);
97
73 m_log.InfoFormat("[SERVER]: Loading {0}", friendlyName); 98 m_log.InfoFormat("[SERVER]: Loading {0}", friendlyName);
74 99
75 Object[] modargs = new Object[] { m_Server.Config, m_Server.HttpServer }; 100 IServiceConnector connector = null;
76 IServiceConnector connector = 101 try
77 ServerUtils.LoadPlugin<IServiceConnector>(conn, 102 {
78 modargs); 103 Object[] modargs = new Object[] { m_Server.Config, server,
104 configName };
105 connector = ServerUtils.LoadPlugin<IServiceConnector>(conn,
106 modargs);
107
108 if (connector == null)
109 {
110 modargs = new Object[] { m_Server.Config, server };
111 connector =
112 ServerUtils.LoadPlugin<IServiceConnector>(conn,
113 modargs);
114 }
115 }
116 catch (Exception)
117 {
118 }
79 119
80 if (connector != null) 120 if (connector != null)
81 { 121 {