Make clear that compressed chunk checksum can be 0s
authorJonathan Dieter <jdieter@gmail.com>
Sat, 5 Feb 2022 16:08:45 +0000 (16:08 +0000)
committerJonathan Dieter <jdieter@gmail.com>
Sat, 5 Feb 2022 17:04:18 +0000 (17:04 +0000)
Also, fix a small bug

Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
src/unzck.c
zchunk_format.txt

index 2b6ad9663303f1f9c3c8614c2115502b6d845304..fd4af6f060742475ff7379a0a76969d753aa93bc 100644 (file)
@@ -200,7 +200,7 @@ int main (int argc, char *argv[]) {
             int ret = zck_get_chunk_valid(dict);
             if(ret < 1) {
                 if(ret == -1)
-                    LOG_ERROR("Data checksum failed verification\n");
+                    LOG_ERROR("Dictionary checksum failed verification\n");
                 else
                     LOG_ERROR("%s", zck_get_error(zck));
                 goto error2;
index ecaf2784a5570f884f6046c5a16069bddb798be6..d1dfe480b778a6b1efc126f0184619fbb6940b40 100644 (file)
@@ -179,6 +179,9 @@ Chunk checksum
  This is the checksum of the compressed chunk, used to detect whether any two
  chunks are identical.
 
+ NOTE: If flag 2 is set, this checksum must be set to 0s if and only if this
+ particular chunk is stored uncompressed in the file.
+
 NOTE: Uncompressed chunk checksum will only exist if flag 2 is set to 1
 Uncompressed chunk checksum
  This is the checksum of the uncompressed chunk, used to detect whether a chunk
@@ -187,7 +190,10 @@ Uncompressed chunk checksum
 Chunk length
  This is an integer containing the length of the chunk.
 
-Uncompressed dict length
+ NOTE: If flag 2 is set and this particular chunk is stored uncompressed, this
+ must be the same as the uncompressed chunk length
+
+Uncompressed chunk length
  This is an integer containing the length of the chunk after it has been
  decompressed.