For each file the client calculates the MD5 checksum and make sure that it matches, otherwise it tries again (until it's out of tries).
The process involves repeatedly checking the MD5 checksum of files until a successful match is found or a specified number of retries has been exhausted.