Skip to main content

MAX_KVP_VALUE_LEN

Constant MAX_KVP_VALUE_LEN 

Source
pub const MAX_KVP_VALUE_LEN: usize = 65535;
Expand description

Maximum value length for a Key-Value Pair: 2^16 - 1 bytes.

Drafts 11 through 15 state it of the Key-Value-Pair Length field: “The maximum length of a value is 2^16-1 bytes. If an endpoint receives a length larger than the maximum, it MUST close the session with a Protocol Violation.” Drafts 16 and later spell the code PROTOCOL_VIOLATION and change nothing else. It is a receiver’s rule, which is why it is applied when decoding.

Drafts 07 through 10 have no Key-Value-Pair. They carry a Parameter with an unbounded length and state no maximum, so KeyValuePair::decode_d07 does not apply this.