Closing transport during handshake process leaks socket (#480)

This commit is contained in:
Nikolay Kim 2017-06-09 14:46:14 -07:00 committed by Yury Selivanov
parent b4e5fee6f5
commit a0e3d2dd09
3 changed files with 23 additions and 2 deletions

View file

@ -546,8 +546,11 @@ def _get_extra_info(self, name, default=None):
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))