[Python-checkins] cpython (merge 3.6 -> 3.6): Merge heads

serhiy.storchaka python-checkins at python.org
Fri Dec 16 12:08:47 EST 2016


https://hg.python.org/cpython/rev/1254dce790ce
changeset: 105679:1254dce790ce
branch: 3.6
parent: 105675:268d3763bb07
parent: 105672:fcc642bf88c1
user: Serhiy Storchaka <storchaka at gmail.com>
date: Fri Dec 16 19:05:57 2016 +0200
summary:
 Merge heads
files:
 Lib/asyncio/sslproto.py | 1 +
 Lib/test/test_asyncio/test_sslproto.py | 10 ++++++++++
 Misc/NEWS | 4 ++++
 3 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py
--- a/Lib/asyncio/sslproto.py
+++ b/Lib/asyncio/sslproto.py
@@ -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 --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py
--- a/Lib/test/test_asyncio/test_sslproto.py
+++ b/Lib/test/test_asyncio/test_sslproto.py
@@ -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 --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -44,6 +44,10 @@
 now when the grp module cannot be imported, as for example on Android
 platforms.
 
+- Issue #28990: Fix SSL hanging if connection is closed before handshake
+ completed.
+ (Patch by HoHo-Ho)
+
 Windows
 -------
 
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /