Commit 9af29e8a authored by justcoding121's avatar justcoding121

#184 dispose args

parent 5d461f5b
......@@ -218,6 +218,10 @@ namespace Titanium.Web.Proxy.Http
//but just to be on safe side
Request.RequestBody = null;
Response.ResponseBody = null;
Request.RequestBodyString = null;
Response.ResponseBodyString = null;
}
}
}
......@@ -460,6 +460,7 @@ namespace Titanium.Web.Proxy
await CheckAuthorization(clientStreamWriter,
args.WebSession.Request.RequestHeaders.Values) == false)
{
args.Dispose();
break;
}
......@@ -480,6 +481,7 @@ namespace Titanium.Web.Proxy
httpCmd, httpVersion, args.WebSession.Request.RequestHeaders, args.IsHttps,
clientStream, tcpConnectionFactory);
args.Dispose();
break;
}
......@@ -494,20 +496,25 @@ namespace Titanium.Web.Proxy
if (disposed)
{
//already disposed inside above method
args.Dispose();
break;
}
if (args.WebSession.Request.CancelRequest)
{
args.Dispose();
break;
}
//if connection is closing exit
if (args.WebSession.Response.ResponseKeepAlive == false)
{
args.Dispose();
break;
}
args.Dispose();
// read the next request
httpCmd = await clientStreamReader.ReadLineAsync();
}
......
......@@ -133,8 +133,6 @@ namespace Titanium.Web.Proxy
return true;
}
args.Dispose();
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