summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorNikolay Kim <fafhrd91@gmail.com>2017-06-09 21:46:14 (GMT)
committerYury Selivanov <yury@magic.io>2017-06-09 21:46:14 (GMT)
commita0e3d2dd09346b01e7d29a35ed31ed28041570b1 (patch)
tree91f9cddcfc5425c9f29c8575cd4d54e908c116ce /Lib/asyncio
parentb4e5fee6f5bcc50500ea6261a22021db58955b55 (diff)
downloadcpython-a0e3d2dd09346b01e7d29a35ed31ed28041570b1.zip
cpython-a0e3d2dd09346b01e7d29a35ed31ed28041570b1.tar.gz
cpython-a0e3d2dd09346b01e7d29a35ed31ed28041570b1.tar.bz2
Closing transport during handshake process leaks socket (#480)
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/sslproto.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py
index 61d31a3..a7f1e61 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))