aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/Clients/RegionClient.cs39
1 files changed, 34 insertions, 5 deletions
diff --git a/OpenSim/Framework/Communications/Clients/RegionClient.cs b/OpenSim/Framework/Communications/Clients/RegionClient.cs
index 5c2babc..4f5a4cf 100644
--- a/OpenSim/Framework/Communications/Clients/RegionClient.cs
+++ b/OpenSim/Framework/Communications/Clients/RegionClient.cs
@@ -45,8 +45,21 @@ namespace OpenSim.Framework.Communications.Clients
45 45
46 public bool DoCreateChildAgentCall(RegionInfo region, AgentCircuitData aCircuit, string authKey, out string reason) 46 public bool DoCreateChildAgentCall(RegionInfo region, AgentCircuitData aCircuit, string authKey, out string reason)
47 { 47 {
48 reason = String.Empty;
49
48 // Eventually, we want to use a caps url instead of the agentID 50 // Eventually, we want to use a caps url instead of the agentID
49 string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/agent/" + aCircuit.AgentID + "/"; 51 string uri = string.Empty;
52 try
53 {
54 uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/agent/" + aCircuit.AgentID + "/";
55 }
56 catch (Exception e)
57 {
58 m_log.Debug("[REST COMMS]: Unable to resolve external endpoint on agent create. Reason: " + e.Message);
59 reason = e.Message;
60 return false;
61 }
62
50 //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri); 63 //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri);
51 64
52 HttpWebRequest AgentCreateRequest = (HttpWebRequest)WebRequest.Create(uri); 65 HttpWebRequest AgentCreateRequest = (HttpWebRequest)WebRequest.Create(uri);
@@ -56,8 +69,6 @@ namespace OpenSim.Framework.Communications.Clients
56 //AgentCreateRequest.KeepAlive = false; 69 //AgentCreateRequest.KeepAlive = false;
57 AgentCreateRequest.Headers.Add("Authorization", authKey); 70 AgentCreateRequest.Headers.Add("Authorization", authKey);
58 71
59 reason = String.Empty;
60
61 // Fill it in 72 // Fill it in
62 OSDMap args = null; 73 OSDMap args = null;
63 try 74 try
@@ -158,7 +169,16 @@ namespace OpenSim.Framework.Communications.Clients
158 public bool DoChildAgentUpdateCall(RegionInfo region, IAgentData cAgentData) 169 public bool DoChildAgentUpdateCall(RegionInfo region, IAgentData cAgentData)
159 { 170 {
160 // Eventually, we want to use a caps url instead of the agentID 171 // Eventually, we want to use a caps url instead of the agentID
161 string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/agent/" + cAgentData.AgentID + "/"; 172 string uri = string.Empty;
173 try
174 {
175 uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/agent/" + cAgentData.AgentID + "/";
176 }
177 catch (Exception e)
178 {
179 m_log.Debug("[REST COMMS]: Unable to resolve external endpoint on agent update. Reason: " + e.Message);
180 return false;
181 }
162 //Console.WriteLine(" >>> DoChildAgentUpdateCall <<< " + uri); 182 //Console.WriteLine(" >>> DoChildAgentUpdateCall <<< " + uri);
163 183
164 HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri); 184 HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri);
@@ -330,7 +350,16 @@ namespace OpenSim.Framework.Communications.Clients
330 350
331 public bool DoCloseAgentCall(RegionInfo region, UUID id) 351 public bool DoCloseAgentCall(RegionInfo region, UUID id)
332 { 352 {
333 string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/agent/" + id + "/" + region.RegionHandle.ToString() + "/"; 353 string uri = string.Empty;
354 try
355 {
356 uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/agent/" + id + "/" + region.RegionHandle.ToString() + "/";
357 }
358 catch (Exception e)
359 {
360 m_log.Debug("[REST COMMS]: Unable to resolve external endpoint on agent close. Reason: " + e.Message);
361 return false;
362 }
334 363
335 //Console.WriteLine(" >>> DoCloseAgentCall <<< " + uri); 364 //Console.WriteLine(" >>> DoCloseAgentCall <<< " + uri);
336 365