Remove will message when received disconnect packet with reason code 0x00
This commit is contained in:
parent
2d354ca883
commit
59798762a9
|
@ -412,12 +412,14 @@ process_packet(?DISCONNECT_PACKET(?RC_SUCCESS, #{'Session-Expiry-Interval' := In
|
|||
case Interval =/= 0 andalso OldInterval =:= 0 of
|
||||
true ->
|
||||
deliver({disconnect, ?RC_PROTOCOL_ERROR}, PState),
|
||||
{error, protocol_error, PState};
|
||||
{error, protocol_error, PState#pstate{will_msg = undefined}};
|
||||
false ->
|
||||
emqx_session:update_expiry_interval(SPid, Interval),
|
||||
%% Clean willmsg
|
||||
{stop, normal, PState#pstate{will_msg = undefined}}
|
||||
end;
|
||||
process_packet(?DISCONNECT_PACKET(?RC_SUCCESS), PState) ->
|
||||
{stop, normal, PState#pstate{will_msg = undefined}};
|
||||
process_packet(?DISCONNECT_PACKET(_), PState) ->
|
||||
{stop, normal, PState}.
|
||||
|
||||
|
|
Loading…
Reference in New Issue