Rollback code
This commit is contained in:
parent
61fa9f3f89
commit
798c60f269
4
Makefile
4
Makefile
|
@ -2,7 +2,7 @@ PROJECT = emqttd
|
||||||
PROJECT_DESCRIPTION = Erlang MQTT Broker
|
PROJECT_DESCRIPTION = Erlang MQTT Broker
|
||||||
PROJECT_VERSION = 2.2
|
PROJECT_VERSION = 2.2
|
||||||
|
|
||||||
DEPS = goldrush gproc lager esockd mochiweb pbkdf2 lager_syslog bcrypt clique jsx
|
DEPS = goldrush gproc lager esockd mochiweb pbkdf2 lager_syslog bcrypt
|
||||||
|
|
||||||
dep_goldrush = git https://github.com/basho/goldrush 0.1.9
|
dep_goldrush = git https://github.com/basho/goldrush 0.1.9
|
||||||
dep_gproc = git https://github.com/uwiger/gproc
|
dep_gproc = git https://github.com/uwiger/gproc
|
||||||
|
@ -13,8 +13,6 @@ dep_mochiweb = git https://github.com/emqtt/mochiweb emq22
|
||||||
dep_pbkdf2 = git https://github.com/emqtt/pbkdf2 2.0.1
|
dep_pbkdf2 = git https://github.com/emqtt/pbkdf2 2.0.1
|
||||||
dep_lager_syslog = git https://github.com/basho/lager_syslog
|
dep_lager_syslog = git https://github.com/basho/lager_syslog
|
||||||
dep_bcrypt = git https://github.com/smarkets/erlang-bcrypt master
|
dep_bcrypt = git https://github.com/smarkets/erlang-bcrypt master
|
||||||
dep_clique = git https://github.com/turtleDeng/clique
|
|
||||||
dep_jsx = git https://github.com/talentdeficit/jsx
|
|
||||||
ERLC_OPTS += +'{parse_transform, lager_transform}'
|
ERLC_OPTS += +'{parse_transform, lager_transform}'
|
||||||
|
|
||||||
NO_AUTOPATCH = cuttlefish
|
NO_AUTOPATCH = cuttlefish
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
{modules,[]},
|
{modules,[]},
|
||||||
{registered,[emqttd_sup]},
|
{registered,[emqttd_sup]},
|
||||||
{applications,[kernel,stdlib,gproc,lager,esockd,mochiweb,
|
{applications,[kernel,stdlib,gproc,lager,esockd,mochiweb,
|
||||||
lager_syslog,pbkdf2,bcrypt,jsx]},
|
lager_syslog,pbkdf2,bcrypt]},
|
||||||
{env,[]},
|
{env,[]},
|
||||||
{mod,{emqttd_app,[]}},
|
{mod,{emqttd_app,[]}},
|
||||||
{maintainers,["Feng Lee <feng@emqtt.io>"]},
|
{maintainers,["Feng Lee <feng@emqtt.io>"]},
|
||||||
|
|
|
@ -43,7 +43,6 @@ start(_Type, _Args) ->
|
||||||
{ok, Sup} = emqttd_sup:start_link(),
|
{ok, Sup} = emqttd_sup:start_link(),
|
||||||
start_servers(Sup),
|
start_servers(Sup),
|
||||||
emqttd_cli:load(),
|
emqttd_cli:load(),
|
||||||
emqttd_cli2:register_cli(),
|
|
||||||
register_acl_mod(),
|
register_acl_mod(),
|
||||||
emqttd_plugins:init(),
|
emqttd_plugins:init(),
|
||||||
emqttd_plugins:load(),
|
emqttd_plugins:load(),
|
||||||
|
|
1163
src/emqttd_cli2.erl
1163
src/emqttd_cli2.erl
File diff suppressed because it is too large
Load Diff
|
@ -1,27 +0,0 @@
|
||||||
-module (emqttd_cli_format).
|
|
||||||
|
|
||||||
-behavior(clique_writer).
|
|
||||||
|
|
||||||
%% API
|
|
||||||
-export([write/1]).
|
|
||||||
|
|
||||||
write([{text, Text}]) ->
|
|
||||||
Json = jsx:encode([{text, lists:flatten(Text)}]),
|
|
||||||
{io_lib:format("~p~n", [Json]), []};
|
|
||||||
|
|
||||||
write([{table, Table}]) ->
|
|
||||||
Json = jsx:encode(Table),
|
|
||||||
{io_lib:format("~p~n", [Json]), []};
|
|
||||||
|
|
||||||
write([{list, Key, [Value]}| Tail]) ->
|
|
||||||
Table = lists:reverse(write(Tail, [{Key, Value}])),
|
|
||||||
Json = jsx:encode(Table),
|
|
||||||
{io_lib:format("~p~n", [Json]), []};
|
|
||||||
|
|
||||||
write(_) ->
|
|
||||||
{io_lib:format("error~n", []), []}.
|
|
||||||
|
|
||||||
write([], Acc) ->
|
|
||||||
Acc;
|
|
||||||
write([{list, Key, [Value]}| Tail], Acc) ->
|
|
||||||
write(Tail, [{Key, Value}| Acc]).
|
|
|
@ -559,11 +559,6 @@ handle_info({'EXIT', ClientPid, _Reason},
|
||||||
State = #state{clean_sess = true, client_pid = ClientPid}) ->
|
State = #state{clean_sess = true, client_pid = ClientPid}) ->
|
||||||
{stop, normal, State};
|
{stop, normal, State};
|
||||||
|
|
||||||
%% ClientPid was killed
|
|
||||||
handle_info({'EXIT', ClientPid, killed}, State) ->
|
|
||||||
?LOG(info, "Client ~p EXIT for ~p", [ClientPid, killed], State),
|
|
||||||
shutdown(killed, State);
|
|
||||||
|
|
||||||
handle_info({'EXIT', ClientPid, Reason},
|
handle_info({'EXIT', ClientPid, Reason},
|
||||||
State = #state{clean_sess = false,
|
State = #state{clean_sess = false,
|
||||||
client_pid = ClientPid,
|
client_pid = ClientPid,
|
||||||
|
|
Loading…
Reference in New Issue