cloudmqtt
Public

A simple and straightforward to use MQTT client/server

Does not support Disconnect message#291

Open
Opened 5/21/20241 commentsby dscso
dscso

If using this command to publish a message the parser fails parsing the disconnect packet: ```bash mosquitto_pub -h 192.168.178.101 -t /test -m "mylittlemessage" -V mqttv5 ``` <img width="1264" alt="Screenshot 2024-05-21 at 12 14 42" src="https://github.com/TheNeikos/cloudmqtt/assets/6866008/86d74e1d-4109-43d6-b453-29193b554660"> ```rust #[test] fn test_disconnect_packet() { let buf = [0xe0, 0x00]; let parsed = MqttPacket::parse_complete(&buf).unwrap(); } ``` this is not working unfortunately results in an error: ``` called `Result::unwrap()` on an `Err` value: Backtrack(ContextError { context: PhantomData<winnow::error::StrContext> }) thread 'v5::packets::disconnect::test::test_disconnect_packet' panicked at mqtt-format/src/v5/packets/disconnect.rs:144:55: called `Result::unwrap()` on an `Err` value: Backtrack(ContextError { context: PhantomData<winnow::error::StrContext> }) stack backtrace: ``` The disconnect packet seems to be a special case. In the standard there is written: > The Client or Server sending the DISCONNECT packet MUST use one of the DISCONNECT Reason Code values [MQTT-3.14.2-1]. The Reason Code and Property Length can be omitted if the Reason Code is 0x00 (Normal disconnecton) and there are no Properties. In this case the DISCONNECT has a Remaining Length of 0. PR incoming...

AI Analysis

This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by dscso and has received 1 comments.

Add a comment
Comment form would go here