Exemplo n.º 1
0
 public HeadersContinuation(DefaultHttp2FrameReader reader, IChannelHandlerContext ctx, int streamId, int padding)
 {
     _builder  = new HeadersBlockBuilder(reader);
     _ctx      = ctx;
     _streamId = streamId;
     _padding  = padding;
 }
Exemplo n.º 2
0
 public PriorityHeadersFrameHeadersContinuation(DefaultHttp2FrameReader reader,
                                                IChannelHandlerContext ctx, int streamId, int padding, int streamDependency,
                                                short weight, bool exclusive, Http2Flags headersFlags)
     : base(reader, ctx, streamId, padding)
 {
     _streamDependency = streamDependency;
     _weight           = weight;
     _exclusive        = exclusive;
     _headersFlags     = headersFlags;
 }
Exemplo n.º 3
0
        /// <inheritdoc />
        public override Http2MultiplexCodec Build()
        {
            var frameWriter = _frameWriter;

            if (frameWriter is object)
            {
                // This is to support our tests and will never be executed by the user as frameWriter(...)
                // is package-private.
                var connection                = new DefaultHttp2Connection(IsServer, MaxReservedStreams);
                var maxHeaderListSize         = InitialSettings.MaxHeaderListSize();
                IHttp2FrameReader frameReader = new DefaultHttp2FrameReader(!maxHeaderListSize.HasValue ?
                                                                            new DefaultHttp2HeadersDecoder(IsValidateHeaders) :
                                                                            new DefaultHttp2HeadersDecoder(IsValidateHeaders, maxHeaderListSize.Value));

                var frameLogger = FrameLogger;
                if (frameLogger is object)
                {
                    frameWriter = new Http2OutboundFrameLogger(frameWriter, frameLogger);
                    frameReader = new Http2InboundFrameLogger(frameReader, frameLogger);
                }
                IHttp2ConnectionEncoder encoder = new DefaultHttp2ConnectionEncoder(connection, frameWriter);
                if (EncoderEnforceMaxConcurrentStreams)
                {
                    encoder = new StreamBufferingEncoder(encoder);
                }
                IHttp2ConnectionDecoder decoder = new DefaultHttp2ConnectionDecoder(connection, encoder, frameReader,
                                                                                    PromisedRequestVerifier, AutoAckSettingsFrame, AutoAckPingFrame);

                int maxConsecutiveEmptyDataFrames = DecoderEnforceMaxConsecutiveEmptyDataFrames;
                if ((uint)maxConsecutiveEmptyDataFrames > 0u)
                {
                    decoder = new Http2EmptyDataFrameConnectionDecoder(decoder, maxConsecutiveEmptyDataFrames);
                }

                return(Build(decoder, encoder, InitialSettings));
            }
            return(base.Build());
        }
Exemplo n.º 4
0
 public HeadersBlockBuilder(DefaultHttp2FrameReader reader)
 {
     _reader = reader;
 }
Exemplo n.º 5
0
 public PushPromiseFrameHeadersContinuation(DefaultHttp2FrameReader reader,
                                            IChannelHandlerContext ctx, int streamId, int padding, int promisedStreamId)
     : base(reader, ctx, streamId, padding)
 {
     _promisedStreamId = promisedStreamId;
 }
Exemplo n.º 6
0
 public HeadersFrameHeadersContinuation(DefaultHttp2FrameReader reader,
                                        IChannelHandlerContext ctx, int streamId, int padding, Http2Flags headersFlags)
     : base(reader, ctx, streamId, padding)
 {
     _headersFlags = headersFlags;
 }