some conditional dispose on http requests inputstream

httptests
UbitUmarov 2017-05-08 00:54:17 +01:00
parent b20778d8ec
commit 6c79cc652b
2 changed files with 8 additions and 1 deletions

View File

@ -815,7 +815,8 @@ namespace OpenSim.Framework.Servers.HttpServer
}
}
request.InputStream.Dispose();
if(request.InputStream.CanRead)
request.InputStream.Dispose();
if (buffer != null)
{

View File

@ -86,6 +86,9 @@ namespace OpenSim.Framework.Servers.HttpServer
byte[] buffer = server.DoHTTPGruntWork(responsedata, response);
if(Request.Body.CanRead)
Request.Body.Dispose();
response.SendChunked = false;
response.ContentLength64 = buffer.Length;
response.ContentEncoding = Encoding.UTF8;
@ -111,6 +114,9 @@ namespace OpenSim.Framework.Servers.HttpServer
OSHttpResponse response
= new OSHttpResponse(new HttpResponse(HttpContext, Request), HttpContext);
if(Request.Body.CanRead)
Request.Body.Dispose();
response.SendChunked = false;
response.ContentLength64 = 0;
response.ContentEncoding = Encoding.UTF8;