diff --git a/benchmarks/Kestrel.Performance/Http1ConnectionBenchmark.cs b/benchmarks/Kestrel.Performance/Http1ConnectionBenchmark.cs index b90221b4a7..0443a43b5e 100644 --- a/benchmarks/Kestrel.Performance/Http1ConnectionBenchmark.cs +++ b/benchmarks/Kestrel.Performance/Http1ConnectionBenchmark.cs @@ -43,7 +43,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance ConnectionFeatures = new FeatureCollection(), MemoryPool = memoryPool, TimeoutControl = new MockTimeoutControl(), - Application = pair.Application, Transport = pair.Transport }); diff --git a/benchmarks/Kestrel.Performance/Http1ConnectionParsingOverheadBenchmark.cs b/benchmarks/Kestrel.Performance/Http1ConnectionParsingOverheadBenchmark.cs index 3046c5f1e9..c7d3df7702 100644 --- a/benchmarks/Kestrel.Performance/Http1ConnectionParsingOverheadBenchmark.cs +++ b/benchmarks/Kestrel.Performance/Http1ConnectionParsingOverheadBenchmark.cs @@ -39,7 +39,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance ConnectionFeatures = new FeatureCollection(), MemoryPool = memoryPool, TimeoutControl = new MockTimeoutControl(), - Application = pair.Application, Transport = pair.Transport }); diff --git a/benchmarks/Kestrel.Performance/Http1WritingBenchmark.cs b/benchmarks/Kestrel.Performance/Http1WritingBenchmark.cs index 891d94ab0a..7052bf3a41 100644 --- a/benchmarks/Kestrel.Performance/Http1WritingBenchmark.cs +++ b/benchmarks/Kestrel.Performance/Http1WritingBenchmark.cs @@ -113,7 +113,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance ServiceContext = serviceContext, ConnectionFeatures = new FeatureCollection(), MemoryPool = _memoryPool, - Application = pair.Application, Transport = pair.Transport }); diff --git a/benchmarks/Kestrel.Performance/HttpProtocolFeatureCollection.cs b/benchmarks/Kestrel.Performance/HttpProtocolFeatureCollection.cs index 24b2c6c4b6..6498d49842 100644 --- a/benchmarks/Kestrel.Performance/HttpProtocolFeatureCollection.cs +++ b/benchmarks/Kestrel.Performance/HttpProtocolFeatureCollection.cs @@ -96,7 +96,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance ServiceContext = serviceContext, ConnectionFeatures = new FeatureCollection(), MemoryPool = memoryPool, - Application = pair.Application, Transport = pair.Transport }); diff --git a/benchmarks/Kestrel.Performance/RequestParsingBenchmark.cs b/benchmarks/Kestrel.Performance/RequestParsingBenchmark.cs index 2d881588d2..c03f8c7284 100644 --- a/benchmarks/Kestrel.Performance/RequestParsingBenchmark.cs +++ b/benchmarks/Kestrel.Performance/RequestParsingBenchmark.cs @@ -41,7 +41,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance ServiceContext = serviceContext, ConnectionFeatures = new FeatureCollection(), MemoryPool = _memoryPool, - Application = pair.Application, Transport = pair.Transport, TimeoutControl = new MockTimeoutControl() }); diff --git a/benchmarks/Kestrel.Performance/ResponseHeaderCollectionBenchmark.cs b/benchmarks/Kestrel.Performance/ResponseHeaderCollectionBenchmark.cs index e04f007222..abd19bc359 100644 --- a/benchmarks/Kestrel.Performance/ResponseHeaderCollectionBenchmark.cs +++ b/benchmarks/Kestrel.Performance/ResponseHeaderCollectionBenchmark.cs @@ -188,7 +188,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance ServiceContext = serviceContext, ConnectionFeatures = new FeatureCollection(), MemoryPool = memoryPool, - Application = pair.Application, Transport = pair.Transport }); diff --git a/benchmarks/Kestrel.Performance/ResponseHeadersWritingBenchmark.cs b/benchmarks/Kestrel.Performance/ResponseHeadersWritingBenchmark.cs index 2134a7d5b4..6eea85d72d 100644 --- a/benchmarks/Kestrel.Performance/ResponseHeadersWritingBenchmark.cs +++ b/benchmarks/Kestrel.Performance/ResponseHeadersWritingBenchmark.cs @@ -133,7 +133,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance ConnectionFeatures = new FeatureCollection(), MemoryPool = _memoryPool, TimeoutControl = new MockTimeoutControl(), - Application = _pair.Application, Transport = _pair.Transport }); diff --git a/src/Connections.Abstractions/ConnectionContext.cs b/src/Connections.Abstractions/ConnectionContext.cs index bb942f2627..381780b32e 100644 --- a/src/Connections.Abstractions/ConnectionContext.cs +++ b/src/Connections.Abstractions/ConnectionContext.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO.Pipelines; +using System.Threading; using Microsoft.AspNetCore.Connections.Features; using Microsoft.AspNetCore.Http.Features; @@ -22,7 +23,7 @@ namespace Microsoft.AspNetCore.Connections { // We expect this to be overridden, but this helps maintain back compat // with implementations of ConnectionContext that predate the addition of - // ConnectioContext.Abort() + // ConnectionContext.Abort() Features.Get()?.Abort(); } diff --git a/src/Kestrel.Core/Adapter/Internal/AdaptedPipeline.cs b/src/Kestrel.Core/Adapter/Internal/AdaptedPipeline.cs index 2f44503c0e..eb65aac253 100644 --- a/src/Kestrel.Core/Adapter/Internal/AdaptedPipeline.cs +++ b/src/Kestrel.Core/Adapter/Internal/AdaptedPipeline.cs @@ -168,9 +168,5 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal _transport.Input.Complete(); } } - - public void Dispose() - { - } } } diff --git a/src/Kestrel.Core/Internal/Http/Http1ConnectionContext.cs b/src/Kestrel.Core/Internal/Http/Http1ConnectionContext.cs index 28b5f95ed4..9ad2e9e9b3 100644 --- a/src/Kestrel.Core/Internal/Http/Http1ConnectionContext.cs +++ b/src/Kestrel.Core/Internal/Http/Http1ConnectionContext.cs @@ -21,6 +21,5 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http public IPEndPoint LocalEndPoint { get; set; } public ITimeoutControl TimeoutControl { get; set; } public IDuplexPipe Transport { get; set; } - public IDuplexPipe Application { get; set; } } } diff --git a/src/Kestrel.Core/Internal/Http2/Http2Connection.cs b/src/Kestrel.Core/Internal/Http2/Http2Connection.cs index 69defdbc1b..b447fffdf3 100644 --- a/src/Kestrel.Core/Internal/Http2/Http2Connection.cs +++ b/src/Kestrel.Core/Internal/Http2/Http2Connection.cs @@ -86,7 +86,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 public Http2Connection(Http2ConnectionContext context) { _context = context; - _frameWriter = new Http2FrameWriter(context.Transport.Output, context.Application.Input, _outputFlowControl, this, context.ConnectionId, context.ServiceContext.Log); + _frameWriter = new Http2FrameWriter(context.Transport.Output, context.ConnectionContext, _outputFlowControl, this, context.ConnectionId, context.ServiceContext.Log); _hpackDecoder = new HPackDecoder((int)_serverSettings.HeaderTableSize); _serverSettings.MaxConcurrentStreams = (uint)context.ServiceContext.ServerOptions.Limits.Http2.MaxStreamsPerConnection; } diff --git a/src/Kestrel.Core/Internal/Http2/Http2ConnectionContext.cs b/src/Kestrel.Core/Internal/Http2/Http2ConnectionContext.cs index ae9ceb3b70..04a7ab8ca6 100644 --- a/src/Kestrel.Core/Internal/Http2/Http2ConnectionContext.cs +++ b/src/Kestrel.Core/Internal/Http2/Http2ConnectionContext.cs @@ -4,6 +4,7 @@ using System.Buffers; using System.IO.Pipelines; using System.Net; +using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Http.Features; namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 @@ -11,13 +12,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 public class Http2ConnectionContext { public string ConnectionId { get; set; } + public ConnectionContext ConnectionContext { get; set; } public ServiceContext ServiceContext { get; set; } public IFeatureCollection ConnectionFeatures { get; set; } public MemoryPool MemoryPool { get; set; } public IPEndPoint LocalEndPoint { get; set; } public IPEndPoint RemoteEndPoint { get; set; } - public IDuplexPipe Transport { get; set; } - public IDuplexPipe Application { get; set; } } } diff --git a/src/Kestrel.Core/Internal/Http2/Http2FrameWriter.cs b/src/Kestrel.Core/Internal/Http2/Http2FrameWriter.cs index f867f36490..0a9b62e30e 100644 --- a/src/Kestrel.Core/Internal/Http2/Http2FrameWriter.cs +++ b/src/Kestrel.Core/Internal/Http2/Http2FrameWriter.cs @@ -26,7 +26,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 private readonly object _writeLock = new object(); private readonly HPackEncoder _hpackEncoder = new HPackEncoder(); private readonly PipeWriter _outputWriter; - private readonly PipeReader _outputReader; + private bool _aborted; + private readonly ConnectionContext _connectionContext; private readonly OutputFlowControl _connectionOutputFlowControl; private readonly string _connectionId; private readonly IKestrelTrace _log; @@ -36,15 +37,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 public Http2FrameWriter( PipeWriter outputPipeWriter, - PipeReader outputPipeReader, + ConnectionContext connectionContext, OutputFlowControl connectionOutputFlowControl, ITimeoutControl timeoutControl, string connectionId, IKestrelTrace log) { _outputWriter = outputPipeWriter; - _outputReader = outputPipeReader; - + _connectionContext = connectionContext; _connectionOutputFlowControl = connectionOutputFlowControl; _connectionId = connectionId; _log = log; @@ -66,11 +66,20 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 } } - public void Abort(ConnectionAbortedException ex) + public void Abort(ConnectionAbortedException error) { - // TODO: Really abort the connection using the ConnectionContex like Http1OutputProducer. - _outputReader.CancelPendingRead(); - Complete(); + lock (_writeLock) + { + if (_aborted) + { + return; + } + + _aborted = true; + _connectionContext.Abort(error); + + Complete(); + } } public Task FlushAsync(IHttpOutputProducer outputProducer, CancellationToken cancellationToken) @@ -239,7 +248,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 } // This awaitable releases continuations in FIFO order when the window updates. - // It should be very rare for a continuation to run without any availability. + // It should be very rare for a continuation to run without any availability. if (availabilityAwaitable != null) { await availabilityAwaitable; diff --git a/src/Kestrel.Core/Internal/HttpConnection.cs b/src/Kestrel.Core/Internal/HttpConnection.cs index 4553f08426..28224a6ac0 100644 --- a/src/Kestrel.Core/Internal/HttpConnection.cs +++ b/src/Kestrel.Core/Internal/HttpConnection.cs @@ -112,7 +112,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal // _adaptedTransport must be set prior to adding the connection to the manager in order // to allow the connection to be aported prior to protocol selection. _adaptedTransport = _context.Transport; - var application = _context.Application; if (_context.ConnectionAdapters.Count > 0) @@ -147,14 +146,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal { case HttpProtocols.Http1: // _http1Connection must be initialized before adding the connection to the connection manager - requestProcessor = _http1Connection = CreateHttp1Connection(_adaptedTransport, application); + requestProcessor = _http1Connection = CreateHttp1Connection(_adaptedTransport); _protocolSelectionState = ProtocolSelectionState.Selected; break; case HttpProtocols.Http2: // _http2Connection must be initialized before yielding control to the transport thread, // to prevent a race condition where _http2Connection.Abort() is called just as // _http2Connection is about to be initialized. - requestProcessor = CreateHttp2Connection(_adaptedTransport, application); + requestProcessor = CreateHttp2Connection(_adaptedTransport); _protocolSelectionState = ProtocolSelectionState.Selected; break; case HttpProtocols.None: @@ -199,13 +198,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal } // For testing only - internal void Initialize(IDuplexPipe transport, IDuplexPipe application) + internal void Initialize(IDuplexPipe transport) { - _requestProcessor = _http1Connection = CreateHttp1Connection(transport, application); + _requestProcessor = _http1Connection = CreateHttp1Connection(transport); _protocolSelectionState = ProtocolSelectionState.Selected; } - private Http1Connection CreateHttp1Connection(IDuplexPipe transport, IDuplexPipe application) + private Http1Connection CreateHttp1Connection(IDuplexPipe transport) { return new Http1Connection(new Http1ConnectionContext { @@ -217,22 +216,21 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal ServiceContext = _context.ServiceContext, ConnectionContext = _context.ConnectionContext, TimeoutControl = this, - Transport = transport, - Application = application + Transport = transport }); } - private Http2Connection CreateHttp2Connection(IDuplexPipe transport, IDuplexPipe application) + private Http2Connection CreateHttp2Connection(IDuplexPipe transport) { return new Http2Connection(new Http2ConnectionContext { ConnectionId = _context.ConnectionId, + ConnectionContext = _context.ConnectionContext, ServiceContext = _context.ServiceContext, ConnectionFeatures = _context.ConnectionFeatures, MemoryPool = MemoryPool, LocalEndPoint = LocalEndPoint, RemoteEndPoint = RemoteEndPoint, - Application = application, Transport = transport }); } diff --git a/src/Kestrel.Core/Internal/HttpConnectionContext.cs b/src/Kestrel.Core/Internal/HttpConnectionContext.cs index 161ca647a7..da01a5a7b0 100644 --- a/src/Kestrel.Core/Internal/HttpConnectionContext.cs +++ b/src/Kestrel.Core/Internal/HttpConnectionContext.cs @@ -24,6 +24,5 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal public IPEndPoint LocalEndPoint { get; set; } public IPEndPoint RemoteEndPoint { get; set; } public IDuplexPipe Transport { get; set; } - public IDuplexPipe Application { get; set; } } } diff --git a/src/Kestrel.Core/Internal/HttpConnectionMiddleware.cs b/src/Kestrel.Core/Internal/HttpConnectionMiddleware.cs index 6b15c06705..5d05220811 100644 --- a/src/Kestrel.Core/Internal/HttpConnectionMiddleware.cs +++ b/src/Kestrel.Core/Internal/HttpConnectionMiddleware.cs @@ -37,7 +37,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal { // We need the transport feature so that we can cancel the output reader that the transport is using // This is a bit of a hack but it preserves the existing semantics - var applicationFeature = connectionContext.Features.Get(); var memoryPoolFeature = connectionContext.Features.Get(); var httpConnectionId = Interlocked.Increment(ref _lastHttpConnectionId); @@ -52,8 +51,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal ConnectionFeatures = connectionContext.Features, MemoryPool = memoryPoolFeature.MemoryPool, ConnectionAdapters = _connectionAdapters, - Transport = connectionContext.Transport, - Application = applicationFeature.Application + Transport = connectionContext.Transport }; var connectionFeature = connectionContext.Features.Get(); diff --git a/test/Kestrel.Core.Tests/Http1ConnectionTests.cs b/test/Kestrel.Core.Tests/Http1ConnectionTests.cs index de762a0a7a..19e17d4dc3 100644 --- a/test/Kestrel.Core.Tests/Http1ConnectionTests.cs +++ b/test/Kestrel.Core.Tests/Http1ConnectionTests.cs @@ -63,7 +63,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests ConnectionFeatures = connectionFeatures, MemoryPool = _pipelineFactory, TimeoutControl = _timeoutControl.Object, - Application = pair.Application, Transport = pair.Transport }; diff --git a/test/Kestrel.Core.Tests/HttpConnectionTests.cs b/test/Kestrel.Core.Tests/HttpConnectionTests.cs index c8dbf28ba0..2c78c922c7 100644 --- a/test/Kestrel.Core.Tests/HttpConnectionTests.cs +++ b/test/Kestrel.Core.Tests/HttpConnectionTests.cs @@ -44,7 +44,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests ConnectionFeatures = connectionFeatures, MemoryPool = _memoryPool, HttpConnectionId = long.MinValue, - Application = pair.Application, Transport = pair.Transport, ServiceContext = new TestServiceContext { @@ -66,7 +65,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests var mockDebugger = new Mock(); mockDebugger.SetupGet(g => g.IsAttached).Returns(true); _httpConnection.Debugger = mockDebugger.Object; - _httpConnection.Initialize(_httpConnectionContext.Transport, _httpConnectionContext.Application); + _httpConnection.Initialize(_httpConnectionContext.Transport); var now = DateTimeOffset.Now; _httpConnection.Tick(now); @@ -113,7 +112,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests _httpConnectionContext.ServiceContext.Log = logger; - _httpConnection.Initialize(_httpConnectionContext.Transport, _httpConnectionContext.Application); + _httpConnection.Initialize(_httpConnectionContext.Transport); _httpConnection.Http1Connection.Reset(); // Initialize timestamp @@ -140,7 +139,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests var mockLogger = new Mock(); _httpConnectionContext.ServiceContext.Log = mockLogger.Object; - _httpConnection.Initialize(_httpConnectionContext.Transport, _httpConnectionContext.Application); + _httpConnection.Initialize(_httpConnectionContext.Transport); _httpConnection.Http1Connection.Reset(); // Initialize timestamp @@ -182,7 +181,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests var mockLogger = new Mock(); _httpConnectionContext.ServiceContext.Log = mockLogger.Object; - _httpConnection.Initialize(_httpConnectionContext.Transport, _httpConnectionContext.Application); + _httpConnection.Initialize(_httpConnectionContext.Transport); _httpConnection.Http1Connection.Reset(); // Initialize timestamp @@ -259,7 +258,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests var mockLogger = new Mock(); _httpConnectionContext.ServiceContext.Log = mockLogger.Object; - _httpConnection.Initialize(_httpConnectionContext.Transport, _httpConnectionContext.Application); + _httpConnection.Initialize(_httpConnectionContext.Transport); _httpConnection.Http1Connection.Reset(); // Initialize timestamp @@ -327,7 +326,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests var mockLogger = new Mock(); _httpConnectionContext.ServiceContext.Log = mockLogger.Object; - _httpConnection.Initialize(_httpConnectionContext.Transport, _httpConnectionContext.Application); + _httpConnection.Initialize(_httpConnectionContext.Transport); _httpConnection.Http1Connection.Reset(); // Initialize timestamp @@ -389,7 +388,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests var mockLogger = new Mock(); _httpConnectionContext.ServiceContext.Log = mockLogger.Object; - _httpConnection.Initialize(_httpConnectionContext.Transport, _httpConnectionContext.Application); + _httpConnection.Initialize(_httpConnectionContext.Transport); _httpConnection.Http1Connection.Reset(); var startTime = systemClock.UtcNow; @@ -430,7 +429,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests var mockLogger = new Mock(); _httpConnectionContext.ServiceContext.Log = mockLogger.Object; - _httpConnection.Initialize(_httpConnectionContext.Transport, _httpConnectionContext.Application); + _httpConnection.Initialize(_httpConnectionContext.Transport); _httpConnection.Http1Connection.Reset(); _httpConnection.Http1Connection.RequestAborted.Register(() => { @@ -464,7 +463,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests var mockLogger = new Mock(); _httpConnectionContext.ServiceContext.Log = mockLogger.Object; - _httpConnection.Initialize(_httpConnectionContext.Transport, _httpConnectionContext.Application); + _httpConnection.Initialize(_httpConnectionContext.Transport); _httpConnection.Http1Connection.Reset(); _httpConnection.Http1Connection.RequestAborted.Register(() => { @@ -506,7 +505,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests var mockLogger = new Mock(); _httpConnectionContext.ServiceContext.Log = mockLogger.Object; - _httpConnection.Initialize(_httpConnectionContext.Transport, _httpConnectionContext.Application); + _httpConnection.Initialize(_httpConnectionContext.Transport); _httpConnection.Http1Connection.Reset(); _httpConnection.Http1Connection.RequestAborted.Register(() => { @@ -555,7 +554,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests var mockLogger = new Mock(); _httpConnectionContext.ServiceContext.Log = mockLogger.Object; - _httpConnection.Initialize(_httpConnectionContext.Transport, _httpConnectionContext.Application); + _httpConnection.Initialize(_httpConnectionContext.Transport); _httpConnection.Http1Connection.Reset(); _httpConnection.Http1Connection.RequestAborted.Register(() => { diff --git a/test/Kestrel.Core.Tests/HttpProtocolFeatureCollectionTests.cs b/test/Kestrel.Core.Tests/HttpProtocolFeatureCollectionTests.cs index 84d08ff3d7..6ac87ba1a5 100644 --- a/test/Kestrel.Core.Tests/HttpProtocolFeatureCollectionTests.cs +++ b/test/Kestrel.Core.Tests/HttpProtocolFeatureCollectionTests.cs @@ -46,7 +46,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests ConnectionFeatures = new FeatureCollection(), MemoryPool = _memoryPool, TimeoutControl = _timeoutControl.Object, - Application = pair.Application, Transport = pair.Transport }; diff --git a/test/Kestrel.Core.Tests/HttpResponseHeadersTests.cs b/test/Kestrel.Core.Tests/HttpResponseHeadersTests.cs index 1afb559ad1..eddc7701fd 100644 --- a/test/Kestrel.Core.Tests/HttpResponseHeadersTests.cs +++ b/test/Kestrel.Core.Tests/HttpResponseHeadersTests.cs @@ -30,7 +30,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests ServiceContext = new TestServiceContext(), ConnectionFeatures = new FeatureCollection(), MemoryPool = memoryPool, - Application = pair.Application, Transport = pair.Transport, TimeoutControl = null }; diff --git a/test/Kestrel.Core.Tests/MessageBodyTests.cs b/test/Kestrel.Core.Tests/MessageBodyTests.cs index 3bd6a8ca74..870e89c47b 100644 --- a/test/Kestrel.Core.Tests/MessageBodyTests.cs +++ b/test/Kestrel.Core.Tests/MessageBodyTests.cs @@ -422,12 +422,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests var options = new PipeOptions(pool: memoryPool, readerScheduler: PipeScheduler.Inline, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false); var pair = DuplexPipe.CreateConnectionPair(options, options); var transport = pair.Transport; - var application = pair.Application; var http1ConnectionContext = new Http1ConnectionContext { ServiceContext = new TestServiceContext(), ConnectionFeatures = new FeatureCollection(), - Application = application, Transport = transport, MemoryPool = memoryPool, TimeoutControl = Mock.Of() diff --git a/test/Kestrel.Core.Tests/TestHelpers/TestInput.cs b/test/Kestrel.Core.Tests/TestHelpers/TestInput.cs index b032b334f0..78e28dcbc2 100644 --- a/test/Kestrel.Core.Tests/TestHelpers/TestInput.cs +++ b/test/Kestrel.Core.Tests/TestHelpers/TestInput.cs @@ -38,7 +38,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests ServiceContext = new TestServiceContext(), ConnectionContext = Mock.Of(), ConnectionFeatures = connectionFeatures, - Application = Application, Transport = Transport, MemoryPool = _memoryPool, TimeoutControl = Mock.Of() diff --git a/test/Kestrel.InMemory.FunctionalTests/Http2/Http2StreamTests.cs b/test/Kestrel.InMemory.FunctionalTests/Http2/Http2StreamTests.cs index 4a82ff4d01..7e97ad2cc6 100644 --- a/test/Kestrel.InMemory.FunctionalTests/Http2/Http2StreamTests.cs +++ b/test/Kestrel.InMemory.FunctionalTests/Http2/Http2StreamTests.cs @@ -16,6 +16,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Logging; using Microsoft.Net.Http.Headers; +using Moq; using Xunit; namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests diff --git a/test/Kestrel.InMemory.FunctionalTests/Http2/Http2TestBase.cs b/test/Kestrel.InMemory.FunctionalTests/Http2/Http2TestBase.cs index bc9c2d7f27..ec588826c2 100644 --- a/test/Kestrel.InMemory.FunctionalTests/Http2/Http2TestBase.cs +++ b/test/Kestrel.InMemory.FunctionalTests/Http2/Http2TestBase.cs @@ -20,6 +20,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack; using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal; using Microsoft.AspNetCore.Testing; +using Microsoft.AspNetCore.Connections; using Microsoft.Net.Http.Headers; using Moq; using Xunit; @@ -280,10 +281,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests _connectionContext = new Http2ConnectionContext { + ConnectionContext = Mock.Of(), ConnectionFeatures = new FeatureCollection(), ServiceContext = new TestServiceContext(LoggerFactory, mockKestrelTrace.Object), MemoryPool = _memoryPool, - Application = _pair.Application, Transport = _pair.Transport }; diff --git a/test/Kestrel.Transport.Libuv.Tests/LibuvOutputConsumerTests.cs b/test/Kestrel.Transport.Libuv.Tests/LibuvOutputConsumerTests.cs index d2f6a4fb89..2aa92e37d2 100644 --- a/test/Kestrel.Transport.Libuv.Tests/LibuvOutputConsumerTests.cs +++ b/test/Kestrel.Transport.Libuv.Tests/LibuvOutputConsumerTests.cs @@ -743,7 +743,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Tests ConnectionFeatures = connectionFeatures, MemoryPool = _memoryPool, TimeoutControl = Mock.Of(), - Application = pair.Application, Transport = pair.Transport });