aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2018-01-05 12:24:07 +0000
committerUbitUmarov2018-01-05 12:24:07 +0000
commit89a690c11f8c7b6bbe0b6339e79a64d1ae428aec (patch)
treeeb039c92222bf22359a20ecb5294b8ab1b2a38eb /OpenSim/Region
parentdon't be bad Jenkins.. (diff)
downloadopensim-SC_OLD-89a690c11f8c7b6bbe0b6339e79a64d1ae428aec.zip
opensim-SC_OLD-89a690c11f8c7b6bbe0b6339e79a64d1ae428aec.tar.gz
opensim-SC_OLD-89a690c11f8c7b6bbe0b6339e79a64d1ae428aec.tar.bz2
opensim-SC_OLD-89a690c11f8c7b6bbe0b6339e79a64d1ae428aec.tar.xz
a few more xml things
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SOPVehicle.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs31
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/TerrainChannel.cs16
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs7
11 files changed, 60 insertions, 24 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs
index cfa9581..013b416 100644
--- a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs
@@ -124,6 +124,8 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures
124 { 124 {
125 using(XmlTextReader sr = new XmlTextReader(s)) 125 using(XmlTextReader sr = new XmlTextReader(s))
126 { 126 {
127 sr.DtdProcessing = DtdProcessing.Prohibit;
128 sr.XmlResolver = null;
127 sr.ReadStartElement("BakedAppearance"); 129 sr.ReadStartElement("BakedAppearance");
128 while(sr.LocalName == "BakedTexture") 130 while(sr.LocalName == "BakedTexture")
129 { 131 {
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index 99ff9b5..63ebf86 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -1130,6 +1130,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
1130 XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable()); 1130 XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable());
1131 XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None); 1131 XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
1132 XmlTextReader xtr = new XmlTextReader(Encoding.ASCII.GetString(data), XmlNodeType.Document, context); 1132 XmlTextReader xtr = new XmlTextReader(Encoding.ASCII.GetString(data), XmlNodeType.Document, context);
1133 xtr.DtdProcessing = DtdProcessing.Prohibit;
1134 xtr.XmlResolver = null;
1133 1135
1134 // Loaded metadata will be empty if no information exists in the archive 1136 // Loaded metadata will be empty if no information exists in the archive
1135 dearchivedScenes.LoadedCreationDateTime = 0; 1137 dearchivedScenes.LoadedCreationDateTime = 0;
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs
index 8c0ef88..92c935b 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs
@@ -93,6 +93,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
93 93
94 StringReader sr = new StringReader(xml); 94 StringReader sr = new StringReader(xml);
95 XmlTextReader reader = new XmlTextReader(sr); 95 XmlTextReader reader = new XmlTextReader(sr);
96 reader.DtdProcessing = DtdProcessing.Prohibit;
97 reader.XmlResolver = null;
96 98
97 reader.ReadStartElement("assets"); 99 reader.ReadStartElement("assets");
98 reader.Read(); 100 reader.Read();
diff --git a/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs b/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs
index b8db3a9..38ab934 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs
@@ -58,7 +58,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation
58 58
59 using (XmlTextReader reader = new XmlTextReader(path)) 59 using (XmlTextReader reader = new XmlTextReader(path))
60 { 60 {
61 reader.DtdProcessing = DtdProcessing.Prohibit;
62 reader.XmlResolver = null;
61 XmlDocument doc = new XmlDocument(); 63 XmlDocument doc = new XmlDocument();
64 doc.XmlResolver = null;
65
62 doc.Load(reader); 66 doc.Load(reader);
63// if (doc.DocumentElement != null) 67// if (doc.DocumentElement != null)
64// { 68// {
diff --git a/OpenSim/Region/Framework/Scenes/SOPVehicle.cs b/OpenSim/Region/Framework/Scenes/SOPVehicle.cs
index 351eda3..22734b3 100644
--- a/OpenSim/Region/Framework/Scenes/SOPVehicle.cs
+++ b/OpenSim/Region/Framework/Scenes/SOPVehicle.cs
@@ -593,6 +593,8 @@ namespace OpenSim.Region.Framework.Scenes
593 UTF8Encoding enc = new UTF8Encoding(); 593 UTF8Encoding enc = new UTF8Encoding();
594 MemoryStream ms = new MemoryStream(enc.GetBytes(text)); 594 MemoryStream ms = new MemoryStream(enc.GetBytes(text));
595 XmlTextReader xreader = new XmlTextReader(ms); 595 XmlTextReader xreader = new XmlTextReader(ms);
596 xreader.DtdProcessing = DtdProcessing.Prohibit;
597 xreader.XmlResolver = null;
596 598
597 SOPVehicle v = new SOPVehicle(); 599 SOPVehicle v = new SOPVehicle();
598 bool error; 600 bool error;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 71c8807..84367df 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2389,7 +2389,7 @@ namespace OpenSim.Region.Framework.Scenes
2389 { 2389 {
2390 using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null)) 2390 using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null))
2391 { 2391 {
2392 using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment })) 2392 using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, DtdProcessing = DtdProcessing.Prohibit, XmlResolver = null }))
2393 { 2393 {
2394 reader.Read(); 2394 reader.Read();
2395 bool isSingleObject = reader.Name != "CoalescedObject"; 2395 bool isSingleObject = reader.Name != "CoalescedObject";
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs
index a93782e..c3bc4a0 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs
@@ -133,6 +133,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
133 { 133 {
134 using (XmlTextReader reader = new XmlTextReader(sr)) 134 using (XmlTextReader reader = new XmlTextReader(sr))
135 { 135 {
136 reader.DtdProcessing = DtdProcessing.Prohibit;
137 reader.XmlResolver = null;
138
136 reader.MoveToContent(); // skip possible xml declaration 139 reader.MoveToContent(); // skip possible xml declaration
137 140
138 if (reader.Name != "CoalescedObject") 141 if (reader.Name != "CoalescedObject")
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 948c345..a2d512a 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -63,7 +63,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
63 String fixedData = ExternalRepresentationUtils.SanitizeXml(xmlData); 63 String fixedData = ExternalRepresentationUtils.SanitizeXml(xmlData);
64 using (XmlTextReader wrappedReader = new XmlTextReader(fixedData, XmlNodeType.Element, null)) 64 using (XmlTextReader wrappedReader = new XmlTextReader(fixedData, XmlNodeType.Element, null))
65 { 65 {
66 using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment })) 66 using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, DtdProcessing = DtdProcessing.Prohibit, XmlResolver = null }))
67 { 67 {
68 try 68 try
69 { 69 {
@@ -267,18 +267,29 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
267 return null; 267 return null;
268 } 268 }
269 269
270 StringReader sr = new StringReader(parts[0].OuterXml); 270 SceneObjectGroup sceneObject;
271 XmlTextReader reader = new XmlTextReader(sr); 271 using(StringReader sr = new StringReader(parts[0].OuterXml))
272 SceneObjectGroup sceneObject = new SceneObjectGroup(SceneObjectPart.FromXml(reader)); 272 {
273 reader.Close(); 273 using(XmlTextReader reader = new XmlTextReader(sr))
274 sr.Close(); 274 {
275 reader.DtdProcessing = DtdProcessing.Prohibit;
276 reader.XmlResolver = null;
277
278 sceneObject = new SceneObjectGroup(SceneObjectPart.FromXml(reader));
279 }
280 }
275 281
276 // Then deal with the rest 282 // Then deal with the rest
283 SceneObjectPart part;
277 for (int i = 1; i < parts.Count; i++) 284 for (int i = 1; i < parts.Count; i++)
278 { 285 {
279 sr = new StringReader(parts[i].OuterXml); 286 using(StringReader sr = new StringReader(parts[i].OuterXml))
280 reader = new XmlTextReader(sr); 287 {
281 SceneObjectPart part = SceneObjectPart.FromXml(reader); 288 using(XmlTextReader reader = new XmlTextReader(sr))
289 {
290 part = SceneObjectPart.FromXml(reader);
291 }
292 }
282 293
283 int originalLinkNum = part.LinkNum; 294 int originalLinkNum = part.LinkNum;
284 295
@@ -289,8 +300,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
289 if (originalLinkNum != 0) 300 if (originalLinkNum != 0)
290 part.LinkNum = originalLinkNum; 301 part.LinkNum = originalLinkNum;
291 302
292 reader.Close();
293 sr.Close();
294 } 303 }
295 304
296 XmlNodeList keymotion = doc.GetElementsByTagName("KeyframeMotion"); 305 XmlNodeList keymotion = doc.GetElementsByTagName("KeyframeMotion");
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
index 34fdb6d..977dd73 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
@@ -49,14 +49,19 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
49 public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, Vector3 loadOffset) 49 public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, Vector3 loadOffset)
50 { 50 {
51 XmlDocument doc = new XmlDocument(); 51 XmlDocument doc = new XmlDocument();
52 doc.XmlResolver=null;
52 XmlNode rootNode; 53 XmlNode rootNode;
53 54
54 if (fileName.StartsWith("http:") || File.Exists(fileName)) 55 if (fileName.StartsWith("http:") || File.Exists(fileName))
55 { 56 {
56 XmlTextReader reader = new XmlTextReader(fileName); 57 using(XmlTextReader reader = new XmlTextReader(fileName))
57 reader.WhitespaceHandling = WhitespaceHandling.None; 58 {
58 doc.Load(reader); 59 reader.WhitespaceHandling = WhitespaceHandling.None;
59 reader.Close(); 60 reader.DtdProcessing = DtdProcessing.Prohibit;
61 reader.XmlResolver = null;
62
63 doc.Load(reader);
64 }
60 rootNode = doc.FirstChild; 65 rootNode = doc.FirstChild;
61 foreach (XmlNode aPrimNode in rootNode.ChildNodes) 66 foreach (XmlNode aPrimNode in rootNode.ChildNodes)
62 { 67 {
diff --git a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs
index 89d78cf..1beca04 100644
--- a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs
+++ b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs
@@ -196,13 +196,15 @@ namespace OpenSim.Region.Framework.Scenes
196 // ITerrainChannel.LoadFromXmlString() 196 // ITerrainChannel.LoadFromXmlString()
197 public void LoadFromXmlString(string data) 197 public void LoadFromXmlString(string data)
198 { 198 {
199 StringReader sr = new StringReader(data); 199 using(StringReader sr = new StringReader(data))
200 XmlTextReader reader = new XmlTextReader(sr); 200 {
201 reader.Read(); 201 using(XmlTextReader reader = new XmlTextReader(sr))
202 202 {
203 ReadXml(reader); 203 reader.DtdProcessing = DtdProcessing.Prohibit;
204 reader.Close(); 204 reader.XmlResolver = null;
205 sr.Close(); 205 ReadXml(reader);
206 }
207 }
206 } 208 }
207 209
208 // ITerrainChannel.Merge 210 // ITerrainChannel.Merge
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
index 57930d7..08242b6 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
@@ -1125,6 +1125,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1125 return null; 1125 return null;
1126 1126
1127 doc = new XmlDocument(); 1127 doc = new XmlDocument();
1128 doc.XmlResolver = null;
1128 1129
1129 // Let's serialize all calls to Vivox. Most of these are driven by 1130 // Let's serialize all calls to Vivox. Most of these are driven by
1130 // the clients (CAPs), when the user arrives at the region. We don't 1131 // the clients (CAPs), when the user arrives at the region. We don't
@@ -1146,7 +1147,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1146 using (HttpWebResponse rsp = (HttpWebResponse)req.GetResponse()) 1147 using (HttpWebResponse rsp = (HttpWebResponse)req.GetResponse())
1147 using (Stream s = rsp.GetResponseStream()) 1148 using (Stream s = rsp.GetResponseStream())
1148 using (XmlTextReader rdr = new XmlTextReader(s)) 1149 using (XmlTextReader rdr = new XmlTextReader(s))
1149 doc.Load(rdr); 1150 {
1151 rdr.DtdProcessing = DtdProcessing.Prohibit;
1152 rdr.XmlResolver = null;
1153 doc.Load(rdr);
1154 }
1150 } 1155 }
1151 catch (Exception e) 1156 catch (Exception e)
1152 { 1157 {