From c0b86c765981ce40faa4cee2e83a30b0732394de Mon Sep 17 00:00:00 2001 From: Luca Date: Thu, 5 Sep 2024 17:52:07 +0200 Subject: [PATCH] fix: typos and wrong numbers --- mqtt.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mqtt.lua b/mqtt.lua index 37943c0..83c31f7 100644 --- a/mqtt.lua +++ b/mqtt.lua @@ -69,7 +69,7 @@ function MqttClient:handle () return err end - local ptype, length, _ = string.unpack("B B", s) + local ptype, length, _ = string.unpack("B B", data) local length, err = self.conn:readVarint(length) if err ~= nil then @@ -127,8 +127,8 @@ function MqttClient:connect (username, password) return nil end - local length = 15 - local flags = 1 + local length = 13 + local flags = 2 if username ~= nil then length = length + 2 + #username flags = flags | 0x80