bpo-34745: Fix asyncio sslproto memory issues (GH-12386)

* Fix handshake timeout leak in asyncio/sslproto

Refs MagicStack/uvloop#222

* Break circular ref _SSLPipe <-> SSLProtocol

* bpo-34745: Fix asyncio ssl memory leak

* Break circular ref SSLProtocol <-> UserProtocol

* Add NEWS entry
This commit is contained in:
Fantix King 2019-03-17 17:51:10 -05:00 committed by Yury Selivanov
parent 06e1e68822
commit f683f46425
3 changed files with 77 additions and 0 deletions

View file

@ -498,7 +498,11 @@ class SSLProtocol(protocols.Protocol):
self._app_transport._closed = True
self._transport = None
self._app_transport = None
if getattr(self, '_handshake_timeout_handle', None):
self._handshake_timeout_handle.cancel()
self._wakeup_waiter(exc)
self._app_protocol = None
self._sslpipe = None
def pause_writing(self):
"""Called when the low-level transport's buffer goes over