mirror of
https://github.com/python/cpython.git
synced 2026-03-06 13:00:50 +00:00
bpo-33674: asyncio: Fix SSLProtocol race (GH-7175) (GH-7188)
Fix a race condition in SSLProtocol.connection_made() of
asyncio.sslproto: start immediately the handshake instead of using
call_soon(). Previously, data_received() could be called before the
handshake started, causing the handshake to hang or fail.
(cherry picked from commit be00a5583a)
This commit is contained in:
parent
325320d5f5
commit
7593b8a507
2 changed files with 5 additions and 1 deletions
|
|
@ -574,7 +574,7 @@ def _start_handshake(self):
|
|||
# (b'', 1) is a special value in _process_write_backlog() to do
|
||||
# the SSL handshake
|
||||
self._write_backlog.append((b'', 1))
|
||||
self._loop.call_soon(self._process_write_backlog)
|
||||
self._process_write_backlog()
|
||||
|
||||
def _on_handshake_complete(self, handshake_exc):
|
||||
self._in_handshake = False
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
Fix a race condition in SSLProtocol.connection_made() of asyncio.sslproto:
|
||||
start immediately the handshake instead of using call_soon(). Previously,
|
||||
data_received() could be called before the handshake started, causing the
|
||||
handshake to hang or fail.
|
||||
Loading…
Add table
Add a link
Reference in a new issue