From 86105a1533f305514f05581e4a97b5913ed07390 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 7 Apr 2014 19:51:26 -0700 Subject: Better (amend to previous commit) --- .../Connectors/Hypergrid/HeloServicesConnector.cs | 31 +++++++++++++--------- 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'OpenSim/Services/Connectors/Hypergrid/HeloServicesConnector.cs') diff --git a/OpenSim/Services/Connectors/Hypergrid/HeloServicesConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HeloServicesConnector.cs index d04cc22..c0041e6 100644 --- a/OpenSim/Services/Connectors/Hypergrid/HeloServicesConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/HeloServicesConnector.cs @@ -47,16 +47,22 @@ namespace OpenSim.Services.Connectors public HeloServicesConnector(string serverURI) { - if (!serverURI.EndsWith("=")) - m_ServerURI = serverURI.TrimEnd('/') + "/helo/"; - else + try { - // Simian sends malformed urls like this: - // http://valley.virtualportland.org/simtest/Grid/?id= - // - try + Uri uri; + + if (!serverURI.EndsWith("=")) { - Uri uri = new Uri(serverURI + "xxx"); + // Let's check if this is a valid URI, because it may not be + uri = new Uri(serverURI); + m_ServerURI = serverURI.TrimEnd('/') + "/helo/"; + } + else + { + // Simian sends malformed urls like this: + // http://valley.virtualportland.org/simtest/Grid/?id= + // + uri = new Uri(serverURI + "xxx"); if (uri.Query == string.Empty) m_ServerURI = serverURI.TrimEnd('/') + "/helo/"; else @@ -66,10 +72,11 @@ namespace OpenSim.Services.Connectors m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/"; } } - catch (UriFormatException) - { - m_log.WarnFormat("[HELO SERVICE]: Malformed URL {0}", serverURI); - } + + } + catch (UriFormatException) + { + m_log.WarnFormat("[HELO SERVICE]: Malformed URL {0}", serverURI); } } -- cgit v1.1