summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/sslproto.py
diff options
context:
space:
mode:
authorFantix King <fantix.king@gmail.com>2019-03-17 22:51:10 (GMT)
committerYury Selivanov <yury@magic.io>2019-03-17 22:51:10 (GMT)
commitf683f464259715d620777d7ed568e701337a703a (patch)
treead6d04f88ba79dd229f98cd9685631113de5fbd6 /Lib/asyncio/sslproto.py
parent06e1e688228013f411aca6309562ef80df6ce5d3 (diff)
downloadcpython-f683f464259715d620777d7ed568e701337a703a.zip
cpython-f683f464259715d620777d7ed568e701337a703a.tar.gz
cpython-f683f464259715d620777d7ed568e701337a703a.tar.bz2
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
Diffstat (limited to 'Lib/asyncio/sslproto.py')
-rw-r--r--Lib/asyncio/sslproto.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py
index 4278560..97a6fc6 100644
--- a/Lib/asyncio/sslproto.py
+++ b/Lib/asyncio/sslproto.py
@@ -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