aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDiva Canto2014-04-07 19:51:26 -0700
committerDiva Canto2014-04-07 19:51:26 -0700
commit86105a1533f305514f05581e4a97b5913ed07390 (patch)
tree93dc2885be5f9bfcfade451edaa99b932eba86bc /OpenSim
parentAvoid calling HELO service on malformed URLs. This is in response to an excep... (diff)
downloadopensim-SC_OLD-86105a1533f305514f05581e4a97b5913ed07390.zip
opensim-SC_OLD-86105a1533f305514f05581e4a97b5913ed07390.tar.gz
opensim-SC_OLD-86105a1533f305514f05581e4a97b5913ed07390.tar.bz2
opensim-SC_OLD-86105a1533f305514f05581e4a97b5913ed07390.tar.xz
Better (amend to previous commit)
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/HeloServicesConnector.cs31
1 files changed, 19 insertions, 12 deletions
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
47 47
48 public HeloServicesConnector(string serverURI) 48 public HeloServicesConnector(string serverURI)
49 { 49 {
50 if (!serverURI.EndsWith("=")) 50 try
51 m_ServerURI = serverURI.TrimEnd('/') + "/helo/";
52 else
53 { 51 {
54 // Simian sends malformed urls like this: 52 Uri uri;
55 // http://valley.virtualportland.org/simtest/Grid/?id= 53
56 // 54 if (!serverURI.EndsWith("="))
57 try
58 { 55 {
59 Uri uri = new Uri(serverURI + "xxx"); 56 // Let's check if this is a valid URI, because it may not be
57 uri = new Uri(serverURI);
58 m_ServerURI = serverURI.TrimEnd('/') + "/helo/";
59 }
60 else
61 {
62 // Simian sends malformed urls like this:
63 // http://valley.virtualportland.org/simtest/Grid/?id=
64 //
65 uri = new Uri(serverURI + "xxx");
60 if (uri.Query == string.Empty) 66 if (uri.Query == string.Empty)
61 m_ServerURI = serverURI.TrimEnd('/') + "/helo/"; 67 m_ServerURI = serverURI.TrimEnd('/') + "/helo/";
62 else 68 else
@@ -66,10 +72,11 @@ namespace OpenSim.Services.Connectors
66 m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/"; 72 m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/";
67 } 73 }
68 } 74 }
69 catch (UriFormatException) 75
70 { 76 }
71 m_log.WarnFormat("[HELO SERVICE]: Malformed URL {0}", serverURI); 77 catch (UriFormatException)
72 } 78 {
79 m_log.WarnFormat("[HELO SERVICE]: Malformed URL {0}", serverURI);
73 } 80 }
74 } 81 }
75 82