From a3103cec7b92cf90f2a1caa5ae2957eb273cffcb Mon Sep 17 00:00:00 2001 From: turtleDeng Date: Wed, 12 Jun 2019 15:51:01 +0800 Subject: [PATCH] Revert "Fix websocket bug. Prior to this change, websocket connection would be closed directly without sending connack packet when acl check fails." This reverts commit e73c4c64d02a50bbef87366ce4946abf2123272b. --- src/emqx_ws_connection.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emqx_ws_connection.erl b/src/emqx_ws_connection.erl index 29749f35c..d635a0caa 100644 --- a/src/emqx_ws_connection.erl +++ b/src/emqx_ws_connection.erl @@ -301,6 +301,7 @@ websocket_info(Info, State) -> terminate(SockError, _Req, #state{keepalive = Keepalive, proto_state = ProtoState, shutdown = Shutdown}) -> + ?LOG(debug, "[WS Connection] Terminated for ~p, sockerror: ~p", [Shutdown, SockError]), emqx_keepalive:cancel(Keepalive), case {ProtoState, Shutdown} of @@ -326,8 +327,7 @@ ensure_stats_timer(State) -> State. shutdown(Reason, State) -> - self() ! {stop, State#state{shutdown = Reason}}, - {ok, State}. + {stop, State#state{shutdown = Reason}}. wsock_stats() -> [{Key, emqx_pd:get_counter(Key)} || Key <- ?SOCK_STATS].