internal void Close()
{
if (NetEventSource.IsEnabled) NetEventSource.Enter(this);
try
{
_response?.Close();
}
finally
{
try
{
Request.Close();
}
finally
{
IDisposable user = _user == null ? null : _user.Identity as IDisposable;
// For unsafe connection ntlm auth we dont dispose this identity as yet since its cached
if ((user != null) &&
(_user.Identity.AuthenticationType != AuthConstants.NTLM) &&
(!_listener.UnsafeConnectionNtlmAuthentication))
{
user.Dispose();
}
}
}
if (NetEventSource.IsEnabled) NetEventSource.Exit(this);
}