aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-06-15 00:40:12 +0100
committerJustin Clark-Casey (justincc)2012-06-15 00:40:12 +0100
commit6993a26ba599ae38dc6f66332980657d5621987a (patch)
tree7e055b0d22bb47bca6ca94ae185cc1525b484374
parentminor: Extend 'debug http' usage statement to 0..3 from 0..2 (diff)
downloadopensim-SC-6993a26ba599ae38dc6f66332980657d5621987a.zip
opensim-SC-6993a26ba599ae38dc6f66332980657d5621987a.tar.gz
opensim-SC-6993a26ba599ae38dc6f66332980657d5621987a.tar.bz2
opensim-SC-6993a26ba599ae38dc6f66332980657d5621987a.tar.xz
Get rid of some unnecessary null checks in RegionApplicationBase.StartupSpecific() - a constructor can never return null.
Also adds some method doc to MainServer
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/MainServer.cs31
-rw-r--r--OpenSim/Region/ClientStack/RegionApplicationBase.cs14
2 files changed, 32 insertions, 13 deletions
diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs
index b8ab8d9..ea972ef 100644
--- a/OpenSim/Framework/Servers/MainServer.cs
+++ b/OpenSim/Framework/Servers/MainServer.cs
@@ -47,20 +47,43 @@ namespace OpenSim.Framework.Servers
47 set { instance = value; } 47 set { instance = value; }
48 } 48 }
49 49
50 public static IHttpServer GetHttpServer(uint port) 50 /// <summary>
51 /// Add an already started HTTP server to the collection of known servers.
52 /// </summary>
53 /// <param name='server'></param>
54 public static void AddHttpServer(BaseHttpServer server)
51 { 55 {
52 return GetHttpServer(port,null); 56 m_Servers.Add(server.Port, server);
53 } 57 }
54 58
55 public static void AddHttpServer(BaseHttpServer server) 59 /// <summary>
60 /// Get the default http server or an http server for a specific port.
61 /// </summary>
62 /// <remarks>
63 /// If the requested HTTP server doesn't already exist then a new one is instantiated and started.
64 /// </remarks>
65 /// <returns></returns>
66 /// <param name='port'>If 0 then the default HTTP server is returned.</param>
67 public static IHttpServer GetHttpServer(uint port)
56 { 68 {
57 m_Servers.Add(server.Port, server); 69 return GetHttpServer(port, null);
58 } 70 }
59 71
72 /// <summary>
73 /// Get the default http server, an http server for a specific port
74 /// and/or an http server bound to a specific address
75 /// </summary>
76 /// <remarks>
77 /// If the requested HTTP server doesn't already exist then a new one is instantiated and started.
78 /// </remarks>
79 /// <returns></returns>
80 /// <param name='port'>If 0 then the default HTTP server is returned.</param>
81 /// <param name='ipaddr'>A specific IP address to bind to. If null then the default IP address is used.</param>
60 public static IHttpServer GetHttpServer(uint port, IPAddress ipaddr) 82 public static IHttpServer GetHttpServer(uint port, IPAddress ipaddr)
61 { 83 {
62 if (port == 0) 84 if (port == 0)
63 return Instance; 85 return Instance;
86
64 if (instance != null && port == Instance.Port) 87 if (instance != null && port == Instance.Port)
65 return Instance; 88 return Instance;
66 89
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index 6e78d6d..27a5879 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -99,17 +99,13 @@ namespace OpenSim.Region.ClientStack
99 // "OOB" Server 99 // "OOB" Server
100 if (m_networkServersInfo.ssl_listener) 100 if (m_networkServersInfo.ssl_listener)
101 { 101 {
102 BaseHttpServer server = null; 102 BaseHttpServer server = new BaseHttpServer(
103 server = new BaseHttpServer(
104 m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path, 103 m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path,
105 m_networkServersInfo.cert_pass); 104 m_networkServersInfo.cert_pass);
106 // Add the server to m_Servers 105
107 if(server != null) 106 m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port);
108 { 107 MainServer.AddHttpServer(server);
109 m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port); 108 server.Start();
110 MainServer.AddHttpServer(server);
111 server.Start();
112 }
113 } 109 }
114 110
115 base.StartupSpecific(); 111 base.StartupSpecific();