mirror of
https://github.com/mikedilger/chorus.git
synced 2026-01-03 06:15:33 +00:00
A double check when counting/hashing
This commit is contained in:
parent
f8d9be7c6d
commit
beb9635e13
@ -77,7 +77,12 @@ impl FileStore {
|
||||
});
|
||||
|
||||
// Copy the data into the tempfile (hashing and counting as we go)
|
||||
tokio::io::copy(&mut inspect_reader, &mut tempfile).await?;
|
||||
let count = tokio::io::copy(&mut inspect_reader, &mut tempfile).await?;
|
||||
|
||||
// Verify our code was correct
|
||||
if count != size {
|
||||
return Err(ChorusError::General("INTERNAL COUNT MISMATCH".to_string()).into());
|
||||
}
|
||||
|
||||
// Finish the hash
|
||||
let hash = HashOutput::from_engine(hash_engine);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user