#1389051, #1092502: fix excessively large allocations when using read() on a socket

This commit is contained in:
Andrew M. Kuchling 2008-02-23 19:30:59 +00:00
parent 37d4f7bc0c
commit 664553a778
2 changed files with 4 additions and 1 deletions

View File

@ -305,7 +305,7 @@ class _fileobject(object):
self._rbuf = ""
while True:
left = size - buf_len
recv_size = max(self._rbufsize, left)
recv_size = min(self._rbufsize, left)
data = self._sock.recv(recv_size)
if not data:
break

View File

@ -18,6 +18,9 @@ Library
- Bug #1389051: imaplib causes excessive memory fragmentation when reading
large messages.
- Bug #1389051, 1092502: fix excessively large memory allocations when
calling .read() on a socket object wrapped with makefile().
- Bug #1433694: minidom's .normalize() failed to set .nextSibling for
last child element.