summaryrefslogtreecommitdiffstats
path: root/Lib/ssl.py
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-03-28 00:22:09 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-03-28 00:22:09 (GMT)
commitf6b1d66a3ca060247e03e7b198db8a5a966b836e (patch)
tree09a7423be3c47ec27efb71f5457110a4a3361d1e /Lib/ssl.py
parentce913877e42b7fa03434c2e765ace891e0f5c4dc (diff)
downloadcpython-f6b1d66a3ca060247e03e7b198db8a5a966b836e.zip
cpython-f6b1d66a3ca060247e03e7b198db8a5a966b836e.tar.gz
cpython-f6b1d66a3ca060247e03e7b198db8a5a966b836e.tar.bz2
Issue #23804: Fix SSL recv/read(0) to not return 1024 bytes
Diffstat (limited to 'Lib/ssl.py')
-rw-r--r--Lib/ssl.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/ssl.py b/Lib/ssl.py
index df39592..65ad38f 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -561,7 +561,7 @@ class SSLObject:
server hostame is set."""
return self._sslobj.server_hostname
- def read(self, len=0, buffer=None):
+ def read(self, len=1024, buffer=None):
"""Read up to 'len' bytes from the SSL object and return them.
If 'buffer' is provided, read into this buffer and return the number of
@@ -570,7 +570,7 @@ class SSLObject:
if buffer is not None:
v = self._sslobj.read(len, buffer)
else:
- v = self._sslobj.read(len or 1024)
+ v = self._sslobj.read(len)
return v
def write(self, data):
@@ -776,7 +776,7 @@ class SSLSocket(socket):
# EAGAIN.
self.getpeername()
- def read(self, len=0, buffer=None):
+ def read(self, len=1024, buffer=None):
"""Read up to LEN bytes and return them.
Return zero-length string on EOF."""