Skip to content

Commit

Permalink
#4855 fix race condition that can sometimes make H2 stream send an i…
Browse files Browse the repository at this point in the history
…mproper reset with cancel error code instead of protocol error code when the client sends more data than the content-length header specifies

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
  • Loading branch information
lorban committed Jun 9, 2020
1 parent 56bda1b commit 714a920
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ private void onData(DataFrame frame, Callback callback)
if (dataLength != Long.MIN_VALUE)
{
dataLength -= frame.remaining();
if (frame.isEndStream() && dataLength != 0)
if (dataLength < 0 || (frame.isEndStream() && dataLength != 0))
{
reset(new ResetFrame(streamId, ErrorCode.PROTOCOL_ERROR.code), Callback.NOOP);
callback.failed(new IOException("invalid_data_length"));
Expand Down

0 comments on commit 714a920

Please sign in to comment.