diff options
author | Loïc Hoguin <[email protected]> | 2013-08-27 18:21:03 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2013-08-27 18:21:03 +0200 |
commit | 0d5a12c3ecd3bd093c33e9a8126f1d129719b9ea (patch) | |
tree | 20c96cc59c40282e002d5f9d8279771f3d910b06 | |
parent | 8a77c8f753910168438986d13733f19bfc10fde1 (diff) | |
parent | 01d30568dd2f3a51a683921f0d2be76c2f32cca1 (diff) | |
download | cowboy-0d5a12c3ecd3bd093c33e9a8126f1d129719b9ea.tar.gz cowboy-0d5a12c3ecd3bd093c33e9a8126f1d129719b9ea.tar.bz2 cowboy-0d5a12c3ecd3bd093c33e9a8126f1d129719b9ea.zip |
Merge branch 'fix-ws-atom-responses' of git://github.com/seriyps/cowboy
-rw-r--r-- | src/cowboy_websocket.erl | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/cowboy_websocket.erl b/src/cowboy_websocket.erl index 50d5b9b..40046e1 100644 --- a/src/cowboy_websocket.erl +++ b/src/cowboy_websocket.erl @@ -602,8 +602,8 @@ handler_call(State=#state{handler=Handler}, Req, HandlerState, NextState(State#state{hibernate=true}, Req2, HandlerState2, RemainingData); {reply, Payload, Req2, HandlerState2} - when is_tuple(Payload) -> - case websocket_send(Payload, State) of + when is_list(Payload) -> + case websocket_send_many(Payload, State) of {ok, State2} -> NextState(State2, Req2, HandlerState2, RemainingData); {shutdown, State2} -> @@ -613,8 +613,8 @@ handler_call(State=#state{handler=Handler}, Req, HandlerState, handler_terminate(State2, Req2, HandlerState2, Error) end; {reply, Payload, Req2, HandlerState2, hibernate} - when is_tuple(Payload) -> - case websocket_send(Payload, State) of + when is_list(Payload) -> + case websocket_send_many(Payload, State) of {ok, State2} -> NextState(State2#state{hibernate=true}, Req2, HandlerState2, RemainingData); @@ -624,9 +624,8 @@ handler_call(State=#state{handler=Handler}, Req, HandlerState, {{error, _} = Error, State2} -> handler_terminate(State2, Req2, HandlerState2, Error) end; - {reply, Payload, Req2, HandlerState2} - when is_list(Payload) -> - case websocket_send_many(Payload, State) of + {reply, Payload, Req2, HandlerState2} -> + case websocket_send(Payload, State) of {ok, State2} -> NextState(State2, Req2, HandlerState2, RemainingData); {shutdown, State2} -> @@ -635,9 +634,8 @@ handler_call(State=#state{handler=Handler}, Req, HandlerState, {{error, _} = Error, State2} -> handler_terminate(State2, Req2, HandlerState2, Error) end; - {reply, Payload, Req2, HandlerState2, hibernate} - when is_list(Payload) -> - case websocket_send_many(Payload, State) of + {reply, Payload, Req2, HandlerState2, hibernate} -> + case websocket_send(Payload, State) of {ok, State2} -> NextState(State2#state{hibernate=true}, Req2, HandlerState2, RemainingData); |