Skip to content

Commit 85e47b6

Browse files
Deomid Ryabkovcesantabot
authored andcommitted
MQTT: Only PUBACK if the message's QoS is > 0
As opposed to topic subscription QoS, since granted QoS may be different than requested. CL: MQTT: Only PUBACK if the message's QoS is > 0 PUBLISHED_FROM=074e3af3da82a0cdd113dfdd972a2db2c7a896e1
1 parent c65c99f commit 85e47b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mgos_mqtt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static bool call_topic_handler(struct mg_connection *nc, int ev, void *ev_data,
9292
SLIST_FOREACH(th, &s_topic_handlers, entries) {
9393
if ((ev == MG_EV_MQTT_SUBACK && th->sub_id == msg->message_id) ||
9494
mg_mqtt_match_topic_expression(th->topic, msg->topic)) {
95-
if (ev == MG_EV_MQTT_PUBLISH && th->qos > 0) {
95+
if (ev == MG_EV_MQTT_PUBLISH && msg->qos > 0) {
9696
mg_mqtt_puback(nc, msg->message_id);
9797
}
9898
th->handler(nc, ev, ev_data, th->user_data);

0 commit comments

Comments
 (0)