diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-15 08:41:48 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-15 08:41:48 (GMT) |
commit | 042dad7232a021e6c848f1368e75d8b3e5ce0dbe (patch) | |
tree | 6729c9e163c213f6397d5a19af3db9e26c953370 /Lib/asyncio/sslproto.py | |
parent | e7a35717d29cf0b070c814a7a43b44966bf89f73 (diff) | |
download | cpython-042dad7232a021e6c848f1368e75d8b3e5ce0dbe.zip cpython-042dad7232a021e6c848f1368e75d8b3e5ce0dbe.tar.gz cpython-042dad7232a021e6c848f1368e75d8b3e5ce0dbe.tar.bz2 |
Issue #22560: Fix SSLProtocol._on_handshake_complete()
Don't call immediatly self._process_write_backlog() but schedule the call using
call_soon(). _on_handshake_complete() can be called indirectly from
_process_write_backlog(), and _process_write_backlog() is not reentrant.
Diffstat (limited to 'Lib/asyncio/sslproto.py')
-rw-r--r-- | Lib/asyncio/sslproto.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index 541e252..31eab51 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -572,8 +572,12 @@ class SSLProtocol(protocols.Protocol): # wait until protocol.connection_made() has been called self._waiter._set_result_unless_cancelled(None) self._session_established = True - # In case transport.write() was already called - self._process_write_backlog() + # In case transport.write() was already called. Don't call + # immediatly _process_write_backlog(), but schedule it: + # _on_handshake_complete() can be called indirectly from + # _process_write_backlog(), and _process_write_backlog() is not + # reentrant. + self._loop.call(self._process_write_backlog) def _process_write_backlog(self): # Try to make progress on the write backlog. |