From f54a36bd592fec6571ddfda81d12a546583ab123 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 12 May 2011 17:34:26 -0700 Subject: Tracking a problem with offline IMs coming in as null list. --- OpenSim/Framework/WebUtil.cs | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index bc2cd01..2fd31d8 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -918,6 +918,10 @@ namespace OpenSim.Framework public class SynchronousRestObjectRequester { + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); + /// /// Perform a synchronous REST request. /// @@ -972,9 +976,9 @@ namespace OpenSim.Framework } } - try + using (WebResponse resp = request.GetResponse()) { - using (WebResponse resp = request.GetResponse()) + try { if (resp.ContentLength > 0) { @@ -984,10 +988,19 @@ namespace OpenSim.Framework respStream.Close(); } } - } - catch (System.InvalidOperationException) - { - // This is what happens when there is invalid XML + catch (System.InvalidOperationException) + { + // This is what happens when there is invalid XML + try + { + m_log.WarnFormat("[SynchronousRestObjectRequester]: Invalid XML:"); + using (StreamReader sr = new StreamReader(resp.GetResponseStream())) + m_log.WarnFormat("{0}", sr.ReadToEnd()); + } + catch (Exception e) + { } + + } } return deserial; } -- cgit v1.1