mirror of https://github.com/python/cpython
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.
This commit is contained in:
parent
e7a35717d2
commit
042dad7232
|
@ -572,8 +572,12 @@ class SSLProtocol(protocols.Protocol):
|
||||||
# wait until protocol.connection_made() has been called
|
# wait until protocol.connection_made() has been called
|
||||||
self._waiter._set_result_unless_cancelled(None)
|
self._waiter._set_result_unless_cancelled(None)
|
||||||
self._session_established = True
|
self._session_established = True
|
||||||
# In case transport.write() was already called
|
# In case transport.write() was already called. Don't call
|
||||||
self._process_write_backlog()
|
# 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):
|
def _process_write_backlog(self):
|
||||||
# Try to make progress on the write backlog.
|
# Try to make progress on the write backlog.
|
||||||
|
|
Loading…
Reference in New Issue