]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Avoid 2GB read limitation on SSLIOStream
authorbfis <b.fis@cern.ch>
Wed, 6 Jan 2021 12:22:04 +0000 (13:22 +0100)
committerGitHub <noreply@github.com>
Wed, 6 Jan 2021 12:22:04 +0000 (13:22 +0100)
tornado/iostream.py

index 768b404b1ba52edf7b6209941d1b6de53dcb0a16..9d8d9c7fbebfc0315435f0787f0d553805a954c8 100644 (file)
@@ -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: