diff --git a/apps/emqttd/src/emqttd_client.erl b/apps/emqttd/src/emqttd_client.erl index 2605b42a7..0c9e2413a 100644 --- a/apps/emqttd/src/emqttd_client.erl +++ b/apps/emqttd/src/emqttd_client.erl @@ -257,7 +257,8 @@ inc(_) -> notify(disconnected, _Reason, undefined) -> ingore; notify(disconnected, {shutdown, Reason}, ProtoState) -> - emqttd_event:notify({disconnected, emqttd_protocol:clientid(ProtoState), [{reason, Reason}]}); + emqttd_event:notify({disconnected, emqttd_protocol:clientid(ProtoState), Reason}); notify(disconnected, Reason, ProtoState) -> - emqttd_event:notify({disconnected, emqttd_protocol:clientid(ProtoState), [{reason, Reason}]}). + emqttd_event:notify({disconnected, emqttd_protocol:clientid(ProtoState), Reason}). + diff --git a/apps/emqttd/src/emqttd_event.erl b/apps/emqttd/src/emqttd_event.erl index 3db7817aa..350b46b2f 100644 --- a/apps/emqttd/src/emqttd_event.erl +++ b/apps/emqttd/src/emqttd_event.erl @@ -73,7 +73,7 @@ handle_event({connected, ClientId, Params}, State = #state{systop = SysTop}) -> emqttd_pubsub:publish(event, Msg), {ok, State}; -handle_event({disconnectd, ClientId, Reason}, State = #state{systop = SysTop}) -> +handle_event({disconnected, ClientId, Reason}, State = #state{systop = SysTop}) -> Topic = <>, Msg = #mqtt_message{topic = Topic, payload = payload(disconnected, Reason)}, emqttd_pubsub:publish(event, Msg),