Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,8 @@ private void consumeFrame(final RawFrame frame) throws HttpException, IOExceptio
try {
updateOutputWindow(streamId, stream.getOutputWindow(), delta);
} catch (final ArithmeticException ex) {
throw new H2ConnectionException(H2Error.FLOW_CONTROL_ERROR, ex.getMessage());
stream.localReset(new H2StreamResetException(H2Error.FLOW_CONTROL_ERROR, ex.getMessage()));
requestSessionOutput();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,13 @@ void testIncrementOverflow() throws Exception {
writableChannel.reset();
final RawFrame incrementFrame2 = FRAME_FACTORY.createWindowUpdate(1, 0x7fffffff - 50);
outBuffer.write(incrementFrame2, writableChannel);
final H2ConnectionException exception = Assertions.assertThrows(H2ConnectionException.class, () ->
Assertions.assertDoesNotThrow(() ->
streamMultiplexer.onInput(ByteBuffer.wrap(writableChannel.toByteArray())));
Assertions.assertEquals(H2Error.FLOW_CONTROL_ERROR, H2Error.getByCode(exception.getCode()));
Mockito.verify(streamHandler).failed(exceptionCaptor.capture());
final Exception exception = exceptionCaptor.getValue();
Assertions.assertInstanceOf(H2StreamResetException.class, exception);
Assertions.assertEquals(H2Error.FLOW_CONTROL_ERROR,
H2Error.getByCode(((H2StreamResetException) exception).getCode()));
}

@Test
Expand Down
Loading