on simple cases no need to parse at all

master
UbitUmarov 2020-06-04 02:50:39 +01:00
parent 84a3ff37ab
commit 7a07731371
6 changed files with 28 additions and 73 deletions

View File

@ -199,20 +199,16 @@ namespace OpenSim.Region.CoreModules.World.Estate
string reply = SynchronousRestFormsRequester.MakeRequest("POST", string reply = SynchronousRestFormsRequester.MakeRequest("POST",
url + "estate", url + "estate",
reqString); reqString);
if (reply != string.Empty) if (reply != string.Empty)
{ {
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); if (reply != string.Empty)
if (replyData.ContainsKey("RESULT"))
{ {
if (replyData["RESULT"].ToString().ToLower() == "true") int indx = reply.IndexOf("true", StringComparison.InvariantCultureIgnoreCase);
if (indx > 0)
return true; return true;
else return false;
return false;
} }
else
m_log.DebugFormat("[XESTATE CONNECTOR]: reply data does not contain result field");
} }
else else
m_log.DebugFormat("[XESTATE CONNECTOR]: received empty reply"); m_log.DebugFormat("[XESTATE CONNECTOR]: received empty reply");

View File

@ -154,20 +154,10 @@ namespace OpenSim.Services.Connectors
string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth); string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth);
if (reply != string.Empty) if (reply != string.Empty)
{ {
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); int indx = reply.IndexOf("success", StringComparison.InvariantCultureIgnoreCase);
if (indx > 0)
if (replyData.ContainsKey("result")) return true;
{ return false;
if (replyData["result"].ToString().ToLower() == "success")
return true;
else
return false;
}
else
{
m_log.DebugFormat("[AGENT PREFERENCES CONNECTOR]: StoreAgentPreferences reply data does not contain result field");
}
} }
else else
m_log.DebugFormat("[AGENT PREFERENCES CONNECTOR]: StoreAgentPreferences received empty reply"); m_log.DebugFormat("[AGENT PREFERENCES CONNECTOR]: StoreAgentPreferences received empty reply");

View File

@ -148,8 +148,7 @@ namespace OpenSim.Services.Connectors
m_ServerURI + "/auth/plain", m_ServerURI + "/auth/plain",
ServerUtils.BuildQueryString(sendData), m_Auth); ServerUtils.BuildQueryString(sendData), m_Auth);
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse( Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
reply);
if (replyData["Result"].ToString() != "Success") if (replyData["Result"].ToString() != "Success")
return false; return false;

View File

@ -157,17 +157,10 @@ namespace OpenSim.Services.Connectors
string reply = SynchronousRestFormsRequester.MakeRequest("POST", m_ServerURI, reqString, m_Auth); string reply = SynchronousRestFormsRequester.MakeRequest("POST", m_ServerURI, reqString, m_Auth);
if (reply != string.Empty) if (reply != string.Empty)
{ {
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); int indx = reply.IndexOf("success", StringComparison.InvariantCultureIgnoreCase);
if (indx > 0)
if (replyData.ContainsKey("result")) return true;
{ return false;
if (replyData["result"].ToString().ToLower() == "success")
return true;
else
return false;
}
else
m_log.DebugFormat("[MUTELIST CONNECTOR]: {0} reply data does not contain result field", meth);
} }
else else
m_log.DebugFormat("[MUTELIST CONNECTOR]: {0} received empty reply", meth); m_log.DebugFormat("[MUTELIST CONNECTOR]: {0} received empty reply", meth);

View File

@ -111,18 +111,10 @@ namespace OpenSim.Services.Connectors
m_Auth); m_Auth);
if (reply != string.Empty) if (reply != string.Empty)
{ {
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); int indx = reply.IndexOf("success", StringComparison.InvariantCultureIgnoreCase);
if (indx > 0)
if (replyData.ContainsKey("result")) return true;
{ return false;
if (replyData["result"].ToString().ToLower() == "success")
return true;
else
return false;
}
else
m_log.DebugFormat("[PRESENCE CONNECTOR]: LoginAgent reply data does not contain result field");
} }
else else
m_log.DebugFormat("[PRESENCE CONNECTOR]: LoginAgent received empty reply"); m_log.DebugFormat("[PRESENCE CONNECTOR]: LoginAgent received empty reply");
@ -155,20 +147,13 @@ namespace OpenSim.Services.Connectors
uri, uri,
reqString, reqString,
m_Auth); m_Auth);
if (reply != string.Empty) if (reply != string.Empty)
{ {
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); int indx = reply.IndexOf("success", StringComparison.InvariantCultureIgnoreCase);
if (indx > 0)
if (replyData.ContainsKey("result")) return true;
{ return false;
if (replyData["result"].ToString().ToLower() == "success")
return true;
else
return false;
}
else
m_log.DebugFormat("[PRESENCE CONNECTOR]: LogoutAgent reply data does not contain result field");
} }
else else
m_log.DebugFormat("[PRESENCE CONNECTOR]: LogoutAgent received empty reply"); m_log.DebugFormat("[PRESENCE CONNECTOR]: LogoutAgent received empty reply");
@ -202,18 +187,10 @@ namespace OpenSim.Services.Connectors
m_Auth); m_Auth);
if (reply != string.Empty) if (reply != string.Empty)
{ {
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); int indx = reply.IndexOf("success", StringComparison.InvariantCultureIgnoreCase);
if (indx > 0)
if (replyData.ContainsKey("result")) return true;
{ return false;
if (replyData["result"].ToString().ToLower() == "success")
return true;
else
return false;
}
else
m_log.DebugFormat("[PRESENCE CONNECTOR]: LogoutRegionAgents reply data does not contain result field");
} }
else else
m_log.DebugFormat("[PRESENCE CONNECTOR]: LogoutRegionAgents received empty reply"); m_log.DebugFormat("[PRESENCE CONNECTOR]: LogoutRegionAgents received empty reply");

View File

@ -469,7 +469,7 @@ namespace OpenSim.Services.Connectors.Simulation
try try
{ {
OSDMap args = new OSDMap(2); OSDMap args = new OSDMap(16);
args["sog"] = OSD.FromString(sog.ToXml2()); args["sog"] = OSD.FromString(sog.ToXml2());
args["extra"] = OSD.FromString(sog.ExtraToXmlString()); args["extra"] = OSD.FromString(sog.ExtraToXmlString());