From e89f1e635b2933e6e43628d8d06a457d8ad1ea02 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 18 Jan 2018 13:04:05 +0000 Subject: fail to connect to estates service is a fatal error --- .../Services/Connectors/Estate/EstateDataConnector.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'OpenSim/Services/Connectors/Estate/EstateDataConnector.cs') diff --git a/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs b/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs index b9a6281..0971b38 100644 --- a/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs +++ b/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs @@ -195,6 +195,14 @@ namespace OpenSim.Services.Connectors string uri = m_ServerURI + string.Format("/estates/estate/?region={0}&create={1}", regionID, create); reply = MakeRequest("GET", uri, string.Empty); + if(reply == 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); + } + if (String.IsNullOrEmpty(reply)) return null; @@ -308,7 +316,8 @@ namespace OpenSim.Services.Connectors string reply = string.Empty; try { - reply = SynchronousRestFormsRequester.MakeRequest(verb, uri, formdata, m_Auth); + reply = SynchronousRestFormsRequester.MakeRequest(verb, uri, formdata, 30, m_Auth); + return reply; } catch (WebException e) { @@ -317,14 +326,17 @@ namespace OpenSim.Services.Connectors if (hwr != null) { if (hwr.StatusCode == HttpStatusCode.NotFound) + { m_log.Error(string.Format("[ESTATE CONNECTOR]: Resource {0} not found ", uri)); + return reply; + } if (hwr.StatusCode == HttpStatusCode.Unauthorized) m_log.Error(string.Format("[ESTATE CONNECTOR]: Web request {0} requires authentication ", uri)); } else m_log.Error(string.Format( "[ESTATE CONNECTOR]: WebException for {0} {1} {2} {3}", - verb, uri, formdata, e)); + verb, uri, formdata, e.Message)); } } catch (Exception e) @@ -332,7 +344,7 @@ namespace OpenSim.Services.Connectors m_log.DebugFormat("[ESTATE CONNECTOR]: Exception when contacting estate server at {0}: {1}", uri, e.Message); } - return reply; + return null; } } } -- cgit v1.1