aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-05-31 12:48:59 +0200
committerLoïc Hoguin <[email protected]>2011-05-31 12:48:59 +0200
commit3cfdf46e97c98d031f1aae9a0333afa132466a7a (patch)
tree995c808e837c2926b140c62738794be4d5fca320
parentad2e905a81cc03b29857fd91e424d7cea484c8c7 (diff)
downloadcowboy-3cfdf46e97c98d031f1aae9a0333afa132466a7a.tar.gz
cowboy-3cfdf46e97c98d031f1aae9a0333afa132466a7a.tar.bz2
cowboy-3cfdf46e97c98d031f1aae9a0333afa132466a7a.zip
Remove a binary warning from websocket_data by removing a byte_size call.
-rw-r--r--src/cowboy_http_websocket.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cowboy_http_websocket.erl b/src/cowboy_http_websocket.erl
index f262de3..8acc842 100644
--- a/src/cowboy_http_websocket.erl
+++ b/src/cowboy_http_websocket.erl
@@ -128,8 +128,8 @@ handler_loop(State=#state{messages={OK, Closed, Error}, timeout=Timeout},
-spec websocket_data(#state{}, #http_req{}, any(), binary()) -> ok.
websocket_data(State, Req, HandlerState, << 255, 0, _Rest/bits >>) ->
websocket_close(State, Req, HandlerState, {normal, closed});
-websocket_data(State, Req, HandlerState, Data) when byte_size(Data) < 3 ->
- handler_loop(State, Req, HandlerState, Data);
+websocket_data(State, Req, HandlerState, <<>>) ->
+ handler_loop(State, Req, HandlerState, <<>>);
websocket_data(State, Req, HandlerState, Data) ->
websocket_frame(State, Req, HandlerState, Data, binary:first(Data)).