mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #23804: Merge SSL zero read fix from 3.5
This commit is contained in:
commit
ef4bb1e994
4 changed files with 15 additions and 5 deletions
|
@ -2783,13 +2783,20 @@ if _have_threads:
|
|||
# consume data
|
||||
s.read()
|
||||
|
||||
# read(-1, buffer) is supported, even though read(-1) is not
|
||||
data = b"data"
|
||||
|
||||
# read(-1, buffer) is supported, even though read(-1) is not
|
||||
s.send(data)
|
||||
buffer = bytearray(len(data))
|
||||
self.assertEqual(s.read(-1, buffer), len(data))
|
||||
self.assertEqual(buffer, data)
|
||||
|
||||
# recv/read(0) should return no data
|
||||
s.send(data)
|
||||
self.assertEqual(s.recv(0), b"")
|
||||
self.assertEqual(s.read(0), b"")
|
||||
self.assertEqual(s.read(), data)
|
||||
|
||||
# Make sure sendmsg et al are disallowed to avoid
|
||||
# inadvertent disclosure of data and/or corruption
|
||||
# of the encrypted data stream
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue