Break circular references when closing SSLTransport objects (#981) (#2049)

This commit is contained in:
Yury Selivanov 2017-06-09 19:14:35 -04:00 committed by GitHub
parent 7a16a4535d
commit fe9c7a0fd3
2 changed files with 9 additions and 4 deletions

View file

@ -686,12 +686,14 @@ class SSLProtocol(protocols.Protocol):
self._transport._force_close(exc) self._transport._force_close(exc)
def _finalize(self): def _finalize(self):
self._sslpipe = None
if self._transport is not None: if self._transport is not None:
self._transport.close() self._transport.close()
def _abort(self): def _abort(self):
if self._transport is not None:
try: try:
if self._transport is not None:
self._transport.abort() self._transport.abort()
finally: finally:
self._finalize() self._finalize()

View file

@ -49,6 +49,9 @@ Core and Builtins
Library Library
------- -------
- bpo-29870: Fix ssl sockets leaks when connection is aborted in asyncio/ssl
implementation. Patch by Michaël Sghaïer.
- bpo-29743: Closing transport during handshake process leaks open socket. - bpo-29743: Closing transport during handshake process leaks open socket.
Patch by Nikolay Kim Patch by Nikolay Kim