Update 'Message Expiry Interval' property before delivering a PUBLISH

This commit is contained in:
Feng Lee 2018-08-30 18:31:37 +08:00
parent 7b5f2577d3
commit 553a60cdec
1 changed files with 4 additions and 3 deletions

View File

@ -455,8 +455,9 @@ deliver({connack, ReasonCode, SP}, PState) ->
deliver({publish, PacketId, Msg}, PState = #pstate{is_bridge = IsBridge, mountpoint = MountPoint}) ->
_ = emqx_hooks:run('message.delivered', [credentials(PState)], Msg),
Msg1 = emqx_mountpoint:unmount(MountPoint, clean_retain(IsBridge, Msg)),
send(emqx_packet:from_message(PacketId, Msg1), PState);
Msg1 = emqx_message:update_expiry(Msg),
Msg2 = emqx_mountpoint:unmount(MountPoint, clean_retain(IsBridge, Msg1)),
send(emqx_packet:from_message(PacketId, Msg2), PState);
deliver({puback, PacketId, ReasonCode}, PState) ->
send(?PUBACK_PACKET(PacketId, ReasonCode), PState);