Fix websocket bug.
Prior to this change, websocket connection would be closed directly without sending connack packet when acl check fails. This change fix this bug.
This commit is contained in:
parent
76525cc703
commit
e73c4c64d0
|
@ -301,7 +301,6 @@ 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
|
||||
|
@ -327,7 +326,8 @@ ensure_stats_timer(State) ->
|
|||
State.
|
||||
|
||||
shutdown(Reason, State) ->
|
||||
{stop, State#state{shutdown = Reason}}.
|
||||
self() ! {stop, State#state{shutdown = Reason}},
|
||||
{ok, State}.
|
||||
|
||||
wsock_stats() ->
|
||||
[{Key, emqx_pd:get_counter(Key)} || Key <- ?SOCK_STATS].
|
||||
|
|
Loading…
Reference in New Issue