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)
{ {
if (!serverURI.EndsWith("=")) try
m_ServerURI = serverURI.TrimEnd('/') + "/helo/";
else
{ {
// Simian sends malformed urls like this: Uri uri;
// http://valley.virtualportland.org/simtest/Grid/?id=
// if (!serverURI.EndsWith("="))
try
{ {
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) if (uri.Query == string.Empty)
m_ServerURI = serverURI.TrimEnd('/') + "/helo/"; m_ServerURI = serverURI.TrimEnd('/') + "/helo/";
else else
@ -66,10 +72,11 @@ namespace OpenSim.Services.Connectors
m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/"; 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);
} }
} }