package io.undertow.protocols.http2;
import java.nio.ByteBuffer;
import org.xnio.Bits;
class extends Http2HeaderBlockParser {
private static final int = ~(1 << 7);
private int = 0;
private int = 0;
private int = 16;
private boolean = false;
private boolean ;
(int frameLength, HpackDecoder hpackDecoder, boolean client,int maxHeaders, int streamId, int maxHeaderListSize) {
super(frameLength, hpackDecoder, client, maxHeaders, streamId, maxHeaderListSize);
}
@Override
protected boolean handleBeforeHeader(ByteBuffer resource, Http2FrameHeaderParser headerParser) {
boolean hasPadding = Bits.anyAreSet(headerParser.flags, Http2Channel.HEADERS_FLAG_PADDED);
boolean hasPriority = Bits.anyAreSet(headerParser.flags, Http2Channel.HEADERS_FLAG_PRIORITY);
headersEndStream = Bits.allAreSet(headerParser.flags, Http2Channel.HEADERS_FLAG_END_STREAM);
int reqLength = (hasPadding ? 1 : 0) + (hasPriority ? 5 : 0);
if (reqLength == 0) {
return true;
}
if (resource.remaining() < reqLength) {
return false;
}
if (hasPadding) {
paddingLength = (resource.get() & 0xFF);
}
if (hasPriority) {
if (resource.remaining() < 4) {
return false;
}
byte b = resource.get();
exclusive = (b & (1 << 7)) != 0;
dependentStreamId = (b & DEPENDENCY_MASK & 0xFF) << 24;
dependentStreamId += (resource.get() & 0xFF) << 16;
dependentStreamId += (resource.get() & 0xFF) << 8;
dependentStreamId += (resource.get() & 0xFF);
weight = resource.get() & 0xFF;
}
return true;
}
protected int () {
return paddingLength;
}
int () {
return dependentStreamId;
}
int () {
return weight;
}
boolean () {
return headersEndStream;
}
public boolean () {
return exclusive;
}
}