Skip to content

Commit

Permalink
Remove try-catch from SmtpClient.Abort to see what Exceptions get cau…
Browse files Browse the repository at this point in the history
…ght. (#428)
  • Loading branch information
tmds authored and stephentoub committed Jan 21, 2020
1 parent dc17345 commit f5d783a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
15 changes: 9 additions & 6 deletions src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1080,13 +1080,16 @@ private void GetConnection()

private void Abort()
{
try
{
// Try-catch commented out to identify exception that is causing
// https://github.com/dotnet/corefx/issues/40711.

// try
// {
_transport.Abort();
}
catch
{
}
// }
// catch
// {
// }
}

public void Dispose()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ internal partial class SmtpConnection
private readonly ChannelBinding _channelBindingToken = null;
private bool _enableSsl;
private X509CertificateCollection _clientCertificates;
#pragma warning disable CS0414
private bool _aborted; // Tracks whether Abort was called, for debugging https://github.com/dotnet/corefx/issues/40711.
#pragma warning restore CS0414

internal SmtpConnection(SmtpTransport parent, SmtpClient client, ICredentialsByHost credentials, ISmtpAuthenticationModule[] authenticationModules)
{
Expand Down Expand Up @@ -154,8 +151,6 @@ internal void ReleaseConnection()

internal void Abort()
{
_aborted = true;

if (!_isClosed)
{
lock (this)
Expand Down

0 comments on commit f5d783a

Please sign in to comment.