diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-05-28 18:44:16 -0700 |
|---|---|---|
| committer | Ned Deily <nad@python.org> | 2018-05-28 21:44:16 -0400 |
| commit | 0dd8fd03584b61cd769be88f5a2fb59b0d8f6d18 (patch) | |
| tree | 7bd0c480664882514b83cd3d74ad803a2ad8f697 /Lib/asyncio/sslproto.py | |
| parent | 420092e255389008b399efa61db300fe44356ee8 (diff) | |
| download | cpython-git-0dd8fd03584b61cd769be88f5a2fb59b0d8f6d18.tar.gz | |
bpo-33674: asyncio: Fix SSLProtocol race (GH-7175) (#7187)
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 be00a5583a2cb696335c527b921d1868266a42c6)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
Diffstat (limited to 'Lib/asyncio/sslproto.py')
| -rw-r--r-- | Lib/asyncio/sslproto.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index 2bfa45dd15..ab43e93b28 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -592,10 +592,10 @@ class SSLProtocol(protocols.Protocol): # (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._handshake_timeout_handle = \ self._loop.call_later(self._ssl_handshake_timeout, self._check_handshake_timeout) + self._process_write_backlog() def _check_handshake_timeout(self): if self._in_handshake is True: |
