Revert "[3.6] bpo-29406: asyncio SSL contexts leak sockets after call… · python/cpython@8ffe094
@@ -7,7 +7,6 @@
7788from . import base_events
99from . import compat
10-from . import futures
1110from . import protocols
1211from . import transports
1312from .log import logger
@@ -413,7 +412,7 @@ class SSLProtocol(protocols.Protocol):
413412414413def __init__(self, loop, app_protocol, sslcontext, waiter,
415414server_side=False, server_hostname=None,
416-call_connection_made=True, shutdown_timeout=5.0):
415+call_connection_made=True):
417416if ssl is None:
418417raise RuntimeError('stdlib ssl module not available')
419418@@ -444,8 +443,6 @@ def __init__(self, loop, app_protocol, sslcontext, waiter,
444443self._session_established = False
445444self._in_handshake = False
446445self._in_shutdown = False
447-self._shutdown_timeout = shutdown_timeout
448-self._shutdown_timeout_handle = None
449446# transport, ex: SelectorSocketTransport
450447self._transport = None
451448self._call_connection_made = call_connection_made
@@ -560,15 +557,6 @@ def _start_shutdown(self):
560557self._in_shutdown = True
561558self._write_appdata(b'')
562559563-if self._shutdown_timeout is not None:
564-self._shutdown_timeout_handle = self._loop.call_later(
565-self._shutdown_timeout, self._on_shutdown_timeout)
566-567-def _on_shutdown_timeout(self):
568-if self._transport is not None:
569-self._fatal_error(
570-futures.TimeoutError(), 'Can not complete shitdown operation')
571-572560def _write_appdata(self, data):
573561self._write_backlog.append((data, 0))
574562self._write_buffer_size += len(data)
@@ -696,22 +684,12 @@ def _fatal_error(self, exc, message='Fatal error on transport'):
696684 })
697685if self._transport:
698686self._transport._force_close(exc)
699-self._transport = None
700-701-if self._shutdown_timeout_handle is not None:
702-self._shutdown_timeout_handle.cancel()
703-self._shutdown_timeout_handle = None
704687705688def _finalize(self):
706689self._sslpipe = None
707690708691if self._transport is not None:
709692self._transport.close()
710-self._transport = None
711-712-if self._shutdown_timeout_handle is not None:
713-self._shutdown_timeout_handle.cancel()
714-self._shutdown_timeout_handle = None
715693716694def _abort(self):
717695try: