diff --git a/src/emqttd_ws_client.erl b/src/emqttd_ws_client.erl index 196e7d5d1..8b06d9367 100644 --- a/src/emqttd_ws_client.erl +++ b/src/emqttd_ws_client.erl @@ -123,7 +123,8 @@ reset_parser(State = #wsocket_state{packet_opts = PktOpts}) -> %%%============================================================================= init([WsPid, Req, ReplyChannel, PktOpts]) -> - process_flag(trap_exit, true), + %%issue#413: trap_exit is unnecessary + %%process_flag(trap_exit, true), {ok, Peername} = Req:get(peername), SendFun = fun(Payload) -> ReplyChannel({binary, Payload}) end, Headers = mochiweb_request:get(headers, Req), @@ -220,18 +221,9 @@ handle_info({keepalive, check}, State = #wsclient_state{request = Req, shutdown(keepalive_error, State) end; -handle_info({'EXIT', WsPid, Reason}, State = #wsclient_state{ws_pid = WsPid}) -> - stop(Reason, State); - -handle_info({'EXIT', SessPid, Reason}, State = #wsclient_state{request = Req, - proto_state = ProtoState}) -> - case emqttd_protocol:session(ProtoState) of - SessPid -> - stop(Reason, State); - ExitPid -> - ?WSLOG(error, "Unexpected EXIT ~p for ~p", [ExitPid, Reason], Req), - noreply(State) - end; +%%issue#413: removed the trap_exit flag +%%handle_info({'EXIT', WsPid, Reason}, State = #wsclient_state{ws_pid = WsPid}) -> +%% stop(Reason, State); handle_info(Info, State = #wsclient_state{request = Req}) -> ?WSLOG(critical, "Unexpected Info: ~p", [Info], Req),