Search in sources :

Example 1 with Http2Memento

use of com.webpieces.http2parser.api.Http2Memento in project webpieces by deanhiller.

the class HpackParserImpl method unmarshal.

@Override
public UnmarshalState unmarshal(UnmarshalState memento, DataWrapper newData) {
    UnmarshalStateImpl state = (UnmarshalStateImpl) memento;
    //reset any parsed frames
    state.clearParsedFrames();
    Http2Memento result = parser.parse(state.getLowLevelState(), newData);
    List<Http2Frame> parsedFrames = result.getParsedFrames();
    for (Http2Frame frame : parsedFrames) {
        processFrame(state, frame);
    }
    return state;
}
Also used : Http2Memento(com.webpieces.http2parser.api.Http2Memento) Http2Frame(com.webpieces.http2parser.api.dto.lib.Http2Frame)

Example 2 with Http2Memento

use of com.webpieces.http2parser.api.Http2Memento in project webpieces by deanhiller.

the class HpackParserImpl method prepareToUnmarshal.

@Override
public UnmarshalState prepareToUnmarshal(String logId, int maxHeaderSize, int maxHeaderTableSize, long localMaxFrameSize) {
    Decoder decoder = new Decoder(maxHeaderSize, maxHeaderTableSize);
    Http2Memento result = parser.prepareToParse(localMaxFrameSize);
    return new UnmarshalStateImpl(logId, result, decoding, decoder);
}
Also used : Decoder(com.twitter.hpack.Decoder) Http2Memento(com.webpieces.http2parser.api.Http2Memento)

Aggregations

Http2Memento (com.webpieces.http2parser.api.Http2Memento)2 Decoder (com.twitter.hpack.Decoder)1 Http2Frame (com.webpieces.http2parser.api.dto.lib.Http2Frame)1