some conditional dispose on http requests inputstream

httptests
UbitUmarov 2017-05-08 00:40:15 +01:00
parent 8ef43e5fb3
commit 604b966d84
2 changed files with 8 additions and 1 deletions

View File

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

View File

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