From 88fc67b369b910ce8bc5bebbf17ee62ef1ad402f Mon Sep 17 00:00:00 2001 From: William Yang Date: Mon, 26 Feb 2024 17:59:05 +0100 Subject: [PATCH] chore(willmsg): remove unreachable code --- apps/emqx/src/emqx_channel.erl | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/apps/emqx/src/emqx_channel.erl b/apps/emqx/src/emqx_channel.erl index cf9f67f39..d238a78ca 100644 --- a/apps/emqx/src/emqx_channel.erl +++ b/apps/emqx/src/emqx_channel.erl @@ -2353,22 +2353,6 @@ maybe_publish_will_msg( end, %% Maybe we should cancel first then send remove_willmsg(Channel); -maybe_publish_will_msg( - {shutdown, _}, - Channel = #channel{ - conninfo = #{expiry_interval := 0, clientid := ClientId}, - clientinfo = ClientInfo, - will_msg = WillMsg - } -) -> - %% MQTT 5: 3.1.2.11.2 Session Expiry Interval - %% If the Session Expiry Interval is absent the value 0 is used. - %% If it is set to 0, or is absent, the Session ends when the Network Connection is closed. - %% Expire_interval == 0, means session is end at the time of calling with shutdown. - ?tp(debug, maybe_publish_will_msg_shutdown, #{clientid => ClientId}), - _ = publish_will_msg(ClientInfo, WillMsg), - %% Maybe we should cancel first then send - remove_willmsg(Channel); maybe_publish_will_msg( Reason, Channel = #channel{