From f4424bdfcfb5db97d243b65ca30537410b9b2600 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Mon, 13 Oct 2014 23:57:46 +0100 Subject: [PATCH] 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. --- OpenSim/Server/Base/HttpServerBase.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/OpenSim/Server/Base/HttpServerBase.cs b/OpenSim/Server/Base/HttpServerBase.cs index 954783c92f..5dc9eedb3d 100644 --- a/OpenSim/Server/Base/HttpServerBase.cs +++ b/OpenSim/Server/Base/HttpServerBase.cs @@ -56,15 +56,16 @@ namespace OpenSim.Server.Base if (networkConfig == null) { - System.Console.WriteLine("Section 'Network' not found, server can't start"); - Thread.CurrentThread.Abort(); + System.Console.WriteLine("ERROR: Section [Network] not found, server can't start"); + Environment.Exit(1); } uint port = (uint)networkConfig.GetInt("port", 0); if (port == 0) { - Thread.CurrentThread.Abort(); + System.Console.WriteLine("ERROR: No 'port' entry found in [Network]. Server can't start"); + Environment.Exit(1); } bool ssl_main = networkConfig.GetBoolean("https_main",false); @@ -93,13 +94,13 @@ namespace OpenSim.Server.Base if ( cert_path == String.Empty ) { System.Console.WriteLine("Path to X509 certificate is missing, server can't start."); - Thread.CurrentThread.Abort(); + Environment.Exit(1); } string cert_pass = networkConfig.GetString("cert_pass",String.Empty); if ( cert_pass == String.Empty ) { System.Console.WriteLine("Password for X509 certificate is missing, server can't start."); - Thread.CurrentThread.Abort(); + Environment.Exit(1); } httpServer = new BaseHttpServer(port, ssl_main, cert_path, cert_pass); @@ -117,13 +118,13 @@ namespace OpenSim.Server.Base if ( cert_path == String.Empty ) { System.Console.WriteLine("Path to X509 certificate is missing, server can't start."); - Thread.CurrentThread.Abort(); + Environment.Exit(1); } string cert_pass = networkConfig.GetString("cert_pass",String.Empty); if ( cert_pass == String.Empty ) { System.Console.WriteLine("Password for X509 certificate is missing, server can't start."); - Thread.CurrentThread.Abort(); + Environment.Exit(1); } MainServer.AddHttpServer(new BaseHttpServer(https_port, ssl_listener, cert_path, cert_pass));