diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-04 17:57:22 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-04 17:57:22 (GMT) |
commit | f7e7818e245f14c94ce123746efd427634e56109 (patch) | |
tree | 653eaf13847a56a3ee2776bd8021938fed8f8512 /Lib/http | |
parent | d710d147f6a265d6415262d17fed0f61660c3a12 (diff) | |
download | cpython-f7e7818e245f14c94ce123746efd427634e56109.zip cpython-f7e7818e245f14c94ce123746efd427634e56109.tar.gz cpython-f7e7818e245f14c94ce123746efd427634e56109.tar.bz2 |
Issue #13713: fix a regression in HTTP chunked reading after 806cfe39f729
(originally issue #13464: Add a readinto() method to http.client.HTTPResponse)
Diffstat (limited to 'Lib/http')
-rw-r--r-- | Lib/http/client.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py index 24feae8..0002072 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -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) |