use of com.webpieces.http2parser.api.dto.lib.HasHeaderFragment in project webpieces by deanhiller.
the class HpackParserImpl method processFrame.
private void processFrame(UnmarshalStateImpl state, Http2Frame frame) {
List<HasHeaderFragment> headerFragList = state.getHeadersToCombine();
if (frame instanceof HasHeaderFragment) {
HasHeaderFragment headerFrame = (HasHeaderFragment) frame;
headerFragList.add(headerFrame);
validateHeader(state, headerFrame);
if (headerFrame.isEndHeaders())
combineAndSendHeadersToClient(state);
return;
} else if (headerFragList.size() > 0) {
throw new ConnectionException(CancelReasonCode.HEADERS_MIXED_WITH_FRAMES, state.getLogId(), frame.getStreamId(), "Parser in the middle of accepting headers(spec " + "doesn't allow frames between header fragments). frame=" + frame + " list=" + headerFragList);
}
if (frame instanceof UnknownFrame && ignoreUnkownFrames) {
//do nothing
} else if (frame instanceof Http2Msg) {
state.getParsedFrames().add((Http2Msg) frame);
} else {
throw new IllegalStateException("bug forgot support for frame=" + frame);
}
}
Aggregations