From: Andrew M. Kuchling Date: Sat, 23 Feb 2008 19:02:33 +0000 (+0000) Subject: #1389051: IMAP module tries to read entire message in one chunk. Patch by Fredrik... X-Git-Tag: v2.6a1~88 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1219a8098965109a112a4732f8f3b78a00a68bae;p=thirdparty%2FPython%2Fcpython.git #1389051: IMAP module tries to read entire message in one chunk. Patch by Fredrik Lundh. --- diff --git a/Lib/imaplib.py b/Lib/imaplib.py index c05abb470a65..7807e8f3b8dd 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -1156,7 +1156,7 @@ else: chunks = [] read = 0 while read < size: - data = self.sslobj.read(size-read) + data = self.sslobj.read(min(size-read, 16384)) read += len(data) chunks.append(data)