Close was being called to early on the Memory stream.

prioritization
Diva Canto 2009-10-03 16:27:55 -07:00
parent b75b887798
commit b6920267f0
3 changed files with 7 additions and 3 deletions

View File

@ -82,7 +82,6 @@ namespace OpenSim.Framework.Servers.HttpServer
serializer.Serialize(writer, obj); serializer.Serialize(writer, obj);
writer.Flush(); writer.Flush();
} }
buffer.Close();
int length = (int) buffer.Length; int length = (int) buffer.Length;
request.ContentLength = length; request.ContentLength = length;
@ -109,13 +108,16 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
finally finally
{ {
buffer.Close();
respStream.Close(); respStream.Close();
response.Close(); response.Close();
} }
action(deserial); action(deserial);
}, null); }, null);
}, null); }, null);
return; return;
} }

View File

@ -88,14 +88,15 @@ namespace OpenSim.Framework.Servers.HttpServer
serializer.Serialize(writer, sobj); serializer.Serialize(writer, sobj);
writer.Flush(); writer.Flush();
} }
buffer.Close();
int length = (int)buffer.Length; int length = (int)buffer.Length;
request.ContentLength = length; request.ContentLength = length;
Stream requestStream = request.GetRequestStream(); Stream requestStream = request.GetRequestStream();
requestStream.Write(buffer.ToArray(), 0, length); requestStream.Write(buffer.ToArray(), 0, length);
buffer.Close();
requestStream.Close(); requestStream.Close();
TResponse deserial = default(TResponse); TResponse deserial = default(TResponse);
using (WebResponse resp = request.GetResponse()) using (WebResponse resp = request.GetResponse())
{ {

View File

@ -62,7 +62,6 @@ namespace OpenSim.Framework.Servers.HttpServer
writer.Write(obj); writer.Write(obj);
writer.Flush(); writer.Flush();
} }
buffer.Close();
length = (int)obj.Length; length = (int)obj.Length;
request.ContentLength = length; request.ContentLength = length;
@ -80,6 +79,8 @@ namespace OpenSim.Framework.Servers.HttpServer
{ {
if (requestStream != null) if (requestStream != null)
requestStream.Close(); requestStream.Close();
buffer.Close();
} }
} }