changeset: 105693:bfd4f13b478b branch: 3.6 user: Yury Selivanov date: Fri Dec 16 11:51:57 2016 -0500 files: Lib/asyncio/sslproto.py Lib/test/test_asyncio/test_sslproto.py Misc/NEWS description: Merge 3.5 (issue #28990) diff -r b0efa88c4cf4 -r bfd4f13b478b Lib/asyncio/sslproto.py --- a/Lib/asyncio/sslproto.py Tue Nov 22 22:53:18 2016 +0100 +++ b/Lib/asyncio/sslproto.py Fri Dec 16 11:51:57 2016 -0500 @@ -480,6 +480,7 @@ 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 diff -r b0efa88c4cf4 -r bfd4f13b478b Lib/test/test_asyncio/test_sslproto.py --- a/Lib/test/test_asyncio/test_sslproto.py Tue Nov 22 22:53:18 2016 +0100 +++ b/Lib/test/test_asyncio/test_sslproto.py Fri Dec 16 11:51:57 2016 -0500 @@ -85,5 +85,15 @@ # 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() diff -r b0efa88c4cf4 -r bfd4f13b478b Misc/NEWS --- a/Misc/NEWS Tue Nov 22 22:53:18 2016 +0100 +++ b/Misc/NEWS Fri Dec 16 11:51:57 2016 -0500 @@ -14,6 +14,10 @@ must not convert combined table into split table. Patch written by INADA Naoki. +- Issue #28990: Fix SSL hanging if connection is closed before handshake + completed. + (Patch by HoHo-Ho) + Windows -------