Feng 10 лет назад
Родитель
Сommit
d09721301e
4 измененных файлов с 17 добавлено и 3 удалено
  1. 1 1
      src/emqttd_client.erl
  2. 1 1
      src/emqttd_protocol.erl
  3. 1 1
      src/emqttd_ws_client.erl
  4. 14 0
      test/emqttd_auth_dashboard.erl

+ 1 - 1
src/emqttd_client.erl

@@ -170,7 +170,7 @@ handle_info({redeliver, {?PUBREL, PacketId}}, State) ->
 
 handle_info({shutdown, conflict, {ClientId, NewPid}}, State) ->
     ?LOG(warning, "clientid '~s' conflict with ~p", [ClientId, NewPid], State),
-    shutdown(confict, State);
+    shutdown(conflict, State);
 
 handle_info(activate_sock, State) ->
     noreply(run_socket(State#client_state{conn_state = running}));

+ 1 - 1
src/emqttd_protocol.erl

@@ -282,7 +282,7 @@ redeliver({?PUBREL, PacketId}, State) ->
 shutdown(_Error, #proto_state{client_id = undefined}) ->
     ignore;
 
-shutdown(confict, #proto_state{client_id = ClientId}) ->
+shutdown(conflict, #proto_state{client_id = ClientId}) ->
     emqttd_cm:unregister(ClientId);
 
 shutdown(Error, State = #proto_state{client_id = ClientId, will_msg = WillMsg}) ->

+ 1 - 1
src/emqttd_ws_client.erl

@@ -196,7 +196,7 @@ handle_info({redeliver, {?PUBREL, PacketId}}, State) ->
 
 handle_info({shutdown, conflict, {ClientId, NewPid}}, State = #wsclient_state{request = Req}) ->
     ?WSLOG(warning, "clientid '~s' conflict with ~p", [ClientId, NewPid], Req),
-    shutdown(confict, State);
+    shutdown(conflict, State);
 
 handle_info({keepalive, start, Interval}, State = #wsclient_state{request = Req}) ->
     ?WSLOG(debug, "Keepalive at the interval of ~p", [Interval], Req),

+ 14 - 0
test/emqttd_auth_dashboard.erl

@@ -0,0 +1,14 @@
+
+-module(emqttd_auth_dashboard).
+
+%% Auth callbacks
+-export([init/1, check/3, description/0]).
+
+init(Opts) ->
+    {ok, Opts}.
+
+check(_Client, _Password, _Opts) ->
+    allow.
+
+description() ->
+    "Test emqttd_auth_dashboard Mod".