aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Base/HttpServerBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Server/Base/HttpServerBase.cs')
-rw-r--r--OpenSim/Server/Base/HttpServerBase.cs18
1 files changed, 18 insertions, 0 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;