Mantis #7657 and #7514. This should alleviate the problem of bad object assets being passed around via HG and archives. No guarantees that all the leaks have been found, but at least it detects and fixes these bad assets upon:

(1) storing and getting assets over HG -- assuming the core HG asset service is being used (not the case with OSGrid!)
(2) importing assets via OAR and IAR

Instantiation of bad assets now should also work, instead of producing an exception, but the bad assets themselves aren't being fixed in the DB. That should be done with a cleaning tool -- see Perl script in Mantis #7657.

Virus!
This commit is contained in:
Diva Canto
2015-08-01 18:58:05 -07:00
parent 32d87aa168
commit e5a1243abc
4 changed files with 47 additions and 4 deletions

View File

@@ -52,7 +52,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static IUserManagement m_UserManagement;
/// <summary>
/// Deserialize a scene object from the original xml format
/// </summary>
@@ -60,7 +60,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
/// <returns>The scene object deserialized. Null on failure.</returns>
public static SceneObjectGroup FromOriginalXmlFormat(string xmlData)
{
using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null))
String fixedData = ExternalRepresentationUtils.SanitizeXml(xmlData);
using (XmlTextReader wrappedReader = new XmlTextReader(fixedData, XmlNodeType.Element, null))
using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment }))
return FromOriginalXmlFormat(reader);
}
@@ -322,7 +323,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
CoalescedSceneObjects coa = null;
string xmlData = Utils.BytesToString(data);
string xmlData = ExternalRepresentationUtils.SanitizeXml(Utils.BytesToString(data));
if (CoalescedSceneObjectsSerializer.TryFromXml(xmlData, out coa))
{