aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-11-27 18:54:51 +0100
committerLoïc Hoguin <[email protected]>2017-11-27 18:54:51 +0100
commita09bf2778d0a1e32c57f0e79d609b3a0ace3273e (patch)
tree69d091a4a341c44a0f7b59482c82459efa1d0a3b
parenteb8990fccdeaf44e1f58e83c49e23b1b2be4093a (diff)
downloadcowlib-a09bf2778d0a1e32c57f0e79d609b3a0ace3273e.tar.gz
cowlib-a09bf2778d0a1e32c57f0e79d609b3a0ace3273e.tar.bz2
cowlib-a09bf2778d0a1e32c57f0e79d609b3a0ace3273e.zip
Fix an error return value in cow_http2:parse/1
-rw-r--r--src/cow_http2.erl5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cow_http2.erl b/src/cow_http2.erl
index 2233a8c..9e798c5 100644
--- a/src/cow_http2.erl
+++ b/src/cow_http2.erl
@@ -240,8 +240,8 @@ parse(<< 4:24, 8:8, _:9, 0:31, _:1, 0:31, _/bits >>) ->
{connection_error, protocol_error, 'WINDOW_UPDATE frames MUST have a non-zero increment. (RFC7540 6.9)'};
parse(<< 4:24, 8:8, _:9, 0:31, _:1, Increment:31, Rest/bits >>) ->
{ok, {window_update, Increment}, Rest};
-parse(<< 4:24, 8:8, _:9, StreamID:31, _:1, 0:31, _/bits >>) ->
- {stream_error, StreamID, protocol_error, 'WINDOW_UPDATE frames MUST have a non-zero increment. (RFC7540 6.9)'};
+parse(<< 4:24, 8:8, _:9, StreamID:31, _:1, 0:31, Rest/bits >>) ->
+ {stream_error, StreamID, protocol_error, 'WINDOW_UPDATE frames MUST have a non-zero increment. (RFC7540 6.9)', Rest};
parse(<< 4:24, 8:8, _:9, StreamID:31, _:1, Increment:31, Rest/bits >>) ->
{ok, {window_update, StreamID, Increment}, Rest};
parse(<< Len:24, 8:8, _/bits >>) when Len =/= 4->
@@ -345,7 +345,6 @@ parse_settings_payload(<< _:48, Rest/bits >>, Len, Settings) ->
%% Building.
-%% @todo Check size and create multiple frames if needed.
data(StreamID, IsFin, Data) ->
[data_header(StreamID, IsFin, iolist_size(Data)), Data].