Read checksum bytes even if ignoring its value

This commit is contained in:
Nigel Tao committed 2018-03-28 11:21:03 +11:00
1 parent 72449fa0ec
commit 153d1276a1
6 files changed
+68 -50

No files matched your search

+2 -2
View File
@@ -101,8 +101,8 @@ pub func decoder.decode?(dst writer1, src reader1)() {
}
yield z
}
// TODO: read the 4 bytes regardless of this.ignore_checksum.
if (not this.ignore_checksum) and (checksum_got != in.src.read_u32be?()) {
var checksum_want u32 = in.src.read_u32be?()
if (not this.ignore_checksum) and (checksum_got != checksum_want) {
// TODO: return error "checksum mismatch"
}
// TODO: handle the 4 byte ISIZE field.
+2 -2
View File
@@ -61,8 +61,8 @@ pub func decoder.decode?(dst writer1, src reader1)() {
}
yield z
}
// TODO: read the 4 bytes regardless of this.ignore_checksum.
if (not this.ignore_checksum) and (checksum_got != in.src.read_u32be?()) {
var checksum_want u32 = in.src.read_u32be?()
if (not this.ignore_checksum) and (checksum_got != checksum_want) {
return error "checksum mismatch"
}
}