mirror of
https://github.com/OpenSim-NGC/OpenSim-Sasquatch.git
synced 2024-11-21 14:29:10 -07:00
Never call Environment.Exit() from a library, This terminates the process on an estate lookup that fails if the estate doesnt exist, Do a null exit to signal no available data and let the caller decide how to handle it.
This commit is contained in:
parent
0e0953667c
commit
d978ab12b4
2 changed files with 14 additions and 5 deletions
|
@ -39,7 +39,7 @@ namespace OpenSim
|
|||
{
|
||||
public const string VersionNumber = "0.9.3";
|
||||
public const string AssemblyVersionNumber = "0.9.3";
|
||||
public const string Release = "8999";
|
||||
public const string Release = "9026";
|
||||
|
||||
public static string Version
|
||||
{
|
||||
|
|
|
@ -195,17 +195,24 @@ namespace OpenSim.Services.Connectors
|
|||
// /estates/estate/?region=uuid&create=[t|f]
|
||||
string uri = m_ServerURI + string.Format("/estates/estate/?region={0}&create={1}", regionID, create);
|
||||
|
||||
//MakeRequest is bugged as its using the older deprecated WebRequest. A call to the estate
|
||||
// service here will return a 404 if the estate doesnt exist which is correct but the code
|
||||
// assumes thats a fatal error. BTW We should never ever call Enviroinment.Exit from a supporting
|
||||
// module or a library like this. So its gonna go.
|
||||
reply = MakeRequest("GET", uri, string.Empty);
|
||||
if(reply == null)
|
||||
|
||||
if (reply is null)
|
||||
{
|
||||
// this is a fatal error
|
||||
m_log.DebugFormat("[ESTATE CONNECTOR] connection to remote estates service failed");
|
||||
m_log.DebugFormat("[ESTATE CONNECTOR] simulator needs to terminate");
|
||||
Environment.Exit(-1);
|
||||
//m_log.DebugFormat("[ESTATE CONNECTOR] simulator needs to terminate");
|
||||
//Environment.Exit(-1);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (String.IsNullOrEmpty(reply))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
|
||||
|
||||
|
@ -216,7 +223,9 @@ namespace OpenSim.Services.Connectors
|
|||
return es;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat("[ESTATE CONNECTOR]: LoadEstateSettings(regionID) from {0} received null or zero response", uri);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue