@Override protected void handleData(ByteBuffer resource, Http2FrameHeaderParser headerParser) throws ConnectionErrorException { if (Bits.anyAreClear(headerParser.flags, Http2Channel.DATA_FLAG_PADDED)) { finish(); return; } if(headerParser.length == 0) { //empty frame with padding set //which is wrong throw new ConnectionErrorException(Http2Channel.ERROR_PROTOCOL_ERROR); } if (resource.remaining() > 0) { padding = resource.get() & 0xFF; headerParser.length--; //decrement the length by one as we have consumed a byte if(padding > headerParser.length) { throw new ConnectionErrorException(Http2Channel.ERROR_PROTOCOL_ERROR); } finish(); } }
@Override protected void handleData(ByteBuffer resource, Http2FrameHeaderParser headerParser) throws ConnectionErrorException { if (Bits.anyAreClear(headerParser.flags, Http2Channel.DATA_FLAG_PADDED)) { finish(); return; } if(headerParser.length == 0) { //empty frame with padding set //which is wrong throw new ConnectionErrorException(Http2Channel.ERROR_PROTOCOL_ERROR); } if (resource.remaining() > 0) { padding = resource.get() & 0xFF; headerParser.length--; //decrement the length by one as we have consumed a byte if(padding > headerParser.length) { throw new ConnectionErrorException(Http2Channel.ERROR_PROTOCOL_ERROR); } finish(); } }
@Override protected void handleData(ByteBuffer resource, Http2FrameHeaderParser headerParser) throws ConnectionErrorException { if (Bits.anyAreClear(headerParser.flags, Http2Channel.DATA_FLAG_PADDED)) { finish(); return; } if(headerParser.length == 0) { //empty frame with padding set //which is wrong throw new ConnectionErrorException(Http2Channel.ERROR_PROTOCOL_ERROR); } if (resource.remaining() > 0) { padding = resource.get() & 0xFF; headerParser.length--; //decrement the length by one as we have consumed a byte if(padding > headerParser.length) { throw new ConnectionErrorException(Http2Channel.ERROR_PROTOCOL_ERROR); } finish(); } }