mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
bpo-42854: Use SSL_read/write_ex() (GH-25468)
The ssl module now uses ``SSL_read_ex`` and ``SSL_write_ex`` internally. The functions support reading and writing of data larger than 2 GB. Writing zero-length data no longer fails with a protocol violation error. Signed-off-by: Christian Heimes <christian@python.org>
This commit is contained in:
parent
49fdf118ae
commit
89d1550d14
4 changed files with 34 additions and 18 deletions
|
|
@ -1110,6 +1110,17 @@ class BasicSocketTests(unittest.TestCase):
|
|||
)
|
||||
self.assertIn(rc, errors)
|
||||
|
||||
def test_read_write_zero(self):
|
||||
# empty reads and writes now work, bpo-42854, bpo-31711
|
||||
client_context, server_context, hostname = testing_context()
|
||||
server = ThreadedEchoServer(context=server_context)
|
||||
with server:
|
||||
with client_context.wrap_socket(socket.socket(),
|
||||
server_hostname=hostname) as s:
|
||||
s.connect((HOST, server.port))
|
||||
self.assertEqual(s.recv(0), b"")
|
||||
self.assertEqual(s.send(b""), 0)
|
||||
|
||||
|
||||
class ContextTests(unittest.TestCase):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue