fix issue #311
This commit is contained in:
parent
b609d16bf2
commit
d7cdc477b4
|
@ -162,10 +162,10 @@ sessions(["list"]) ->
|
||||||
dump(session, mqtt_transient_session),
|
dump(session, mqtt_transient_session),
|
||||||
dump(session, mqtt_persistent_session);
|
dump(session, mqtt_persistent_session);
|
||||||
|
|
||||||
sessions(["show", ClientId0]) ->
|
sessions(["show", ClientId]) ->
|
||||||
ClientId = list_to_binary(ClientId0),
|
MP = {{list_to_binary(ClientId), '_'}, '_'},
|
||||||
case {ets:lookup(mqtt_transient_session, ClientId),
|
case {ets:match_object(mqtt_transient_session, MP),
|
||||||
ets:lookup(mqtt_persistent_session, ClientId)} of
|
ets:match_object(mqtt_persistent_session, MP)} of
|
||||||
{[], []} ->
|
{[], []} ->
|
||||||
?PRINT_MSG("Not Found.~n");
|
?PRINT_MSG("Not Found.~n");
|
||||||
{[SessInfo], _} ->
|
{[SessInfo], _} ->
|
||||||
|
@ -318,7 +318,7 @@ print(client, #mqtt_client{client_id = ClientId, clean_sess = CleanSess,
|
||||||
emqttd_net:format(Peername),
|
emqttd_net:format(Peername),
|
||||||
emqttd_util:now_to_secs(ConnectedAt)]);
|
emqttd_util:now_to_secs(ConnectedAt)]);
|
||||||
|
|
||||||
print(session, {ClientId, SessInfo}) ->
|
print(session, {{ClientId, _ClientPid}, SessInfo}) ->
|
||||||
InfoKeys = [clean_sess,
|
InfoKeys = [clean_sess,
|
||||||
max_inflight,
|
max_inflight,
|
||||||
inflight_queue,
|
inflight_queue,
|
||||||
|
@ -330,7 +330,8 @@ print(session, {ClientId, SessInfo}) ->
|
||||||
created_at,
|
created_at,
|
||||||
subscriptions],
|
subscriptions],
|
||||||
?PRINT("Session(~s, clean_sess=~s, max_inflight=~w, inflight_queue=~w, "
|
?PRINT("Session(~s, clean_sess=~s, max_inflight=~w, inflight_queue=~w, "
|
||||||
"message_queue=~w, message_dropped=~w, awaiting_rel=~w, awaiting_ack=~w, awaiting_comp=~w, "
|
"message_queue=~w, message_dropped=~w, "
|
||||||
|
"awaiting_rel=~w, awaiting_ack=~w, awaiting_comp=~w, "
|
||||||
"created_at=~w, subscriptions=~s)~n",
|
"created_at=~w, subscriptions=~s)~n",
|
||||||
[ClientId | [format(Key, proplists:get_value(Key, SessInfo)) || Key <- InfoKeys]]);
|
[ClientId | [format(Key, proplists:get_value(Key, SessInfo)) || Key <- InfoKeys]]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue