Skip to content

Commit 2f7eb2f

Browse files
committed
Use larger OpenSSL chunk size limit w/Python 3.10+
1 parent 1fee0ba commit 2f7eb2f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

distributed/comm/tcp.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@
4545

4646
# Workaround for OpenSSL 1.0.2 (can drop with OpenSSL 1.1.1)
4747
# ref: https://bugs.python.org/issue42853
48-
OPENSSL_MAX_CHUNKSIZE = 256 ** ctypes.sizeof(ctypes.c_int) // 2 - 1
48+
if sys.version_info < (3, 10):
49+
OPENSSL_MAX_CHUNKSIZE = 256 ** ctypes.sizeof(ctypes.c_int) // 2 - 1
50+
else:
51+
OPENSSL_MAX_CHUNKSIZE = 256 ** ctypes.sizeof(ctypes.c_size_t) - 1
4952

5053
MAX_BUFFER_SIZE = MEMORY_LIMIT / 2
5154

0 commit comments

Comments
 (0)