0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 04:30:25 +00:00

call websocket_terminate in case of a handshake error

This commit is contained in:
Andre Graf 2012-12-05 17:42:17 +01:00
parent 8bc6bde62f
commit ae2a6cfb68

View file

@ -175,7 +175,8 @@ websocket_handshake(State=#state{socket=Socket, transport=Transport,
handler_before_loop(State#state{messages=Transport:messages()},
Req4, HandlerState, <<>>);
_Any ->
closed %% If an error happened reading the body, stop there.
%% If an error happened reading the body, stop there.
handler_terminate(State, Req3, HandlerState, {error, closed})
end;
websocket_handshake(State=#state{transport=Transport, challenge=Challenge},
Req, HandlerState) ->