tvl-depot/tvix/nix-compat
edef ebad318ab3 fix(nix-compat/wire/bytes/reader): always read trailer tag data
Even if we have an aligned (or zero) size (and thus have no padding),
we may still have a non-padding trailer.

Since an exact read of only the user data bytes must always read the
trailer bytes as well, this has to happen for aligned sizes too.

For zero-sized trailers, we solve this by reading immediately, since no
read is required of the user at all.

user_len thus becomes a NonZeroU64, and the definition of "body data"
is adjusted to always exclude the final block.

Change-Id: I2c6bb51270fb22ad72a65076a3468673ab56ef68
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11597
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
2024-05-08 04:44:01 +00:00
..
benches fix(nix-compat/narinfo): unwrap in the benchmark 2023-10-28 17:11:22 +00:00
src fix(nix-compat/wire/bytes/reader): always read trailer tag data 2024-05-08 04:44:01 +00:00
testdata feat(tvix/nix-compat): add narinfo parsing and serialisation 2023-10-27 16:08:06 +00:00
Cargo.toml chore(nix-compat): remove unused test-case and test-generator 2024-04-19 19:22:10 +00:00
default.nix refactor(tvix/nix-compat): reorganize wire and bytes 2024-04-13 10:09:35 +00:00