diff --git a/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs b/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs index 6c8d7cf756..a459f1b370 100644 --- a/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs +++ b/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs @@ -82,7 +82,6 @@ namespace OpenSim.Framework.Servers.HttpServer serializer.Serialize(writer, obj); writer.Flush(); } - buffer.Close(); int length = (int) buffer.Length; request.ContentLength = length; @@ -109,13 +108,16 @@ namespace OpenSim.Framework.Servers.HttpServer } finally { + buffer.Close(); respStream.Close(); response.Close(); } action(deserial); + }, null); }, null); + return; } diff --git a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs index 6c0aa46ce8..7ebb462539 100644 --- a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs +++ b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs @@ -88,14 +88,15 @@ namespace OpenSim.Framework.Servers.HttpServer serializer.Serialize(writer, sobj); writer.Flush(); } - buffer.Close(); int length = (int)buffer.Length; request.ContentLength = length; Stream requestStream = request.GetRequestStream(); requestStream.Write(buffer.ToArray(), 0, length); + buffer.Close(); requestStream.Close(); + TResponse deserial = default(TResponse); using (WebResponse resp = request.GetResponse()) { diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs index e76d80e6c9..11df1039b2 100644 --- a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs +++ b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs @@ -62,7 +62,6 @@ namespace OpenSim.Framework.Servers.HttpServer writer.Write(obj); writer.Flush(); } - buffer.Close(); length = (int)obj.Length; request.ContentLength = length; @@ -80,6 +79,8 @@ namespace OpenSim.Framework.Servers.HttpServer { if (requestStream != null) requestStream.Close(); + buffer.Close(); + } }