commit
8822468528
2
Makefile
2
Makefile
|
@ -1,6 +1,6 @@
|
||||||
PROJECT = emqttd
|
PROJECT = emqttd
|
||||||
PROJECT_DESCRIPTION = Erlang MQTT Broker
|
PROJECT_DESCRIPTION = Erlang MQTT Broker
|
||||||
PROJECT_VERSION = 2.3.5
|
PROJECT_VERSION = 2.3.6
|
||||||
|
|
||||||
DEPS = goldrush gproc lager esockd ekka mochiweb pbkdf2 lager_syslog bcrypt clique jsx
|
DEPS = goldrush gproc lager esockd ekka mochiweb pbkdf2 lager_syslog bcrypt clique jsx
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{application,emqttd,
|
{application,emqttd,
|
||||||
[{description,"Erlang MQTT Broker"},
|
[{description,"Erlang MQTT Broker"},
|
||||||
{vsn,"2.3.5"},
|
{vsn,"2.3.6"},
|
||||||
{modules,[]},
|
{modules,[]},
|
||||||
{registered,[emqttd_sup]},
|
{registered,[emqttd_sup]},
|
||||||
{applications,[kernel,stdlib,gproc,lager,esockd,mochiweb,
|
{applications,[kernel,stdlib,gproc,lager,esockd,mochiweb,
|
||||||
|
|
|
@ -406,7 +406,7 @@ shutdown(Error, State = #proto_state{will_msg = WillMsg}) ->
|
||||||
%% Auth failure not publish the will message
|
%% Auth failure not publish the will message
|
||||||
case Error =:= auth_failure of
|
case Error =:= auth_failure of
|
||||||
true -> ok;
|
true -> ok;
|
||||||
false -> send_willmsg(Client, WillMsg)
|
false -> send_willmsg(State, WillMsg)
|
||||||
end,
|
end,
|
||||||
emqttd_hooks:run('client.disconnected', [Error], Client),
|
emqttd_hooks:run('client.disconnected', [Error], Client),
|
||||||
%% let it down
|
%% let it down
|
||||||
|
@ -429,10 +429,14 @@ maybe_set_clientid(State = #proto_state{client_id = NullId})
|
||||||
maybe_set_clientid(State) ->
|
maybe_set_clientid(State) ->
|
||||||
State.
|
State.
|
||||||
|
|
||||||
send_willmsg(_Client, undefined) ->
|
send_willmsg(_State, undefined) ->
|
||||||
ignore;
|
ignore;
|
||||||
send_willmsg(#mqtt_client{client_id = ClientId, username = Username}, WillMsg) ->
|
send_willmsg(State = #proto_state{client_id = ClientId, username = Username, is_superuser = IsSuper},
|
||||||
emqttd:publish(WillMsg#mqtt_message{from = {ClientId, Username}}).
|
WillMsg = #mqtt_message{topic = Topic}) ->
|
||||||
|
case IsSuper orelse allow == check_acl(publish, Topic, client(State)) of
|
||||||
|
true -> emqttd:publish(WillMsg#mqtt_message{from = {ClientId, Username}});
|
||||||
|
false -> ?LOG(error, "Cannot publish LWT message to ~s for ACL Deny", [Topic], State)
|
||||||
|
end.
|
||||||
|
|
||||||
start_keepalive(0, _State) -> ignore;
|
start_keepalive(0, _State) -> ignore;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue