@Test(expected = SpdyProtocolException.class) public void testHeaderBlockExtraData() throws Exception { ByteBuf headerBlock = Unpooled.buffer(37); headerBlock.writeBytes(zlibHeader); headerBlock.writeByte(0); headerBlock.writeByte(0x15); headerBlock.writeByte(0x00); headerBlock.writeByte(0xea); headerBlock.writeByte(0xff); headerBlock.writeInt(1); headerBlock.writeInt(4); headerBlock.writeBytes(nameBytes); headerBlock.writeInt(5); headerBlock.writeBytes(valueBytes); headerBlock.writeByte(0x19); headerBlock.writeByte(0xa5); headerBlock.writeByte(0x03); headerBlock.writeByte(0xc9); headerBlock.writeByte(0); decoder.decode(ByteBufAllocator.DEFAULT, headerBlock, frame); headerBlock.release(); }
@Override void decode(ByteBufAllocator alloc, ByteBuf headerBlock, SpdyHeadersFrame frame) throws Exception { int len = setInput(headerBlock); int numBytes; do { numBytes = decompress(alloc, frame); } while (numBytes > 0); if (decompressor.getRemaining() != 0) { throw INVALID_HEADER_BLOCK; } headerBlock.skipBytes(len); }
SpdyHeaderBlockZlibDecoder extends SpdyHeaderBlockRawDecoder { @Override void decode(ByteBufAllocator alloc, ByteBuf headerBlock, SpdyHeadersFrame frame) throws Exception { int len = setInput(headerBlock); int numBytes; do { numBytes = decompress(alloc, frame); } while (numBytes > 0); if (decompressor.getRemaining() != 0) { throw INVALID_HEADER_BLOCK; } headerBlock.skipBytes(len); } }
SpdyHeaderBlockZlibDecoder extends SpdyHeaderBlockRawDecoder { @Override void decode(ByteBufAllocator alloc, ByteBuf headerBlock, SpdyHeadersFrame frame) throws Exception { int len = setInput(headerBlock); int numBytes; do { numBytes = decompress(alloc, frame); } while (numBytes > 0); if (decompressor.getRemaining() != 0) { throw INVALID_HEADER_BLOCK; } headerBlock.skipBytes(len); } SpdyHeaderBlockZlibDecoder(SpdyVersion spdyVersion, int maxHeaderSize); }
SpdyHeaderBlockZlibDecoder extends SpdyHeaderBlockRawDecoder { @Override void decode(ByteBufAllocator alloc, ByteBuf headerBlock, SpdyHeadersFrame frame) throws Exception { int len = setInput(headerBlock); int numBytes; do { numBytes = decompress(alloc, frame); } while (numBytes > 0); if (decompressor.getRemaining() != 0) { throw INVALID_HEADER_BLOCK; } headerBlock.skipBytes(len); } SpdyHeaderBlockZlibDecoder(SpdyVersion spdyVersion, int maxHeaderSize); @Override void end(); }
SpdyHeaderBlockZlibDecoder extends SpdyHeaderBlockRawDecoder { @Override void decode(ByteBufAllocator alloc, ByteBuf headerBlock, SpdyHeadersFrame frame) throws Exception { int len = setInput(headerBlock); int numBytes; do { numBytes = decompress(alloc, frame); } while (numBytes > 0); if (decompressor.getRemaining() != 0) { throw INVALID_HEADER_BLOCK; } headerBlock.skipBytes(len); } SpdyHeaderBlockZlibDecoder(SpdyVersion spdyVersion, int maxHeaderSize); @Override void end();  }