[Python-checkins] r61008 - python/trunk/Lib/socket.py

andrew.kuchling python-checkins at python.org
Sat Feb 23 20:28:58 CET 2008


Author: andrew.kuchling
Date: Sat Feb 23 20:28:58 2008
New Revision: 61008

Modified:
   python/trunk/Lib/socket.py
Log:
#1389051, #1092502: fix excessively large allocations when using read() on a socket

Modified: python/trunk/Lib/socket.py
==============================================================================
--- python/trunk/Lib/socket.py	(original)
+++ python/trunk/Lib/socket.py	Sat Feb 23 20:28:58 2008
@@ -328,7 +328,7 @@
             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


More information about the Python-checkins mailing list