aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Serialization
diff options
context:
space:
mode:
authorDiva Canto2015-08-01 18:58:05 -0700
committerDiva Canto2015-08-01 18:58:05 -0700
commite5a1243abc04c3f6f62e94425fea25b2ad84b577 (patch)
tree6b408e3b9cf8bb35a7de9042be8270df3900809f /OpenSim/Region/Framework/Scenes/Serialization
parentMantis #7664: Added IHypergridLinker interface to establish a contract about ... (diff)
downloadopensim-SC_OLD-e5a1243abc04c3f6f62e94425fea25b2ad84b577.zip
opensim-SC_OLD-e5a1243abc04c3f6f62e94425fea25b2ad84b577.tar.gz
opensim-SC_OLD-e5a1243abc04c3f6f62e94425fea25b2ad84b577.tar.bz2
opensim-SC_OLD-e5a1243abc04c3f6f62e94425fea25b2ad84b577.tar.xz
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!
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Serialization')
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index cb13ca4..463ef22 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 53
54 private static IUserManagement m_UserManagement; 54 private static IUserManagement m_UserManagement;
55 55
56 /// <summary> 56 /// <summary>
57 /// Deserialize a scene object from the original xml format 57 /// Deserialize a scene object from the original xml format
58 /// </summary> 58 /// </summary>
@@ -60,7 +60,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
60 /// <returns>The scene object deserialized. Null on failure.</returns> 60 /// <returns>The scene object deserialized. Null on failure.</returns>
61 public static SceneObjectGroup FromOriginalXmlFormat(string xmlData) 61 public static SceneObjectGroup FromOriginalXmlFormat(string xmlData)
62 { 62 {
63 using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null)) 63 String fixedData = ExternalRepresentationUtils.SanitizeXml(xmlData);
64 using (XmlTextReader wrappedReader = new XmlTextReader(fixedData, XmlNodeType.Element, null))
64 using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment })) 65 using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment }))
65 return FromOriginalXmlFormat(reader); 66 return FromOriginalXmlFormat(reader);
66 } 67 }
@@ -322,7 +323,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
322 List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); 323 List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
323 CoalescedSceneObjects coa = null; 324 CoalescedSceneObjects coa = null;
324 325
325 string xmlData = Utils.BytesToString(data); 326 string xmlData = ExternalRepresentationUtils.SanitizeXml(Utils.BytesToString(data));
326 327
327 if (CoalescedSceneObjectsSerializer.TryFromXml(xmlData, out coa)) 328 if (CoalescedSceneObjectsSerializer.TryFromXml(xmlData, out coa))
328 { 329 {