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

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

Open
@superkartoffel

Description

@superkartoffel

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.

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