Skip to content

Commit a6feb8a

Browse files
committed
Fix a bug in download streaming.
Currently apitools has a bug where downloads with (1) no total size and (2) auto_transfer off will only stream one chunk and quit. (Test added internally, but internal tests still aren't sync'd.) There's still more to be done around normalizing use of chunksize in downloads.
1 parent c431900 commit a6feb8a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

apitools/base/py/transfer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ def StreamInChunks(self, callback=None, finish_callback=None,
404404
else:
405405
response = self.__GetChunk(self.progress,
406406
additional_headers=additional_headers)
407+
if self.total_size is None:
408+
self.__SetTotal(response.info)
407409
response = self.__ProcessResponse(response)
408410
self._ExecuteCallback(callback, response)
409411
if (response.status_code == http_client.OK or

0 commit comments

Comments
 (0)