Commit 664553a7 authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

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

parent 37d4f7bc
...@@ -305,7 +305,7 @@ class _fileobject(object): ...@@ -305,7 +305,7 @@ class _fileobject(object):
self._rbuf = "" self._rbuf = ""
while True: while True:
left = size - buf_len left = size - buf_len
recv_size = max(self._rbufsize, left) recv_size = min(self._rbufsize, left)
data = self._sock.recv(recv_size) data = self._sock.recv(recv_size)
if not data: if not data:
break break
......
...@@ -18,6 +18,9 @@ Library ...@@ -18,6 +18,9 @@ Library
- Bug #1389051: imaplib causes excessive memory fragmentation when reading - Bug #1389051: imaplib causes excessive memory fragmentation when reading
large messages. 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 - Bug #1433694: minidom's .normalize() failed to set .nextSibling for
last child element. last child element.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment