From cae08491520642ecef707e2a2e21e66da5d06362 Mon Sep 17 00:00:00 2001 From: zhanghongtong Date: Tue, 2 Mar 2021 16:57:14 +0800 Subject: [PATCH] fix(emqx_channel): fix bug when publish deny fix the bug of replying to puback when the publish message with Qos equal to 2 is deny --- src/emqx_channel.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/emqx_channel.erl b/src/emqx_channel.erl index 2b51b1d02..03556d193 100644 --- a/src/emqx_channel.erl +++ b/src/emqx_channel.erl @@ -501,8 +501,10 @@ process_publish(Packet = ?PUBLISH_PACKET(QoS, Topic, PacketId), ignore -> case QoS of ?QOS_0 -> {ok, NChannel}; - _ -> - handle_out(puback, {PacketId, Rc}, NChannel) + ?QOS_1 -> + handle_out(puback, {PacketId, Rc}, NChannel); + ?QOS_2 -> + handle_out(pubrec, {PacketId, Rc}, NChannel) end; disconnect -> handle_out(disconnect, Rc, NChannel)