Browse Source

Merge 3.5 (issue #28990)

pull/22/head
Yury Selivanov 10 years ago
parent
commit
11c135136d
  1. 1
      Lib/asyncio/sslproto.py
  2. 10
      Lib/test/test_asyncio/test_sslproto.py
  3. 4
      Misc/NEWS

1
Lib/asyncio/sslproto.py

@ -480,6 +480,7 @@ class SSLProtocol(protocols.Protocol):
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

10
Lib/test/test_asyncio/test_sslproto.py

@ -85,5 +85,15 @@ class SslProtoHandshakeTests(test_utils.TestCase):
# 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()

4
Misc/NEWS

@ -44,6 +44,10 @@ Library
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
-------

Loading…
Cancel
Save