mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #13713: fix a regression in HTTP chunked reading after 806cfe39f729
(originally issue #13464: Add a readinto() method to http.client.HTTPResponse)
This commit is contained in:
parent
d710d147f6
commit
f7e7818e24
2 changed files with 51 additions and 17 deletions
|
@ -603,12 +603,12 @@ class HTTPResponse(io.RawIOBase):
|
|||
if len(mvb) < chunk_left:
|
||||
n = self._safe_readinto(mvb)
|
||||
self.chunk_left = chunk_left - n
|
||||
return n
|
||||
return total_bytes + n
|
||||
elif len(mvb) == chunk_left:
|
||||
n = self._safe_readinto(mvb)
|
||||
self._safe_read(2) # toss the CRLF at the end of the chunk
|
||||
self.chunk_left = None
|
||||
return n
|
||||
return total_bytes + n
|
||||
else:
|
||||
temp_mvb = mvb[0:chunk_left]
|
||||
n = self._safe_readinto(temp_mvb)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue