mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Merge 3.6 (issue #28990)
This commit is contained in:
commit
7c3e71163b
2 changed files with 11 additions and 0 deletions
|
@ -480,6 +480,7 @@ class SSLProtocol(protocols.Protocol):
|
||||||
self._loop.call_soon(self._app_protocol.connection_lost, exc)
|
self._loop.call_soon(self._app_protocol.connection_lost, exc)
|
||||||
self._transport = None
|
self._transport = None
|
||||||
self._app_transport = None
|
self._app_transport = None
|
||||||
|
self._wakeup_waiter(exc)
|
||||||
|
|
||||||
def pause_writing(self):
|
def pause_writing(self):
|
||||||
"""Called when the low-level transport's buffer goes over
|
"""Called when the low-level transport's buffer goes over
|
||||||
|
|
|
@ -85,5 +85,15 @@ class SslProtoHandshakeTests(test_utils.TestCase):
|
||||||
# Restore error logging.
|
# Restore error logging.
|
||||||
log.logger.setLevel(log_level)
|
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__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue