mirror of
https://github.com/python/cpython
synced 2024-09-19 21:21:40 +00:00
Issue #28990: Fix SSL hanging if connection is closed before handshake completed.
This commit is contained in:
parent
610f5d739d
commit
b1461aa781
|
@ -479,6 +479,7 @@ def connection_lost(self, exc):
|
|||
self._loop.call_soon(self._app_protocol.connection_lost, exc)
|
||||
self._transport = None
|
||||
self._app_transport = None
|
||||
self._wakeup_waiter(exc)
|
||||
|
||||
def pause_writing(self):
|
||||
"""Called when the low-level transport's buffer goes over
|
||||
|
|
|
@ -85,5 +85,15 @@ def test_fatal_error_no_name_error(self):
|
|||
# Restore error logging.
|
||||
log.logger.setLevel(log_level)
|
||||
|
||||
def test_connection_lost(self):
|
||||
# From issue #472.
|
||||
# yield from waiter hang if lost_connection was called.
|
||||
waiter = asyncio.Future(loop=self.loop)
|
||||
ssl_proto = self.ssl_protocol(waiter)
|
||||
self.connection_made(ssl_proto)
|
||||
ssl_proto.connection_lost(ConnectionAbortedError)
|
||||
test_utils.run_briefly(self.loop)
|
||||
self.assertIsInstance(waiter.exception(), ConnectionAbortedError)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Reference in a new issue