diff options
Diffstat (limited to 'OpenSim/Framework/Communications/Clients/RegionClient.cs')
-rw-r--r-- | OpenSim/Framework/Communications/Clients/RegionClient.cs | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/OpenSim/Framework/Communications/Clients/RegionClient.cs b/OpenSim/Framework/Communications/Clients/RegionClient.cs index da3f620..6fdacb1 100644 --- a/OpenSim/Framework/Communications/Clients/RegionClient.cs +++ b/OpenSim/Framework/Communications/Clients/RegionClient.cs | |||
@@ -43,7 +43,7 @@ namespace OpenSim.Framework.Communications.Clients | |||
43 | { | 43 | { |
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 45 | ||
46 | public bool DoCreateChildAgentCall(RegionInfo region, AgentCircuitData aCircuit, string authKey) | 46 | public bool DoCreateChildAgentCall(RegionInfo region, AgentCircuitData aCircuit, string authKey, out string reason) |
47 | { | 47 | { |
48 | // Eventually, we want to use a caps url instead of the agentID | 48 | // Eventually, we want to use a caps url instead of the agentID |
49 | string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/agent/" + aCircuit.AgentID + "/"; | 49 | string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/agent/" + aCircuit.AgentID + "/"; |
@@ -56,6 +56,8 @@ namespace OpenSim.Framework.Communications.Clients | |||
56 | //AgentCreateRequest.KeepAlive = false; | 56 | //AgentCreateRequest.KeepAlive = false; |
57 | AgentCreateRequest.Headers.Add("Authorization", authKey); | 57 | AgentCreateRequest.Headers.Add("Authorization", authKey); |
58 | 58 | ||
59 | reason = String.Empty; | ||
60 | |||
59 | // Fill it in | 61 | // Fill it in |
60 | OSDMap args = null; | 62 | OSDMap args = null; |
61 | try | 63 | try |
@@ -98,7 +100,7 @@ namespace OpenSim.Framework.Communications.Clients | |||
98 | catch | 100 | catch |
99 | { | 101 | { |
100 | //m_log.InfoFormat("[REST COMMS]: Bad send on ChildAgentUpdate {0}", ex.Message); | 102 | //m_log.InfoFormat("[REST COMMS]: Bad send on ChildAgentUpdate {0}", ex.Message); |
101 | 103 | reason = "cannot contact remote region"; | |
102 | return false; | 104 | return false; |
103 | } | 105 | } |
104 | 106 | ||
@@ -112,13 +114,24 @@ namespace OpenSim.Framework.Communications.Clients | |||
112 | { | 114 | { |
113 | m_log.Info("[REST COMMS]: Null reply on DoCreateChildAgentCall post"); | 115 | m_log.Info("[REST COMMS]: Null reply on DoCreateChildAgentCall post"); |
114 | } | 116 | } |
117 | else | ||
118 | { | ||
115 | 119 | ||
116 | StreamReader sr = new StreamReader(webResponse.GetResponseStream()); | 120 | StreamReader sr = new StreamReader(webResponse.GetResponseStream()); |
117 | //reply = sr.ReadToEnd().Trim(); | 121 | string response = sr.ReadToEnd().Trim(); |
118 | sr.ReadToEnd().Trim(); | 122 | sr.Close(); |
119 | sr.Close(); | 123 | m_log.InfoFormat("[REST COMMS]: DoCreateChildAgentCall reply was {0} ", response); |
120 | //m_log.InfoFormat("[REST COMMS]: DoCreateChildAgentCall reply was {0} ", reply); | 124 | |
121 | 125 | if (!String.IsNullOrEmpty(response)) | |
126 | { | ||
127 | // we assume we got an OSDMap back | ||
128 | OSDMap r = GetOSDMap(response); | ||
129 | bool success = r["success"].AsBoolean(); | ||
130 | reason = r["reason"].AsString(); | ||
131 | |||
132 | return success; | ||
133 | } | ||
134 | } | ||
122 | } | 135 | } |
123 | catch (WebException ex) | 136 | catch (WebException ex) |
124 | { | 137 | { |