diff options
author | Yury Selivanov <yury@magic.io> | 2017-06-09 22:33:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-09 22:33:31 (GMT) |
commit | 7a16a4535d691eff79fcc65ae57e69741e6c83df (patch) | |
tree | 679f672d3733d982bf48f7d451a135655e37efae /Lib/asyncio | |
parent | d24429a20def5e77ee415fdd8f37faf020a96bff (diff) | |
download | cpython-7a16a4535d691eff79fcc65ae57e69741e6c83df.zip cpython-7a16a4535d691eff79fcc65ae57e69741e6c83df.tar.gz cpython-7a16a4535d691eff79fcc65ae57e69741e6c83df.tar.bz2 |
Closing transport during handshake process leaks socket (#480) (#2044)
Diffstat (limited to 'Lib/asyncio')
-rw-r--r-- | Lib/asyncio/sslproto.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index ab7ff0b..6e9ce29 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -551,8 +551,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)) |