Fix SSL requests with Transfer-Encoding: chunked

Add size parameter to FileLike.readline, used by read_chunked.
This commit is contained in:
Michael Frister 2012-03-08 23:10:21 +01:00
parent e67dbf6123
commit 23f7214fc3

View File

@ -184,10 +184,14 @@ class FileLike:
result += data
return result
def readline(self):
def readline(self, size = None):
result = ''
bytes_read = 0
while True:
if size is not None and bytes_read >= size:
break
ch = self.read(1)
bytes_read += 1
if not ch:
break
else: