diff options
Diffstat (limited to 'OpenSim/Services')
-rw-r--r-- | OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 56 | ||||
-rw-r--r-- | OpenSim/Services/LLLoginService/LLLoginService.cs | 2 |
2 files changed, 33 insertions, 25 deletions
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index e15ac8c..f5e7771 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | |||
@@ -112,7 +112,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
112 | m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: Creating agent at {0}", destination.ServerURI); | 112 | m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: Creating agent at {0}", destination.ServerURI); |
113 | 113 | ||
114 | string uri = destination.ServerURI + AgentPath() + aCircuit.AgentID + "/"; | 114 | string uri = destination.ServerURI + AgentPath() + aCircuit.AgentID + "/"; |
115 | 115 | OSD tmpOSD; | |
116 | try | 116 | try |
117 | { | 117 | { |
118 | OSDMap args = aCircuit.PackAgentCircuitData(ctx); | 118 | OSDMap args = aCircuit.PackAgentCircuitData(ctx); |
@@ -121,10 +121,9 @@ namespace OpenSim.Services.Connectors.Simulation | |||
121 | 121 | ||
122 | OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000); | 122 | OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000); |
123 | bool success = result["success"].AsBoolean(); | 123 | bool success = result["success"].AsBoolean(); |
124 | if (success && result.ContainsKey("_Result")) | 124 | if (success && result.TryGetValue("_Result", out tmpOSD) && tmpOSD is OSDMap) |
125 | { | 125 | { |
126 | OSDMap data = (OSDMap)result["_Result"]; | 126 | OSDMap data = (OSDMap)tmpOSD; |
127 | |||
128 | reason = data["reason"].AsString(); | 127 | reason = data["reason"].AsString(); |
129 | success = data["success"].AsBoolean(); | 128 | success = data["success"].AsBoolean(); |
130 | return success; | 129 | return success; |
@@ -133,14 +132,15 @@ namespace OpenSim.Services.Connectors.Simulation | |||
133 | // Try the old version, uncompressed | 132 | // Try the old version, uncompressed |
134 | result = WebUtil.PostToService(uri, args, 30000, false); | 133 | result = WebUtil.PostToService(uri, args, 30000, false); |
135 | 134 | ||
136 | if (result["Success"].AsBoolean()) | 135 | success = result["success"].AsBoolean(); |
136 | if (success) | ||
137 | { | 137 | { |
138 | if (result.ContainsKey("_Result")) | 138 | if (result.TryGetValue("_Result", out tmpOSD) && tmpOSD is OSDMap) |
139 | { | 139 | { |
140 | OSDMap data = (OSDMap)result["_Result"]; | 140 | OSDMap data = (OSDMap)tmpOSD; |
141 | |||
142 | reason = data["reason"].AsString(); | 141 | reason = data["reason"].AsString(); |
143 | success = data["success"].AsBoolean(); | 142 | success = data["success"].AsBoolean(); |
143 | |||
144 | m_log.WarnFormat( | 144 | m_log.WarnFormat( |
145 | "[REMOTE SIMULATION CONNECTOR]: Remote simulator {0} did not accept compressed transfer, suggest updating it.", destination.RegionName); | 145 | "[REMOTE SIMULATION CONNECTOR]: Remote simulator {0} did not accept compressed transfer, suggest updating it.", destination.RegionName); |
146 | return success; | 146 | return success; |
@@ -312,34 +312,42 @@ namespace OpenSim.Services.Connectors.Simulation | |||
312 | if (agentHomeURI != null) | 312 | if (agentHomeURI != null) |
313 | request.Add("agent_home_uri", OSD.FromString(agentHomeURI)); | 313 | request.Add("agent_home_uri", OSD.FromString(agentHomeURI)); |
314 | 314 | ||
315 | OSD tmpOSD; | ||
315 | try | 316 | try |
316 | { | 317 | { |
317 | OSDMap result = WebUtil.ServiceOSDRequest(uri, request, "QUERYACCESS", 30000, false, false, true); | 318 | OSDMap result = WebUtil.ServiceOSDRequest(uri, request, "QUERYACCESS", 30000, false, false, true); |
319 | |||
318 | bool success = result["success"].AsBoolean(); | 320 | bool success = result["success"].AsBoolean(); |
319 | if (result.ContainsKey("_Result")) | 321 | |
322 | bool has_Result = false; | ||
323 | if (result.TryGetValue("_Result", out tmpOSD)) | ||
320 | { | 324 | { |
321 | OSDMap data = (OSDMap)result["_Result"]; | 325 | has_Result = true; |
326 | OSDMap data = (OSDMap)tmpOSD; | ||
322 | 327 | ||
323 | // FIXME: If there is a _Result map then it's the success key here that indicates the true success | 328 | // FIXME: If there is a _Result map then it's the success key here that indicates the true success |
324 | // or failure, not the sibling result node. | 329 | // or failure, not the sibling result node. |
330 | //nte4.8 crap | ||
325 | success = data["success"].AsBoolean(); | 331 | success = data["success"].AsBoolean(); |
326 | |||
327 | reason = data["reason"].AsString(); | 332 | reason = data["reason"].AsString(); |
328 | // We will need to plumb this and start sing the outbound version as well | 333 | // We will need to plumb this and start sing the outbound version as well |
329 | // TODO: lay the pipe for version plumbing | 334 | // TODO: lay the pipe for version plumbing |
330 | if (data.ContainsKey("negotiated_inbound_version") && data["negotiated_inbound_version"] != null) | 335 | if (data.TryGetValue("negotiated_inbound_version", out tmpOSD) && tmpOSD != null) |
331 | { | 336 | { |
332 | ctx.InboundVersion = (float)data["negotiated_inbound_version"].AsReal(); | 337 | ctx.InboundVersion = (float)tmpOSD.AsReal(); |
333 | ctx.OutboundVersion = (float)data["negotiated_outbound_version"].AsReal(); | 338 | ctx.OutboundVersion = (float)data["negotiated_outbound_version"].AsReal(); |
334 | } | 339 | } |
335 | else if (data["version"] != null && data["version"].AsString() != string.Empty) | 340 | else if (data.TryGetValue("version", out tmpOSD) && tmpOSD != null) |
336 | { | 341 | { |
337 | string versionString = data["version"].AsString(); | 342 | string versionString = tmpOSD.AsString(); |
338 | String[] parts = versionString.Split(new char[] {'/'}); | 343 | if(versionString != string.Empty) |
339 | if (parts.Length > 1) | ||
340 | { | 344 | { |
341 | ctx.InboundVersion = float.Parse(parts[1], Culture.FormatProvider); | 345 | String[] parts = versionString.Split(new char[] {'/'}); |
342 | ctx.OutboundVersion = float.Parse(parts[1], Culture.FormatProvider); | 346 | if (parts.Length > 1) |
347 | { | ||
348 | ctx.InboundVersion = float.Parse(parts[1], Culture.FormatProvider); | ||
349 | ctx.OutboundVersion = float.Parse(parts[1], Culture.FormatProvider); | ||
350 | } | ||
343 | } | 351 | } |
344 | } | 352 | } |
345 | 353 | ||
@@ -352,11 +360,11 @@ namespace OpenSim.Services.Connectors.Simulation | |||
352 | { | 360 | { |
353 | // If we don't check this then OpenSimulator 0.7.3.1 and some period before will never see the | 361 | // If we don't check this then OpenSimulator 0.7.3.1 and some period before will never see the |
354 | // actual failure message | 362 | // actual failure message |
355 | if (!result.ContainsKey("_Result")) | 363 | if (!has_Result) |
356 | { | 364 | { |
357 | if (result.ContainsKey("Message")) | 365 | if (result.TryGetValue("Message", out tmpOSD)) |
358 | { | 366 | { |
359 | string message = result["Message"].AsString(); | 367 | string message = tmpOSD.AsString(); |
360 | if (message == "Service request failed: [MethodNotAllowed] MethodNotAllowed") // Old style region | 368 | if (message == "Service request failed: [MethodNotAllowed] MethodNotAllowed") // Old style region |
361 | { | 369 | { |
362 | m_log.Info("[REMOTE SIMULATION CONNECTOR]: The above web util error was caused by a TP to a sim that doesn't support QUERYACCESS and can be ignored"); | 370 | m_log.Info("[REMOTE SIMULATION CONNECTOR]: The above web util error was caused by a TP to a sim that doesn't support QUERYACCESS and can be ignored"); |
@@ -376,9 +384,9 @@ namespace OpenSim.Services.Connectors.Simulation | |||
376 | 384 | ||
377 | featuresAvailable.Clear(); | 385 | featuresAvailable.Clear(); |
378 | 386 | ||
379 | if (result.ContainsKey("features")) | 387 | if (result.TryGetValue("features", out tmpOSD) && tmpOSD is OSDArray) |
380 | { | 388 | { |
381 | OSDArray array = (OSDArray)result["features"]; | 389 | OSDArray array = (OSDArray)tmpOSD; |
382 | 390 | ||
383 | foreach (OSD o in array) | 391 | foreach (OSD o in array) |
384 | featuresAvailable.Add(new UUID(o.AsString())); | 392 | featuresAvailable.Add(new UUID(o.AsString())); |
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 22748cc..b923761 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -1051,7 +1051,7 @@ namespace OpenSim.Services.LLLoginService | |||
1051 | } | 1051 | } |
1052 | aCircuit.ServiceURLs[keyName] = keyValue; | 1052 | aCircuit.ServiceURLs[keyName] = keyValue; |
1053 | 1053 | ||
1054 | m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]); | 1054 | // m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]); |
1055 | } | 1055 | } |
1056 | 1056 | ||
1057 | if (!account.ServiceURLs.ContainsKey("GatekeeperURI") && !string.IsNullOrEmpty(m_GatekeeperURL)) | 1057 | if (!account.ServiceURLs.ContainsKey("GatekeeperURI") && !string.IsNullOrEmpty(m_GatekeeperURL)) |