cpython: f4cff2bf9903 (original) (raw)

Mercurial > cpython

changeset 100778:f4cff2bf9903 2.7

Issue #23804: Fix SSL recv/read(0) to not return 1024 bytes [#23804]

Martin Panter vadmium+py@gmail.com
date Mon, 28 Mar 2016 00:22:09 +0000
parents b84d136e0028
children cff06d875678
files Lib/ssl.py Lib/test/test_ssl.py Misc/NEWS
diffstat 3 files changed, 13 insertions(+), 3 deletions(-)[+] [-] Lib/ssl.py 4 Lib/test/test_ssl.py 9 Misc/NEWS 3

line wrap: on

line diff

--- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -625,7 +625,7 @@ class SSLSocket(socket): # EAGAIN. self.getpeername()

@@ -636,7 +636,7 @@ class SSLSocket(socket): if buffer is not None: v = self._sslobj.read(len, buffer) else:

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

+ # read(-1, buffer) is supported, even though read(-1) is not

+ s.write(b"over\n") self.assertRaises(ValueError, s.recv, -1)

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -64,6 +64,9 @@ Library