Example #1
0
        public Http3Stream(Http3StreamContext context)
        {
            Initialize(context);

            InputRemaining = null;

            _context = context;

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

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

            // ResponseHeaders aren't set, kind of ugly that we need to reset.
            Reset();

            _http3Output = new Http3OutputProducer(
                _frameWriter,
                context.MemoryPool,
                this,
                context.ServiceContext.Log);
            RequestBodyPipe = CreateRequestBodyPipe(64 * 1024); // windowSize?
            Output          = _http3Output;
            QPackDecoder    = new QPackDecoder(_context.ServiceContext.ServerOptions.Limits.Http3.MaxRequestHeaderFieldSize);
        }
Example #2
0
        public Http3Stream(Http3Connection http3Connection, HttpConnectionContext context) : base(context)
        {
            // First, determine how we know if an Http3stream is unidirectional or bidirectional
            var httpLimits  = context.ServiceContext.ServerOptions.Limits;
            var http3Limits = httpLimits.Http3;

            _http3Connection = http3Connection;
            _context         = context;

            _frameWriter = new Http3FrameWriter(
                context.Transport.Output,
                context.ConnectionContext,
                context.TimeoutControl,
                httpLimits.MinResponseDataRate,
                context.ConnectionId,
                context.MemoryPool,
                context.ServiceContext.Log);

            // ResponseHeaders aren't set, kind of ugly that we need to reset.
            Reset();

            _http3Output = new Http3OutputProducer(
                0, // TODO streamid
                _frameWriter,
                context.MemoryPool,
                this,
                context.ServiceContext.Log);
            RequestBodyPipe = CreateRequestBodyPipe(64 * 1024); // windowSize?
            Output          = _http3Output;
        }
Example #3
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);
        }
Example #4
0
        public Http3Stream(Http3Connection http3Connection, Http3StreamContext context)
        {
            Initialize(context);

            InputRemaining = null;

            // First, determine how we know if an Http3stream is unidirectional or bidirectional
            var httpLimits  = context.ServiceContext.ServerOptions.Limits;
            var http3Limits = httpLimits.Http3;

            _http3Connection = http3Connection;
            _context         = context;

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

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

            // ResponseHeaders aren't set, kind of ugly that we need to reset.
            Reset();

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