Fix typo
This commit is contained in:
parent
7efd7b3ec0
commit
055d0ad98e
|
@ -789,21 +789,21 @@ connected({call, From}, {publish, Msg = #mqtt_msg{qos = ?QOS_0}}, State) ->
|
||||||
|
|
||||||
connected({call, From}, {publish, Msg = #mqtt_msg{qos = QoS}},
|
connected({call, From}, {publish, Msg = #mqtt_msg{qos = QoS}},
|
||||||
State = #state{inflight = Inflight, last_packet_id = PacketId})
|
State = #state{inflight = Inflight, last_packet_id = PacketId})
|
||||||
when (QoS =:= ?QOS_1); (QoS =:= ?QOS_2) ->
|
when (QoS =:= ?QOS_1); (QoS =:= ?QOS_2) ->
|
||||||
case emqx_inflight:is_full(Inflight) of
|
case emqx_inflight:is_full(Inflight) of
|
||||||
true ->
|
true ->
|
||||||
{keep_state, State, [{reply, From, {error, {PacketId, inflight_full}}}]};
|
{keep_state, State, [{reply, From, {error, {PacketId, inflight_full}}}]};
|
||||||
false ->
|
false ->
|
||||||
Msg1 = Msg#mqtt_msg{packet_id = PacketId},
|
Msg1 = Msg#mqtt_msg{packet_id = PacketId},
|
||||||
case send(Msg1, State) of
|
case send(Msg1, State) of
|
||||||
{ok, NewState} ->
|
{ok, NewState} ->
|
||||||
Inflight1 = emqx_inflight:insert(PacketId, {publish, Msg1, os:timestamp()}, Inflight),
|
Inflight1 = emqx_inflight:insert(PacketId, {publish, Msg1, os:timestamp()}, Inflight),
|
||||||
{keep_state, ensure_retry_timer(NewState#state{inflight = Inflight1}),
|
{keep_state, ensure_retry_timer(NewState#state{inflight = Inflight1}),
|
||||||
[{reply, From, {ok, PacketId}}]};
|
[{reply, From, {ok, PacketId}}]};
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
{stop_and_reply, Reason, [{reply, From, {error, {PacketId, Reason}}}]}
|
{stop_and_reply, Reason, [{reply, From, {error, {PacketId, Reason}}}]}
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
|
|
||||||
connected({call, From}, UnsubReq = {unsubscribe, Properties, Topics},
|
connected({call, From}, UnsubReq = {unsubscribe, Properties, Topics},
|
||||||
State = #state{last_packet_id = PacketId}) ->
|
State = #state{last_packet_id = PacketId}) ->
|
||||||
|
|
Loading…
Reference in New Issue