You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MQTT subscribe Remaining Length encoding is incorrect #969
See this discussion for background, also MQTT spec V3.1.1 section 2.2.3.
This may be academic as its main impact is if the topic field is long. This is to record the existence of the issue.
The current encoding stores Remaining Length in a byte. It should be stored as a Variable Byte Integer as per .publish. This will cause a failure if Remaining Length is greater than 127, therefore imposing a limit on the length of the topic field.
I can submit a PR if the maintainers think this is worth fixing.
Opened #1142 with a minimal fix: encode Remaining Length for subscribe and unsubscribe as a Variable Byte Integer, matching the existing publish pattern, plus mock on-wire tests for short and long topics.
Activity
pablogventura commentedon Jul 16, 2026
Opened #1142 with a minimal fix: encode Remaining Length for subscribe and unsubscribe as a Variable Byte Integer, matching the existing
publishpattern, plus mock on-wire tests for short and long topics.umqtt.simple: Encode subscribe Remaining Length as VBI.
umqtt.simple: Encode subscribe Remaining Length as VBI.