[Python-checkins] python/dist/src/Lib httplib.py,1.84,1.85

perky at users.sourceforge.net perky at users.sourceforge.net
Sat Jun 5 09:30:58 EDT 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23584/Lib

Modified Files:
	httplib.py 
Log Message:
Fix a bug that robotparser starves memory when the server responses
in HTTP/0.9 due to dissonance of httplib.LineAndFileWrapper and
urllib.addbase.


Index: httplib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/httplib.py,v
retrieving revision 1.84
retrieving revision 1.85
diff -C2 -d -r1.84 -r1.85
*** httplib.py	4 May 2004 09:21:43 -0000	1.84
--- httplib.py	5 Jun 2004 13:30:56 -0000	1.85
***************
*** 1182,1186 ****
  
      def read(self, amt=None):
!         assert not self._line_consumed and self._line_left
          if amt is None or amt > self._line_left:
              s = self._line[self._line_offset:]
--- 1182,1188 ----
  
      def read(self, amt=None):
!         if self._line_consumed:
!             return self._file.read(amt)
!         assert self._line_left
          if amt is None or amt > self._line_left:
              s = self._line[self._line_offset:]
***************
*** 1202,1205 ****
--- 1204,1210 ----
  
      def readline(self):
+         if self._line_consumed:
+             return self._file.readline()
+         assert self._line_left
          s = self._line[self._line_offset:]
          self._done()
***************
*** 1207,1210 ****
--- 1212,1218 ----
  
      def readlines(self, size=None):
+         if self._line_consumed:
+             return self._file.readlines(size)
+         assert self._line_left
          L = [self._line[self._line_offset:]]
          self._done()




More information about the Python-checkins mailing list