summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/sslproto.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-03-17 23:09:14 (GMT)
committerGitHub <noreply@github.com>2019-03-17 23:09:14 (GMT)
commit7f7485c0605fe979e39c58b688f2bb6a4f43e65e (patch)
tree39a25939dcd1f1419bdbdd0be2ab9eabf06ba607 /Lib/asyncio/sslproto.py
parentb34f1aa81433d60aee7bd744352b347dd650ca84 (diff)
downloadcpython-7f7485c0605fe979e39c58b688f2bb6a4f43e65e.zip
cpython-7f7485c0605fe979e39c58b688f2bb6a4f43e65e.tar.gz
cpython-7f7485c0605fe979e39c58b688f2bb6a4f43e65e.tar.bz2
bpo-34745: Fix asyncio sslproto memory issues (GH-12386)
* Fix handshake timeout leak in asyncio/sslproto Refs MagicStack/uvloopGH-222 * Break circular ref _SSLPipe <-> SSLProtocol * bpo-34745: Fix asyncio ssl memory leak * Break circular ref SSLProtocol <-> UserProtocol * Add NEWS entry (cherry picked from commit f683f464259715d620777d7ed568e701337a703a) Co-authored-by: Fantix King <fantix.king@gmail.com>
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 12fdb0d..15eb9c7 100644
--- a/Lib/asyncio/sslproto.py
+++ b/Lib/asyncio/sslproto.py
@@ -499,7 +499,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