fix session issue
This commit is contained in:
parent
ce5ca88cb6
commit
82bd645d7a
|
@ -323,6 +323,8 @@ handle_cast({resume, ClientId, ClientPid}, Session) ->
|
||||||
|
|
||||||
kick(ClientId, ClientPid, OldClientPid),
|
kick(ClientId, ClientPid, OldClientPid),
|
||||||
|
|
||||||
|
true = link(ClientPid),
|
||||||
|
|
||||||
%% Redeliver PUBREL
|
%% Redeliver PUBREL
|
||||||
[ClientPid ! {redeliver, {?PUBREL, MsgId}} || MsgId <- maps:keys(AwaitingComp)],
|
[ClientPid ! {redeliver, {?PUBREL, MsgId}} || MsgId <- maps:keys(AwaitingComp)],
|
||||||
|
|
||||||
|
@ -484,7 +486,7 @@ handle_info({'EXIT', ClientPid, Reason}, Session = #session{clean_sess = false,
|
||||||
expired_after = Expires}) ->
|
expired_after = Expires}) ->
|
||||||
lager:info("Session ~s unlink with client ~p: reason=~p", [ClientId, ClientPid, Reason]),
|
lager:info("Session ~s unlink with client ~p: reason=~p", [ClientId, ClientPid, Reason]),
|
||||||
TRef = timer(Expires, session_expired),
|
TRef = timer(Expires, session_expired),
|
||||||
{noreply, Session#session{expired_timer = TRef}, hibernate};
|
{noreply, Session#session{client_pid = undefined, expired_timer = TRef}, hibernate};
|
||||||
|
|
||||||
handle_info({'EXIT', Pid, _Reason}, Session = #session{clientid = ClientId,
|
handle_info({'EXIT', Pid, _Reason}, Session = #session{clientid = ClientId,
|
||||||
client_pid = ClientPid}) ->
|
client_pid = ClientPid}) ->
|
||||||
|
|
Loading…
Reference in New Issue