Merge pull request #1800 from terry-xiaoyu/ignor_zero_will_delay
Ignore Will-Delay-Interval = 0
This commit is contained in:
commit
c8341c85ba
|
@ -370,7 +370,7 @@ process_packet(?SUBSCRIBE_PACKET(PacketId, Properties, RawTopicFilters),
|
||||||
end;
|
end;
|
||||||
true ->
|
true ->
|
||||||
RawTopicFilters
|
RawTopicFilters
|
||||||
end,
|
end,
|
||||||
case check_subscribe(
|
case check_subscribe(
|
||||||
parse_topic_filters(?SUBSCRIBE, RawTopicFilters1), PState) of
|
parse_topic_filters(?SUBSCRIBE, RawTopicFilters1), PState) of
|
||||||
{ok, TopicFilters} ->
|
{ok, TopicFilters} ->
|
||||||
|
@ -732,7 +732,8 @@ shutdown(Reason, PState = #pstate{connected = true,
|
||||||
send_willmsg(undefined) ->
|
send_willmsg(undefined) ->
|
||||||
ignore;
|
ignore;
|
||||||
send_willmsg(WillMsg = #message{topic = Topic,
|
send_willmsg(WillMsg = #message{topic = Topic,
|
||||||
headers = #{'Will-Delay-Interval' := Interval}}) when is_integer(Interval) ->
|
headers = #{'Will-Delay-Interval' := Interval}})
|
||||||
|
when is_integer(Interval), Interval > 0 ->
|
||||||
SendAfter = integer_to_binary(Interval),
|
SendAfter = integer_to_binary(Interval),
|
||||||
emqx_broker:publish(WillMsg#message{topic = <<"$delayed/", SendAfter/binary, "/", Topic/binary>>});
|
emqx_broker:publish(WillMsg#message{topic = <<"$delayed/", SendAfter/binary, "/", Topic/binary>>});
|
||||||
send_willmsg(WillMsg) ->
|
send_willmsg(WillMsg) ->
|
||||||
|
|
Loading…
Reference in New Issue