Fix piecemap downlad error when invalid piecemap got downloaded

This commit is contained in:
shortcutme 2020-06-30 17:02:39 +02:00
parent 14cbaf47c8
commit 6776dabdb3
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 2 additions and 2 deletions

View File

@ -391,8 +391,8 @@ class ContentManagerPlugin(object):
def verifyPiece(self, inner_path, pos, piece):
try:
piecemap = self.getPiecemap(inner_path)
except OSError as err:
raise VerifyError("Unable to download piecemap: %s" % err)
except Exception as err:
raise VerifyError("Unable to download piecemap: %s" % Debug.formatException(err))
piece_i = int(pos / piecemap["piece_size"])
if CryptHash.sha512sum(piece, format="digest") != piecemap["sha512_pieces"][piece_i]: