Better (amend to previous commit)

0.8.0.3
Diva Canto 2014-04-07 19:51:26 -07:00
parent c0fd09b445
commit 86105a1533
1 changed files with 19 additions and 12 deletions

View File

@ -47,16 +47,22 @@ namespace OpenSim.Services.Connectors
public HeloServicesConnector(string serverURI) public HeloServicesConnector(string serverURI)
{ {
try
{
Uri uri;
if (!serverURI.EndsWith("=")) if (!serverURI.EndsWith("="))
{
// Let's check if this is a valid URI, because it may not be
uri = new Uri(serverURI);
m_ServerURI = serverURI.TrimEnd('/') + "/helo/"; m_ServerURI = serverURI.TrimEnd('/') + "/helo/";
}
else else
{ {
// Simian sends malformed urls like this: // Simian sends malformed urls like this:
// http://valley.virtualportland.org/simtest/Grid/?id= // http://valley.virtualportland.org/simtest/Grid/?id=
// //
try uri = new Uri(serverURI + "xxx");
{
Uri uri = new Uri(serverURI + "xxx");
if (uri.Query == string.Empty) if (uri.Query == string.Empty)
m_ServerURI = serverURI.TrimEnd('/') + "/helo/"; m_ServerURI = serverURI.TrimEnd('/') + "/helo/";
else else
@ -66,12 +72,13 @@ namespace OpenSim.Services.Connectors
m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/"; m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/";
} }
} }
}
catch (UriFormatException) catch (UriFormatException)
{ {
m_log.WarnFormat("[HELO SERVICE]: Malformed URL {0}", serverURI); m_log.WarnFormat("[HELO SERVICE]: Malformed URL {0}", serverURI);
} }
} }
}
public virtual string Helo() public virtual string Helo()
{ {