Skip to main content

check_parameter_value_ranges

Function check_parameter_value_ranges 

Source
fn check_parameter_value_ranges(
    parameters: &[KeyValuePair],
) -> Result<(), CodecError>
Expand description

Refuse a Message Parameter whose value falls outside the range its type allows.

Message Parameters only. Each rule is stated for a named Message Parameter, and the Setup registry is a separate namespace that defines none of these numbers, so a SETUP carrying type 0x22 is carrying something the draft has not given a range to. Refusing it here would close the session on a reading the draft never gives.

Only the varint-valued shape is examined. Every type with a range is an even number, and draft-16 gives an even type a bare varint value, so a length-prefixed value under one of these keys is already a CodecError::KeyValueFormatting before it reaches here.