Pass the paho interoperability tests
This commit is contained in:
parent
d756ce93c6
commit
5f32f3c560
|
@ -572,7 +572,7 @@ sp(false) -> 0.
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
||||||
clean_retain(false, Msg = #message{flags = #{retain := true}, headers = Headers}) ->
|
clean_retain(false, Msg = #message{flags = #{retain := true}, headers = Headers}) ->
|
||||||
case lists:member(retained, Headers) of
|
case maps:get(retained, Headers, false) of
|
||||||
true -> Msg;
|
true -> Msg;
|
||||||
false -> emqx_message:set_flag(retain, false, Msg)
|
false -> emqx_message:set_flag(retain, false, Msg)
|
||||||
end;
|
end;
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
-import(proplists, [get_value/2, get_value/3]).
|
-import(proplists, [get_value/2, get_value/3]).
|
||||||
|
|
||||||
%% Session API
|
%% Session API
|
||||||
-export([start_link/1, resume/3, discard/2]).
|
-export([start_link/1, resume/2, discard/2]).
|
||||||
|
|
||||||
%% Management and Monitor API
|
%% Management and Monitor API
|
||||||
-export([state/1, info/1, stats/1]).
|
-export([state/1, info/1, stats/1]).
|
||||||
|
@ -215,9 +215,9 @@ unsubscribe(SessionPid, TopicTable) ->
|
||||||
gen_server:cast(SessionPid, {unsubscribe, self(), TopicTable}).
|
gen_server:cast(SessionPid, {unsubscribe, self(), TopicTable}).
|
||||||
|
|
||||||
%% @doc Resume the session
|
%% @doc Resume the session
|
||||||
-spec(resume(pid(), client_id(), pid()) -> ok).
|
-spec(resume(pid(), pid()) -> ok).
|
||||||
resume(SessionPid, ClientId, ClientPid) ->
|
resume(SessionPid, ClientPid) ->
|
||||||
gen_server:cast(SessionPid, {resume, ClientId, ClientPid}).
|
gen_server:cast(SessionPid, {resume, ClientPid}).
|
||||||
|
|
||||||
%% @doc Get session state
|
%% @doc Get session state
|
||||||
state(SessionPid) when is_pid(SessionPid) ->
|
state(SessionPid) when is_pid(SessionPid) ->
|
||||||
|
@ -457,7 +457,7 @@ handle_cast({pubcomp, PacketId}, State = #state{inflight = Inflight}) ->
|
||||||
end, hibernate};
|
end, hibernate};
|
||||||
|
|
||||||
%% RESUME:
|
%% RESUME:
|
||||||
handle_cast({resume, ClientId, ClientPid},
|
handle_cast({resume, ClientPid},
|
||||||
State = #state{client_id = ClientId,
|
State = #state{client_id = ClientId,
|
||||||
client_pid = OldClientPid,
|
client_pid = OldClientPid,
|
||||||
clean_start = CleanStart,
|
clean_start = CleanStart,
|
||||||
|
|
Loading…
Reference in New Issue