Commit b6989acf by Julien Muchembled

fixup! download: verify checksum of downloaded data

1 parent 316d365a
......@@ -90,9 +90,9 @@ class CheckResponse(object):
def read(self, amt=None):
r = self._response.read(amt)
if r:
self._sha512sum.update(r)
elif amt != 0 and self._expected != self._sha512sum.hexdigest():
self._sha512sum.update(r)
if (not r if amt else amt is None) and \
self._expected != self._sha512sum.hexdigest():
raise NetworkcacheException(
'Failed to download data to SHACACHE Server: invalid checksum.')
return r
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!