diff options
author | Loïc Hoguin <[email protected]> | 2017-11-27 11:54:37 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2017-11-27 11:54:37 +0100 |
commit | eb8990fccdeaf44e1f58e83c49e23b1b2be4093a (patch) | |
tree | ce7a187683d9c5fa94245468dc719b2ffe9187bb /src/cow_http2.erl | |
parent | e48f1cb34f5cc16844577ae55a9ebf0b7d08818a (diff) | |
download | cowlib-eb8990fccdeaf44e1f58e83c49e23b1b2be4093a.tar.gz cowlib-eb8990fccdeaf44e1f58e83c49e23b1b2be4093a.tar.bz2 cowlib-eb8990fccdeaf44e1f58e83c49e23b1b2be4093a.zip |
Fix DATA payload size with padding
Diffstat (limited to 'src/cow_http2.erl')
-rw-r--r-- | src/cow_http2.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cow_http2.erl b/src/cow_http2.erl index ef7d439..2233a8c 100644 --- a/src/cow_http2.erl +++ b/src/cow_http2.erl @@ -97,7 +97,7 @@ parse(<< Len:24, 0:8, _:4, 0:1, _:2, FlagEndStream:1, _:1, StreamID:31, Data:Len %% Padding. parse(<< Len0:24, 0:8, _:4, 1:1, _:2, FlagEndStream:1, _:1, StreamID:31, PadLen:8, Rest0/bits >>) when byte_size(Rest0) >= Len0 - 1 -> - Len = Len0 - PadLen, + Len = Len0 - PadLen - 1, case Rest0 of << Data:Len/binary, 0:PadLen/unit:8, Rest/bits >> -> {ok, {data, StreamID, parse_fin(FlagEndStream), Data}, Rest}; |