Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in invokaton of struct.unpack in method unsubscribe? #163

Open
wnelis opened this issue Jan 15, 2025 · 3 comments
Open

Error in invokaton of struct.unpack in method unsubscribe? #163

wnelis opened this issue Jan 15, 2025 · 3 comments

Comments

@wnelis
Copy link

wnelis commented Jan 15, 2025

In file mqtt_as/__init__.py, line 560 in method unsubscribe reads:

    struct.pack_into("!BH", pkt, sz, pid)

I think it should be:

    struct.pack_into("!BH", pkt, 1, sz, pid)
@peterhinch
Copy link
Owner

Thanks for the report.

This does look like a bug. @bobveringa Do you agree that this fix is correct?

@bobveringa
Copy link
Contributor

Looking at the docs and surrounding code this does seem like a correct fix.

Interesting that this hasn't caused issues before.

@peterhinch
Copy link
Owner

@bobveringa Indeed. Your views on #164 would also be appreciated. The original assumption behind mqtt_as (also the official library) was that topic names would be short.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants