diff options
author | Loïc Hoguin <[email protected]> | 2014-10-03 18:25:29 +0300 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2014-10-03 18:25:29 +0300 |
commit | bee5ca852b1a8e1506872aeea57f6c745c8add77 (patch) | |
tree | 00f65257b5ba7e4688dceb46ecce99f2f5f898a6 /src/cowboy_spdy.erl | |
parent | 8e17d492b377cbf2eaf0d191b1e8636ea06c806a (diff) | |
download | cowboy-bee5ca852b1a8e1506872aeea57f6c745c8add77.tar.gz cowboy-bee5ca852b1a8e1506872aeea57f6c745c8add77.tar.bz2 cowboy-bee5ca852b1a8e1506872aeea57f6c745c8add77.zip |
Replace some /binary to /bits in binary pattern matching
We don't need the extra check for multiple of 8 bits.
Diffstat (limited to 'src/cowboy_spdy.erl')
-rw-r--r-- | src/cowboy_spdy.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cowboy_spdy.erl b/src/cowboy_spdy.erl index 3057cca..4d83ff6 100644 --- a/src/cowboy_spdy.erl +++ b/src/cowboy_spdy.erl @@ -123,7 +123,7 @@ loop(State=#state{parent=Parent, socket=Socket, transport=Transport, FromPid ! {recv, FromSocket, {ok, InBuffer}}, loop(replace_child(Child#child{in_buffer= <<>>}, State)); byte_size(InBuffer) >= Length -> - << Data:Length/binary, Rest/binary >> = InBuffer, + << Data:Length/binary, Rest/bits >> = InBuffer, FromPid ! {recv, FromSocket, {ok, Data}}, loop(replace_child(Child#child{in_buffer=Rest}, State)); true -> @@ -293,7 +293,7 @@ handle_frame(State, {data, StreamID, IsFin, Data}) -> Child#child{input=IsFin2, in_buffer= <<>>, is_recv=false}; {passive, FromSocket, FromPid, Length, TRef} when byte_size(Data2) >= Length -> - << Data3:Length/binary, Rest/binary >> = Data2, + << Data3:Length/binary, Rest/bits >> = Data2, FromPid ! {recv, FromSocket, {ok, Data3}}, cancel_recv_timeout(StreamID, TRef), Child#child{input=IsFin2, in_buffer=Rest, is_recv=false}; |