still losing time with of halcyon incompatibile oars... cathch exceptions of the function that actually throws; Reduce log spam; don't let a broken MOAP stop all object deserialization. Fixing MOAP does not mean halcyon oars issues are fixed, just one. And really we should not even try to go against halcyon decison to be incompatible.(our MOAP encoding did not change since 2010)

0.9.0-post-fixes
UbitUmarov 2017-06-09 12:14:13 +01:00
parent 5bfe8b18fe
commit d12957dc2c
1 changed files with 6 additions and 8 deletions

View File

@ -1364,26 +1364,24 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
string value = String.Empty; string value = String.Empty;
try try
{ {
// The prominant format for MOAP is escaped XML (with > etc). // The STANDARD content of Media elemet is escaped XML string (with > etc).
// This is read as a string and passed to PrimitiveBaseShape which requires
// its XML as a string (which it parses with its own XmlReader).
value = reader.ReadElementContentAsString("Media", String.Empty); value = reader.ReadElementContentAsString("Media", String.Empty);
shp.Media = PrimitiveBaseShape.MediaList.FromXml(value);
} }
catch (XmlException e) catch (XmlException e)
{ {
// There are versions of OAR files that contain unquoted XML. // There are versions of OAR files that contain unquoted XML.
// ie ONE comercial fork that never wanted their oars to be read by our code
try try
{ {
m_log.WarnFormat("[SERIALIZER] MOAP specification in non-escaped XML format. Recovering.");
value = reader.ReadInnerXml(); value = reader.ReadInnerXml();
shp.Media = PrimitiveBaseShape.MediaList.FromXml(value);
} }
catch (Exception ee) catch
{ {
m_log.ErrorFormat("[SERIALIZER] Failed parsing of MOAP information"); m_log.ErrorFormat("[SERIALIZER] Failed parsing halcyon MOAP information");
throw new XmlException("Failed parsing of MOAP media XML element");
} }
} }
shp.Media = PrimitiveBaseShape.MediaList.FromXml(value);
} }
#endregion #endregion