diff --git a/docs/source/changes.rst b/docs/source/changes.rst index 96f29fa03..bc16d60ce 100644 --- a/docs/source/changes.rst +++ b/docs/source/changes.rst @@ -5,7 +5,23 @@ Changes ======= -.. _release_1.0.1: +.. _release_1.0.2: + +------------- +Version 1.0.2 +------------- + +*Release Date: 2016-05-04* + +Issue#534 - './bin/emqttd_ctl vm' - add 'port/count', 'port/limit' statistics + +Issue#535 - emqttd_client should be terminated properly even if exception happened when sending data + +PR#519 - The erlang '-name' requires the fully qualified host name + +emqttd_reloader plugin - help reload modified modules during development. + +.. _release_l.0.1: ------------- Version 1.0.1 diff --git a/rel/files/emqttd.test.config b/rel/files/emqttd.test.config index f837d07ac..c2b90993e 100644 --- a/rel/files/emqttd.test.config +++ b/rel/files/emqttd.test.config @@ -46,7 +46,7 @@ %% Authetication. Anonymous Default {auth, [ %% Authentication with username, password - %{username, []}, + {username, [{test, "password"}, {"test1", "password1"}]}, %% Authentication with clientid %{clientid, [{password, no}, {file, "etc/clients.config"}]}, diff --git a/rel/reltool.config b/rel/reltool.config index 1c0fc3356..411543559 100644 --- a/rel/reltool.config +++ b/rel/reltool.config @@ -21,7 +21,7 @@ compiler, runtime_tools, lager, - {gen_logger, load}, + gen_logger, gproc, esockd, mochiweb, diff --git a/src/emqttd_access_control.erl b/src/emqttd_access_control.erl index 8fa96a81f..47d6417d4 100644 --- a/src/emqttd_access_control.erl +++ b/src/emqttd_access_control.erl @@ -89,7 +89,7 @@ check_acl(Client, PubSub, Topic, [{Mod, State, _Seq}|AclMods]) -> end. %% @doc Reload ACL Rules. --spec(reload_acl() -> list(ok | {error, any()})). +-spec(reload_acl() -> list(ok | {error, already_existed})). reload_acl() -> [Mod:reload_acl(State) || {Mod, State, _Seq} <- lookup_mods(acl)]. @@ -201,5 +201,5 @@ mod(Prefix, Name) -> list_to_atom(lists:concat([Prefix, Name])). if_existed(false, Fun) -> Fun(); -if_existed(true, _Fun) -> {error, existed}. +if_existed(_Mod, _Fun) -> {error, already_existed}. diff --git a/src/emqttd_auth_username.erl b/src/emqttd_auth_username.erl index 155537a83..3bbae8abf 100644 --- a/src/emqttd_auth_username.erl +++ b/src/emqttd_auth_username.erl @@ -77,6 +77,9 @@ add_user(Username, Password) -> User = #?AUTH_USERNAME_TAB{username = Username, password = hash(Password)}, ret(mnesia:transaction(fun mnesia:write/1, [User])). +add_default_user(Username, Password) when is_atom(Username) -> + add_default_user(atom_to_list(Username), Password); + add_default_user(Username, Password) -> add_user(iolist_to_binary(Username), iolist_to_binary(Password)). diff --git a/test/emqttd_SUITE.erl b/test/emqttd_SUITE.erl index fc65e0477..ab5480aad 100644 --- a/test/emqttd_SUITE.erl +++ b/test/emqttd_SUITE.erl @@ -421,6 +421,6 @@ cli_listeners(_) -> emqttd_cli:listeners([]). cli_vm(_) -> - emqttd_cli:vm(), + emqttd_cli:vm([]), emqttd_cli:vm(["ports"]). diff --git a/test/emqttd_access_SUITE.erl b/test/emqttd_access_SUITE.erl index c12fd00bd..1aa153b96 100644 --- a/test/emqttd_access_SUITE.erl +++ b/test/emqttd_access_SUITE.erl @@ -78,6 +78,7 @@ reload_acl(_) -> register_mod(_) -> ok = ?AC:register_mod(acl, emqttd_acl_test_mod, []), + {error, already_existed} = ?AC:register_mod(acl, emqttd_acl_test_mod, []), [{emqttd_acl_test_mod, _, 0}, {emqttd_acl_internal, _, 0}] = ?AC:lookup_mods(acl), ok = ?AC:register_mod(auth, emqttd_auth_anonymous_test_mod,[]),