summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-05-28 23:33:35 (GMT)
committerGitHub <noreply@github.com>2018-05-28 23:33:35 (GMT)
commitbe00a5583a2cb696335c527b921d1868266a42c6 (patch)
tree4e744a9b3d1f6183dcefccdfff5b928d05961148 /Lib/asyncio
parent8c1ad0c4f69390fded09012e1ed5242c45753bb4 (diff)
downloadcpython-be00a5583a2cb696335c527b921d1868266a42c6.zip
cpython-be00a5583a2cb696335c527b921d1868266a42c6.tar.gz
cpython-be00a5583a2cb696335c527b921d1868266a42c6.tar.bz2
bpo-33674: asyncio: Fix SSLProtocol race (GH-7175)
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.
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/sslproto.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py
index 2bfa45d..ab43e93 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: