public static void ConnectionAborted(ILogger logger, BaseConnectionContext connection, long errorCode, Exception ex) { if (logger.IsEnabled(LogLevel.Debug)) { ConnectionAbortedCore(logger, connection.ConnectionId, errorCode, ex); } }
public Http2FrameWriter( PipeWriter outputPipeWriter, BaseConnectionContext connectionContext, Http2Connection http2Connection, OutputFlowControl connectionOutputFlowControl, ITimeoutControl timeoutControl, MinDataRate?minResponseDataRate, string connectionId, MemoryPool <byte> memoryPool, ServiceContext serviceContext) { // Allow appending more data to the PipeWriter when a flush is pending. _outputWriter = new ConcurrentPipeWriter(outputPipeWriter, memoryPool, _writeLock); _connectionContext = connectionContext; _http2Connection = http2Connection; _connectionOutputFlowControl = connectionOutputFlowControl; _connectionId = connectionId; _log = serviceContext.Log; _timeoutControl = timeoutControl; _minResponseDataRate = minResponseDataRate; _flusher = new TimingPipeFlusher(timeoutControl, serviceContext.Log); _flusher.Initialize(_outputWriter); _outgoingFrame = new Http2Frame(); _headerEncodingBuffer = new byte[_maxFrameSize]; _scheduleInline = serviceContext.Scheduler == PipeScheduler.Inline; _hpackEncoder = new DynamicHPackEncoder(serviceContext.ServerOptions.AllowResponseHeaderCompression); }
public void ConnectionStop(BaseConnectionContext connection) { if (IsEnabled()) { ConnectionStop(connection.ConnectionId); } }
public void ConnectionError(BaseConnectionContext connection, Exception ex) { if (_logger.IsEnabled(LogLevel.Debug)) { _connectionError(_logger, connection.ConnectionId, ex); } }
public static void ConnectionAbort(ILogger logger, BaseConnectionContext connection, long errorCode, string reason) { if (logger.IsEnabled(LogLevel.Debug)) { ConnectionAbortCore(logger, connection.ConnectionId, errorCode, reason); } }
public void AcceptedConnection(BaseConnectionContext connection) { if (_logger.IsEnabled(LogLevel.Debug)) { _acceptedConnection(_logger, connection.ConnectionId, null); } }
public static Http3StreamContext CreateHttp3StreamContext( string connectionId = null, BaseConnectionContext connectionContext = null, ServiceContext serviceContext = null, IFeatureCollection connectionFeatures = null, MemoryPool <byte> memoryPool = null, IPEndPoint localEndPoint = null, IPEndPoint remoteEndPoint = null, IDuplexPipe transport = null, ITimeoutControl timeoutControl = null, IHttp3StreamLifetimeHandler streamLifetimeHandler = null) { var context = new Http3StreamContext ( connectionId: connectionId ?? "TestConnectionId", protocols: HttpProtocols.Http3, altSvcHeader: null, connectionContext: connectionContext, serviceContext: serviceContext ?? CreateServiceContext(new KestrelServerOptions()), connectionFeatures: connectionFeatures ?? new FeatureCollection(), memoryPool: memoryPool ?? MemoryPool <byte> .Shared, localEndPoint: localEndPoint, remoteEndPoint: remoteEndPoint, streamLifetimeHandler: streamLifetimeHandler, streamContext: new DefaultConnectionContext(), clientPeerSettings: new Http3PeerSettings(), serverPeerSettings: null ); context.TimeoutControl = timeoutControl; context.Transport = transport; return(context); }
public static void AcceptedConnection(ILogger logger, BaseConnectionContext connection) { if (logger.IsEnabled(LogLevel.Debug)) { AcceptedConnectionCore(logger, connection.ConnectionId); } }
public void ConnectionAbort(BaseConnectionContext connection, string reason) { if (_logger.IsEnabled(LogLevel.Debug)) { ConnectionAbort(_logger, connection.ConnectionId, reason); } }
public void ConnectionStop(BaseConnectionContext connection) { Interlocked.Decrement(ref _currentConnections); if (IsEnabled()) { ConnectionStop(connection.ConnectionId); } }
public void TlsHandshakeStart(BaseConnectionContext connectionContext, SslServerAuthenticationOptions sslOptions) { Interlocked.Increment(ref _currentTlsHandshakes); Interlocked.Increment(ref _totalTlsHandshakes); if (IsEnabled()) { TlsHandshakeStart(connectionContext.ConnectionId, sslOptions.EnabledSslProtocols.ToString()); } }
public void ConnectionStop(BaseConnectionContext connection) { Interlocked.Decrement(ref _currentConnections); if (IsEnabled(EventLevel.Informational, EventKeywords.None)) { ConnectionStop(connection.ConnectionId); } }
public void ConnectionQueuedStop(BaseConnectionContext connection) { Interlocked.Decrement(ref _connectionQueueLength); if (IsEnabled()) { ConnectionQueuedStop( connection.ConnectionId, connection.LocalEndPoint?.ToString(), connection.RemoteEndPoint?.ToString()); } }
public void ConnectionStart(BaseConnectionContext connection) { // avoid allocating strings unless this event source is enabled if (IsEnabled()) { ConnectionStart( connection.ConnectionId, connection.LocalEndPoint?.ToString(), connection.RemoteEndPoint?.ToString()); } }
public HttpConnectionContext( string connectionId, HttpProtocols protocols, AltSvcHeader?altSvcHeader, BaseConnectionContext connectionContext, ServiceContext serviceContext, IFeatureCollection connectionFeatures, MemoryPool <byte> memoryPool, IPEndPoint?localEndPoint, IPEndPoint?remoteEndPoint) : base(connectionId, protocols, altSvcHeader, connectionContext, serviceContext, connectionFeatures, memoryPool, localEndPoint, remoteEndPoint) { }
public void TlsHandshakeStop(BaseConnectionContext connectionContext, TlsConnectionFeature?feature) { Interlocked.Decrement(ref _currentTlsHandshakes); if (IsEnabled()) { // TODO: Write this without a string allocation using WriteEventData var applicationProtocol = feature == null ? string.Empty : Encoding.UTF8.GetString(feature.ApplicationProtocol.Span); var sslProtocols = feature?.Protocol.ToString() ?? string.Empty; var hostName = feature?.HostName ?? string.Empty; TlsHandshakeStop(connectionContext.ConnectionId, sslProtocols, applicationProtocol, hostName); } }
public void ConnectionStart(BaseConnectionContext connection) { // avoid allocating strings unless this event source is enabled Interlocked.Increment(ref _totalConnections); Interlocked.Increment(ref _currentConnections); if (IsEnabled()) { ConnectionStart( connection.ConnectionId, connection.LocalEndPoint?.ToString(), connection.RemoteEndPoint?.ToString()); } }
public static Http3StreamContext CreateHttp3StreamContext( string connectionId = null, BaseConnectionContext connectionContext = null, ServiceContext serviceContext = null, IFeatureCollection connectionFeatures = null, MemoryPool <byte> memoryPool = null, IPEndPoint localEndPoint = null, IPEndPoint remoteEndPoint = null, IDuplexPipe transport = null, ITimeoutControl timeoutControl = null, IHttp3StreamLifetimeHandler streamLifetimeHandler = null) { var http3ConnectionContext = CreateHttp3ConnectionContext( null, serviceContext, connectionFeatures, memoryPool, localEndPoint, remoteEndPoint, timeoutControl); var http3Conection = new Http3Connection(http3ConnectionContext) { _streamLifetimeHandler = streamLifetimeHandler }; return(new Http3StreamContext ( connectionId: connectionId ?? "TestConnectionId", protocols: HttpProtocols.Http3, altSvcHeader: null, connectionContext: connectionContext, serviceContext: serviceContext ?? CreateServiceContext(new KestrelServerOptions()), connectionFeatures: connectionFeatures ?? new FeatureCollection(), memoryPool: memoryPool ?? MemoryPool <byte> .Shared, localEndPoint: localEndPoint, remoteEndPoint: remoteEndPoint, streamContext: new DefaultConnectionContext(), connection: http3Conection ) { TimeoutControl = timeoutControl, Transport = transport, }); }
public Http3StreamContext( string connectionId, HttpProtocols protocols, AltSvcHeader?altSvcHeader, BaseConnectionContext connectionContext, ServiceContext serviceContext, IFeatureCollection connectionFeatures, MemoryPool <byte> memoryPool, IPEndPoint?localEndPoint, IPEndPoint?remoteEndPoint, ConnectionContext streamContext, Http3Connection connection) : base(connectionId, protocols, altSvcHeader, connectionContext, serviceContext, connectionFeatures, memoryPool, localEndPoint, remoteEndPoint) { StreamLifetimeHandler = connection._streamLifetimeHandler; StreamContext = streamContext; ClientPeerSettings = connection._clientSettings; ServerPeerSettings = connection._serverSettings; Connection = connection; }
public BaseHttpConnectionContext( string connectionId, HttpProtocols protocols, BaseConnectionContext connectionContext, ServiceContext serviceContext, IFeatureCollection connectionFeatures, MemoryPool <byte> memoryPool, IPEndPoint?localEndPoint, IPEndPoint?remoteEndPoint) { ConnectionId = connectionId; Protocols = protocols; ConnectionContext = connectionContext; ServiceContext = serviceContext; ConnectionFeatures = connectionFeatures; MemoryPool = memoryPool; LocalEndPoint = localEndPoint; RemoteEndPoint = remoteEndPoint; }
public Http1OutputProducer( PipeWriter pipeWriter, string connectionId, BaseConnectionContext connectionContext, MemoryPool <byte> memoryPool, IKestrelTrace log, ITimeoutControl timeoutControl, IHttpMinResponseDataRateFeature minResponseDataRateFeature, IHttpOutputAborter outputAborter) { // Allow appending more data to the PipeWriter when a flush is pending. _pipeWriter = new ConcurrentPipeWriter(pipeWriter, memoryPool, _contextLock); _connectionId = connectionId; _connectionContext = connectionContext; _memoryPool = memoryPool; _log = log; _minResponseDataRateFeature = minResponseDataRateFeature; _outputAborter = outputAborter; _flusher = new TimingPipeFlusher(_pipeWriter, timeoutControl, log); }
public void ConnectionQueuedStop(BaseConnectionContext connection) { Interlocked.Decrement(ref _connectionQueueLength); }
public ConnectionContextAdapter(BaseConnectionContext inner) => _inner = inner;