Exemplo n.º 1
0
        public void Initialize(Http3StreamContext context)
        {
            base.Initialize(context);

            InputRemaining = null;

            _context = context;

            _errorCodeFeature   = _context.ConnectionFeatures.Get <IProtocolErrorCodeFeature>() !;
            _streamIdFeature    = _context.ConnectionFeatures.Get <IStreamIdFeature>() !;
            _streamAbortFeature = _context.ConnectionFeatures.Get <IStreamAbortFeature>() !;

            _appCompleted = null;
            _isClosed     = 0;
            _requestHeaderParsingState = default;
            _parsedPseudoHeaderFields  = default;
            _totalParsedHeaderSize     = 0;
            _isMethodConnect           = false;
            _completionState           = default;
            StreamTimeoutTicks         = 0;

            if (_frameWriter == null)
            {
                _frameWriter = new Http3FrameWriter(
                    context.StreamContext,
                    context.TimeoutControl,
                    context.ServiceContext.ServerOptions.Limits.MinResponseDataRate,
                    context.MemoryPool,
                    context.ServiceContext.Log,
                    _streamIdFeature,
                    context.ClientPeerSettings,
                    this);

                _http3Output = new Http3OutputProducer(
                    _frameWriter,
                    context.MemoryPool,
                    this,
                    context.ServiceContext.Log);
                Output          = _http3Output;
                RequestBodyPipe = CreateRequestBodyPipe(64 * 1024); // windowSize?
                QPackDecoder    = new QPackDecoder(_context.ServiceContext.ServerOptions.Limits.Http3.MaxRequestHeaderFieldSize);
            }
            else
            {
                _http3Output.StreamReset();
                RequestBodyPipe.Reset();
                QPackDecoder.Reset();
            }

            _frameWriter.Reset(context.Transport.Output, context.ConnectionId);
        }
Exemplo n.º 2
0
        public Http3ControlStream(Http3StreamContext context)
        {
            var httpLimits = context.ServiceContext.ServerOptions.Limits;

            _context            = context;
            _serverPeerSettings = context.ServerPeerSettings;
            _streamIdFeature    = context.ConnectionFeatures.Get <IStreamIdFeature>() !;
            _errorCodeFeature   = context.ConnectionFeatures.Get <IProtocolErrorCodeFeature>() !;
            _headerType         = -1;

            _frameWriter = new Http3FrameWriter(
                context.StreamContext,
                context.TimeoutControl,
                httpLimits.MinResponseDataRate,
                context.MemoryPool,
                context.ServiceContext.Log,
                _streamIdFeature,
                context.ClientPeerSettings,
                this);
            _frameWriter.Reset(context.Transport.Output, context.ConnectionId);
        }