aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Base
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Server/Base')
-rw-r--r--OpenSim/Server/Base/HttpServerBase.cs28
-rw-r--r--OpenSim/Server/Base/ServerUtils.cs8
2 files changed, 33 insertions, 3 deletions
diff --git a/OpenSim/Server/Base/HttpServerBase.cs b/OpenSim/Server/Base/HttpServerBase.cs
index 791e1ef..ed0210f 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;
@@ -40,17 +41,40 @@ namespace OpenSim.Server.Base
40 { 41 {
41 // Logger 42 // Logger
42 // 43 //
43 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 private static readonly ILog m_Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 45
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 uint DefaultPort
59 {
60 get { return m_Port; }
61 }
62
63 public IHttpServer GetHttpServer(uint port)
64 {
65 m_Log.InfoFormat("[SERVER]: Requested port {0}", port);
66 if (port == m_Port)
67 return HttpServer;
68
69 if (m_Servers.ContainsKey(port))
70 return m_Servers[port];
71
72 m_Servers[port] = new BaseHttpServer(port);
73 m_Servers[port].Start();
74
75 return m_Servers[port];
76 }
77
54 // Handle all the automagical stuff 78 // Handle all the automagical stuff
55 // 79 //
56 public HttpServerBase(string prompt, string[] args) : base(prompt, args) 80 public HttpServerBase(string prompt, string[] args) : base(prompt, args)
@@ -74,6 +98,8 @@ namespace OpenSim.Server.Base
74 Thread.CurrentThread.Abort(); 98 Thread.CurrentThread.Abort();
75 } 99 }
76 100
101 m_Port = port;
102
77 m_HttpServer = new BaseHttpServer(port); 103 m_HttpServer = new BaseHttpServer(port);
78 104
79 MainServer.Instance = m_HttpServer; 105 MainServer.Instance = m_HttpServer;
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs
index 6c2b3ed..2340645 100644
--- a/OpenSim/Server/Base/ServerUtils.cs
+++ b/OpenSim/Server/Base/ServerUtils.cs
@@ -141,7 +141,9 @@ namespace OpenSim.Server.Base
141 } 141 }
142 catch (Exception e) 142 catch (Exception e)
143 { 143 {
144 m_log.ErrorFormat("Error loading plugin from {0}, exception {1}", dllName, e.InnerException); 144 if (!(e is System.MissingMethodException))
145 m_log.ErrorFormat("Error loading plugin from {0}, exception {1}", dllName, e.InnerException);
146 return null;
145 } 147 }
146 148
147 return plug; 149 return plug;
@@ -258,6 +260,8 @@ namespace OpenSim.Server.Base
258 260
259 public static Dictionary<string, object> ParseXmlResponse(string data) 261 public static Dictionary<string, object> ParseXmlResponse(string data)
260 { 262 {
263 //m_log.DebugFormat("[XXX]: received xml string: {0}", data);
264
261 Dictionary<string, object> ret = new Dictionary<string, object>(); 265 Dictionary<string, object> ret = new Dictionary<string, object>();
262 266
263 XmlDocument doc = new XmlDocument(); 267 XmlDocument doc = new XmlDocument();
@@ -284,7 +288,7 @@ namespace OpenSim.Server.Base
284 288
285 foreach (XmlNode part in partL) 289 foreach (XmlNode part in partL)
286 { 290 {
287 XmlNode type = part.Attributes.GetNamedItem("Type"); 291 XmlNode type = part.Attributes.GetNamedItem("type");
288 if (type == null || type.Value != "List") 292 if (type == null || type.Value != "List")
289 { 293 {
290 ret[part.Name] = part.InnerText; 294 ret[part.Name] = part.InnerText;