From a0e3d2dd09346b01e7d29a35ed31ed28041570b1 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Fri, 9 Jun 2017 14:46:14 -0700 Subject: Closing transport during handshake process leaks socket (#480) --- Lib/asyncio/sslproto.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Lib/asyncio/sslproto.py') diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index 61d31a3b29..a7f1e61596 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -546,8 +546,11 @@ class SSLProtocol(protocols.Protocol): def _start_shutdown(self): if self._in_shutdown: return - self._in_shutdown = True - self._write_appdata(b'') + if self._in_handshake: + self._abort() + else: + self._in_shutdown = True + self._write_appdata(b'') def _write_appdata(self, data): self._write_backlog.append((data, 0)) -- cgit v1.2.1