From d04e775212ccd2d03e4ee79407c8cb996ae0f738 Mon Sep 17 00:00:00 2001 From: bfis Date: Wed, 6 Jan 2021 13:22:04 +0100 Subject: [PATCH] Avoid 2GB read limitation on SSLIOStream --- tornado/iostream.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tornado/iostream.py b/tornado/iostream.py index 768b404b1..9d8d9c7fb 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -1587,6 +1587,8 @@ class SSLIOStream(IOStream): # to read (attempting to read may or may not raise an exception # depending on the SSL version) return None + if len(buf) >> 30: + buf = memoryview(buf)[: 1 << 30] try: return self.socket.recv_into(buf, len(buf)) except ssl.SSLError as e: -- 2.47.2