aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs20
-rw-r--r--OpenSim/Framework/Servers/MainServer.cs41
2 files changed, 40 insertions, 21 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