]> git.proxmox.com Git - proxmox-backup.git/commitdiff
src/backup/fixed_index.rs: do not use offset for checksum
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 23 Sep 2019 09:30:20 +0000 (11:30 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 23 Sep 2019 09:30:20 +0000 (11:30 +0200)
src/backup/fixed_index.rs
src/client/http_client.rs

index d2d6a95796a60bea926adde4163e773d74114f07..12e534b4bf1aed399c98d29093f5858de4fdd0c1 100644 (file)
@@ -194,7 +194,6 @@ impl FixedIndexReader {
         for pos in 0..self.index_length {
             chunk_end = ((pos+1) * self.chunk_size) as u64;
             let digest = self.chunk_digest(pos);
-            csum.update(&chunk_end.to_le_bytes());
             csum.update(digest);
         }
         let csum = csum.finish();
index 20b64236ac99d60b2d73a93ff1897b876ca5f876..0ab92e3e35cfeb279d0977c62540e487e53b03f2 100644 (file)
@@ -901,6 +901,7 @@ impl BackupClient {
 
         let append_chunk_path = format!("{}_index", prefix);
         let upload_chunk_path = format!("{}_chunk", prefix);
+        let is_fixed_chunk_size = prefix == "fixed";
 
         let (upload_queue, upload_result) =
             Self::append_chunk_queue(h2.clone(), wid, append_chunk_path.to_owned());
@@ -933,7 +934,7 @@ impl BackupClient {
 
                 let chunk_end = offset + chunk_len as u64;
 
-                csum.update(&chunk_end.to_le_bytes());
+                if !is_fixed_chunk_size { csum.update(&chunk_end.to_le_bytes()); }
                 csum.update(digest);
 
                 let chunk_is_known = known_chunks.contains(digest);