Commit Graph
1 Commits
Author SHA1 Message Date
MildlyMeticulous d87d860cc8 codec: optimize buffer reserve for LengthDelimitedCodec::encode (#8333)
The reservation used `n`, the length after `length_adjustment` has been
applied, but the encoder goes on to write `length_field_len` bytes of
header plus `data.len()` bytes of payload. A positive `length_adjustment`
therefore under-reserved by exactly the adjustment on every frame, and a
negative one over-reserved, so the reservation did not match the write in
either of the adjusted configurations shown in the module docs.
2026-08-09 16:47:16 +02:00