Issue #13713: fix a regression in HTTP chunked reading after 806cfe39f729
(originally issue #13464: Add a readinto() method to http.client.HTTPResponse)
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 @@
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)