From c643ff4cbadbe632654ff97d4d71f6abaa5b8605 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 15 Oct 2014 14:14:25 +0100 Subject: fix some errors when using http debug level > 4 --- OpenSim/Framework/WebUtil.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 86e5293..b5152e0 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -189,7 +189,10 @@ namespace OpenSim.Framework { if (DebugLevel == 5) { - output = output.Substring(0, 80); + int len = output.Length; + if(len > 80) + len = 80; + output = output.Substring(0, len); output = output + "..."; } @@ -1035,13 +1038,13 @@ namespace OpenSim.Framework { writer.Write(obj); writer.Flush(); + if (WebUtil.DebugLevel >= 5) + WebUtil.LogOutgoingDetail(buffer); } length = (int)obj.Length; request.ContentLength = length; - if (WebUtil.DebugLevel >= 5) - WebUtil.LogOutgoingDetail(buffer); Stream requestStream = null; try @@ -1188,14 +1191,13 @@ namespace OpenSim.Framework XmlSerializer serializer = new XmlSerializer(type); serializer.Serialize(writer, obj); writer.Flush(); + if (WebUtil.DebugLevel >= 5) + WebUtil.LogOutgoingDetail(buffer); } int length = (int)buffer.Length; request.ContentLength = length; - if (WebUtil.DebugLevel >= 5) - WebUtil.LogOutgoingDetail(buffer); - Stream requestStream = null; try { -- cgit v1.1