Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Resolved connection leak in SNI by adding dispose for underlying TCP …
Browse files Browse the repository at this point in the history
…stream in SNITcpHandle.Dispose()
  • Loading branch information
corivera committed Nov 14, 2016
1 parent 8bdf055 commit 2e7be0c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal class SNITCPHandle : SNIHandle
private readonly string _targetServer;
private readonly object _callbackObject;
private readonly Socket _socket;
private readonly NetworkStream _tcpStream;
private NetworkStream _tcpStream;
private readonly TaskScheduler _writeScheduler;
private readonly TaskFactory _writeTaskFactory;

Expand Down Expand Up @@ -57,6 +57,12 @@ public override void Dispose()
_sslStream.Dispose();
_sslStream = null;
}

if (_tcpStream != null)
{
_tcpStream.Dispose();
_tcpStream = null;
}
}
}

Expand Down

0 comments on commit 2e7be0c

Please sign in to comment.