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 | |
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')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 20 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/MainServer.cs | 41 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 2 |
3 files changed, 41 insertions, 22 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 35a0be4..6b52485 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -53,6 +53,16 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
53 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 53 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
54 | private HttpServerLogWriter httpserverlog = new HttpServerLogWriter(); | 54 | private HttpServerLogWriter httpserverlog = new HttpServerLogWriter(); |
55 | 55 | ||
56 | /// <summary> | ||
57 | /// Control the printing of certain debug messages. | ||
58 | /// </summary> | ||
59 | /// <remarks> | ||
60 | /// If DebugLevel >= 1, then short warnings are logged when receiving bad input data. | ||
61 | /// If DebugLevel >= 2, then long warnings are logged when receiving bad input data. | ||
62 | /// If DebugLevel >= 3, then short notices about all incoming non-poll HTTP requests are logged. | ||
63 | /// </remarks> | ||
64 | public int DebugLevel { get; set; } | ||
65 | |||
56 | private volatile int NotSocketErrors = 0; | 66 | private volatile int NotSocketErrors = 0; |
57 | public volatile bool HTTPDRunning = false; | 67 | public volatile bool HTTPDRunning = false; |
58 | 68 | ||
@@ -79,16 +89,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
79 | 89 | ||
80 | private PollServiceRequestManager m_PollServiceManager; | 90 | private PollServiceRequestManager m_PollServiceManager; |
81 | 91 | ||
82 | /// <summary> | ||
83 | /// Control the printing of certain debug messages. | ||
84 | /// </summary> | ||
85 | /// <remarks> | ||
86 | /// If DebugLevel >= 1, then short warnings are logged when receiving bad input data. | ||
87 | /// If DebugLevel >= 2, then long warnings are logged when receiving bad input data. | ||
88 | /// If DebugLevel >= 3, then short notices about all incoming non-poll HTTP requests are logged. | ||
89 | /// </remarks> | ||
90 | public int DebugLevel { get; set; } | ||
91 | |||
92 | public uint SSLPort | 92 | public uint SSLPort |
93 | { | 93 | { |
94 | get { return m_sslport; } | 94 | get { return m_sslport; } |
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 |
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 00ae880..9043137 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -921,7 +921,7 @@ namespace OpenSim | |||
921 | int newDebug; | 921 | int newDebug; |
922 | if (int.TryParse(args[2], out newDebug)) | 922 | if (int.TryParse(args[2], out newDebug)) |
923 | { | 923 | { |
924 | MainServer.Instance.DebugLevel = newDebug; | 924 | MainServer.DebugLevel = newDebug; |
925 | MainConsole.Instance.OutputFormat("Debug http level set to {0}", newDebug); | 925 | MainConsole.Instance.OutputFormat("Debug http level set to {0}", newDebug); |
926 | break; | 926 | break; |
927 | } | 927 | } |