2
0
mirror of https://opendev.org/x/pyghmi synced 2025-12-07 09:21:54 +00:00

Merge "Rewrite download loop"

This commit is contained in:
Zuul
2020-03-10 19:27:49 +00:00
committed by Gerrit Code Review

View File

@@ -247,8 +247,10 @@ class SecureHTTPConnection(httplib.HTTPConnection, object):
rsp = webclient.getresponse()
self._currdl = rsp
self._dlfile = file
for chunk in iter(lambda: rsp.read(16384), ''):
chunk = rsp.read(16384)
while chunk:
file.write(chunk)
chunk = rsp.read(16384)
self._currdl = None
file.close()