diff options
author | Justin Clark-Casey (justincc) | 2012-06-15 01:24:36 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-06-15 01:24:36 +0100 |
commit | 478acfff34b94c7c42bdb927be531b669c43af72 (patch) | |
tree | 7ae0a11b9ebc3ff37b9add3e8800cf3fd2963716 /OpenSim/Framework/Servers/MainServer.cs | |
parent | Make XMLRPCModule use an existing HTTP server if one already exists on the de... (diff) | |
download | opensim-SC_OLD-478acfff34b94c7c42bdb927be531b669c43af72.zip opensim-SC_OLD-478acfff34b94c7c42bdb927be531b669c43af72.tar.gz opensim-SC_OLD-478acfff34b94c7c42bdb927be531b669c43af72.tar.bz2 opensim-SC_OLD-478acfff34b94c7c42bdb927be531b669c43af72.tar.xz |
When setting debug http level, do this for all known http servers, not just the main instance.
Diffstat (limited to 'OpenSim/Framework/Servers/MainServer.cs')
-rw-r--r-- | OpenSim/Framework/Servers/MainServer.cs | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs index ea972ef..efac6e1 100644 --- a/OpenSim/Framework/Servers/MainServer.cs +++ b/OpenSim/Framework/Servers/MainServer.cs | |||
@@ -38,8 +38,23 @@ namespace OpenSim.Framework.Servers | |||
38 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 38 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
39 | 39 | ||
40 | private static BaseHttpServer instance = null; | 40 | private static BaseHttpServer instance = null; |
41 | private static Dictionary<uint, BaseHttpServer> m_Servers = | 41 | private static Dictionary<uint, BaseHttpServer> m_Servers = new Dictionary<uint, BaseHttpServer>(); |
42 | new Dictionary<uint, BaseHttpServer>(); | 42 | |
43 | public static int DebugLevel | ||
44 | { | ||
45 | get { return s_debugLevel; } | ||
46 | set | ||
47 | { | ||
48 | s_debugLevel = value; | ||
49 | Instance.DebugLevel = s_debugLevel; | ||
50 | |||
51 | lock (m_Servers) | ||
52 | foreach (BaseHttpServer server in m_Servers.Values) | ||
53 | server.DebugLevel = s_debugLevel; | ||
54 | } | ||
55 | } | ||
56 | |||
57 | private static int s_debugLevel; | ||
43 | 58 | ||
44 | public static BaseHttpServer Instance | 59 | public static BaseHttpServer Instance |
45 | { | 60 | { |
@@ -53,7 +68,8 @@ namespace OpenSim.Framework.Servers | |||
53 | /// <param name='server'></param> | 68 | /// <param name='server'></param> |
54 | public static void AddHttpServer(BaseHttpServer server) | 69 | public static void AddHttpServer(BaseHttpServer server) |
55 | { | 70 | { |
56 | m_Servers.Add(server.Port, server); | 71 | lock (m_Servers) |
72 | m_Servers.Add(server.Port, server); | ||
57 | } | 73 | } |
58 | 74 | ||
59 | /// <summary> | 75 | /// <summary> |
@@ -87,18 +103,21 @@ namespace OpenSim.Framework.Servers | |||
87 | if (instance != null && port == Instance.Port) | 103 | if (instance != null && port == Instance.Port) |
88 | return Instance; | 104 | return Instance; |
89 | 105 | ||
90 | if (m_Servers.ContainsKey(port)) | 106 | lock (m_Servers) |
91 | return m_Servers[port]; | 107 | { |
108 | if (m_Servers.ContainsKey(port)) | ||
109 | return m_Servers[port]; | ||
92 | 110 | ||
93 | m_Servers[port] = new BaseHttpServer(port); | 111 | m_Servers[port] = new BaseHttpServer(port); |
94 | 112 | ||
95 | if (ipaddr != null) | 113 | if (ipaddr != null) |
96 | m_Servers[port].ListenIPAddress = ipaddr; | 114 | m_Servers[port].ListenIPAddress = ipaddr; |
97 | 115 | ||
98 | m_log.InfoFormat("[MAIN HTTP SERVER]: Starting main http server on port {0}", port); | 116 | m_log.InfoFormat("[MAIN HTTP SERVER]: Starting main http server on port {0}", port); |
99 | m_Servers[port].Start(); | 117 | m_Servers[port].Start(); |
118 | } | ||
100 | 119 | ||
101 | return m_Servers[port]; | 120 | return m_Servers[port]; |
102 | } | 121 | } |
103 | } | 122 | } |
104 | } | 123 | } \ No newline at end of file |