src/api2/backup/environment.rs - add_blob: always verify blob crc

This commit is contained in:
Dietmar Maurer 2019-08-07 09:15:13 +02:00
parent eecb23560b
commit 34066e2eeb

View File

@ -400,9 +400,9 @@ impl BackupEnvironment {
let blob_len = data.len();
let orig_len = data.len(); // fixme:
let mut blob = DataBlob::from_raw(data)?;
// always comput CRC at server side
blob.set_crc(blob.compute_crc());
let blob = DataBlob::from_raw(data)?;
// always verify CRC at server side
blob.verify_crc()?;
let raw_data = blob.raw_data();
file_set_contents(&path, raw_data, None)?;