Просмотр исходного кода

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
zhanghongtong 5 лет назад
Родитель
Сommit
cae0849152
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      src/emqx_channel.erl

+ 4 - 2
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)