Merge branch 'master' into httptests

httptests
UbitUmarov 2018-01-16 17:17:44 +00:00
commit b903287dd1
22 changed files with 32 additions and 42 deletions

View File

@ -83,8 +83,7 @@ namespace OpenSim.Framework.Capabilities
{
using (XmlTextReader reader = new XmlTextReader(st))
{
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.XmlResolver = null;
reader.ProhibitDtd = true;
reader.Read();
SkipWS(reader);

View File

@ -193,8 +193,7 @@ namespace OpenSim.Framework
using(MemoryStream ms = new MemoryStream(enc.GetBytes(text)))
using(XmlTextReader xreader = new XmlTextReader(ms))
{
xreader.DtdProcessing = DtdProcessing.Prohibit;
xreader.XmlResolver = null;
xreader.ProhibitDtd = true;
v = new PhysicsInertiaData();
v.FromXml2(xreader, out error);

View File

@ -1595,8 +1595,7 @@ namespace OpenSim.Framework
{
using (XmlTextReader xtr = new XmlTextReader(sr))
{
xtr.DtdProcessing = DtdProcessing.Prohibit;
xtr.XmlResolver = null;
xtr.ProhibitDtd = true;
xtr.MoveToContent();

View File

@ -221,7 +221,7 @@ namespace OpenSim.Framework.Serialization.External
using (StringWriter sw = new StringWriter())
using (XmlTextWriter writer = new XmlTextWriter(sw))
using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null))
using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, DtdProcessing = DtdProcessing.Prohibit, XmlResolver = null }))
using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, ProhibitDtd = true}))
{
TransformXml(reader, writer, sceneName, homeURL, userService, scopeID);

View File

@ -178,8 +178,7 @@ namespace OpenSim.Framework.Serialization.External
using (XmlTextReader reader = new XmlTextReader(new StringReader(serializedLandData)))
{
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.XmlResolver = null;
reader.ProhibitDtd = true;
reader.ReadStartElement("LandData");
ExternalRepresentationUtils.ExecuteReadProcessors<LandData>(landData, m_ldProcessors, reader);

View File

@ -63,8 +63,7 @@ namespace OpenSim.Framework.Serialization.External
StringReader sr = new StringReader(serializedSettings);
XmlTextReader xtr = new XmlTextReader(sr);
xtr.DtdProcessing = DtdProcessing.Prohibit;
xtr.XmlResolver = null;
xtr.ProhibitDtd = true;
xtr.ReadStartElement("RegionSettings");

View File

@ -202,8 +202,7 @@ namespace OpenSim.Framework.Serialization.External
using (XmlTextReader reader = new XmlTextReader(new StringReader(serialization)))
{
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.XmlResolver = null;
reader.ProhibitDtd = true;
reader.ReadStartElement("InventoryItem");

View File

@ -54,8 +54,7 @@ namespace OpenSim.Framework.Servers.HttpServer
TRequest deserial;
using (XmlTextReader xmlReader = new XmlTextReader(request))
{
xmlReader.DtdProcessing = DtdProcessing.Prohibit;
xmlReader.XmlResolver = null;
xmlReader.ProhibitDtd = true;
XmlSerializer deserializer = new XmlSerializer(typeof (TRequest));
deserial = (TRequest) deserializer.Deserialize(xmlReader);

View File

@ -210,8 +210,8 @@ namespace OpenSim.Framework.Servers.HttpServer
{
try
{
xmlReader.DtdProcessing = DtdProcessing.Prohibit;
xmlReader.XmlResolver = null;
xmlReader.ProhibitDtd = true;
XmlSerializer deserializer = new XmlSerializer(typeof(RestSessionObject<TRequest>));
deserial = (RestSessionObject<TRequest>)deserializer.Deserialize(xmlReader);
}
@ -271,8 +271,8 @@ namespace OpenSim.Framework.Servers.HttpServer
{
try
{
xmlReader.DtdProcessing = DtdProcessing.Prohibit;
xmlReader.XmlResolver = null;
xmlReader.ProhibitDtd = true;
XmlSerializer deserializer = new XmlSerializer(typeof(TRequest));
deserial = (TRequest)deserializer.Deserialize(xmlReader);
}

View File

@ -124,8 +124,8 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures
{
using(XmlTextReader sr = new XmlTextReader(s))
{
sr.DtdProcessing = DtdProcessing.Prohibit;
sr.XmlResolver = null;
sr.ProhibitDtd = true;
sr.ReadStartElement("BakedAppearance");
while(sr.LocalName == "BakedTexture")
{

View File

@ -1130,8 +1130,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable());
XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
XmlTextReader xtr = new XmlTextReader(Encoding.ASCII.GetString(data), XmlNodeType.Document, context);
xtr.DtdProcessing = DtdProcessing.Prohibit;
xtr.XmlResolver = null;
xtr.ProhibitDtd = true;
// Loaded metadata will be empty if no information exists in the archive
dearchivedScenes.LoadedCreationDateTime = 0;

View File

@ -93,8 +93,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
StringReader sr = new StringReader(xml);
XmlTextReader reader = new XmlTextReader(sr);
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.XmlResolver = null;
reader.ProhibitDtd = true;
reader.ReadStartElement("assets");
reader.Read();

View File

@ -720,6 +720,8 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
string xml = SceneObjectSerializer.ToOriginalXmlFormat(so);
XmlTextReader xtr = new XmlTextReader(new StringReader(xml));
xtr.ProhibitDtd = true;
xtr.ReadStartElement("SceneObjectGroup");
xtr.ReadStartElement("RootPart");
xtr.ReadStartElement("SceneObjectPart");
@ -831,6 +833,8 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
string xml2 = m_serialiserModule.SerializeGroupToXml2(so, options);
XmlTextReader xtr = new XmlTextReader(new StringReader(xml2));
xtr.ProhibitDtd = true;
xtr.ReadStartElement("SceneObjectGroup");
xtr.ReadStartElement("SceneObjectPart");

View File

@ -58,8 +58,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation
using (XmlTextReader reader = new XmlTextReader(path))
{
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.XmlResolver = null;
reader.ProhibitDtd = true;
XmlDocument doc = new XmlDocument();
doc.XmlResolver = null;

View File

@ -593,8 +593,7 @@ namespace OpenSim.Region.Framework.Scenes
UTF8Encoding enc = new UTF8Encoding();
MemoryStream ms = new MemoryStream(enc.GetBytes(text));
XmlTextReader xreader = new XmlTextReader(ms);
xreader.DtdProcessing = DtdProcessing.Prohibit;
xreader.XmlResolver = null;
xreader.ProhibitDtd = true;
SOPVehicle v = new SOPVehicle();
bool error;

View File

@ -2389,7 +2389,7 @@ namespace OpenSim.Region.Framework.Scenes
{
using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null))
{
using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, DtdProcessing = DtdProcessing.Prohibit, XmlResolver = null }))
using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, ProhibitDtd = true }))
{
reader.Read();
bool isSingleObject = reader.Name != "CoalescedObject";

View File

@ -1943,7 +1943,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (!m_backingup)
{
WorkManager.RunInThreadPool(o => Backup(false), null, string.Format("BackupWorker ({0})", Name));
WorkManager.RunInThreadPool(o => Backup(false), null, string.Format("BackupWorker ({0})", Name, false));
}
}

View File

@ -133,8 +133,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
{
using (XmlTextReader reader = new XmlTextReader(sr))
{
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.XmlResolver = null;
reader.ProhibitDtd = true;
reader.MoveToContent(); // skip possible xml declaration

View File

@ -63,7 +63,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
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, DtdProcessing = DtdProcessing.Prohibit, XmlResolver = null }))
using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, ProhibitDtd = true }))
{
try
{
@ -272,8 +272,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
{
using(XmlTextReader reader = new XmlTextReader(sr))
{
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.XmlResolver = null;
reader.ProhibitDtd = true;
sceneObject = new SceneObjectGroup(SceneObjectPart.FromXml(reader));
}

View File

@ -57,8 +57,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
using(XmlTextReader reader = new XmlTextReader(fileName))
{
reader.WhitespaceHandling = WhitespaceHandling.None;
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.XmlResolver = null;
reader.ProhibitDtd = true;
doc.Load(reader);
}

View File

@ -200,8 +200,8 @@ namespace OpenSim.Region.Framework.Scenes
{
using(XmlTextReader reader = new XmlTextReader(sr))
{
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.XmlResolver = null;
reader.ProhibitDtd = true;
ReadXml(reader);
}
}

View File

@ -1148,8 +1148,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
using (Stream s = rsp.GetResponseStream())
using (XmlTextReader rdr = new XmlTextReader(s))
{
rdr.DtdProcessing = DtdProcessing.Prohibit;
rdr.XmlResolver = null;
rdr.ProhibitDtd = true;
doc.Load(rdr);
}
}