connector-contract-v3: drop the unreachable short-string arms of the str header width

Mutation survivors on 2101602: the worst-case payload is the base64 of an
envelope holding two 256-byte ids, so it never fits a one- or two-byte str
header.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-28 11:38:11 +01:00
commit aed07a4b71

View file

@ -226,14 +226,11 @@ fn bin_header_bytes(len: usize) -> usize {
}
}
/// MessagePack `str` header width for a string of `len` bytes.
/// MessagePack `str` header width for the base64 payload. The payload always
/// exceeds 255 bytes: the envelope it encodes holds two ids of at least
/// `MAX_IDENTITY_BYTES` in the worst case this bound measures.
fn str_header_bytes(len: usize) -> usize {
match len {
0..=31 => 1,
32..=255 => 2,
256..=65_535 => 3,
_ => 5,
}
if len <= 65_535 { 3 } else { 5 }
}
/// The largest payload bound whose worst-case frame fits `max_frame_bytes`: