From 37af7a72ec5864e81323ce979e53e64175a3a937 Mon Sep 17 00:00:00 2001 From: cbdev Date: Wed, 20 Oct 2021 23:15:10 +0200 Subject: Minor MQTT fix --- backends/mqtt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/mqtt.c b/backends/mqtt.c index 6d25fd3..c9a303e 100644 --- a/backends/mqtt.c +++ b/backends/mqtt.c @@ -314,11 +314,11 @@ static int mqtt_reconnect(instance* inst){ //prepare CONNECT message header variable_header[6] = data->mqtt_version; - variable_header[7] = 0x02 /*clean start*/ | (data->user ? 0x80 : 0x00) | (data->user ? 0x40 : 0x00); + variable_header[7] = 0x02 /*clean start*/ | (data->user ? 0x80 : 0x00) | (data->password ? 0x40 : 0x00); if(data->mqtt_version == 0x05){ //mqtt v5 has additional options //push number of option bytes (as a varint, no less) before actually pushing the option data. - //obviously someone thought saving 3 whole bytes in exchange for not being able to sequentially creating the package was smart.. + //obviously someone thought saving 3 whole bytes in exchange for not being able to sequentially create the package was smart.. variable_header[vh_offset++] = 8; //push maximum packet size option variable_header[vh_offset++] = 0x27; -- cgit v1.2.3