This commit is contained in:
Feng 2016-01-21 12:46:43 +08:00
parent c0e3145147
commit 7193bf4f20
1 changed files with 1 additions and 6 deletions

View File

@ -40,7 +40,7 @@
-endif. -endif.
load(Opts) -> load(Opts) ->
Topics = [{bin(Topic), QoS} || {Topic, QoS} <- Opts, ?IS_QOS(QoS)], Topics = [{iolist_to_binary(Topic), QoS} || {Topic, QoS} <- Opts, ?IS_QOS(QoS)],
State = #state{topics = Topics, stored = lists:member(stored, Opts)}, State = #state{topics = Topics, stored = lists:member(stored, Opts)},
emqttd_broker:hook('client.connected', {?MODULE, client_connected}, emqttd_broker:hook('client.connected', {?MODULE, client_connected},
{?MODULE, client_connected, [State]}), {?MODULE, client_connected, [State]}),
@ -70,8 +70,3 @@ rep(<<"$u">>, undefined, Topic) ->
rep(<<"$u">>, Username, Topic) -> rep(<<"$u">>, Username, Topic) ->
emqttd_topic:feed_var(<<"$u">>, Username, Topic). emqttd_topic:feed_var(<<"$u">>, Username, Topic).
bin(B) when is_binary(B) ->
B;
bin(S) when is_list(S) ->
list_to_binary(S).