From 067d28dcb6d93594975f44f58922c91d106be82b Mon Sep 17 00:00:00 2001 From: Gilbert Date: Mon, 21 Jan 2019 09:49:29 +0800 Subject: [PATCH] Change the reason code in will topic acl check (#2168) This chang the reason code to not authorized code. --- src/emqx_protocol.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emqx_protocol.erl b/src/emqx_protocol.erl index 8aafb313f..19a1dd838 100644 --- a/src/emqx_protocol.erl +++ b/src/emqx_protocol.erl @@ -708,7 +708,7 @@ set_session_attrs({topic_alias_maximum, #pstate{zone = Zone}}, SessAttrs) -> maps:put(topic_alias_maximum, emqx_zone:get_env(Zone, max_topic_alias, 0), SessAttrs); set_session_attrs({misc, #pstate{zone = Zone, - client_id = ClientId, + client_id = ClientId, conn_pid = ConnPid, username = Username, clean_start = CleanStart}}, SessAttrs) -> @@ -821,7 +821,7 @@ check_will_acl(#mqtt_packet_connect{will_topic = WillTopic}, PState) -> allow -> ok; deny -> ?LOG(warning, "Will message (to ~s) validation failed, acl denied", [WillTopic]), - {error, ?RC_UNSPECIFIED_ERROR} + {error, ?RC_NOT_AUTHORIZED} end. check_publish(Packet, PState) ->