Revert "[3.5] bpo-29406: asyncio SSL contexts leak sockets after call… · python/cpython@4e9dfe2
@@ -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
@@ -412,7 +411,7 @@ class SSLProtocol(protocols.Protocol):
412411413412def __init__(self, loop, app_protocol, sslcontext, waiter,
414413server_side=False, server_hostname=None,
415-call_connection_made=True, shutdown_timeout=5.0):
414+call_connection_made=True):
416415if ssl is None:
417416raise RuntimeError('stdlib ssl module not available')
418417@@ -443,8 +442,6 @@ def __init__(self, loop, app_protocol, sslcontext, waiter,
443442self._session_established = False
444443self._in_handshake = False
445444self._in_shutdown = False
446-self._shutdown_timeout = shutdown_timeout
447-self._shutdown_timeout_handle = None
448445# transport, ex: SelectorSocketTransport
449446self._transport = None
450447self._call_connection_made = call_connection_made
@@ -559,15 +556,6 @@ def _start_shutdown(self):
559556self._in_shutdown = True
560557self._write_appdata(b'')
561558562-if self._shutdown_timeout is not None:
563-self._shutdown_timeout_handle = self._loop.call_later(
564-self._shutdown_timeout, self._on_shutdown_timeout)
565-566-def _on_shutdown_timeout(self):
567-if self._transport is not None:
568-self._fatal_error(
569-futures.TimeoutError(), 'Can not complete shitdown operation')
570-571559def _write_appdata(self, data):
572560self._write_backlog.append((data, 0))
573561self._write_buffer_size += len(data)
@@ -695,22 +683,12 @@ def _fatal_error(self, exc, message='Fatal error on transport'):
695683 })
696684if self._transport:
697685self._transport._force_close(exc)
698-self._transport = None
699-700-if self._shutdown_timeout_handle is not None:
701-self._shutdown_timeout_handle.cancel()
702-self._shutdown_timeout_handle = None
703686704687def _finalize(self):
705688self._sslpipe = None
706689707690if self._transport is not None:
708691self._transport.close()
709-self._transport = None
710-711-if self._shutdown_timeout_handle is not None:
712-self._shutdown_timeout_handle.cancel()
713-self._shutdown_timeout_handle = None
714692715693def _abort(self):
716694try: