mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #26644: Merge SSL negative read fix from 3.5
This commit is contained in:
commit
afd465d497
3 changed files with 19 additions and 0 deletions
|
@ -2783,6 +2783,13 @@ if _have_threads:
|
|||
# consume data
|
||||
s.read()
|
||||
|
||||
# read(-1, buffer) is supported, even though read(-1) is not
|
||||
data = b"data"
|
||||
s.send(data)
|
||||
buffer = bytearray(len(data))
|
||||
self.assertEqual(s.read(-1, buffer), len(data))
|
||||
self.assertEqual(buffer, data)
|
||||
|
||||
# Make sure sendmsg et al are disallowed to avoid
|
||||
# inadvertent disclosure of data and/or corruption
|
||||
# of the encrypted data stream
|
||||
|
@ -2792,6 +2799,10 @@ if _have_threads:
|
|||
s.recvmsg_into, bytearray(100))
|
||||
|
||||
s.write(b"over\n")
|
||||
|
||||
self.assertRaises(ValueError, s.recv, -1)
|
||||
self.assertRaises(ValueError, s.read, -1)
|
||||
|
||||
s.close()
|
||||
|
||||
def test_nonblocking_send(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue