Currently I am getting CrcNotMatched errors when I try to upload files. The CRC returned by the server is the correct CRC but the client is calculating an incorrect CRC.
With the current logic, the last chunk of the file will not be calculated into the CRC and MD5 hashes because the size of bytes left in the file is less than the read size.
if size <= self._file_size:
self.crc.update(bres)
self.md5.update(bres)
This patch will ensure the whole file is used to calculate the CRC and MD5 hashes.
Currently I am getting CrcNotMatched errors when I try to upload files. The CRC returned by the server is the correct CRC but the client is calculating an incorrect CRC.
With the current logic, the last chunk of the file will not be calculated into the CRC and MD5 hashes because the size of bytes left in the file is less than the read size.
This patch will ensure the whole file is used to calculate the CRC and MD5 hashes.