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);
writer.Flush();
}
buffer.Close();
int length = (int) buffer.Length;
request.ContentLength = length;
@ -109,14 +108,17 @@ namespace OpenSim.Framework.Servers.HttpServer
}
finally
{
buffer.Close();
respStream.Close();
response.Close();
}
action(deserial);
}, null);
}, null);
return;
}

View File

@ -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())
{

View File

@ -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();
}
}