mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-12 21:52:07 +02:00
Handle TCP errors in websockets
This commit is contained in:
parent
e427358e08
commit
4b6f1195c6
|
@ -203,6 +203,9 @@ ws_loop(FrameInfo, Socket, WsHandleLoopPid, SocketMode) ->
|
||||||
{tcp_closed, _Socket} ->
|
{tcp_closed, _Socket} ->
|
||||||
?DEBUG("tcp connection was closed, exit", []),
|
?DEBUG("tcp connection was closed, exit", []),
|
||||||
websocket_close(Socket, WsHandleLoopPid, SocketMode, 0);
|
websocket_close(Socket, WsHandleLoopPid, SocketMode, 0);
|
||||||
|
{tcp_error, Socket, Reason} ->
|
||||||
|
?DEBUG("tcp connection error: ~s", [inet:format_error(Reason)]),
|
||||||
|
websocket_close(Socket, WsHandleLoopPid, SocketMode, 0);
|
||||||
{'DOWN', Ref, process, WsHandleLoopPid, Reason} ->
|
{'DOWN', Ref, process, WsHandleLoopPid, Reason} ->
|
||||||
Code = case Reason of
|
Code = case Reason of
|
||||||
normal ->
|
normal ->
|
||||||
|
|
Loading…
Reference in New Issue
Block a user