summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/sslproto.py
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2017-06-09 22:27:45 (GMT)
committerGitHub <noreply@github.com>2017-06-09 22:27:45 (GMT)
commitff9511bbadba27457cd0eb084e9b4305ab9dfcf5 (patch)
tree38a32487fe4a2a068b252eca6303b3ddc0fdc7d8 /Lib/asyncio/sslproto.py
parenta0338045dbaa6c9f922113c6e9efad6bdbc4cdcb (diff)
downloadcpython-ff9511bbadba27457cd0eb084e9b4305ab9dfcf5.zip
cpython-ff9511bbadba27457cd0eb084e9b4305ab9dfcf5.tar.gz
cpython-ff9511bbadba27457cd0eb084e9b4305ab9dfcf5.tar.bz2
Closing transport during handshake process leaks socket (#480) (#2045)
Diffstat (limited to 'Lib/asyncio/sslproto.py')
-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 aa5e034..31803ac 100644
--- a/Lib/asyncio/sslproto.py
+++ b/Lib/asyncio/sslproto.py
@@ -550,8 +550,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))