aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-10-13 23:57:46 +0100
committerJustin Clark-Casey (justincc)2014-11-25 23:21:38 +0000
commitf4424bdfcfb5db97d243b65ca30537410b9b2600 (patch)
treee0a50867db5e03639c6c9af6f584c172dcfcaf91 /OpenSim/Server
parentAdd an IConfigSource constructor to HGAssetBroker so that it can be instantia... (diff)
downloadopensim-SC_OLD-f4424bdfcfb5db97d243b65ca30537410b9b2600.zip
opensim-SC_OLD-f4424bdfcfb5db97d243b65ca30537410b9b2600.tar.gz
opensim-SC_OLD-f4424bdfcfb5db97d243b65ca30537410b9b2600.tar.bz2
opensim-SC_OLD-f4424bdfcfb5db97d243b65ca30537410b9b2600.tar.xz
If the port entry in [Network] for a server is missing, then actually tell the user that's the problem rather than simply exiting silently.
Also exit with Environment.Exit(), not by aborting the thread.
Diffstat (limited to 'OpenSim/Server')
-rw-r--r--OpenSim/Server/Base/HttpServerBase.cs15
1 files changed, 8 insertions, 7 deletions
diff --git a/OpenSim/Server/Base/HttpServerBase.cs b/OpenSim/Server/Base/HttpServerBase.cs
index 954783c..5dc9eed 100644
--- a/OpenSim/Server/Base/HttpServerBase.cs
+++ b/OpenSim/Server/Base/HttpServerBase.cs
@@ -56,15 +56,16 @@ namespace OpenSim.Server.Base
56 56
57 if (networkConfig == null) 57 if (networkConfig == null)
58 { 58 {
59 System.Console.WriteLine("Section 'Network' not found, server can't start"); 59 System.Console.WriteLine("ERROR: Section [Network] not found, server can't start");
60 Thread.CurrentThread.Abort(); 60 Environment.Exit(1);
61 } 61 }
62 62
63 uint port = (uint)networkConfig.GetInt("port", 0); 63 uint port = (uint)networkConfig.GetInt("port", 0);
64 64
65 if (port == 0) 65 if (port == 0)
66 { 66 {
67 Thread.CurrentThread.Abort(); 67 System.Console.WriteLine("ERROR: No 'port' entry found in [Network]. Server can't start");
68 Environment.Exit(1);
68 } 69 }
69 70
70 bool ssl_main = networkConfig.GetBoolean("https_main",false); 71 bool ssl_main = networkConfig.GetBoolean("https_main",false);
@@ -93,13 +94,13 @@ namespace OpenSim.Server.Base
93 if ( cert_path == String.Empty ) 94 if ( cert_path == String.Empty )
94 { 95 {
95 System.Console.WriteLine("Path to X509 certificate is missing, server can't start."); 96 System.Console.WriteLine("Path to X509 certificate is missing, server can't start.");
96 Thread.CurrentThread.Abort(); 97 Environment.Exit(1);
97 } 98 }
98 string cert_pass = networkConfig.GetString("cert_pass",String.Empty); 99 string cert_pass = networkConfig.GetString("cert_pass",String.Empty);
99 if ( cert_pass == String.Empty ) 100 if ( cert_pass == String.Empty )
100 { 101 {
101 System.Console.WriteLine("Password for X509 certificate is missing, server can't start."); 102 System.Console.WriteLine("Password for X509 certificate is missing, server can't start.");
102 Thread.CurrentThread.Abort(); 103 Environment.Exit(1);
103 } 104 }
104 105
105 httpServer = new BaseHttpServer(port, ssl_main, cert_path, cert_pass); 106 httpServer = new BaseHttpServer(port, ssl_main, cert_path, cert_pass);
@@ -117,13 +118,13 @@ namespace OpenSim.Server.Base
117 if ( cert_path == String.Empty ) 118 if ( cert_path == String.Empty )
118 { 119 {
119 System.Console.WriteLine("Path to X509 certificate is missing, server can't start."); 120 System.Console.WriteLine("Path to X509 certificate is missing, server can't start.");
120 Thread.CurrentThread.Abort(); 121 Environment.Exit(1);
121 } 122 }
122 string cert_pass = networkConfig.GetString("cert_pass",String.Empty); 123 string cert_pass = networkConfig.GetString("cert_pass",String.Empty);
123 if ( cert_pass == String.Empty ) 124 if ( cert_pass == String.Empty )
124 { 125 {
125 System.Console.WriteLine("Password for X509 certificate is missing, server can't start."); 126 System.Console.WriteLine("Password for X509 certificate is missing, server can't start.");
126 Thread.CurrentThread.Abort(); 127 Environment.Exit(1);
127 } 128 }
128 129
129 MainServer.AddHttpServer(new BaseHttpServer(https_port, ssl_listener, cert_path, cert_pass)); 130 MainServer.AddHttpServer(new BaseHttpServer(https_port, ssl_listener, cert_path, cert_pass));