This commit is contained in:
Feng Lee 2015-09-21 21:11:42 +08:00
parent 7186ba2a21
commit ba9534a683
1 changed files with 4 additions and 3 deletions

View File

@ -311,13 +311,14 @@ trace(send, Packet, #proto_state{peername = Peername, client_id = ClientId}) ->
redeliver({?PUBREL, PacketId}, State) -> redeliver({?PUBREL, PacketId}, State) ->
send(?PUBREL_PACKET(PacketId), State). send(?PUBREL_PACKET(PacketId), State).
shutdown(duplicate_id, _State) ->
quiet; %%
shutdown(Error, #proto_state{client_id = undefined}) -> shutdown(Error, #proto_state{client_id = undefined}) ->
lager:info("Protocol shutdown ~p", [Error]), lager:info("Protocol shutdown ~p", [Error]),
ignore; ignore;
shutdown(duplicate_id, #proto_state{client_id = ClientId}) ->
%% unregister the device
emqttd_cm:unregister(ClientId);
%% TODO: ClientId?? %% TODO: ClientId??
shutdown(Error, #proto_state{peername = Peername, client_id = ClientId, will_msg = WillMsg}) -> shutdown(Error, #proto_state{peername = Peername, client_id = ClientId, will_msg = WillMsg}) ->
lager:info([{client, ClientId}], "Client ~s@~s: shutdown ~p", lager:info([{client, ClientId}], "Client ~s@~s: shutdown ~p",