diff options
author | Diva Canto | 2011-12-24 07:44:26 -0800 |
---|---|---|
committer | Diva Canto | 2011-12-24 07:44:26 -0800 |
commit | b6cfe15c7c0b3697709179cbbf32818576919642 (patch) | |
tree | a8ccc7f63e150caa159973e7d30b2f49253fa063 /OpenSim/Services/Connectors/Hypergrid | |
parent | HG: one more adjustment with trailing /s (diff) | |
download | opensim-SC_OLD-b6cfe15c7c0b3697709179cbbf32818576919642.zip opensim-SC_OLD-b6cfe15c7c0b3697709179cbbf32818576919642.tar.gz opensim-SC_OLD-b6cfe15c7c0b3697709179cbbf32818576919642.tar.bz2 opensim-SC_OLD-b6cfe15c7c0b3697709179cbbf32818576919642.tar.xz |
HG: more / love for Xmas
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs index ff1dd5f..8ac89cc 100644 --- a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs | |||
@@ -47,13 +47,36 @@ namespace OpenSim.Services.Connectors | |||
47 | 47 | ||
48 | public HeloServicesConnector(string serverURI) | 48 | public HeloServicesConnector(string serverURI) |
49 | { | 49 | { |
50 | m_ServerURI = serverURI.TrimEnd('/'); | 50 | if (!serverURI.EndsWith("=")) |
51 | m_ServerURI = serverURI.TrimEnd('/') + "/helo/"; | ||
52 | else | ||
53 | { | ||
54 | // Simian sends malformed urls like this: | ||
55 | // http://valley.virtualportland.org/simtest/Grid/?id= | ||
56 | // | ||
57 | try | ||
58 | { | ||
59 | Uri uri = new Uri(serverURI + "xxx"); | ||
60 | if (uri.Query == string.Empty) | ||
61 | m_ServerURI = serverURI.TrimEnd('/') + "/helo/"; | ||
62 | else | ||
63 | { | ||
64 | serverURI = serverURI + "xxx"; | ||
65 | m_ServerURI = serverURI.Replace("?" + uri.Query, ""); | ||
66 | m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/"; | ||
67 | } | ||
68 | } | ||
69 | catch (UriFormatException e) | ||
70 | { | ||
71 | m_log.WarnFormat("[HELO SERVICE]: Malformed URL {0}", serverURI); | ||
72 | } | ||
73 | } | ||
51 | } | 74 | } |
52 | 75 | ||
53 | 76 | ||
54 | public virtual string Helo() | 77 | public virtual string Helo() |
55 | { | 78 | { |
56 | HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI + "/helo/"); | 79 | HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI); |
57 | // Eventually we need to switch to HEAD | 80 | // Eventually we need to switch to HEAD |
58 | /* req.Method = "HEAD"; */ | 81 | /* req.Method = "HEAD"; */ |
59 | 82 | ||