@Override public int size(Object msg) { return msg instanceof Http2DataFrame ? // Guard against overflow. (int) min(Integer.MAX_VALUE, ((Http2DataFrame) msg).initialFlowControlledBytes() + (long) MIN_HTTP2_FRAME_SIZE) : MIN_HTTP2_FRAME_SIZE; } };
@SuppressWarnings("deprecation") void doRead0(Http2Frame frame, Handle allocHandle) { pipeline().fireChannelRead(frame); allocHandle.incMessagesRead(1); if (frame instanceof Http2DataFrame) { final int numBytesToBeConsumed = ((Http2DataFrame) frame).initialFlowControlledBytes(); allocHandle.attemptedBytesRead(numBytesToBeConsumed); allocHandle.lastBytesRead(numBytesToBeConsumed); if (numBytesToBeConsumed != 0) { try { writeDoneAndNoFlush |= onBytesConsumed(ctx, stream, numBytesToBeConsumed); } catch (Http2Exception e) { pipeline().fireExceptionCaught(e); } } } else { allocHandle.attemptedBytesRead(MIN_HTTP2_FRAME_SIZE); allocHandle.lastBytesRead(MIN_HTTP2_FRAME_SIZE); } }
@Override public int size(Object msg) { return msg instanceof Http2DataFrame ? // Guard against overflow. (int) min(Integer.MAX_VALUE, ((Http2DataFrame) msg).initialFlowControlledBytes() + (long) MIN_HTTP2_FRAME_SIZE) : MIN_HTTP2_FRAME_SIZE; } };
@Override public int size(Object msg) { return msg instanceof Http2DataFrame ? // Guard against overflow. (int) min(Integer.MAX_VALUE, ((Http2DataFrame) msg).initialFlowControlledBytes() + (long) MIN_HTTP2_FRAME_SIZE) : MIN_HTTP2_FRAME_SIZE; } };
@Override public int size(Object msg) { return msg instanceof Http2DataFrame ? // Guard against overflow. (int) min(Integer.MAX_VALUE, ((Http2DataFrame) msg).initialFlowControlledBytes() + (long) MIN_HTTP2_FRAME_SIZE) : MIN_HTTP2_FRAME_SIZE; } };
@Override public int size(Object msg) { return msg instanceof Http2DataFrame ? // Guard against overflow. (int) min(Integer.MAX_VALUE, ((Http2DataFrame) msg).initialFlowControlledBytes() + (long) MIN_HTTP2_FRAME_SIZE) : MIN_HTTP2_FRAME_SIZE; } };
@SuppressWarnings("deprecation") void doRead0(Http2Frame frame, RecvByteBufAllocator.Handle allocHandle) { int numBytesToBeConsumed = 0; if (frame instanceof Http2DataFrame) { numBytesToBeConsumed = ((Http2DataFrame) frame).initialFlowControlledBytes(); allocHandle.lastBytesRead(numBytesToBeConsumed); } else { allocHandle.lastBytesRead(MIN_HTTP2_FRAME_SIZE); } allocHandle.incMessagesRead(1); pipeline().fireChannelRead(frame); if (numBytesToBeConsumed != 0) { try { writeDoneAndNoFlush |= onBytesConsumed(ctx, stream, numBytesToBeConsumed); } catch (Http2Exception e) { pipeline().fireExceptionCaught(e); } } }
@SuppressWarnings("deprecation") void doRead0(Http2Frame frame, RecvByteBufAllocator.Handle allocHandle) { int numBytesToBeConsumed = 0; if (frame instanceof Http2DataFrame) { numBytesToBeConsumed = ((Http2DataFrame) frame).initialFlowControlledBytes(); allocHandle.lastBytesRead(numBytesToBeConsumed); } else { allocHandle.lastBytesRead(MIN_HTTP2_FRAME_SIZE); } allocHandle.incMessagesRead(1); pipeline().fireChannelRead(frame); if (numBytesToBeConsumed != 0) { try { writeDoneAndNoFlush |= onBytesConsumed(ctx, stream, numBytesToBeConsumed); } catch (Http2Exception e) { pipeline().fireExceptionCaught(e); } } }
@SuppressWarnings("deprecation") void doRead0(Http2Frame frame, RecvByteBufAllocator.Handle allocHandle) { int numBytesToBeConsumed = 0; if (frame instanceof Http2DataFrame) { numBytesToBeConsumed = ((Http2DataFrame) frame).initialFlowControlledBytes(); allocHandle.lastBytesRead(numBytesToBeConsumed); } else { allocHandle.lastBytesRead(MIN_HTTP2_FRAME_SIZE); } allocHandle.incMessagesRead(1); pipeline().fireChannelRead(frame); if (numBytesToBeConsumed != 0) { try { writeDoneAndNoFlush |= onBytesConsumed(ctx, stream, numBytesToBeConsumed); } catch (Http2Exception e) { pipeline().fireExceptionCaught(e); } } }
@SuppressWarnings("deprecation") void doRead0(Http2Frame frame, Handle allocHandle) { pipeline().fireChannelRead(frame); allocHandle.incMessagesRead(1); if (frame instanceof Http2DataFrame) { final int numBytesToBeConsumed = ((Http2DataFrame) frame).initialFlowControlledBytes(); allocHandle.attemptedBytesRead(numBytesToBeConsumed); allocHandle.lastBytesRead(numBytesToBeConsumed); if (numBytesToBeConsumed != 0) { try { writeDoneAndNoFlush |= consumeBytes(stream.id(), numBytesToBeConsumed); } catch (Http2Exception e) { pipeline().fireExceptionCaught(e); } } } else { allocHandle.attemptedBytesRead(MIN_HTTP2_FRAME_SIZE); allocHandle.lastBytesRead(MIN_HTTP2_FRAME_SIZE); } }