From 604b966d8442be6f034d81c8e8d04d12413c357c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 8 May 2017 00:40:15 +0100 Subject: some conditional dispose on http requests inputstream --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 3 ++- OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/Servers') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index c32ee28..92be3a3 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -686,7 +686,8 @@ namespace OpenSim.Framework.Servers.HttpServer } } - request.InputStream.Dispose(); + if(request.InputStream.CanRead) + request.InputStream.Dispose(); if (buffer != null) { diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs index 0e4a941..fefcb20 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs @@ -82,6 +82,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; @@ -107,6 +110,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; -- cgit v1.1