Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

mqtt.connect() fails if remaining length exceeds 128 #130

Open
superkartoffel opened this issue Sep 17, 2020 · 0 comments
Open

mqtt.connect() fails if remaining length exceeds 128 #130

superkartoffel opened this issue Sep 17, 2020 · 0 comments

Comments

@superkartoffel
Copy link

What are the steps to reproduce this issue?

  1. Connect to any mqtt broker using mqtt.py with values for username, clientId, password and/or will-message so that the "remaining length" of the connect message exceeds 128, i.e.:
client = MQTTClient("d5dab9db471a417f95c1e86d61b8b68e", "mqtt.eclipse.org", port=1883, user="d5dab9db471a417f95c1e86d61b8b68e", password="d5dab9db471a417f95c1e86d61b8b68e", keepalive=60)
client.set_last_will(topic="some/d5dab9db471a417f95c1e86d61b8b68e/topic", msg="d5dab9db471a417f95c1e86d61b8b68e")
client.connect()

What happens?

The broker will reset the connection after receiving the CONNECT packet.

What were you expecting to happen?

The broker should not reset the connection.

Any logs, error output, etc?

Unfortunately no. After reading the code and the mqtt specification, I found out, that mqtt.py does not implement the "remaining length" field correctly for values above 128. See mqtt 3.1.1 specification

Any other comments?

The publish packet seems to implement this field correctly.

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

No branches or pull requests

1 participant