From 040d04c9fb42aadd47688ccfdc9962d7e80ce39d Mon Sep 17 00:00:00 2001 From: DDDHuang <44492639+DDDHuang@users.noreply.github.com> Date: Tue, 18 Jan 2022 18:02:13 +0800 Subject: [PATCH] fix(test): for paho qos3 --- src/emqx_connection.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/emqx_connection.erl b/src/emqx_connection.erl index abba2bcdd..ccf4430a9 100644 --- a/src/emqx_connection.erl +++ b/src/emqx_connection.erl @@ -881,8 +881,9 @@ inc_outgoing_stats(Packet = ?PACKET(Type)) -> end, emqx_metrics:inc_sent(Packet). -inc_qos_stats(Type, #mqtt_packet{header = #mqtt_packet_header{qos = QoS}}) -> - inc_counter(inc_qos_stats_key(Type, QoS), 1). +inc_qos_stats(Type, #mqtt_packet{header = #mqtt_packet_header{qos = QoS}}) when ?IS_QOS(QoS) -> + inc_counter(inc_qos_stats_key(Type, QoS), 1); +inc_qos_stats(_, _) -> ok. inc_qos_stats_key(send_msg, ?QOS_0) -> 'send_msg.qos0'; inc_qos_stats_key(send_msg, ?QOS_1) -> 'send_msg.qos1';