Mountpoint support %c and %u

This commit is contained in:
turtled 2019-08-09 16:54:49 +08:00
parent b5aebb19b9
commit 31cc446818
1 changed files with 6 additions and 6 deletions

View File

@ -203,7 +203,7 @@ handle_in(?PUBACK_PACKET(PacketId, _ReasonCode), PState = #protocol{session = Se
{ok, PState} {ok, PState}
end; end;
handle_in(?PUBREC_PACKET(PacketId, ReasonCode), PState = #protocol{session = Session}) -> handle_in(?PUBREC_PACKET(PacketId, _ReasonCode), PState = #protocol{session = Session}) ->
case emqx_session:pubrec(PacketId, Session) of case emqx_session:pubrec(PacketId, Session) of
{ok, NSession} -> {ok, NSession} ->
handle_out({pubrel, PacketId}, PState#protocol{session = NSession}); handle_out({pubrel, PacketId}, PState#protocol{session = NSession});
@ -211,7 +211,7 @@ handle_in(?PUBREC_PACKET(PacketId, ReasonCode), PState = #protocol{session = Ses
handle_out({pubrel, PacketId, ReasonCode1}, PState) handle_out({pubrel, PacketId, ReasonCode1}, PState)
end; end;
handle_in(?PUBREL_PACKET(PacketId, ReasonCode), PState = #protocol{session = Session}) -> handle_in(?PUBREL_PACKET(PacketId, _ReasonCode), PState = #protocol{session = Session}) ->
case emqx_session:pubrel(PacketId, Session) of case emqx_session:pubrel(PacketId, Session) of
{ok, NSession} -> {ok, NSession} ->
handle_out({pubcomp, PacketId}, PState#protocol{session = NSession}); handle_out({pubcomp, PacketId}, PState#protocol{session = NSession});
@ -871,11 +871,11 @@ parse(unsubscribe, TopicFilters) ->
%% Mount/Unmount %% Mount/Unmount
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
mount(#{mountpoint := MountPoint}, TopicOrMsg) -> mount(Client = #{mountpoint := MountPoint}, TopicOrMsg) ->
emqx_mountpoint:mount(MountPoint, TopicOrMsg). emqx_mountpoint:mount(emqx_mountpoint:replvar(MountPoint, Client), TopicOrMsg).
unmount(#{mountpoint := MountPoint}, TopicOrMsg) -> unmount(Client = #{mountpoint := MountPoint}, TopicOrMsg) ->
emqx_mountpoint:unmount(MountPoint, TopicOrMsg). emqx_mountpoint:unmount(emqx_mountpoint:replvar(MountPoint, Client), TopicOrMsg).
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% Pipeline %% Pipeline