Better handling of invalid XML: a) prevent infinite loop on EOF; b) better logging

If the XML was truncated for some reason then ExecuteReadProcessors() would get into an infinite loop, using high CPU. Now it detects EOF (and several other error cases) and aborts.

The rest of the changes just improve logging of XML in case of errors, so that we can see what the bad XML is.
This commit is contained in:
Oren Hurvitz
2015-07-05 16:05:01 +03:00
parent 373455a6fa
commit 4ad1468165
5 changed files with 115 additions and 69 deletions

View File

@@ -178,10 +178,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
}
catch (Exception e)
{
m_log.Error(string.Format(
"[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml failed with {0} ",
e.Message), e);
m_log.Error("[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml failed ", e);
Util.LogFailedXML("[COALESCED SCENE OBJECTS SERIALIZER]:", xml);
return false;
}