refactor(tvix/nix-compat/wire): rename padding_len to total_padding_len

Make it a bit more clear that this is the total padding length, not the
padding length we still need to write.

Change-Id: I9ff4aa16f256fda367b4b9295abf82ed01b1f989
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11383
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: picnoir picnoir <picnoir@alternativebit.fr>
This commit is contained in:
Florian Klink 2024-04-08 17:44:28 +03:00 committed by clbot
parent 24fd4e963a
commit f1496f5722

View file

@ -184,13 +184,13 @@ where
}
BytesPacketPosition::Padding(pos) => {
// Write remaining padding, if there is padding to write.
let padding_len = super::bytes::padding_len(*this.payload_len) as usize;
let total_padding_len = super::bytes::padding_len(*this.payload_len) as usize;
if pos != padding_len {
if pos != total_padding_len {
let bytes_written = ensure_nonzero_bytes_written(ready!(this
.inner
.as_mut()
.poll_write(cx, &EMPTY_BYTES[..padding_len]))?)?;
.poll_write(cx, &EMPTY_BYTES[..total_padding_len]))?)?;
*this.state = BytesPacketPosition::Padding(pos + bytes_written);
} else {
// everything written, break