cpython: 43d7e5fb3bc2 (original) (raw)

Mercurial > cpython

changeset 102319:43d7e5fb3bc2 2.7

Issue #23804: Fix SSL zero-length recv() calls to not block and raise EOF [#23804]

Martin Panter vadmium+py@gmail.com
date Mon, 11 Jul 2016 00:17:13 +0000
parents c613d8885054
children 651f7addf4a8
files Lib/test/test_ssl.py Misc/NEWS Modules/_ssl.c
diffstat 3 files changed, 32 insertions(+), 8 deletions(-)[+] [-] Lib/test/test_ssl.py 29 Misc/NEWS 3 Modules/_ssl.c 8

line wrap: on

line diff

--- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -2622,20 +2622,13 @@ else: # consume data s.read()

-

- s.write(b"over\n") self.assertRaises(ValueError, s.recv, -1) @@ -2643,6 +2636,26 @@ else: s.close()

+

+

+ def test_handshake_timeout(self): # Issue #5103: SSL handshake must respect the socket timeout server = socket.socket(socket.AF_INET)

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -17,6 +17,9 @@ Core and Builtins Library ------- +- Issue #23804: Fix SSL zero-length recv() calls to not block and not raise

--- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -1702,6 +1702,10 @@ static PyObject *PySSL_SSLread(PySSLSock dest = PyBytes_FromStringAndSize(NULL, len); if (dest == NULL) goto error;