Skip to content

incompatible remaining_length in connect #165

Closed
@willee

Description

@willee

Hi,
In CONNECT Packet fixed header, The Remaining Length is encoded using a variable length encoding scheme which uses a single byte for values up to 127. Larger values are handled as follows. The least significant seven bits of each byte encode the data, and the most significant bit is used to indicate that there are following bytes in the representation. Thus each byte encodes 128 values and a "continuation bit". The maximum number of bytes in the Remaining Length field is four.

Size of Remaining Length
#Byte x From=>To
#1:0(0x00)=>127(0x7F);
#2:128(0x80,0x01)=>16383(0xFF,0x7F
#3:16384(0x80,0x80,0x01)=>2097151(0xFF,0xFF,0x7F)
#4:2097152(0x80,0x80,0x80,0x01)=>268435455(0xFF,0xFF,0xFF,0x7F)

In connect, Remaining Length feild is only msg[1],only one  bytes, which is incompatible Remaining Length larger than 127 bytes

Willee Gong

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions