Search in sources :

Example 1 with DefaultHttp2HeadersDecoder

use of io.netty.handler.codec.http2.DefaultHttp2HeadersDecoder in project rest.li by linkedin.

the class Http2StreamCodecBuilder method build.

@Override
public Http2StreamCodec build() {
    ObjectUtil.checkNotNull(_connection, "connection");
    ObjectUtil.checkPositive(_maxHeaderSize, "maxHeaderSize");
    Http2HeadersDecoder headerDecoder = new DefaultHttp2HeadersDecoder(_maxHeaderSize, Http2CodecUtil.DEFAULT_HEADER_TABLE_SIZE, isValidateHeaders(), INITIAL_HUFFMAN_DECODE_CAPACITY);
    Http2FrameReader reader = new DefaultHttp2FrameReader(headerDecoder);
    Http2FrameWriter writer = new DefaultHttp2FrameWriter(headerSensitivityDetector());
    if (frameLogger() != null) {
        reader = new Http2InboundFrameLogger(reader, frameLogger());
        writer = new Http2OutboundFrameLogger(writer, frameLogger());
    }
    Http2ConnectionEncoder encoder = new DefaultHttp2ConnectionEncoder(_connection, writer);
    boolean encoderEnforceMaxConcurrentStreams = encoderEnforceMaxConcurrentStreams();
    if (encoderEnforceMaxConcurrentStreams) {
        if (_connection.isServer()) {
            encoder.close();
            reader.close();
            throw new IllegalArgumentException("encoderEnforceMaxConcurrentStreams: " + encoderEnforceMaxConcurrentStreams + " not supported for server");
        }
        encoder = new StreamBufferingEncoder(encoder);
    }
    Http2ConnectionDecoder decoder = new DefaultHttp2ConnectionDecoder(_connection, encoder, reader);
    super.codec(decoder, encoder);
    return super.build();
}
Also used : Http2InboundFrameLogger(io.netty.handler.codec.http2.Http2InboundFrameLogger) Http2FrameReader(io.netty.handler.codec.http2.Http2FrameReader) DefaultHttp2FrameReader(io.netty.handler.codec.http2.DefaultHttp2FrameReader) StreamBufferingEncoder(io.netty.handler.codec.http2.StreamBufferingEncoder) DefaultHttp2ConnectionDecoder(io.netty.handler.codec.http2.DefaultHttp2ConnectionDecoder) Http2OutboundFrameLogger(io.netty.handler.codec.http2.Http2OutboundFrameLogger) Http2HeadersDecoder(io.netty.handler.codec.http2.Http2HeadersDecoder) DefaultHttp2HeadersDecoder(io.netty.handler.codec.http2.DefaultHttp2HeadersDecoder) DefaultHttp2FrameWriter(io.netty.handler.codec.http2.DefaultHttp2FrameWriter) DefaultHttp2ConnectionEncoder(io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder) Http2ConnectionDecoder(io.netty.handler.codec.http2.Http2ConnectionDecoder) DefaultHttp2ConnectionDecoder(io.netty.handler.codec.http2.DefaultHttp2ConnectionDecoder) Http2FrameWriter(io.netty.handler.codec.http2.Http2FrameWriter) DefaultHttp2FrameWriter(io.netty.handler.codec.http2.DefaultHttp2FrameWriter) DefaultHttp2HeadersDecoder(io.netty.handler.codec.http2.DefaultHttp2HeadersDecoder) Http2ConnectionEncoder(io.netty.handler.codec.http2.Http2ConnectionEncoder) DefaultHttp2ConnectionEncoder(io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder) DefaultHttp2FrameReader(io.netty.handler.codec.http2.DefaultHttp2FrameReader)

Aggregations

DefaultHttp2ConnectionDecoder (io.netty.handler.codec.http2.DefaultHttp2ConnectionDecoder)1 DefaultHttp2ConnectionEncoder (io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder)1 DefaultHttp2FrameReader (io.netty.handler.codec.http2.DefaultHttp2FrameReader)1 DefaultHttp2FrameWriter (io.netty.handler.codec.http2.DefaultHttp2FrameWriter)1 DefaultHttp2HeadersDecoder (io.netty.handler.codec.http2.DefaultHttp2HeadersDecoder)1 Http2ConnectionDecoder (io.netty.handler.codec.http2.Http2ConnectionDecoder)1 Http2ConnectionEncoder (io.netty.handler.codec.http2.Http2ConnectionEncoder)1 Http2FrameReader (io.netty.handler.codec.http2.Http2FrameReader)1 Http2FrameWriter (io.netty.handler.codec.http2.Http2FrameWriter)1 Http2HeadersDecoder (io.netty.handler.codec.http2.Http2HeadersDecoder)1 Http2InboundFrameLogger (io.netty.handler.codec.http2.Http2InboundFrameLogger)1 Http2OutboundFrameLogger (io.netty.handler.codec.http2.Http2OutboundFrameLogger)1 StreamBufferingEncoder (io.netty.handler.codec.http2.StreamBufferingEncoder)1