Skip to content

Commit 7ae5c96

Browse files
committed
Merge 3.5 (issue python#28990)
1 parent c8af302 commit 7ae5c96

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

Lib/asyncio/sslproto.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ def connection_lost(self, exc):
480480
self._loop.call_soon(self._app_protocol.connection_lost, exc)
481481
self._transport = None
482482
self._app_transport = None
483+
self._wakeup_waiter(exc)
483484

484485
def pause_writing(self):
485486
"""Called when the low-level transport's buffer goes over

Lib/test/test_asyncio/test_sslproto.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,15 @@ def test_fatal_error_no_name_error(self):
8585
# Restore error logging.
8686
log.logger.setLevel(log_level)
8787

88+
def test_connection_lost(self):
89+
# From issue #472.
90+
# yield from waiter hang if lost_connection was called.
91+
waiter = asyncio.Future(loop=self.loop)
92+
ssl_proto = self.ssl_protocol(waiter)
93+
self.connection_made(ssl_proto)
94+
ssl_proto.connection_lost(ConnectionAbortedError)
95+
test_utils.run_briefly(self.loop)
96+
self.assertIsInstance(waiter.exception(), ConnectionAbortedError)
97+
8898
if __name__ == '__main__':
8999
unittest.main()

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ Core and Builtins
1414
must not convert combined table into split table. Patch written by INADA
1515
Naoki.
1616

17+
- Issue #28990: Fix SSL hanging if connection is closed before handshake
18+
completed.
19+
(Patch by HoHo-Ho)
20+
1721
Windows
1822
-------
1923

0 commit comments

Comments
 (0)