throtle datasnapshot gen

This commit is contained in:
UbitUmarov
2018-01-22 18:37:39 +00:00
parent e3fc272f50
commit efc7480342
2 changed files with 22 additions and 5 deletions

View File

@@ -63,18 +63,24 @@ namespace OpenSim.Region.DataSnapshot
public Hashtable OnGetSnapshot(Hashtable keysvals)
{
m_log.Debug("[DATASNAPSHOT] Received collection request");
string snapObj = (string)keysvals["region"];
m_log.DebugFormat("[DATASNAPSHOT] Received collection request for {0}", snapObj);
Hashtable reply = new Hashtable();
int statuscode = 200;
string snapObj = (string)keysvals["region"];
XmlDocument response = m_externalData.GetSnapshot(snapObj);
if(response == null)
{
reply["str_response_string"] = string.Empty;
reply["int_response_code"] = 503;
reply["content_type"] = "text";
m_log.Debug("[DATASNAPSHOT] Collection request reply try later");
return reply;
}
reply["str_response_string"] = response.OuterXml;
reply["int_response_code"] = statuscode;
reply["content_type"] = "text/xml";
return reply;
}