diff options
author | Diva Canto | 2015-08-01 18:58:05 -0700 |
---|---|---|
committer | Diva Canto | 2015-08-01 18:58:05 -0700 |
commit | e5a1243abc04c3f6f62e94425fea25b2ad84b577 (patch) | |
tree | 6b408e3b9cf8bb35a7de9042be8270df3900809f /OpenSim/Region/Framework | |
parent | Mantis #7664: Added IHypergridLinker interface to establish a contract about ... (diff) | |
download | opensim-SC-e5a1243abc04c3f6f62e94425fea25b2ad84b577.zip opensim-SC-e5a1243abc04c3f6f62e94425fea25b2ad84b577.tar.gz opensim-SC-e5a1243abc04c3f6f62e94425fea25b2ad84b577.tar.bz2 opensim-SC-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')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index c14ce1e..dde54d5 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -37,6 +37,7 @@ using OpenMetaverse; | |||
37 | using OpenMetaverse.Packets; | 37 | using OpenMetaverse.Packets; |
38 | using log4net; | 38 | using log4net; |
39 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
40 | using OpenSim.Framework.Serialization.External; | ||
40 | using OpenSim.Region.Framework; | 41 | using OpenSim.Region.Framework; |
41 | using OpenSim.Framework.Client; | 42 | using OpenSim.Framework.Client; |
42 | using OpenSim.Region.Framework.Interfaces; | 43 | using OpenSim.Region.Framework.Interfaces; |
@@ -2225,7 +2226,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2225 | bbox = Vector3.Zero; | 2226 | bbox = Vector3.Zero; |
2226 | offsetHeight = 0; | 2227 | offsetHeight = 0; |
2227 | 2228 | ||
2228 | string xmlData = Utils.BytesToString(assetData); | 2229 | string xmlData = ExternalRepresentationUtils.SanitizeXml(Utils.BytesToString(assetData)); |
2229 | 2230 | ||
2230 | try | 2231 | try |
2231 | { | 2232 | { |
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 | { |