3.1.4.1 Reading Variable-Sized Records

When a variable-sized record is received, the participant MUST use the following algorithm to decode the size and read the payload. This section assumes that the record type has already been read.

The algorithm takes as input the MaxSize, that is, the maximum supported size for this record. If the encoded size is 0, a Fault Record MAY<8> be sent to indicate that the size is 0 and the session MUST be closed. The decoded size is returned in little-endian format.

Algorithm to decode the size and read the payload

Figure 11: Algorithm to decode the size and read the payload