@Override public void channelRead(ChannelHandlerContext ctx, Object msg) { if (!(msg instanceof ByteBuf)) { ctx.fireChannelRead(msg); return; } ByteBuf in = (ByteBuf) msg; if (buf == null) { buf = in; } else { buf = cumulator.cumulate(ctx.alloc(), buf, in); } if (buf.readableBytes() < 5) { return; } byte frameType = buf.getByte(buf.readerIndex() + 3); byte flags = buf.getByte(buf.readerIndex() + 4); if (frameType == SETTINGS && (flags & Http2Flags.ACK) != 0) { // need to clear the Ack bit logger.debug("fix setting frame"); flags = (byte) (flags & 0xfe); buf.setByte(buf.readerIndex() + 4, flags); } ctx.pipeline().remove(this); ctx.fireChannelRead(buf); buf = null; }
@Override public void onUnknownFrame(ChannelHandlerContext ctx, byte frameType, int streamId, Http2Flags flags, ByteBuf payload) throws Http2Exception {}
@Override public void onUnknownFrame(ChannelHandlerContext ctx, byte frameType, int streamId, Http2Flags flags, ByteBuf payload) { }
@Override public void onUnknownFrame(ChannelHandlerContext ctx, byte frameType, int streamId, Http2Flags flags, ByteBuf payload) {}
@Override public void onUnknownFrame( ChannelHandlerContext ctx, byte frameType, int streamId, Http2Flags flags, ByteBuf payload) { // TODO(CK): We don't currently have a use case for these frames }