]> granicus.if.org Git - python/commitdiff
#1389051: IMAP module tries to read entire message in one chunk. Patch by Fredrik...
authorAndrew M. Kuchling <amk@amk.ca>
Sat, 23 Feb 2008 19:02:33 +0000 (19:02 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Sat, 23 Feb 2008 19:02:33 +0000 (19:02 +0000)
Lib/imaplib.py

index c05abb470a6501468c021f5a16d87eb6cb639643..7807e8f3b8dd3e154fd96587ee8365aa06393365 100644 (file)
@@ -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)