示例#1
0
        public Http3ControlStream(Http3Connection http3Connection, Http3StreamContext context)
        {
            var httpLimits = context.ServiceContext.ServerOptions.Limits;

            _http3Connection    = http3Connection;
            _context            = context;
            _serverPeerSettings = context.ServerSettings;

            _frameWriter = new Http3FrameWriter(
                context.Transport.Output,
                context.StreamContext,
                context.TimeoutControl,
                httpLimits.MinResponseDataRate,
                context.ConnectionId,
                context.MemoryPool,
                context.ServiceContext.Log);
        }
示例#2
0
        public Http3ControlStream(Http3Connection http3Connection, Http3StreamContext context)
        {
            var httpLimits = context.ServiceContext.ServerOptions.Limits;

            _http3Connection          = http3Connection;
            _context                  = context;
            _serverPeerSettings       = context.ServerSettings;
            _streamIdFeature          = context.ConnectionFeatures.Get <IStreamIdFeature>() !;
            _protocolErrorCodeFeature = context.ConnectionFeatures.Get <IProtocolErrorCodeFeature>() !;

            _frameWriter = new Http3FrameWriter(
                context.Transport.Output,
                context.StreamContext,
                context.TimeoutControl,
                httpLimits.MinResponseDataRate,
                context.ConnectionId,
                context.MemoryPool,
                context.ServiceContext.Log,
                _streamIdFeature);
        }
示例#3
0
 public Http3StreamContext(
     string connectionId,
     HttpProtocols protocols,
     AltSvcHeader?altSvcHeader,
     BaseConnectionContext connectionContext,
     ServiceContext serviceContext,
     IFeatureCollection connectionFeatures,
     MemoryPool <byte> memoryPool,
     IPEndPoint?localEndPoint,
     IPEndPoint?remoteEndPoint,
     IHttp3StreamLifetimeHandler streamLifetimeHandler,
     ConnectionContext streamContext,
     Http3PeerSettings clientPeerSettings,
     Http3PeerSettings serverPeerSettings) : base(connectionId, protocols, altSvcHeader, connectionContext, serviceContext, connectionFeatures, memoryPool, localEndPoint, remoteEndPoint)
 {
     StreamLifetimeHandler = streamLifetimeHandler;
     StreamContext         = streamContext;
     ClientPeerSettings    = clientPeerSettings;
     ServerPeerSettings    = serverPeerSettings;
 }
示例#4
0
        //private int _unflushedBytes;

        public Http3FrameWriter(PipeWriter output, ConnectionContext connectionContext, ITimeoutControl timeoutControl, MinDataRate?minResponseDataRate, string connectionId, MemoryPool <byte> memoryPool, IKestrelTrace log, IStreamIdFeature streamIdFeature, Http3PeerSettings clientPeerSettings, IHttp3Stream http3Stream)
        {
            _outputWriter        = output;
            _connectionContext   = connectionContext;
            _timeoutControl      = timeoutControl;
            _minResponseDataRate = minResponseDataRate;
            _connectionId        = connectionId;
            _memoryPool          = memoryPool;
            _log                  = log;
            _streamIdFeature      = streamIdFeature;
            _http3Stream          = http3Stream;
            _outgoingFrame        = new Http3RawFrame();
            _flusher              = new TimingPipeFlusher(_outputWriter, timeoutControl, log);
            _headerEncodingBuffer = new byte[_maxFrameSize];

            // Note that max total header size value doesn't react to settings change during a stream.
            // Unlikely to be a problem in practice:
            // - Settings rarely change after the start of a connection.
            // - Response header size limits are a best-effort requirement in the spec.
            _maxTotalHeaderSize = clientPeerSettings.MaxRequestHeaderFieldSectionSize > int.MaxValue
                ? int.MaxValue
                : (int)clientPeerSettings.MaxRequestHeaderFieldSectionSize;
        }