From 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 19 May 2019 21:24:15 +1000 Subject: Dump OpenSim 0.9.0.1 into it's own branch. --- .../Connectors/Friends/FriendsServicesConnector.cs | 2 +- .../Connectors/Friends/FriendsSimConnector.cs | 68 ++++++++++++---------- 2 files changed, 37 insertions(+), 33 deletions(-) (limited to 'OpenSim/Services/Connectors/Friends') diff --git a/OpenSim/Services/Connectors/Friends/FriendsServicesConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsServicesConnector.cs index b7702a8..873b554 100644 --- a/OpenSim/Services/Connectors/Friends/FriendsServicesConnector.cs +++ b/OpenSim/Services/Connectors/Friends/FriendsServicesConnector.cs @@ -86,7 +86,7 @@ namespace OpenSim.Services.Connectors.Friends #region IFriendsService - + public FriendInfo[] GetFriends(UUID PrincipalID) { Dictionary sendData = new Dictionary(); diff --git a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs index 6d5ce4b..74cd703 100644 --- a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs +++ b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs @@ -144,44 +144,48 @@ namespace OpenSim.Services.Connectors.Friends private bool Call(GridRegion region, Dictionary sendData) { - string reqString = ServerUtils.BuildQueryString(sendData); - //m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: queryString = {0}", reqString); - if (region == null) - return false; - - string path = ServicePath(); - if (!region.ServerURI.EndsWith("/")) - path = "/" + path; - string uri = region.ServerURI + path; -// m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: calling {0}", uri); - - try - { - string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString); - if (reply != string.Empty) + Util.FireAndForget(x => { + string reqString = ServerUtils.BuildQueryString(sendData); + //m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: queryString = {0}", reqString); + if (region == null) + return; + + string path = ServicePath(); + if (!region.ServerURI.EndsWith("/")) + path = "/" + path; + string uri = region.ServerURI + path; + // m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: calling {0}", uri); + + try { - Dictionary replyData = ServerUtils.ParseXmlResponse(reply); - - if (replyData.ContainsKey("RESULT")) + string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, 15, null, false); + if (reply != string.Empty) { - if (replyData["RESULT"].ToString().ToLower() == "true") - return true; + Dictionary replyData = ServerUtils.ParseXmlResponse(reply); + + if (replyData.ContainsKey("RESULT")) + { +// if (replyData["RESULT"].ToString().ToLower() == "true") +// return; +// else + return; + } else - return false; + m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: reply data does not contain result field"); + } else - m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: reply data does not contain result field"); - + m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: received empty reply"); + } + catch (Exception e) + { + m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: Exception when contacting remote sim at {0}: {1}", uri, e.Message); } - else - m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: received empty reply"); - } - catch (Exception e) - { - m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: Exception when contacting remote sim at {0}: {1}", uri, e.Message); - } - - return false; + + return; + }); + + return true; } } } -- cgit v1.1