fix #1562 dup flag not set when re-deliver

The dup flag is not set when redeliver the PUBLISH messages for QoS1 and QoS2
This commit is contained in:
terry-xiaoyu 2018-04-13 16:00:46 +08:00
parent e722e0f6d1
commit 18100cacf9
1 changed files with 3 additions and 4 deletions

View File

@ -720,7 +720,7 @@ enqueue_msg(Msg, State = #state{mqueue = Q}) ->
%%--------------------------------------------------------------------
redeliver(Msg = #mqtt_message{qos = QoS}, State) ->
deliver(Msg#mqtt_message{dup = if QoS =:= ?QOS2 -> false; true -> true end}, State);
deliver(Msg#mqtt_message{dup = if QoS =:= ?QOS0 -> false; true -> true end}, State);
redeliver({pubrel, PacketId}, #state{client_pid = Pid}) ->
Pid ! {redeliver, {?PUBREL, PacketId}}.
@ -853,4 +853,3 @@ shutdown(Reason, State) ->
gc(State) ->
emqttd_gc:maybe_force_gc(#state.force_gc_count, State).