Commit 9af29e8a authored by justcoding121's avatar justcoding121

#184 dispose args

parent 5d461f5b
...@@ -218,6 +218,10 @@ namespace Titanium.Web.Proxy.Http ...@@ -218,6 +218,10 @@ namespace Titanium.Web.Proxy.Http
//but just to be on safe side //but just to be on safe side
Request.RequestBody = null; Request.RequestBody = null;
Response.ResponseBody = null; Response.ResponseBody = null;
Request.RequestBodyString = null;
Response.ResponseBodyString = null;
} }
} }
} }
...@@ -460,6 +460,7 @@ namespace Titanium.Web.Proxy ...@@ -460,6 +460,7 @@ namespace Titanium.Web.Proxy
await CheckAuthorization(clientStreamWriter, await CheckAuthorization(clientStreamWriter,
args.WebSession.Request.RequestHeaders.Values) == false) args.WebSession.Request.RequestHeaders.Values) == false)
{ {
args.Dispose();
break; break;
} }
...@@ -480,6 +481,7 @@ namespace Titanium.Web.Proxy ...@@ -480,6 +481,7 @@ namespace Titanium.Web.Proxy
httpCmd, httpVersion, args.WebSession.Request.RequestHeaders, args.IsHttps, httpCmd, httpVersion, args.WebSession.Request.RequestHeaders, args.IsHttps,
clientStream, tcpConnectionFactory); clientStream, tcpConnectionFactory);
args.Dispose();
break; break;
} }
...@@ -494,20 +496,25 @@ namespace Titanium.Web.Proxy ...@@ -494,20 +496,25 @@ namespace Titanium.Web.Proxy
if (disposed) if (disposed)
{ {
//already disposed inside above method //already disposed inside above method
args.Dispose();
break; break;
} }
if (args.WebSession.Request.CancelRequest) if (args.WebSession.Request.CancelRequest)
{ {
args.Dispose();
break; break;
} }
//if connection is closing exit //if connection is closing exit
if (args.WebSession.Response.ResponseKeepAlive == false) if (args.WebSession.Response.ResponseKeepAlive == false)
{ {
args.Dispose();
break; break;
} }
args.Dispose();
// read the next request // read the next request
httpCmd = await clientStreamReader.ReadLineAsync(); httpCmd = await clientStreamReader.ReadLineAsync();
} }
......
...@@ -133,8 +133,6 @@ namespace Titanium.Web.Proxy ...@@ -133,8 +133,6 @@ namespace Titanium.Web.Proxy
return true; return true;
} }
args.Dispose();
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment