aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authorOren Hurvitz2015-07-05 16:05:01 +0300
committerOren Hurvitz2015-08-11 07:35:37 +0100
commit4ad1468165b80f67439399e36688d36944996312 (patch)
tree541cfb87ecae92a3bff53aaa8875b06d83878a35 /OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
parentFixed mistakes in string format specifiers (e.g., "{0)" instead of {0}") (diff)
downloadopensim-SC-4ad1468165b80f67439399e36688d36944996312.zip
opensim-SC-4ad1468165b80f67439399e36688d36944996312.tar.gz
opensim-SC-4ad1468165b80f67439399e36688d36944996312.tar.bz2
opensim-SC-4ad1468165b80f67439399e36688d36944996312.tar.xz
Better handling of invalid XML: a) prevent infinite loop on EOF; b) better logging
If the XML was truncated for some reason then ExecuteReadProcessors() would get into an infinite loop, using high CPU. Now it detects EOF (and several other error cases) and aborts. The rest of the changes just improve logging of XML in case of errors, so that we can see what the bad XML is.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs19
1 files changed, 15 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index ac27716..b838177 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2243,13 +2243,25 @@ namespace OpenSim.Region.Framework.Scenes
2243 2243
2244 if (isSingleObject || isAttachment) 2244 if (isSingleObject || isAttachment)
2245 { 2245 {
2246 SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(reader); 2246 SceneObjectGroup g;
2247 try
2248 {
2249 g = SceneObjectSerializer.FromOriginalXmlFormat(reader);
2250 }
2251 catch (Exception e)
2252 {
2253 m_log.Error("[AGENT INVENTORY]: Deserialization of xml failed ", e);
2254 Util.LogFailedXML("[AGENT INVENTORY]:", xmlData);
2255 g = null;
2256 }
2257
2247 if (g != null) 2258 if (g != null)
2248 { 2259 {
2249 objlist.Add(g); 2260 objlist.Add(g);
2250 veclist.Add(Vector3.Zero); 2261 veclist.Add(Vector3.Zero);
2251 bbox = g.GetAxisAlignedBoundingBox(out offsetHeight); 2262 bbox = g.GetAxisAlignedBoundingBox(out offsetHeight);
2252 } 2263 }
2264
2253 return true; 2265 return true;
2254 } 2266 }
2255 else 2267 else
@@ -2291,9 +2303,8 @@ namespace OpenSim.Region.Framework.Scenes
2291 } 2303 }
2292 catch (Exception e) 2304 catch (Exception e)
2293 { 2305 {
2294 m_log.Error( 2306 m_log.Error("[AGENT INVENTORY]: Deserialization of xml failed when looking for CoalescedObject tag ", e);
2295 "[AGENT INVENTORY]: Deserialization of xml failed when looking for CoalescedObject tag. Exception ", 2307 Util.LogFailedXML("[AGENT INVENTORY]:", xmlData);
2296 e);
2297 } 2308 }
2298 2309
2299 return true; 2310 return true;