diff options
author | Yury Selivanov <yury@magic.io> | 2017-06-11 14:46:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-11 14:46:45 (GMT) |
commit | 83d30bd667924549bacf1428ac3e475cdf9792ae (patch) | |
tree | 5f48fdc6177e267a177df63f5d398b761157de8a /Lib/asyncio/sslproto.py | |
parent | 176f2ebdad93f20876c08efabd364a0e6c86de14 (diff) | |
download | cpython-83d30bd667924549bacf1428ac3e475cdf9792ae.zip cpython-83d30bd667924549bacf1428ac3e475cdf9792ae.tar.gz cpython-83d30bd667924549bacf1428ac3e475cdf9792ae.tar.bz2 |
Revert "[3.6] bpo-29406: asyncio SSL contexts leak sockets after calling close with certain servers (GH-409) (#2062)" (#2112)
This reverts commit 6e14fd2a14cef6ea0709ad234ab41198c2195591.
Diffstat (limited to 'Lib/asyncio/sslproto.py')
-rw-r--r-- | Lib/asyncio/sslproto.py | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index 3b1eb99..7948c4c 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -7,7 +7,6 @@ except ImportError: # pragma: no cover from . import base_events from . import compat -from . import futures from . import protocols from . import transports from .log import logger @@ -413,7 +412,7 @@ class SSLProtocol(protocols.Protocol): def __init__(self, loop, app_protocol, sslcontext, waiter, server_side=False, server_hostname=None, - call_connection_made=True, shutdown_timeout=5.0): + call_connection_made=True): if ssl is None: raise RuntimeError('stdlib ssl module not available') @@ -444,8 +443,6 @@ class SSLProtocol(protocols.Protocol): self._session_established = False self._in_handshake = False self._in_shutdown = False - self._shutdown_timeout = shutdown_timeout - self._shutdown_timeout_handle = None # transport, ex: SelectorSocketTransport self._transport = None self._call_connection_made = call_connection_made @@ -560,15 +557,6 @@ class SSLProtocol(protocols.Protocol): self._in_shutdown = True self._write_appdata(b'') - if self._shutdown_timeout is not None: - self._shutdown_timeout_handle = self._loop.call_later( - self._shutdown_timeout, self._on_shutdown_timeout) - - def _on_shutdown_timeout(self): - if self._transport is not None: - self._fatal_error( - futures.TimeoutError(), 'Can not complete shitdown operation') - def _write_appdata(self, data): self._write_backlog.append((data, 0)) self._write_buffer_size += len(data) @@ -696,22 +684,12 @@ class SSLProtocol(protocols.Protocol): }) if self._transport: self._transport._force_close(exc) - self._transport = None - - if self._shutdown_timeout_handle is not None: - self._shutdown_timeout_handle.cancel() - self._shutdown_timeout_handle = None def _finalize(self): self._sslpipe = None if self._transport is not None: self._transport.close() - self._transport = None - - if self._shutdown_timeout_handle is not None: - self._shutdown_timeout_handle.cancel() - self._shutdown_timeout_handle = None def _abort(self): try: |