From 7ceea5323aeb78c5c5a9b0f68f1e52d65073b16f Mon Sep 17 00:00:00 2001 From: Cesar Blum Silveira Date: Tue, 4 Apr 2017 13:45:02 -0700 Subject: [PATCH] Rename namespaces/directories/classes in Kestrel.Core and Transport.Libuv (#1582). - Put everything in the libuv transport package under `Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.*` namespaces. - Move stuff in Transport.Libuv/Internal/Http and Transport.Libuv/Internal/Infrastructure to Transport.Libuv/Internal (keep the Networking directory for the libuv wrappers). - Add `Libuv` prefix to most libuv internal classes. - Rename `KestrelEngine` to `LibuvTransport`. - Rename `SocketOutputConsumer` to `LibuvOutputConsumer`. - Rename `SocketOutputProducer` to `OutputProducer`. - Fix namespaces in `Microsoft.AspNetCore.Server.Kestrel.Core.` --- samples/SampleApp/Startup.cs | 2 +- .../Adapter/ConnectionAdapterContext.cs | 2 +- .../Adapter/IAdaptedConnection.cs | 2 +- .../Adapter/IConnectionAdapter.cs | 2 +- .../Adapter/Internal/AdaptedPipeline.cs | 4 +- .../Adapter/Internal/LoggingStream.cs | 2 +- .../Adapter/Internal/RawStream.cs | 4 +- .../Adapter/Internal/StreamSocketOutput.cs | 4 +- ...istenOptionsConnectionLoggingExtensions.cs | 4 +- .../Adapter/LoggingConnectionAdapter.cs | 4 +- .../BadHttpRequestException.cs | 6 +- .../Internal/ConnectionHandler.cs | 8 +-- .../Internal/FrameConnection.cs | 10 +-- .../Internal/FrameConnectionContext.cs | 8 +-- .../Internal/Http/ChunkWriter.cs | 2 +- .../Http/ConnectionLifetimeControl.cs | 8 +-- .../Internal/Http/ConnectionOptions.cs | 2 +- .../Internal/Http/DateHeaderValueManager.cs | 4 +- .../Internal/Http/Frame.FeatureCollection.cs | 2 +- .../Internal/Http/Frame.Generated.cs | 2 +- .../Internal/Http/Frame.cs | 6 +- .../Internal/Http/FrameContext.cs | 2 +- .../Internal/Http/FrameDuplexStream.cs | 2 +- .../Internal/Http/FrameHeaders.Generated.cs | 4 +- .../Internal/Http/FrameHeaders.cs | 2 +- .../Internal/Http/FrameOfT.cs | 4 +- .../Internal/Http/FrameRequestHeaders.cs | 4 +- .../Internal/Http/FrameRequestStream.cs | 2 +- .../Internal/Http/FrameResponseHeaders.cs | 2 +- .../Internal/Http/FrameResponseStream.cs | 2 +- .../Internal/Http/FrameStreamState.cs | 2 +- .../Internal/Http/HttpMethod.cs | 2 +- .../Internal/Http/HttpScheme.cs | 2 +- .../Internal/Http/HttpVersion.cs | 2 +- .../Internal/Http/IFrameControl.cs | 2 +- .../Internal/Http/IHttpHeadersHandler.cs | 2 +- .../Internal/Http/IHttpParser.cs | 2 +- .../Internal/Http/IHttpRequestLineHandler.cs | 2 +- .../Internal/Http/ISocketOutput.cs | 2 +- .../Internal/Http/KestrelHttpParser.cs | 4 +- .../Internal/Http/MessageBody.cs | 2 +- ...ketOutputProducer.cs => OutputProducer.cs} | 8 +-- .../Internal/Http/PathNormalizer.cs | 2 +- .../Internal/Http/PipelineExtensions.cs | 2 +- .../Internal/Http/ProduceEndType.cs | 2 +- .../Internal/Http/ReasonPhrases.cs | 2 +- .../Internal/Http/RequestProcessingStatus.cs | 2 +- .../Internal/Http/RequestRejectionReason.cs | 2 +- .../Internal/Http/TransferCoding.cs | 2 +- .../Internal/Infrastructure/AsciiUtilities.cs | 2 +- .../CancellationTokenExtensions.cs | 2 +- .../Internal/Infrastructure/Constants.cs | 2 +- .../Infrastructure/CorrelationIdGenerator.cs | 2 +- .../Internal/Infrastructure/Disposable.cs | 2 +- .../Infrastructure/DisposableAction.cs | 2 +- .../Internal/Infrastructure/HttpUtilities.cs | 4 +- .../Internal/Infrastructure/IKestrelTrace.cs | 2 +- .../Internal/Infrastructure/ISystemClock.cs | 2 +- .../Internal/Infrastructure/IThreadPool.cs | 2 +- .../Infrastructure/InlineLoggingThreadPool.cs | 2 +- .../Infrastructure/KestrelEventSource.cs | 4 +- .../Internal/Infrastructure/KestrelTrace.cs | 4 +- .../Infrastructure/LoggingThreadPool.cs | 2 +- .../Internal/Infrastructure/Streams.cs | 4 +- .../Internal/Infrastructure/SystemClock.cs | 2 +- .../Internal/Infrastructure/UriUtilities.cs | 2 +- .../Internal/InternalKestrelServerOptions.cs | 2 +- .../Internal/KestrelServerOptionsSetup.cs | 2 +- .../Internal/ServiceContext.cs | 6 +- .../KestrelServer.cs | 7 +- .../KestrelServerLimits.cs | 2 +- .../KestrelServerOptions.cs | 2 +- .../ListenOptions.cs | 4 +- .../ServerAddress.cs | 4 +- .../KesterlServerOptionsSystemdExtensions.cs | 2 +- .../HttpsConnectionAdapter.cs | 2 +- .../ListenOptionsHttpsExtensions.cs | 2 +- .../Internal/{Http => }/IAsyncDisposable.cs | 2 +- .../{Infrastructure => }/ILibuvTrace.cs | 2 +- .../{Infrastructure => }/LibuvAwaitable.cs | 4 +- .../Connection.cs => LibuvConnection.cs} | 30 ++++---- ...onContext.cs => LibuvConnectionContext.cs} | 8 +-- ...onManager.cs => LibuvConnectionManager.cs} | 14 ++-- .../Constants.cs => LibuvConstants.cs} | 4 +- ...tputConsumer.cs => LibuvOutputConsumer.cs} | 20 +++--- .../KestrelThread.cs => LibuvThread.cs} | 56 +++++++-------- .../{Infrastructure => }/LibuvTrace.cs | 2 +- .../Internal/LibuvTransportContext.cs | 2 - .../Internal/{Http => }/Listener.cs | 15 ++-- .../Internal/{Http => }/ListenerContext.cs | 7 +- .../Internal/{Http => }/ListenerPrimary.cs | 10 ++- .../Internal/{Http => }/ListenerSecondary.cs | 15 ++-- .../{Libuv.cs => LibuvFunctions.cs} | 2 +- .../Internal/Networking/PlatformApis.cs | 2 +- .../Internal/Networking/SockAddr.cs | 2 +- .../Internal/Networking/UvAsyncHandle.cs | 4 +- .../Internal/Networking/UvConnectRequest.cs | 4 +- .../Internal/Networking/UvException.cs | 2 +- .../Internal/Networking/UvHandle.cs | 4 +- .../Internal/Networking/UvLoopHandle.cs | 4 +- .../Internal/Networking/UvMemory.cs | 5 +- .../Internal/Networking/UvPipeHandle.cs | 4 +- .../Internal/Networking/UvRequest.cs | 7 +- .../Internal/Networking/UvShutdownReq.cs | 4 +- .../Internal/Networking/UvStreamHandle.cs | 7 +- .../Internal/Networking/UvTcpHandle.cs | 4 +- .../Internal/Networking/UvTimerHandle.cs | 4 +- .../Internal/Networking/UvWriteReq.cs | 4 +- .../{Infrastructure => }/WriteReqPool.cs | 16 +++-- .../{KestrelEngine.cs => LibuvTransport.cs} | 20 +++--- .../LibuvTransportFactory.cs | 9 +-- .../WebHostBuilderKestrelExtensions.cs | 4 +- .../AddressRegistrationTests.cs | 3 +- .../BadHttpRequestTests.cs | 5 +- .../EventSourceTests.cs | 2 +- .../KeepAliveTimeoutTests.cs | 1 + .../MaxRequestLineSizeTests.cs | 1 + .../RequestHeaderLimitsTests.cs | 1 + .../RequestHeadersTimeoutTests.cs | 1 + .../RequestTests.cs | 2 +- .../ResponseTests.cs | 5 +- .../DotSegmentRemovalBenchmark.cs | 2 +- .../FrameParsingOverheadBenchmark.cs | 5 +- .../FrameWritingBenchmark.cs | 5 +- .../KestrelHttpParserBenchmark.cs | 2 +- .../KnownStringsBenchmark.cs | 4 +- .../Mocks/MockTrace.cs | 3 +- .../RequestParsingBenchmark.cs | 5 +- .../ResponseHeaderCollectionBenchmark.cs | 5 +- .../ResponseHeadersWritingBenchmark.cs | 13 ++-- .../AsciiDecoding.cs | 2 +- .../ChunkWriterTests.cs | 2 +- .../ChunkedRequestTests.cs | 2 +- .../ChunkedResponseTests.cs | 2 +- .../ConnectionAdapterTests.cs | 4 +- .../ConnectionTests.cs | 12 ++-- .../CreateIPEndpointTests.cs | 2 +- .../DateHeaderValueManagerTests.cs | 2 +- .../EngineTests.cs | 33 ++++----- .../FrameHeadersTests.cs | 2 +- .../FrameRequestHeadersTests.cs | 4 +- .../FrameRequestStreamTests.cs | 2 +- .../FrameResponseHeadersTests.cs | 2 +- .../FrameResponseStreamTests.cs | 2 +- .../FrameTests.cs | 10 +-- .../HttpParserTests.cs | 6 +- .../HttpUtilitiesTest.cs | 4 +- .../HttpsConnectionAdapterTests.cs | 2 +- .../KestrelEventSourceTests.cs | 4 +- .../KestrelServerLimitsTests.cs | 2 +- .../KestrelServerOptionsTests.cs | 2 +- .../KestrelServerTests.cs | 2 +- ...utTests.cs => LibuvOutputConsumerTests.cs} | 63 ++++++++-------- .../ListenerPrimaryTests.cs | 72 +++++++++---------- .../LoggingThreadPoolTests.cs | 2 +- .../MessageBodyTests.cs | 4 +- .../MultipleLoopTests.cs | 4 +- .../NetworkingTests.cs | 5 +- .../PathNormalizerTests.cs | 2 +- .../PipeOptionsTests.cs | 4 +- .../PipelineExtensionTests.cs | 2 +- .../RequestTargetProcessingTests.cs | 6 +- .../ServerAddressTests.cs | 2 +- .../StreamSocketOutputTests.cs | 2 +- .../TestHelpers/MockFrameControl.cs | 2 +- .../TestHelpers/MockLibuv.cs | 2 +- .../TestHelpers/MockSocket.cs | 4 +- .../TestInput.cs | 2 +- .../UvStreamHandleTests.cs | 4 +- .../UvTimerHandleTests.cs | 4 +- .../WebHostBuilderKestrelExtensionsTests.cs | 2 +- test/shared/HttpParsingData.cs | 2 +- test/shared/MockConnection.cs | 4 +- test/shared/MockSocketOutput.cs | 2 +- test/shared/MockSystemClock.cs | 2 +- test/shared/PassThroughConnectionAdapter.cs | 4 +- test/shared/TestApplicationErrorLogger.cs | 3 +- test/shared/TestFrame.cs | 2 +- test/shared/TestKestrelTrace.cs | 2 +- test/shared/TestServer.cs | 19 ++--- test/shared/TestServiceContext.cs | 10 ++- tools/CodeGenerator/FrameFeatureCollection.cs | 2 +- tools/CodeGenerator/KnownHeaders.cs | 4 +- 183 files changed, 459 insertions(+), 493 deletions(-) rename src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/{SocketOutputProducer.cs => OutputProducer.cs} (94%) rename src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/{Http => }/IAsyncDisposable.cs (79%) rename src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/{Infrastructure => }/ILibuvTrace.cs (97%) rename src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/{Infrastructure => }/LibuvAwaitable.cs (93%) rename src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/{Http/Connection.cs => LibuvConnection.cs} (89%) rename src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/{Http/ConnectionContext.cs => LibuvConnectionContext.cs} (77%) rename src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/{Http/ConnectionManager.cs => LibuvConnectionManager.cs} (79%) rename src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/{Infrastructure/Constants.cs => LibuvConstants.cs} (92%) rename src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/{Http/SocketOutputConsumer.cs => LibuvOutputConsumer.cs} (88%) rename src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/{Infrastructure/KestrelThread.cs => LibuvThread.cs} (89%) rename src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/{Infrastructure => }/LibuvTrace.cs (99%) rename src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/{Http => }/Listener.cs (91%) rename src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/{Http => }/ListenerContext.cs (89%) rename src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/{Http => }/ListenerPrimary.cs (97%) rename src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/{Http => }/ListenerSecondary.cs (92%) rename src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/{Libuv.cs => LibuvFunctions.cs} (99%) rename src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/{Infrastructure => }/WriteReqPool.cs (80%) rename src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/{KestrelEngine.cs => LibuvTransport.cs} (85%) rename test/Microsoft.AspNetCore.Server.KestrelTests/{SocketOutputTests.cs => LibuvOutputConsumerTests.cs} (89%) diff --git a/samples/SampleApp/Startup.cs b/samples/SampleApp/Startup.cs index 4a6f015a4c..7f066dc7b5 100644 --- a/samples/SampleApp/Startup.cs +++ b/samples/SampleApp/Startup.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; using Microsoft.Extensions.Logging; namespace SampleApp diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/ConnectionAdapterContext.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/ConnectionAdapterContext.cs index 15a87c9075..380f56ffc8 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/ConnectionAdapterContext.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/ConnectionAdapterContext.cs @@ -3,7 +3,7 @@ using System.IO; -namespace Microsoft.AspNetCore.Server.Kestrel.Adapter +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter { // Even though this only includes the non-adapted ConnectionStream currently, this is a context in case // we want to add more connection metadata later. diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/IAdaptedConnection.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/IAdaptedConnection.cs index aa8c2e820e..793d4b7e0a 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/IAdaptedConnection.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/IAdaptedConnection.cs @@ -4,7 +4,7 @@ using System.IO; using Microsoft.AspNetCore.Http.Features; -namespace Microsoft.AspNetCore.Server.Kestrel.Adapter +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter { public interface IAdaptedConnection { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/IConnectionAdapter.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/IConnectionAdapter.cs index 65140d1952..57c9d904d9 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/IConnectionAdapter.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/IConnectionAdapter.cs @@ -3,7 +3,7 @@ using System.Threading.Tasks; -namespace Microsoft.AspNetCore.Server.Kestrel.Adapter +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter { public interface IConnectionAdapter { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/Internal/AdaptedPipeline.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/Internal/AdaptedPipeline.cs index 54674ae5d4..7d943c0c8d 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/Internal/AdaptedPipeline.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/Internal/AdaptedPipeline.cs @@ -5,9 +5,9 @@ using System; using System.IO; using System.IO.Pipelines; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; -namespace Microsoft.AspNetCore.Server.Kestrel.Adapter.Internal +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal { public class AdaptedPipeline { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/Internal/LoggingStream.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/Internal/LoggingStream.cs index 24fa1edb08..520b456d3b 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/Internal/LoggingStream.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/Internal/LoggingStream.cs @@ -8,7 +8,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Adapter.Internal +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal { internal class LoggingStream : Stream { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/Internal/RawStream.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/Internal/RawStream.cs index 6e21958576..170f068801 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/Internal/RawStream.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/Internal/RawStream.cs @@ -6,9 +6,9 @@ using System.IO; using System.IO.Pipelines; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; -namespace Microsoft.AspNetCore.Server.Kestrel.Adapter.Internal +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal { public class RawStream : Stream { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/Internal/StreamSocketOutput.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/Internal/StreamSocketOutput.cs index 11da4bc24b..9b351e8874 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/Internal/StreamSocketOutput.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/Internal/StreamSocketOutput.cs @@ -6,9 +6,9 @@ using System.IO; using System.IO.Pipelines; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; -namespace Microsoft.AspNetCore.Server.Kestrel.Adapter.Internal +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal { public class StreamSocketOutput : ISocketOutput { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/ListenOptionsConnectionLoggingExtensions.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/ListenOptionsConnectionLoggingExtensions.cs index 9d5affe345..2c99618aae 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/ListenOptionsConnectionLoggingExtensions.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/ListenOptionsConnectionLoggingExtensions.cs @@ -1,8 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNetCore.Server.Kestrel; -using Microsoft.AspNetCore.Server.Kestrel.Adapter; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/LoggingConnectionAdapter.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/LoggingConnectionAdapter.cs index 6c25f4ba2f..d0c268b1b4 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/LoggingConnectionAdapter.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Adapter/LoggingConnectionAdapter.cs @@ -5,10 +5,10 @@ using System; using System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Server.Kestrel.Adapter.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Adapter +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter { public class LoggingConnectionAdapter : IConnectionAdapter { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/BadHttpRequestException.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/BadHttpRequestException.cs index 3c80a8a53a..5a19ea4565 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/BadHttpRequestException.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/BadHttpRequestException.cs @@ -3,11 +3,11 @@ using System.IO; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.Extensions.Primitives; -namespace Microsoft.AspNetCore.Server.Kestrel +namespace Microsoft.AspNetCore.Server.Kestrel.Core { public sealed class BadHttpRequestException : IOException { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/ConnectionHandler.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/ConnectionHandler.cs index 23ef1630eb..1376c975ed 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/ConnectionHandler.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/ConnectionHandler.cs @@ -3,11 +3,11 @@ using System.IO.Pipelines; using Microsoft.AspNetCore.Hosting.Server; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal { public class ConnectionHandler : IConnectionHandler { @@ -38,7 +38,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal // TODO: Untangle this mess var frame = new Frame(_application, frameContext); - var outputProducer = new SocketOutputProducer(outputPipe.Writer, frame, connectionId, _serviceContext.Log); + var outputProducer = new OutputProducer(outputPipe.Writer, frame, connectionId, _serviceContext.Log); frame.LifetimeControl = new ConnectionLifetimeControl(connectionId, outputPipe.Reader, outputProducer, _serviceContext.Log); var connection = new FrameConnection(new FrameConnectionContext diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/FrameConnection.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/FrameConnection.cs index 8c4805c839..e59689b163 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/FrameConnection.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/FrameConnection.cs @@ -6,15 +6,15 @@ using System.Collections.Generic; using System.IO; using System.IO.Pipelines; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Adapter; -using Microsoft.AspNetCore.Server.Kestrel.Adapter.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter; +using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; using Microsoft.Extensions.Internal; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal { public class FrameConnection : IConnectionContext { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/FrameConnectionContext.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/FrameConnectionContext.cs index 271c009385..61414ed429 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/FrameConnectionContext.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/FrameConnectionContext.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.IO.Pipelines; -using Microsoft.AspNetCore.Server.Kestrel.Adapter; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal { public class FrameConnectionContext { @@ -15,7 +15,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal public PipeFactory PipeFactory { get; set; } public List ConnectionAdapters { get; set; } public Frame Frame { get; set; } - public SocketOutputProducer OutputProducer { get; set; } + public OutputProducer OutputProducer { get; set; } public IPipe Input { get; set; } public IPipe Output { get; set; } diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ChunkWriter.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ChunkWriter.cs index 6ffbc577b9..27b7dadba5 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ChunkWriter.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ChunkWriter.cs @@ -5,7 +5,7 @@ using System; using System.IO.Pipelines; using System.Text; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public static class ChunkWriter { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ConnectionLifetimeControl.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ConnectionLifetimeControl.cs index ae7d98ba3f..7e44f26f59 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ConnectionLifetimeControl.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ConnectionLifetimeControl.cs @@ -2,16 +2,16 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO.Pipelines; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public class ConnectionLifetimeControl { public ConnectionLifetimeControl( string connectionId, IPipeReader outputPipeReader, - SocketOutputProducer outputProducer, + OutputProducer outputProducer, IKestrelTrace log) { ConnectionId = connectionId; @@ -22,7 +22,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http private string ConnectionId { get; } private IPipeReader OutputReader { get; } - private SocketOutputProducer OutputProducer { get; } + private OutputProducer OutputProducer { get; } private IKestrelTrace Log { get; } public void End(ProduceEndType endType) diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ConnectionOptions.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ConnectionOptions.cs index 72d4eeb5d1..71817aed69 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ConnectionOptions.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ConnectionOptions.cs @@ -3,7 +3,7 @@ using System; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { [Flags] public enum ConnectionOptions diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/DateHeaderValueManager.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/DateHeaderValueManager.cs index 57f68967a4..349345e5fe 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/DateHeaderValueManager.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/DateHeaderValueManager.cs @@ -4,10 +4,10 @@ using System; using System.Text; using System.Threading; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { /// /// Manages the generation of the date header value. diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/Frame.FeatureCollection.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/Frame.FeatureCollection.cs index c1dada9715..abf4bddf7d 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/Frame.FeatureCollection.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/Frame.FeatureCollection.cs @@ -12,7 +12,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; using Microsoft.Extensions.Primitives; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public partial class Frame : IFeatureCollection, IHttpRequestFeature, diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/Frame.Generated.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/Frame.Generated.cs index a1caf15e33..181e54d667 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/Frame.Generated.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/Frame.Generated.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public partial class Frame { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/Frame.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/Frame.cs index 6c83f20b3e..35e7f4cdea 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/Frame.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/Frame.cs @@ -14,8 +14,8 @@ using System.Text.Encodings.Web.Utf8; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Server.Kestrel.Adapter; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; using Microsoft.Extensions.Internal; using Microsoft.Extensions.Logging; @@ -23,7 +23,7 @@ using Microsoft.Extensions.Primitives; // ReSharper disable AccessToModifiedClosure -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public abstract partial class Frame : IFrameControl, IHttpRequestLineHandler, IHttpHeadersHandler { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameContext.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameContext.cs index cbccf8684a..28069ce4ae 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameContext.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameContext.cs @@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public class FrameContext { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameDuplexStream.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameDuplexStream.cs index 10469dc05d..b427651405 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameDuplexStream.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameDuplexStream.cs @@ -8,7 +8,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { class FrameDuplexStream : Stream { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameHeaders.Generated.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameHeaders.Generated.cs index 8cc1ad75bd..8d182b0234 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameHeaders.Generated.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameHeaders.Generated.cs @@ -4,11 +4,11 @@ using System; using System.Collections.Generic; using System.IO.Pipelines; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.Extensions.Primitives; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public partial class FrameRequestHeaders diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameHeaders.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameHeaders.cs index 312fc0dfd7..2432afa6a3 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameHeaders.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameHeaders.cs @@ -9,7 +9,7 @@ using System.Runtime.CompilerServices; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Primitives; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public abstract class FrameHeaders : IHeaderDictionary { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameOfT.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameOfT.cs index 75edc1659c..0d4ffe7544 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameOfT.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameOfT.cs @@ -6,11 +6,11 @@ using System.IO; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting.Server; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public class Frame : Frame { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameRequestHeaders.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameRequestHeaders.cs index b7432853b7..f210549803 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameRequestHeaders.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameRequestHeaders.cs @@ -5,11 +5,11 @@ using System; using System.Collections; using System.Collections.Generic; using System.Runtime.CompilerServices; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.Extensions.Primitives; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public partial class FrameRequestHeaders : FrameHeaders { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameRequestStream.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameRequestStream.cs index 3d084adafd..93f0db1018 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameRequestStream.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameRequestStream.cs @@ -7,7 +7,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Internal; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { class FrameRequestStream : Stream { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameResponseHeaders.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameResponseHeaders.cs index 9fc752f6cd..262496dd60 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameResponseHeaders.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameResponseHeaders.cs @@ -9,7 +9,7 @@ using System.Runtime.CompilerServices; using Microsoft.Extensions.Primitives; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public partial class FrameResponseHeaders : FrameHeaders { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameResponseStream.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameResponseStream.cs index 3100520393..699aa90f92 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameResponseStream.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameResponseStream.cs @@ -6,7 +6,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { class FrameResponseStream : Stream { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameStreamState.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameStreamState.cs index 8e1e26eaa5..a46cb733eb 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameStreamState.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameStreamState.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { enum FrameStreamState { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/HttpMethod.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/HttpMethod.cs index 88b4ed73c2..0aa230cf50 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/HttpMethod.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/HttpMethod.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public enum HttpMethod: byte { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/HttpScheme.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/HttpScheme.cs index 23f0bed5b9..dfd4642f3d 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/HttpScheme.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/HttpScheme.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public enum HttpScheme { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/HttpVersion.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/HttpVersion.cs index f3a015af88..5ca3e8bdba 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/HttpVersion.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/HttpVersion.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public enum HttpVersion { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/IFrameControl.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/IFrameControl.cs index 0303188e3a..5ad87bc264 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/IFrameControl.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/IFrameControl.cs @@ -5,7 +5,7 @@ using System; using System.Threading; using System.Threading.Tasks; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public interface IFrameControl { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/IHttpHeadersHandler.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/IHttpHeadersHandler.cs index 57468508d1..9a322f0da9 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/IHttpHeadersHandler.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/IHttpHeadersHandler.cs @@ -3,7 +3,7 @@ using System; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public interface IHttpHeadersHandler { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/IHttpParser.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/IHttpParser.cs index ee888bea1f..0af7ef01b7 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/IHttpParser.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/IHttpParser.cs @@ -3,7 +3,7 @@ using System.IO.Pipelines; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public interface IHttpParser { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/IHttpRequestLineHandler.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/IHttpRequestLineHandler.cs index 83481002b3..ac91138512 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/IHttpRequestLineHandler.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/IHttpRequestLineHandler.cs @@ -3,7 +3,7 @@ using System; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public interface IHttpRequestLineHandler { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ISocketOutput.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ISocketOutput.cs index 379dd52318..494e6df8de 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ISocketOutput.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ISocketOutput.cs @@ -6,7 +6,7 @@ using System.IO.Pipelines; using System.Threading; using System.Threading.Tasks; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { /// /// Operations performed for buffered socket output diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/KestrelHttpParser.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/KestrelHttpParser.cs index b78d04b69c..c1131fd6c1 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/KestrelHttpParser.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/KestrelHttpParser.cs @@ -5,10 +5,10 @@ using System; using System.IO.Pipelines; using System.Numerics; using System.Runtime.CompilerServices; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public class KestrelHttpParser : IHttpParser { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/MessageBody.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/MessageBody.cs index 03130d7628..837a30c027 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/MessageBody.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/MessageBody.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Internal; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public abstract class MessageBody { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/SocketOutputProducer.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/OutputProducer.cs similarity index 94% rename from src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/SocketOutputProducer.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/OutputProducer.cs index 956fd5a336..7aee461ca7 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/SocketOutputProducer.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/OutputProducer.cs @@ -5,12 +5,12 @@ using System; using System.IO.Pipelines; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.Extensions.Internal; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { - public class SocketOutputProducer : ISocketOutput, IDisposable + public class OutputProducer : ISocketOutput, IDisposable { private static readonly ArraySegment _emptyData = new ArraySegment(new byte[0]); @@ -33,7 +33,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http private readonly object _flushLock = new object(); private readonly Action _onFlushCallback; - public SocketOutputProducer(IPipeWriter pipe, Frame frame, string connectionId, IKestrelTrace log) + public OutputProducer(IPipeWriter pipe, Frame frame, string connectionId, IKestrelTrace log) { _pipe = pipe; _frame = frame; diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/PathNormalizer.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/PathNormalizer.cs index 99f49f287c..de076e1849 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/PathNormalizer.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/PathNormalizer.cs @@ -4,7 +4,7 @@ using System; using System.Diagnostics; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public static class PathNormalizer { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/PipelineExtensions.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/PipelineExtensions.cs index 4109119da9..233544deb6 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/PipelineExtensions.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/PipelineExtensions.cs @@ -7,7 +7,7 @@ using System.IO.Pipelines; using System.Runtime.CompilerServices; using System.Threading.Tasks; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public static class PipelineExtensions { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ProduceEndType.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ProduceEndType.cs index 06da2e11e6..72107f90e7 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ProduceEndType.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ProduceEndType.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public enum ProduceEndType { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ReasonPhrases.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ReasonPhrases.cs index d3e916606e..36eaaacf87 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ReasonPhrases.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/ReasonPhrases.cs @@ -6,7 +6,7 @@ using System.Globalization; using System.Text; using Microsoft.AspNetCore.Http; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public static class ReasonPhrases { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/RequestProcessingStatus.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/RequestProcessingStatus.cs index e8ebb73784..f6e4248047 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/RequestProcessingStatus.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/RequestProcessingStatus.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public enum RequestProcessingStatus { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/RequestRejectionReason.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/RequestRejectionReason.cs index 33aec0fc67..e6b70b7551 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/RequestRejectionReason.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/RequestRejectionReason.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { public enum RequestRejectionReason { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/TransferCoding.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/TransferCoding.cs index 3bfa8cc74b..39c52ba6aa 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/TransferCoding.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/TransferCoding.cs @@ -3,7 +3,7 @@ using System; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { [Flags] public enum TransferCoding diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/AsciiUtilities.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/AsciiUtilities.cs index 1959ca23d9..5a95493a28 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/AsciiUtilities.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/AsciiUtilities.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure { internal class AsciiUtilities { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/CancellationTokenExtensions.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/CancellationTokenExtensions.cs index 1d4275a314..c5d0392f00 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/CancellationTokenExtensions.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/CancellationTokenExtensions.cs @@ -4,7 +4,7 @@ using System; using System.Threading; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure { internal static class CancellationTokenExtensions { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/Constants.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/Constants.cs index f18246c655..8b22cd7cc4 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/Constants.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/Constants.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure { internal static class Constants { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/CorrelationIdGenerator.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/CorrelationIdGenerator.cs index 81233b3a3f..fc161d4116 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/CorrelationIdGenerator.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/CorrelationIdGenerator.cs @@ -4,7 +4,7 @@ using System; using System.Threading; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure { internal static class CorrelationIdGenerator { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/Disposable.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/Disposable.cs index fb0e68855f..620e749fe6 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/Disposable.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/Disposable.cs @@ -3,7 +3,7 @@ using System; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure { /// /// Summary description for Disposable diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/DisposableAction.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/DisposableAction.cs index 4336437ae9..ff65931e24 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/DisposableAction.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/DisposableAction.cs @@ -4,7 +4,7 @@ using System; using System.Threading; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure { internal class DisposableAction : IDisposable { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/HttpUtilities.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/HttpUtilities.cs index b4dafbd3a7..8e42f383e7 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/HttpUtilities.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/HttpUtilities.cs @@ -6,9 +6,9 @@ using System.Diagnostics; using System.Runtime.CompilerServices; using System.Text; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure { public static class HttpUtilities { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/IKestrelTrace.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/IKestrelTrace.cs index 6fc3c610fb..f14c1b33c7 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/IKestrelTrace.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/IKestrelTrace.cs @@ -4,7 +4,7 @@ using System; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure { public interface IKestrelTrace : ILogger { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/ISystemClock.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/ISystemClock.cs index 0cf54d7e64..e29312dda8 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/ISystemClock.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/ISystemClock.cs @@ -3,7 +3,7 @@ using System; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure { /// /// Abstracts the system clock to facilitate testing. diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/IThreadPool.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/IThreadPool.cs index 48db68ff10..9f9037630f 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/IThreadPool.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/IThreadPool.cs @@ -6,7 +6,7 @@ using System.IO.Pipelines; using System.Threading; using System.Threading.Tasks; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure { public interface IThreadPool : IScheduler { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/InlineLoggingThreadPool.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/InlineLoggingThreadPool.cs index 8945ec0827..b81bbfab0a 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/InlineLoggingThreadPool.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/InlineLoggingThreadPool.cs @@ -6,7 +6,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure { public class InlineLoggingThreadPool : IThreadPool { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/KestrelEventSource.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/KestrelEventSource.cs index 18f1ab33fa..2e1b942de3 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/KestrelEventSource.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/KestrelEventSource.cs @@ -3,10 +3,10 @@ using System.Diagnostics.Tracing; using System.Runtime.CompilerServices; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure { [EventSource(Name = "Microsoft-AspNetCore-Server-Kestrel")] public sealed class KestrelEventSource : EventSource diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/KestrelTrace.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/KestrelTrace.cs index fb9a0a4736..cc7204e203 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/KestrelTrace.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/KestrelTrace.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal { /// /// Summary description for KestrelTrace diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/LoggingThreadPool.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/LoggingThreadPool.cs index d0cff5e9ac..6fcad137fd 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/LoggingThreadPool.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/LoggingThreadPool.cs @@ -6,7 +6,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure { public class LoggingThreadPool : IThreadPool { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/Streams.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/Streams.cs index 18712eed2f..61654b3e56 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/Streams.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/Streams.cs @@ -1,9 +1,9 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure { class Streams { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/SystemClock.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/SystemClock.cs index eb4e7e099e..1284ef9f4f 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/SystemClock.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/SystemClock.cs @@ -3,7 +3,7 @@ using System; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure { /// /// Provides access to the normal system clock. diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/UriUtilities.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/UriUtilities.cs index defcb9eb4f..272b30cabf 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/UriUtilities.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Infrastructure/UriUtilities.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure { public class UriUtilities { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/InternalKestrelServerOptions.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/InternalKestrelServerOptions.cs index e8d98268cd..68b8808ddc 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/InternalKestrelServerOptions.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/InternalKestrelServerOptions.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.AspNetCore.Server.Kestrel.Internal +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal { public class InternalKestrelServerOptions { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/KestrelServerOptionsSetup.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/KestrelServerOptionsSetup.cs index 93fda55f07..18c96e2039 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/KestrelServerOptionsSetup.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/KestrelServerOptionsSetup.cs @@ -4,7 +4,7 @@ using System; using Microsoft.Extensions.Options; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal { public class KestrelServerOptionsSetup : IConfigureOptions { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/ServiceContext.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/ServiceContext.cs index 3c3750c6c2..41a37f2fe5 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/ServiceContext.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/ServiceContext.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal { public class ServiceContext { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServer.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServer.cs index 921d77fa78..d84f6f7a19 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServer.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServer.cs @@ -12,14 +12,13 @@ using Microsoft.AspNetCore.Hosting.Server; using Microsoft.AspNetCore.Hosting.Server.Features; using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace Microsoft.AspNetCore.Server.Kestrel +namespace Microsoft.AspNetCore.Server.Kestrel.Core { public class KestrelServer : IServer { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServerLimits.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServerLimits.cs index ac8a047542..b42d2db6a9 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServerLimits.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServerLimits.cs @@ -3,7 +3,7 @@ using System; -namespace Microsoft.AspNetCore.Server.Kestrel +namespace Microsoft.AspNetCore.Server.Kestrel.Core { public class KestrelServerLimits { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServerOptions.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServerOptions.cs index ca53bb1d49..b9a712e0ca 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServerOptions.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServerOptions.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; using System.Net; -namespace Microsoft.AspNetCore.Server.Kestrel +namespace Microsoft.AspNetCore.Server.Kestrel.Core { /// /// Provides programmatic configuration of Kestrel-specific features. diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/ListenOptions.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/ListenOptions.cs index 5fadb48fb4..8777ba98bc 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/ListenOptions.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/ListenOptions.cs @@ -4,10 +4,10 @@ using System; using System.Collections.Generic; using System.Net; -using Microsoft.AspNetCore.Server.Kestrel.Adapter; +using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; -namespace Microsoft.AspNetCore.Server.Kestrel +namespace Microsoft.AspNetCore.Server.Kestrel.Core { /// /// Describes either an , Unix domain socket path, or a file descriptor for an already open diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/ServerAddress.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/ServerAddress.cs index 7836c0658e..4f64268087 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/ServerAddress.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/ServerAddress.cs @@ -4,9 +4,9 @@ using System; using System.Diagnostics; using System.Globalization; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; -namespace Microsoft.AspNetCore.Server.Kestrel +namespace Microsoft.AspNetCore.Server.Kestrel.Core { public class ServerAddress { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Systemd/KesterlServerOptionsSystemdExtensions.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Systemd/KesterlServerOptionsSystemdExtensions.cs index ca24796a65..e26b4d4cc0 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Core/Systemd/KesterlServerOptionsSystemdExtensions.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Core/Systemd/KesterlServerOptionsSystemdExtensions.cs @@ -4,7 +4,7 @@ using System; using System.Diagnostics; using System.Globalization; -using Microsoft.AspNetCore.Server.Kestrel; +using Microsoft.AspNetCore.Server.Kestrel.Core; namespace Microsoft.AspNetCore.Hosting { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Https/HttpsConnectionAdapter.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Https/HttpsConnectionAdapter.cs index d56d440512..7f5aa71eb0 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Https/HttpsConnectionAdapter.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Https/HttpsConnectionAdapter.cs @@ -7,7 +7,7 @@ using System.Net.Security; using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Server.Kestrel.Adapter; +using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter; using Microsoft.AspNetCore.Server.Kestrel.Https.Internal; using Microsoft.Extensions.Logging; diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Https/ListenOptionsHttpsExtensions.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Https/ListenOptionsHttpsExtensions.cs index f757beb3b5..856c91a1c2 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Https/ListenOptionsHttpsExtensions.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Https/ListenOptionsHttpsExtensions.cs @@ -3,7 +3,7 @@ using System.IO; using System.Security.Cryptography.X509Certificates; -using Microsoft.AspNetCore.Server.Kestrel; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.AspNetCore.Server.Kestrel.Https; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/IAsyncDisposable.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/IAsyncDisposable.cs similarity index 79% rename from src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/IAsyncDisposable.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/IAsyncDisposable.cs index 0a6115a6dd..8c98c2127c 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/IAsyncDisposable.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/IAsyncDisposable.cs @@ -3,7 +3,7 @@ using System.Threading.Tasks; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal { interface IAsyncDisposable { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/ILibuvTrace.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/ILibuvTrace.cs similarity index 97% rename from src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/ILibuvTrace.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/ILibuvTrace.cs index 432d5370a1..6f9d2c289a 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/ILibuvTrace.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/ILibuvTrace.cs @@ -4,7 +4,7 @@ using System; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal { public interface ILibuvTrace : ILogger { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/LibuvAwaitable.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvAwaitable.cs similarity index 93% rename from src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/LibuvAwaitable.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvAwaitable.cs index 110c1316f1..da1a8661ef 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/LibuvAwaitable.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvAwaitable.cs @@ -5,9 +5,9 @@ using System; using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal { public class LibuvAwaitable : ICriticalNotifyCompletion where TRequest : UvRequest { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/Connection.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvConnection.cs similarity index 89% rename from src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/Connection.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvConnection.cs index 66c88f630a..01aa2b24e1 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/Connection.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvConnection.cs @@ -7,15 +7,13 @@ using System.IO; using System.IO.Pipelines; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal { - public class Connection : ConnectionContext, ITimeoutControl + public class LibuvConnection : LibuvConnectionContext, ITimeoutControl { private const int MinAllocBufferSize = 2048; @@ -35,7 +33,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http private TimeoutAction _timeoutAction; private WritableBuffer? _currentWritableBuffer; - public Connection(ListenerContext context, UvStreamHandle socket) : base(context) + public LibuvConnection(ListenerContext context, UvStreamHandle socket) : base(context) { _socket = socket; socket.Connection = this; @@ -52,17 +50,17 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http } // For testing - public Connection() + public LibuvConnection() { } public string ConnectionId { get; set; } public IPipeWriter Input { get; set; } - public SocketOutputConsumer Output { get; set; } + public LibuvOutputConsumer Output { get; set; } private ILibuvTrace Log => ListenerContext.TransportContext.Log; private IConnectionHandler ConnectionHandler => ListenerContext.TransportContext.ConnectionHandler; - private KestrelThread Thread => ListenerContext.Thread; + private LibuvThread Thread => ListenerContext.Thread; public void Start() { @@ -72,7 +70,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http ConnectionId = _connectionContext.ConnectionId; Input = _connectionContext.Input; - Output = new SocketOutputConsumer(_connectionContext.Output, Thread, _socket, this, ConnectionId, Log); + Output = new LibuvOutputConsumer(_connectionContext.Output, Thread, _socket, this, ConnectionId, Log); // Start socket prior to applying the ConnectionAdapter _socket.ReadStart(_allocCallback, _readCallback, this); @@ -132,7 +130,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http private static LibuvFunctions.uv_buf_t AllocCallback(UvStreamHandle handle, int suggestedSize, object state) { - return ((Connection)state).OnAlloc(handle, suggestedSize); + return ((LibuvConnection)state).OnAlloc(handle, suggestedSize); } private unsafe LibuvFunctions.uv_buf_t OnAlloc(UvStreamHandle handle, int suggestedSize) @@ -151,13 +149,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http private static void ReadCallback(UvStreamHandle handle, int status, object state) { - ((Connection)state).OnRead(handle, status); + ((LibuvConnection)state).OnRead(handle, status); } private async void OnRead(UvStreamHandle handle, int status) { var normalRead = status >= 0; - var normalDone = status == Constants.EOF; + var normalDone = status == LibuvConstants.EOF; var errorDone = !(normalDone || normalRead); var readCount = normalRead ? status : 0; @@ -183,7 +181,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http handle.Libuv.Check(status, out uvError); // Log connection resets at a lower (Debug) level. - if (status == Constants.ECONNRESET) + if (status == LibuvConstants.ECONNRESET) { Log.ConnectionReset(ConnectionId); error = new ConnectionResetException(uvError.Message, uvError); @@ -273,8 +271,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http { _timeoutAction = timeoutAction; - // Add KestrelThread.HeartbeatMilliseconds extra milliseconds since this can be called right before the next heartbeat. - Interlocked.Exchange(ref _timeoutTimestamp, _lastTimestamp + milliseconds + KestrelThread.HeartbeatMilliseconds); + // Add LibuvThread.HeartbeatMilliseconds extra milliseconds since this can be called right before the next heartbeat. + Interlocked.Exchange(ref _timeoutTimestamp, _lastTimestamp + milliseconds + LibuvThread.HeartbeatMilliseconds); } } } diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/ConnectionContext.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvConnectionContext.cs similarity index 77% rename from src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/ConnectionContext.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvConnectionContext.cs index 25b64697b9..b1a198c8f8 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/ConnectionContext.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvConnectionContext.cs @@ -5,15 +5,15 @@ using System.IO.Pipelines; using System.Net; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal { - public class ConnectionContext : IConnectionInformation + public class LibuvConnectionContext : IConnectionInformation { - public ConnectionContext() + public LibuvConnectionContext() { } - public ConnectionContext(ListenerContext context) + public LibuvConnectionContext(ListenerContext context) { ListenerContext = context; } diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/ConnectionManager.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvConnectionManager.cs similarity index 79% rename from src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/ConnectionManager.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvConnectionManager.cs index 302887aa8a..14f314510d 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/ConnectionManager.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvConnectionManager.cs @@ -4,15 +4,15 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal { - public class ConnectionManager + public class LibuvConnectionManager { - private readonly KestrelThread _thread; + private readonly LibuvThread _thread; - public ConnectionManager(KestrelThread thread) + public LibuvConnectionManager(LibuvThread thread) { _thread = thread; } @@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http return await WalkConnectionsAsync((connectionManager, tcs) => connectionManager.WalkConnectionsAndAbortCore(tcs), timeout).ConfigureAwait(false); } - private async Task WalkConnectionsAsync(Action> action, TimeSpan timeout) + private async Task WalkConnectionsAsync(Action> action, TimeSpan timeout) { var tcs = new TaskCompletionSource(); @@ -46,7 +46,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http WalkConnectionsCore(connection => connection.AbortAsync(), tcs); } - private void WalkConnectionsCore(Func action, TaskCompletionSource tcs) + private void WalkConnectionsCore(Func action, TaskCompletionSource tcs) { var tasks = new List(); diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/Constants.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvConstants.cs similarity index 92% rename from src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/Constants.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvConstants.cs index 10836774a1..70424f7b0c 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/Constants.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvConstants.cs @@ -3,9 +3,9 @@ using System.Runtime.InteropServices; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal { - internal static class Constants + internal static class LibuvConstants { public const int ListenBacklog = 128; diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/SocketOutputConsumer.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvOutputConsumer.cs similarity index 88% rename from src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/SocketOutputConsumer.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvOutputConsumer.cs index 7087a46e79..e96cf35d85 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/SocketOutputConsumer.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvOutputConsumer.cs @@ -4,28 +4,26 @@ using System; using System.IO.Pipelines; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal { - public class SocketOutputConsumer + public class LibuvOutputConsumer { - private readonly KestrelThread _thread; + private readonly LibuvThread _thread; private readonly UvStreamHandle _socket; - private readonly Connection _connection; + private readonly LibuvConnection _connection; private readonly string _connectionId; private readonly ILibuvTrace _log; private readonly WriteReqPool _writeReqPool; private readonly IPipeReader _pipe; - public SocketOutputConsumer( + public LibuvOutputConsumer( IPipeReader pipe, - KestrelThread thread, + LibuvThread thread, UvStreamHandle socket, - Connection connection, + LibuvConnection connection, string connectionId, ILibuvTrace log) { @@ -104,7 +102,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http else { // Log connection resets at a lower (Debug) level. - if (status == Constants.ECONNRESET) + if (status == LibuvConstants.ECONNRESET) { _log.ConnectionReset(_connectionId); } diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/KestrelThread.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvThread.cs similarity index 89% rename from src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/KestrelThread.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvThread.cs index fd3162f6ce..aee08aa862 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/KestrelThread.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvThread.cs @@ -9,18 +9,12 @@ using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal { - /// - /// Summary description for KestrelThread - /// - public class KestrelThread : IScheduler + public class LibuvThread : IScheduler { public const long HeartbeatMilliseconds = 1000; @@ -28,8 +22,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal { var streamHandle = UvMemory.FromIntPtr(ptr) as UvStreamHandle; var thisHandle = GCHandle.FromIntPtr(arg); - var kestrelThread = (KestrelThread)thisHandle.Target; - streamHandle?.Connection?.Tick(kestrelThread.Now); + var libuvThread = (LibuvThread)thisHandle.Target; + streamHandle?.Connection?.Tick(libuvThread.Now); }; // maximum times the work queues swapped and are processed in a single pass @@ -37,7 +31,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal // otherwise it needs to wait till the next pass of the libuv loop private readonly int _maxLoops = 8; - private readonly KestrelEngine _engine; + private readonly LibuvTransport _transport; private readonly IApplicationLifetime _appLifetime; private readonly Thread _thread; private readonly TaskCompletionSource _threadTcs = new TaskCompletionSource(); @@ -57,16 +51,16 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal private readonly TimeSpan _shutdownTimeout; private IntPtr _thisPtr; - public KestrelThread(KestrelEngine engine) + public LibuvThread(LibuvTransport transport) { - _engine = engine; - _appLifetime = engine.AppLifetime; - _log = engine.Log; - _shutdownTimeout = engine.TransportOptions.ShutdownTimeout; + _transport = transport; + _appLifetime = transport.AppLifetime; + _log = transport.Log; + _shutdownTimeout = transport.TransportOptions.ShutdownTimeout; _loop = new UvLoopHandle(_log); _post = new UvAsyncHandle(_log); _thread = new Thread(ThreadStart); - _thread.Name = "KestrelThread - libuv"; + _thread.Name = nameof(LibuvThread); _heartbeatTimer = new UvTimerHandle(_log); #if !DEBUG // Mark the thread as being as unimportant to keeping the process alive. @@ -77,12 +71,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal QueueCloseAsyncHandle = EnqueueCloseHandle; PipelineFactory = new PipeFactory(); WriteReqPool = new WriteReqPool(this, _log); - ConnectionManager = new ConnectionManager(this); + ConnectionManager = new LibuvConnectionManager(this); } // For testing - public KestrelThread(KestrelEngine engine, int maxLoops) - : this(engine) + public LibuvThread(LibuvTransport transport, int maxLoops) + : this(transport) { _maxLoops = maxLoops; } @@ -91,7 +85,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal public PipeFactory PipelineFactory { get; } - public ConnectionManager ConnectionManager { get; } + public LibuvConnectionManager ConnectionManager { get; } public WriteReqPool WriteReqPool { get; } @@ -140,7 +134,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal Post(t => t.OnStopImmediate()); if (!await WaitAsync(_threadTcs.Task, stepTimeout).ConfigureAwait(false)) { - _log.LogCritical("KestrelThread.StopAsync failed to terminate libuv thread."); + _log.LogCritical($"{nameof(LibuvThread)}.{nameof(StopAsync)} failed to terminate libuv thread."); } } } @@ -149,7 +143,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal // Until we rework this logic, ODEs are bound to happen sometimes. if (!await WaitAsync(_threadTcs.Task, stepTimeout).ConfigureAwait(false)) { - _log.LogCritical("KestrelThread.StopAsync failed to terminate libuv thread."); + _log.LogCritical($"{nameof(LibuvThread)}.{nameof(StopAsync)} failed to terminate libuv thread."); } } } @@ -236,7 +230,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal _post.Send(); } - private void Post(Action callback) + private void Post(Action callback) { Post(callback, this); } @@ -265,7 +259,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal private void Walk(LibuvFunctions.uv_walk_cb callback, IntPtr arg) { - _engine.Libuv.walk( + _transport.Libuv.walk( _loop, callback, arg @@ -293,7 +287,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal var tcs = (TaskCompletionSource)parameter; try { - _loop.Init(_engine.Libuv); + _loop.Init(_transport.Libuv); _post.Init(_loop, OnPost, EnqueueCloseHandle); _heartbeatTimer.Init(_loop, EnqueueCloseHandle); _heartbeatTimer.Start(OnHeartbeat, timeout: HeartbeatMilliseconds, repeat: HeartbeatMilliseconds); @@ -391,7 +385,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal } catch (Exception e) { - _log.LogError(0, e, "KestrelThread.DoPostWork"); + _log.LogError(0, e, $"{nameof(LibuvThread)}.{nameof(DoPostWork)}"); } }, work.Completion); } @@ -408,13 +402,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal } catch (Exception e) { - _log.LogError(0, e, "KestrelThread.DoPostWork"); + _log.LogError(0, e, $"{nameof(LibuvThread)}.{nameof(DoPostWork)}"); } }, work.Completion); } else { - _log.LogError(0, ex, "KestrelThread.DoPostWork"); + _log.LogError(0, ex, $"{nameof(LibuvThread)}.{nameof(DoPostWork)}"); throw; } } @@ -444,7 +438,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal } catch (Exception ex) { - _log.LogError(0, ex, "KestrelThread.DoPostCloseHandle"); + _log.LogError(0, ex, $"{nameof(LibuvThread)}.{nameof(DoPostCloseHandle)}"); throw; } } diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/LibuvTrace.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvTrace.cs similarity index 99% rename from src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/LibuvTrace.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvTrace.cs index d113bf2010..93623918d9 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/LibuvTrace.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvTrace.cs @@ -4,7 +4,7 @@ using System; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal { public class LibuvTrace : ILibuvTrace { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvTransportContext.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvTransportContext.cs index df8a8b1275..78f21248c2 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvTransportContext.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/LibuvTransportContext.cs @@ -2,9 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/Listener.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Listener.cs similarity index 91% rename from src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/Listener.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Listener.cs index ca4b780510..aa03493751 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/Listener.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Listener.cs @@ -3,14 +3,11 @@ using System; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal { /// /// Base class for listeners in Kestrel. Listens for incoming connections @@ -29,7 +26,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http public Task StartAsync( IEndPointInformation endPointInformation, - KestrelThread thread) + LibuvThread thread) { EndPointInformation = endPointInformation; Thread = thread; @@ -43,7 +40,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http { var listener = ((Listener) tcs2.Task.AsyncState); listener.ListenSocket = listener.CreateListenSocket(); - ListenSocket.Listen(Constants.ListenBacklog, ConnectionCallback, this); + ListenSocket.Listen(LibuvConstants.ListenBacklog, ConnectionCallback, this); tcs2.SetResult(0); } catch (Exception ex) @@ -148,7 +145,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http protected virtual void DispatchConnection(UvStreamHandle socket) { - var connection = new Connection(this, socket); + var connection = new LibuvConnection(this, socket); connection.Start(); } @@ -156,7 +153,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http { // Ensure the event loop is still running. // If the event loop isn't running and we try to wait on this Post - // to complete, then KestrelEngine will never be disposed and + // to complete, then LibuvTransport will never be disposed and // the exception that stopped the event loop will never be surfaced. if (Thread.FatalError == null && ListenSocket != null) { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/ListenerContext.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/ListenerContext.cs similarity index 89% rename from src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/ListenerContext.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/ListenerContext.cs index f0bb7b5b3a..b3b30328b5 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/ListenerContext.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/ListenerContext.cs @@ -2,11 +2,10 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal { public class ListenerContext { @@ -19,7 +18,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http public IEndPointInformation EndPointInformation { get; set; } - public KestrelThread Thread { get; set; } + public LibuvThread Thread { get; set; } /// /// Creates a socket which can be used to accept an incoming connection. diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/ListenerPrimary.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/ListenerPrimary.cs similarity index 97% rename from src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/ListenerPrimary.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/ListenerPrimary.cs index eebcd96e6d..7ebe34b709 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/ListenerPrimary.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/ListenerPrimary.cs @@ -6,13 +6,11 @@ using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal { /// /// A primary listener waits for incoming connections on a specified socket. Incoming @@ -41,7 +39,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http string pipeName, byte[] pipeMessage, IEndPointInformation endPointInformation, - KestrelThread thread) + LibuvThread thread) { _pipeName = pipeName; _pipeMessage = pipeMessage; @@ -64,7 +62,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http ListenPipe = new UvPipeHandle(Log); ListenPipe.Init(Thread.Loop, Thread.QueueCloseHandle, false); ListenPipe.Bind(_pipeName); - ListenPipe.Listen(Constants.ListenBacklog, + ListenPipe.Listen(LibuvConstants.ListenBacklog, (pipe, status, error, state) => ((ListenerPrimary)state).OnListenPipe(pipe, status, error), this); } diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/ListenerSecondary.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/ListenerSecondary.cs similarity index 92% rename from src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/ListenerSecondary.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/ListenerSecondary.cs index 506832a72d..25c7d1ab6d 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Http/ListenerSecondary.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/ListenerSecondary.cs @@ -5,14 +5,11 @@ using System; using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal { /// /// A secondary listener is delegated requests from a primary listener via a named pipe or @@ -39,7 +36,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http string pipeName, byte[] pipeMessage, IEndPointInformation endPointInformation, - KestrelThread thread) + LibuvThread thread) { _pipeName = pipeName; _pipeMessage = pipeMessage; @@ -130,7 +127,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http { if (status < 0) { - if (status != Constants.EOF) + if (status != LibuvConstants.EOF) { Exception ex; Thread.Loop.Libuv.Check(status, out ex); @@ -161,7 +158,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http try { - var connection = new Connection(this, acceptSocket); + var connection = new LibuvConnection(this, acceptSocket); connection.Start(); } catch (UvException ex) @@ -184,7 +181,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http { // Ensure the event loop is still running. // If the event loop isn't running and we try to wait on this Post - // to complete, then KestrelEngine will never be disposed and + // to complete, then LibuvTransport will never be disposed and // the exception that stopped the event loop will never be surfaced. if (Thread.FatalError == null) { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/Libuv.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/LibuvFunctions.cs similarity index 99% rename from src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/Libuv.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/LibuvFunctions.cs index b527524b6c..1d3cbccb96 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/Libuv.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/LibuvFunctions.cs @@ -5,7 +5,7 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking { public class LibuvFunctions { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/PlatformApis.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/PlatformApis.cs index 5bb37f60a9..ffc7619d73 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/PlatformApis.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/PlatformApis.cs @@ -6,7 +6,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Threading; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking { public static class PlatformApis { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/SockAddr.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/SockAddr.cs index 71e7c59b32..0f0210f91a 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/SockAddr.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/SockAddr.cs @@ -4,7 +4,7 @@ using System.Net; using System.Runtime.InteropServices; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking { [StructLayout(LayoutKind.Sequential)] public struct SockAddr diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvAsyncHandle.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvAsyncHandle.cs index 141ca6dcb7..d68a79c4ca 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvAsyncHandle.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvAsyncHandle.cs @@ -4,10 +4,8 @@ using System; using System.Diagnostics; using System.Threading; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking { public class UvAsyncHandle : UvHandle { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvConnectRequest.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvConnectRequest.cs index 204d8c4ba4..3e29e42520 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvConnectRequest.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvConnectRequest.cs @@ -2,11 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking { /// /// Summary description for UvWriteRequest diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvException.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvException.cs index 5e7b26e998..fa7c4087fe 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvException.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvException.cs @@ -3,7 +3,7 @@ using System; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking { public class UvException : Exception { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvHandle.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvHandle.cs index 41a074ae21..0f33eee7c3 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvHandle.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvHandle.cs @@ -4,10 +4,8 @@ using System; using System.Diagnostics; using System.Threading; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking { public abstract class UvHandle : UvMemory { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvLoopHandle.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvLoopHandle.cs index 39bce92897..c1a47d163d 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvLoopHandle.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvLoopHandle.cs @@ -3,10 +3,8 @@ using System; using System.Threading; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking { public class UvLoopHandle : UvMemory { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvMemory.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvMemory.cs index 3e67b6b399..dcd5fdec2a 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvMemory.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvMemory.cs @@ -1,14 +1,13 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. #define TRACE + using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.Threading; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking { /// /// Summary description for UvMemory diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvPipeHandle.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvPipeHandle.cs index 0ce7e1fe27..338cc1f643 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvPipeHandle.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvPipeHandle.cs @@ -2,10 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking { public class UvPipeHandle : UvStreamHandle { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvRequest.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvRequest.cs index 20a285304f..3826ea9cde 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvRequest.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvRequest.cs @@ -1,9 +1,10 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + using System; using System.Runtime.InteropServices; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking { public class UvRequest : UvMemory { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvShutdownReq.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvShutdownReq.cs index 9d13b715b7..726d1b9867 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvShutdownReq.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvShutdownReq.cs @@ -2,10 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking { /// /// Summary description for UvShutdownRequest diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvStreamHandle.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvStreamHandle.cs index ee3b3abc7f..714ddfbc0e 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvStreamHandle.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvStreamHandle.cs @@ -3,12 +3,9 @@ using System; using System.Runtime.InteropServices; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking { public abstract class UvStreamHandle : UvHandle { @@ -30,7 +27,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking { } - public Connection Connection { get; set; } + public LibuvConnection Connection { get; set; } protected override bool ReleaseHandle() { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvTcpHandle.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvTcpHandle.cs index 2c794509ae..260f04598e 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvTcpHandle.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvTcpHandle.cs @@ -4,10 +4,8 @@ using System; using System.Net; using System.Runtime.InteropServices; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking { public class UvTcpHandle : UvStreamHandle { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvTimerHandle.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvTimerHandle.cs index 77c288ae8c..85547e7d69 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvTimerHandle.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvTimerHandle.cs @@ -2,11 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking { public class UvTimerHandle : UvHandle { diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvWriteReq.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvWriteReq.cs index f680aa5892..0f5edff121 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvWriteReq.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Networking/UvWriteReq.cs @@ -6,11 +6,9 @@ using System.Buffers; using System.Collections.Generic; using System.IO.Pipelines; using System.Runtime.InteropServices; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Networking +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking { /// /// Summary description for UvWriteRequest diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/WriteReqPool.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/WriteReqPool.cs similarity index 80% rename from src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/WriteReqPool.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/WriteReqPool.cs index dc83eae51c..9a7ad2532a 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/Infrastructure/WriteReqPool.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/Internal/WriteReqPool.cs @@ -1,20 +1,22 @@ -using System; -using System.Collections.Generic; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; + +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal { public class WriteReqPool { private const int _maxPooledWriteReqs = 1024; - private readonly KestrelThread _thread; + private readonly LibuvThread _thread; private readonly Queue _pool = new Queue(_maxPooledWriteReqs); private readonly ILibuvTrace _log; private bool _disposed; - public WriteReqPool(KestrelThread thread, ILibuvTrace log) + public WriteReqPool(LibuvThread thread, ILibuvTrace log) { _thread = thread; _log = log; diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/KestrelEngine.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/LibuvTransport.cs similarity index 85% rename from src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/KestrelEngine.cs rename to src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/LibuvTransport.cs index 2763dce1c6..bf23beeb0e 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/KestrelEngine.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/LibuvTransport.cs @@ -6,29 +6,25 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv; using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal +namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv { - public class KestrelEngine : ITransport + public class LibuvTransport : ITransport { private readonly IEndPointInformation _endPointInformation; private readonly List _listeners = new List(); - public KestrelEngine(LibuvTransportContext context, IEndPointInformation endPointInformation) + public LibuvTransport(LibuvTransportContext context, IEndPointInformation endPointInformation) : this(new LibuvFunctions(), context, endPointInformation) { } // For testing - public KestrelEngine(LibuvFunctions uv, LibuvTransportContext context, IEndPointInformation endPointInformation) + public LibuvTransport(LibuvFunctions uv, LibuvTransportContext context, IEndPointInformation endPointInformation) { Libuv = uv; TransportContext = context; @@ -38,7 +34,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal public LibuvFunctions Libuv { get; } public LibuvTransportContext TransportContext { get; } - public List Threads { get; } = new List(); + public List Threads { get; } = new List(); public IApplicationLifetime AppLifetime => TransportContext.AppLifetime; public ILibuvTrace Log => TransportContext.Log; @@ -78,7 +74,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal // TODO: Split endpoint management from thread management for (var index = 0; index < TransportOptions.ThreadCount; index++) { - Threads.Add(new KestrelThread(this)); + Threads.Add(new LibuvThread(this)); } foreach (var thread in Threads) @@ -111,7 +107,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal } } } - catch (UvException ex) when (ex.StatusCode == Constants.EADDRINUSE) + catch (UvException ex) when (ex.StatusCode == LibuvConstants.EADDRINUSE) { await UnbindAsync().ConfigureAwait(false); throw new AddressInUseException(ex.Message, ex); diff --git a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/LibuvTransportFactory.cs b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/LibuvTransportFactory.cs index a05f2972ba..0a2d909580 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/LibuvTransportFactory.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv/LibuvTransportFactory.cs @@ -3,11 +3,8 @@ using System; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Server.Kestrel.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -47,12 +44,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv "ThreadCount must be positive."); } - if (!Constants.ECONNRESET.HasValue) + if (!LibuvConstants.ECONNRESET.HasValue) { trace.LogWarning("Unable to determine ECONNRESET value on this platform."); } - if (!Constants.EADDRINUSE.HasValue) + if (!LibuvConstants.EADDRINUSE.HasValue) { trace.LogWarning("Unable to determine EADDRINUSE value on this platform."); } @@ -75,7 +72,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv ConnectionHandler = handler }; - return new KestrelEngine(transportContext, endPointInformation); + return new LibuvTransport(transportContext, endPointInformation); } } } diff --git a/src/Microsoft.AspNetCore.Server.Kestrel/WebHostBuilderKestrelExtensions.cs b/src/Microsoft.AspNetCore.Server.Kestrel/WebHostBuilderKestrelExtensions.cs index a40b2ec8ae..3d3dad73cb 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel/WebHostBuilderKestrelExtensions.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel/WebHostBuilderKestrelExtensions.cs @@ -3,8 +3,8 @@ using System; using Microsoft.AspNetCore.Hosting.Server; -using Microsoft.AspNetCore.Server.Kestrel; -using Microsoft.AspNetCore.Server.Kestrel.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs index 1abb18fe40..1849113b0a 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs @@ -15,7 +15,8 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting.Server.Features; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Extensions; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Testing; using Microsoft.AspNetCore.Testing.xunit; using Microsoft.Extensions.DependencyInjection; diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/BadHttpRequestTests.cs b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/BadHttpRequestTests.cs index 89deac4fa3..4c59212c6c 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/BadHttpRequestTests.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/BadHttpRequestTests.cs @@ -5,8 +5,9 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Internal; using Microsoft.Extensions.Logging; diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/EventSourceTests.cs b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/EventSourceTests.cs index 74180ccbab..a0124e51a7 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/EventSourceTests.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/EventSourceTests.cs @@ -8,7 +8,7 @@ using System.Diagnostics.Tracing; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Testing; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/KeepAliveTimeoutTests.cs b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/KeepAliveTimeoutTests.cs index 0648c1bf57..28e4ece5d8 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/KeepAliveTimeoutTests.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/KeepAliveTimeoutTests.cs @@ -7,6 +7,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.AspNetCore.Testing; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/MaxRequestLineSizeTests.cs b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/MaxRequestLineSizeTests.cs index 1f6e95e767..8e3dd5d22e 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/MaxRequestLineSizeTests.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/MaxRequestLineSizeTests.cs @@ -3,6 +3,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.AspNetCore.Testing; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/RequestHeaderLimitsTests.cs b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/RequestHeaderLimitsTests.cs index 8c62cc0971..65b4eaaef8 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/RequestHeaderLimitsTests.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/RequestHeaderLimitsTests.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Primitives; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/RequestHeadersTimeoutTests.cs b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/RequestHeadersTimeoutTests.cs index b80a637058..e3807704a7 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/RequestHeadersTimeoutTests.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/RequestHeadersTimeoutTests.cs @@ -5,6 +5,7 @@ using System; using System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.AspNetCore.Testing; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/RequestTests.cs b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/RequestTests.cs index 9dc073f100..a8d20e1d69 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/RequestTests.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/RequestTests.cs @@ -15,7 +15,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; using Microsoft.AspNetCore.Testing; using Microsoft.AspNetCore.Testing.xunit; using Microsoft.Extensions.DependencyInjection; diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/ResponseTests.cs b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/ResponseTests.cs index 2b2854df79..d68624bd3b 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/ResponseTests.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/ResponseTests.cs @@ -13,8 +13,9 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Internal; using Microsoft.Extensions.Logging; diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/DotSegmentRemovalBenchmark.cs b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/DotSegmentRemovalBenchmark.cs index eb626280d1..5e65f9aa03 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/DotSegmentRemovalBenchmark.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/DotSegmentRemovalBenchmark.cs @@ -4,7 +4,7 @@ using System; using System.Text; using BenchmarkDotNet.Attributes; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; namespace Microsoft.AspNetCore.Server.Kestrel.Performance { diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/FrameParsingOverheadBenchmark.cs b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/FrameParsingOverheadBenchmark.cs index a3d0092638..f98d7b7c56 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/FrameParsingOverheadBenchmark.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/FrameParsingOverheadBenchmark.cs @@ -5,8 +5,9 @@ using System; using System.IO.Pipelines; using System.Text; using BenchmarkDotNet.Attributes; -using Microsoft.AspNetCore.Server.Kestrel.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; namespace Microsoft.AspNetCore.Server.Kestrel.Performance { diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/FrameWritingBenchmark.cs b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/FrameWritingBenchmark.cs index ae41da1959..c0762e0d82 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/FrameWritingBenchmark.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/FrameWritingBenchmark.cs @@ -6,8 +6,9 @@ using System.IO.Pipelines; using System.Threading; using System.Threading.Tasks; using BenchmarkDotNet.Attributes; -using Microsoft.AspNetCore.Server.Kestrel.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Microsoft.AspNetCore.Testing; namespace Microsoft.AspNetCore.Server.Kestrel.Performance diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/KestrelHttpParserBenchmark.cs b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/KestrelHttpParserBenchmark.cs index 0a06b448d0..3f6961f030 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/KestrelHttpParserBenchmark.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/KestrelHttpParserBenchmark.cs @@ -4,7 +4,7 @@ using System; using System.IO.Pipelines; using BenchmarkDotNet.Attributes; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; namespace Microsoft.AspNetCore.Server.Kestrel.Performance { diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/KnownStringsBenchmark.cs b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/KnownStringsBenchmark.cs index 2bdc526f9e..e19777aaab 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/KnownStringsBenchmark.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/KnownStringsBenchmark.cs @@ -4,8 +4,8 @@ using System; using System.Text; using BenchmarkDotNet.Attributes; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; namespace Microsoft.AspNetCore.Server.Kestrel.Performance { diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/Mocks/MockTrace.cs b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/Mocks/MockTrace.cs index 915c4805d1..f98d3c15cf 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/Mocks/MockTrace.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/Mocks/MockTrace.cs @@ -2,7 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.Extensions.Logging; namespace Microsoft.AspNetCore.Server.Kestrel.Performance diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/RequestParsingBenchmark.cs b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/RequestParsingBenchmark.cs index 68da390b7a..08507ef3b8 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/RequestParsingBenchmark.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/RequestParsingBenchmark.cs @@ -3,8 +3,9 @@ using System.IO.Pipelines; using BenchmarkDotNet.Attributes; -using Microsoft.AspNetCore.Server.Kestrel.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; namespace Microsoft.AspNetCore.Server.Kestrel.Performance { diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/ResponseHeaderCollectionBenchmark.cs b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/ResponseHeaderCollectionBenchmark.cs index 0d2852dcf3..e1bd6e60dc 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/ResponseHeaderCollectionBenchmark.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/ResponseHeaderCollectionBenchmark.cs @@ -6,8 +6,9 @@ using System.Text; using BenchmarkDotNet.Attributes; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; namespace Microsoft.AspNetCore.Server.Kestrel.Performance { diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/ResponseHeadersWritingBenchmark.cs b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/ResponseHeadersWritingBenchmark.cs index ce2f941c41..b64789dbdb 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.Performance/ResponseHeadersWritingBenchmark.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.Performance/ResponseHeadersWritingBenchmark.cs @@ -8,9 +8,10 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using BenchmarkDotNet.Attributes; -using Microsoft.AspNetCore.Server.Kestrel.Adapter.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Microsoft.AspNetCore.Testing; namespace Microsoft.AspNetCore.Server.Kestrel.Performance @@ -36,7 +37,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance { _frame.Reset(); _frame.StatusCode = 200; - _frame.HttpVersionEnum = Internal.Http.HttpVersion.Http11; + _frame.HttpVersionEnum = HttpVersion.Http11; _frame.KeepAlive = true; Task writeTask = Task.CompletedTask; @@ -128,12 +129,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance ConnectionInformation = new MockConnectionInformation() }; - var socketOutputProducer = new SocketOutputProducer(output.Writer, null, null, null); + var outputProducer = new OutputProducer(output.Writer, null, null, null); var frame = new TestFrame(application: null, context: frameContext) { Input = input.Reader, Output = socketOutput, - LifetimeControl = new ConnectionLifetimeControl(null, output.Reader, socketOutputProducer, serviceContext.Log) + LifetimeControl = new ConnectionLifetimeControl(null, output.Reader, outputProducer, serviceContext.Log) }; frame.Reset(); diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/AsciiDecoding.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/AsciiDecoding.cs index 4e5528d440..8242a6bb43 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/AsciiDecoding.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/AsciiDecoding.cs @@ -3,7 +3,7 @@ using System; using System.Linq; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkWriterTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkWriterTests.cs index d66ac3f60b..d7a7f35770 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkWriterTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkWriterTests.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Text; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkedRequestTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkedRequestTests.cs index f387562c68..0ed47420b9 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkedRequestTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkedRequestTests.cs @@ -8,7 +8,7 @@ using System.Net; using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Server.Kestrel; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Internal; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkedResponseTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkedResponseTests.cs index ed28131ead..c52c1fa5bc 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkedResponseTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/ChunkedResponseTests.cs @@ -7,7 +7,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Server.Kestrel; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.AspNetCore.Testing; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionAdapterTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionAdapterTests.cs index 21d1ab94f4..57e89f56f2 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionAdapterTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionAdapterTests.cs @@ -7,8 +7,8 @@ using System.Net; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Server.Kestrel; -using Microsoft.AspNetCore.Server.Kestrel.Adapter; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter; using Microsoft.AspNetCore.Testing; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionTests.cs index d74cdf6b90..0234cd08c2 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/ConnectionTests.cs @@ -4,9 +4,9 @@ using System; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; using Microsoft.AspNetCore.Server.KestrelTests.TestHelpers; using Microsoft.AspNetCore.Testing; using Xunit; @@ -24,8 +24,8 @@ namespace Microsoft.AspNetCore.Server.KestrelTests var serviceContext = new TestServiceContext(); serviceContext.TransportContext.ConnectionHandler = mockConnectionHandler; - var engine = new KestrelEngine(mockLibuv, serviceContext.TransportContext, null); - var thread = new KestrelThread(engine); + var transport = new LibuvTransport(mockLibuv, serviceContext.TransportContext, null); + var thread = new LibuvThread(transport); try { @@ -37,7 +37,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests Thread = thread }; var socket = new MockSocket(mockLibuv, Thread.CurrentThread.ManagedThreadId, serviceContext.TransportContext.Log); - var connection = new Connection(listenerContext, socket); + var connection = new LibuvConnection(listenerContext, socket); connection.Start(); LibuvFunctions.uv_buf_t ignored; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/CreateIPEndpointTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/CreateIPEndpointTests.cs index a7bb17c55f..e8a3cdfd2c 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/CreateIPEndpointTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/CreateIPEndpointTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Net; -using Microsoft.AspNetCore.Server.Kestrel; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/DateHeaderValueManagerTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/DateHeaderValueManagerTests.cs index 8e9802600b..810814219d 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/DateHeaderValueManagerTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/DateHeaderValueManagerTests.cs @@ -3,7 +3,7 @@ using System; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Microsoft.AspNetCore.Testing; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/EngineTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/EngineTests.cs index eed4aac30e..81a14ee9a1 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/EngineTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/EngineTests.cs @@ -12,9 +12,10 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Server.Kestrel; -using Microsoft.AspNetCore.Server.Kestrel.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Internal; using Xunit; @@ -36,16 +37,16 @@ namespace Microsoft.AspNetCore.Server.KestrelTests }; [Fact] - public async Task EngineCanStartAndStop() + public async Task TransportCanStartAndStop() { var serviceContext = new TestServiceContext(); - // The engine can no longer start threads without binding to an endpoint. - var engine = new KestrelEngine(serviceContext.TransportContext, + // The transport can no longer start threads without binding to an endpoint. + var transport = new LibuvTransport(serviceContext.TransportContext, new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))); - await engine.BindAsync(); - await engine.StopAsync(); + await transport.BindAsync(); + await transport.StopAsync(); } [Theory] @@ -54,11 +55,11 @@ namespace Microsoft.AspNetCore.Server.KestrelTests { var testContext = new TestServiceContext(); testContext.TransportContext.ConnectionHandler = new ConnectionHandler(listenOptions, testContext, new DummyApplication(TestApp.EchoApp)); - var engine = new KestrelEngine(testContext.TransportContext, listenOptions); + var transport = new LibuvTransport(testContext.TransportContext, listenOptions); - await engine.BindAsync(); - await engine.UnbindAsync(); - await engine.StopAsync(); + await transport.BindAsync(); + await transport.UnbindAsync(); + await transport.StopAsync(); } [Theory] @@ -67,9 +68,9 @@ namespace Microsoft.AspNetCore.Server.KestrelTests { var testContext = new TestServiceContext(); testContext.TransportContext.ConnectionHandler = new ConnectionHandler(listenOptions, testContext, new DummyApplication(TestApp.EchoApp)); - var engine = new KestrelEngine(testContext.TransportContext, listenOptions); + var transport = new LibuvTransport(testContext.TransportContext, listenOptions); - await engine.BindAsync(); + await transport.BindAsync(); var socket = TestConnection.CreateConnectedLoopbackSocket(listenOptions.IPEndPoint.Port); var data = "Hello World"; @@ -82,8 +83,8 @@ namespace Microsoft.AspNetCore.Server.KestrelTests } socket.Dispose(); - await engine.UnbindAsync(); - await engine.StopAsync(); + await transport.UnbindAsync(); + await transport.StopAsync(); } [Theory] diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/FrameHeadersTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/FrameHeadersTests.cs index 24ec00d821..06a0b4cc15 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/FrameHeadersTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/FrameHeadersTests.cs @@ -3,7 +3,7 @@ using System; using System.Collections.Generic; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Microsoft.Extensions.Primitives; using Microsoft.Net.Http.Headers; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/FrameRequestHeadersTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/FrameRequestHeadersTests.cs index 006ac65cd1..cc8baef3c6 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/FrameRequestHeadersTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/FrameRequestHeadersTests.cs @@ -5,8 +5,8 @@ using System; using System.Collections.Generic; using System.Text; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Server.Kestrel; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Microsoft.Extensions.Primitives; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/FrameRequestStreamTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/FrameRequestStreamTests.cs index 28f1d800b7..62d6a41ffd 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/FrameRequestStreamTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/FrameRequestStreamTests.cs @@ -4,7 +4,7 @@ using System; using System.IO; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Moq; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/FrameResponseHeadersTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/FrameResponseHeadersTests.cs index d626512420..aea53a5bec 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/FrameResponseHeadersTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/FrameResponseHeadersTests.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Globalization; using System.IO.Pipelines; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Primitives; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/FrameResponseStreamTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/FrameResponseStreamTests.cs index d097ee6161..289125fbfc 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/FrameResponseStreamTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/FrameResponseStreamTests.cs @@ -4,7 +4,7 @@ using System; using System.IO; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Microsoft.AspNetCore.Server.KestrelTests.TestHelpers; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/FrameTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/FrameTests.cs index 5f5f353bb4..f4fd2ae784 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/FrameTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/FrameTests.cs @@ -12,10 +12,10 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting.Server; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Server.Kestrel; -using Microsoft.AspNetCore.Server.Kestrel.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Internal; @@ -248,7 +248,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests public void InitializeStreamsResetsStreams() { // Arrange - var messageBody = MessageBody.For(Kestrel.Internal.Http.HttpVersion.Http11, (FrameRequestHeaders)_frame.RequestHeaders, _frame); + var messageBody = MessageBody.For(Kestrel.Core.Internal.Http.HttpVersion.Http11, (FrameRequestHeaders)_frame.RequestHeaders, _frame); _frame.InitializeStreams(messageBody); var originalRequestBody = _frame.RequestBody; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/HttpParserTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/HttpParserTests.cs index 99daa1a53d..d28eb02e07 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/HttpParserTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/HttpParserTests.cs @@ -8,9 +8,9 @@ using System.IO.Pipelines.Testing; using System.Linq; using System.Text; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Server.Kestrel; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Logging; using Moq; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/HttpUtilitiesTest.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/HttpUtilitiesTest.cs index e21ce86eff..002ec387c4 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/HttpUtilitiesTest.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/HttpUtilitiesTest.cs @@ -3,8 +3,8 @@ using System; using System.Text; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/HttpsConnectionAdapterTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/HttpsConnectionAdapterTests.cs index 5df67aa16f..25c637b628 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/HttpsConnectionAdapterTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/HttpsConnectionAdapterTests.cs @@ -14,7 +14,7 @@ using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Server.Kestrel; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.AspNetCore.Server.Kestrel.Https; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Internal; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelEventSourceTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelEventSourceTests.cs index 97a38802b6..fc51df41f3 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelEventSourceTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelEventSourceTests.cs @@ -4,7 +4,7 @@ using System; using System.Diagnostics.Tracing; using System.Reflection; -using Microsoft.AspNetCore.Server.Kestrel; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests @@ -15,7 +15,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests public void ExistsWithCorrectId() { var esType = typeof(KestrelServer).GetTypeInfo().Assembly.GetType( - "Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure.KestrelEventSource", + "Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.KestrelEventSource", throwOnError: true, ignoreCase: false ); diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelServerLimitsTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelServerLimitsTests.cs index 2b95674e5b..ff30838839 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelServerLimitsTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelServerLimitsTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Server.Kestrel; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelServerOptionsTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelServerOptionsTests.cs index 8a33390342..13a1d442b6 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelServerOptionsTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelServerOptionsTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Net; -using Microsoft.AspNetCore.Server.Kestrel; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelServerTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelServerTests.cs index 24218aa8f7..8c3e5fa0b2 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelServerTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/KestrelServerTests.cs @@ -7,7 +7,7 @@ using System.Net; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting.Server; using Microsoft.AspNetCore.Hosting.Server.Features; -using Microsoft.AspNetCore.Server.Kestrel; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Internal; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/SocketOutputTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/LibuvOutputConsumerTests.cs similarity index 89% rename from test/Microsoft.AspNetCore.Server.KestrelTests/SocketOutputTests.cs rename to test/Microsoft.AspNetCore.Server.KestrelTests/LibuvOutputConsumerTests.cs index fc5e39df9d..0b9a085180 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/SocketOutputTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/LibuvOutputConsumerTests.cs @@ -6,20 +6,21 @@ using System.Collections.Concurrent; using System.IO.Pipelines; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel; -using Microsoft.AspNetCore.Server.Kestrel.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal; using Microsoft.AspNetCore.Server.KestrelTests.TestHelpers; using Microsoft.AspNetCore.Testing; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests { - public class SocketOutputTests : IDisposable + public class LibuvOutputConsumerTests : IDisposable { private readonly PipeFactory _pipeFactory; private readonly MockLibuv _mockLibuv; - private readonly KestrelThread _kestrelThread; + private readonly LibuvThread _libuvThread; public static TheoryData MaxResponseBufferSizeData => new TheoryData { @@ -31,19 +32,19 @@ namespace Microsoft.AspNetCore.Server.KestrelTests (int)new KestrelServerOptions().Limits.MaxResponseBufferSize, 1024, (1024 * 1024) + 1 }; - public SocketOutputTests() + public LibuvOutputConsumerTests() { _pipeFactory = new PipeFactory(); _mockLibuv = new MockLibuv(); - var kestrelEngine = new KestrelEngine(_mockLibuv, new TestServiceContext().TransportContext, new ListenOptions(0)); - _kestrelThread = new KestrelThread(kestrelEngine, maxLoops: 1); - _kestrelThread.StartAsync().Wait(); + var libuvTransport = new LibuvTransport(_mockLibuv, new TestServiceContext().TransportContext, new ListenOptions(0)); + _libuvThread = new LibuvThread(libuvTransport, maxLoops: 1); + _libuvThread.StartAsync().Wait(); } public void Dispose() { - _kestrelThread.StopAsync(TimeSpan.FromSeconds(1)).Wait(); + _libuvThread.StopAsync(TimeSpan.FromSeconds(1)).Wait(); _pipeFactory.Dispose(); } @@ -59,7 +60,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests // This is verified in PipeOptionsTests.OutputPipeOptionsConfiguredCorrectly. var pipeOptions = new PipeOptions { - ReaderScheduler = _kestrelThread, + ReaderScheduler = _libuvThread, MaximumSizeHigh = maxResponseBufferSize ?? 0, MaximumSizeLow = maxResponseBufferSize ?? 0, }; @@ -94,7 +95,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests // This is verified in PipeOptionsTests.OutputPipeOptionsConfiguredCorrectly. var pipeOptions = new PipeOptions { - ReaderScheduler = _kestrelThread, + ReaderScheduler = _libuvThread, MaximumSizeHigh = 0, MaximumSizeLow = 0, }; @@ -119,7 +120,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests foreach (var triggerCompleted in completeQueue) { - await _kestrelThread.PostAsync(cb => cb(0), triggerCompleted); + await _libuvThread.PostAsync(cb => cb(0), triggerCompleted); } } } @@ -140,7 +141,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests // This is verified in PipeOptionsTests.OutputPipeOptionsConfiguredCorrectly. var pipeOptions = new PipeOptions { - ReaderScheduler = _kestrelThread, + ReaderScheduler = _libuvThread, MaximumSizeHigh = 1, MaximumSizeLow = 1, }; @@ -161,7 +162,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests // Finishing the write should allow the task to complete. Assert.True(completeQueue.TryDequeue(out var triggerNextCompleted)); - await _kestrelThread.PostAsync(cb => cb(0), triggerNextCompleted); + await _libuvThread.PostAsync(cb => cb(0), triggerNextCompleted); // Assert await writeTask.TimeoutAfter(TimeSpan.FromSeconds(5)); @@ -174,7 +175,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests foreach (var triggerCompleted in completeQueue) { - await _kestrelThread.PostAsync(cb => cb(0), triggerCompleted); + await _libuvThread.PostAsync(cb => cb(0), triggerCompleted); } } } @@ -194,7 +195,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests var pipeOptions = new PipeOptions { - ReaderScheduler = _kestrelThread, + ReaderScheduler = _libuvThread, MaximumSizeHigh = maxResponseBufferSize, MaximumSizeLow = maxResponseBufferSize, }; @@ -221,7 +222,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests // Act Assert.True(completeQueue.TryDequeue(out var triggerNextCompleted)); - await _kestrelThread.PostAsync(cb => cb(0), triggerNextCompleted); + await _libuvThread.PostAsync(cb => cb(0), triggerNextCompleted); // Finishing the first write should allow the second write to pre-complete. await writeTask2.TimeoutAfter(TimeSpan.FromSeconds(5)); @@ -234,7 +235,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests foreach (var triggerCompleted in completeQueue) { - await _kestrelThread.PostAsync(cb => cb(0), triggerCompleted); + await _libuvThread.PostAsync(cb => cb(0), triggerCompleted); } } } @@ -254,7 +255,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests var pipeOptions = new PipeOptions { - ReaderScheduler = _kestrelThread, + ReaderScheduler = _libuvThread, MaximumSizeHigh = maxResponseBufferSize, MaximumSizeLow = maxResponseBufferSize, }; @@ -291,7 +292,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests // Drain the write queue while (completeQueue.TryDequeue(out var triggerNextCompleted)) { - await _kestrelThread.PostAsync(cb => cb(0), triggerNextCompleted); + await _libuvThread.PostAsync(cb => cb(0), triggerNextCompleted); } var timeout = TimeSpan.FromSeconds(5); @@ -322,7 +323,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests var pipeOptions = new PipeOptions { - ReaderScheduler = _kestrelThread, + ReaderScheduler = _libuvThread, MaximumSizeHigh = maxResponseBufferSize, MaximumSizeLow = maxResponseBufferSize, }; @@ -363,7 +364,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests // Cause all writes to fail while (completeQueue.TryDequeue(out var triggerNextCompleted)) { - await _kestrelThread.PostAsync(cb => cb(-1), triggerNextCompleted); + await _libuvThread.PostAsync(cb => cb(-1), triggerNextCompleted); } // Second task is now completed @@ -394,7 +395,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests var pipeOptions = new PipeOptions { - ReaderScheduler = _kestrelThread, + ReaderScheduler = _libuvThread, MaximumSizeHigh = maxResponseBufferSize, MaximumSizeLow = maxResponseBufferSize, }; @@ -420,7 +421,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests // Drain the write queue while (completeQueue.TryDequeue(out var triggerNextCompleted)) { - await _kestrelThread.PostAsync(cb => cb(0), triggerNextCompleted); + await _libuvThread.PostAsync(cb => cb(0), triggerNextCompleted); } var timeout = TimeSpan.FromSeconds(5); @@ -452,7 +453,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests // This is verified in PipeOptionsTests.OutputPipeOptionsConfiguredCorrectly. var pipeOptions = new PipeOptions { - ReaderScheduler = _kestrelThread, + ReaderScheduler = _libuvThread, MaximumSizeHigh = maxResponseBufferSize ?? 0, MaximumSizeLow = maxResponseBufferSize ?? 0, }; @@ -491,7 +492,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests { var pipeOptions = new PipeOptions { - ReaderScheduler = _kestrelThread, + ReaderScheduler = _libuvThread, }; using (var connection = new MockConnection()) @@ -516,16 +517,16 @@ namespace Microsoft.AspNetCore.Server.KestrelTests } } - private SocketOutputProducer CreateSocketOutput(PipeOptions pipeOptions, MockConnection connection = null) + private OutputProducer CreateSocketOutput(PipeOptions pipeOptions, MockConnection connection = null) { var pipe = _pipeFactory.Create(pipeOptions); var serviceContext = new TestServiceContext(); var frame = new Frame(null, new FrameContext { ServiceContext = serviceContext }); - var socket = new MockSocket(_mockLibuv, _kestrelThread.Loop.ThreadId, serviceContext.TransportContext.Log); - var socketOutput = new SocketOutputProducer(pipe.Writer, frame, "0", serviceContext.Log); - var consumer = new SocketOutputConsumer(pipe.Reader, _kestrelThread, socket, connection ?? new MockConnection(), "0", serviceContext.TransportContext.Log); + var socket = new MockSocket(_mockLibuv, _libuvThread.Loop.ThreadId, serviceContext.TransportContext.Log); + var socketOutput = new OutputProducer(pipe.Writer, frame, "0", serviceContext.Log); + var consumer = new LibuvOutputConsumer(pipe.Reader, _libuvThread, socket, connection ?? new MockConnection(), "0", serviceContext.TransportContext.Log); var ignore = consumer.StartWrites(); return socketOutput; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/ListenerPrimaryTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/ListenerPrimaryTests.cs index 8730d598cb..797e7d00a4 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/ListenerPrimaryTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/ListenerPrimaryTests.cs @@ -7,11 +7,11 @@ using System.Linq; using System.Net; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Server.Kestrel; -using Microsoft.AspNetCore.Server.Kestrel.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; using Microsoft.AspNetCore.Server.KestrelTests.TestHelpers; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Logging; @@ -35,16 +35,16 @@ namespace Microsoft.AspNetCore.Server.KestrelTests serviceContextSecondary.TransportContext.ConnectionHandler = new ConnectionHandler( listenOptions, serviceContextSecondary, new DummyApplication(c => c.Response.WriteAsync("Secondary"))); - var kestrelEngine = new KestrelEngine(libuv, serviceContextPrimary.TransportContext, listenOptions); + var libuvTransport = new LibuvTransport(libuv, serviceContextPrimary.TransportContext, listenOptions); var pipeName = (libuv.IsWindows ? @"\\.\pipe\kestrel_" : "/tmp/kestrel_") + Guid.NewGuid().ToString("n"); var pipeMessage = Guid.NewGuid().ToByteArray(); // Start primary listener - var kestrelThreadPrimary = new KestrelThread(kestrelEngine); - await kestrelThreadPrimary.StartAsync(); + var libuvThreadPrimary = new LibuvThread(libuvTransport); + await libuvThreadPrimary.StartAsync(); var listenerPrimary = new ListenerPrimary(serviceContextPrimary.TransportContext); - await listenerPrimary.StartAsync(pipeName, pipeMessage, listenOptions, kestrelThreadPrimary); + await listenerPrimary.StartAsync(pipeName, pipeMessage, listenOptions, libuvThreadPrimary); var address = listenOptions.ToString(); // Until a secondary listener is added, TCP connections get dispatched directly @@ -52,10 +52,10 @@ namespace Microsoft.AspNetCore.Server.KestrelTests Assert.Equal("Primary", await HttpClientSlim.GetStringAsync(address)); // Add secondary listener - var kestrelThreadSecondary = new KestrelThread(kestrelEngine); - await kestrelThreadSecondary.StartAsync(); + var libuvThreadSecondary = new LibuvThread(libuvTransport); + await libuvThreadSecondary.StartAsync(); var listenerSecondary = new ListenerSecondary(serviceContextSecondary.TransportContext); - await listenerSecondary.StartAsync(pipeName, pipeMessage, listenOptions, kestrelThreadSecondary); + await listenerSecondary.StartAsync(pipeName, pipeMessage, listenOptions, libuvThreadSecondary); // Once a secondary listener is added, TCP connections start getting dispatched to it await AssertResponseEventually(address, "Secondary", allowed: new[] { "Primary" }); @@ -66,10 +66,10 @@ namespace Microsoft.AspNetCore.Server.KestrelTests Assert.Equal("Primary", await HttpClientSlim.GetStringAsync(address)); await listenerSecondary.DisposeAsync(); - await kestrelThreadSecondary.StopAsync(TimeSpan.FromSeconds(1)); + await libuvThreadSecondary.StopAsync(TimeSpan.FromSeconds(1)); await listenerPrimary.DisposeAsync(); - await kestrelThreadPrimary.StopAsync(TimeSpan.FromSeconds(1)); + await libuvThreadPrimary.StopAsync(TimeSpan.FromSeconds(1)); } // https://github.com/aspnet/KestrelHttpServer/issues/1182 @@ -93,23 +93,23 @@ namespace Microsoft.AspNetCore.Server.KestrelTests serviceContextSecondary.TransportContext.ConnectionHandler = new ConnectionHandler( listenOptions, serviceContextSecondary, new DummyApplication(c => c.Response.WriteAsync("Secondary"))); - var kestrelEngine = new KestrelEngine(libuv, serviceContextPrimary.TransportContext, listenOptions); + var libuvTransport = new LibuvTransport(libuv, serviceContextPrimary.TransportContext, listenOptions); var pipeName = (libuv.IsWindows ? @"\\.\pipe\kestrel_" : "/tmp/kestrel_") + Guid.NewGuid().ToString("n"); var pipeMessage = Guid.NewGuid().ToByteArray(); // Start primary listener - var kestrelThreadPrimary = new KestrelThread(kestrelEngine); - await kestrelThreadPrimary.StartAsync(); + var libuvThreadPrimary = new LibuvThread(libuvTransport); + await libuvThreadPrimary.StartAsync(); var listenerPrimary = new ListenerPrimary(serviceContextPrimary.TransportContext); - await listenerPrimary.StartAsync(pipeName, pipeMessage, listenOptions, kestrelThreadPrimary); + await listenerPrimary.StartAsync(pipeName, pipeMessage, listenOptions, libuvThreadPrimary); var address = listenOptions.ToString(); // Add secondary listener - var kestrelThreadSecondary = new KestrelThread(kestrelEngine); - await kestrelThreadSecondary.StartAsync(); + var libuvThreadSecondary = new LibuvThread(libuvTransport); + await libuvThreadSecondary.StartAsync(); var listenerSecondary = new ListenerSecondary(serviceContextSecondary.TransportContext); - await listenerSecondary.StartAsync(pipeName, pipeMessage, listenOptions, kestrelThreadSecondary); + await listenerSecondary.StartAsync(pipeName, pipeMessage, listenOptions, libuvThreadSecondary); // TCP Connections get round-robined await AssertResponseEventually(address, "Secondary", allowed: new[] { "Primary" }); @@ -120,12 +120,12 @@ namespace Microsoft.AspNetCore.Server.KestrelTests var connectionTrace = new LibuvTrace(new TestApplicationErrorLogger()); var pipe = new UvPipeHandle(connectionTrace); - kestrelThreadPrimary.Post(_ => + libuvThreadPrimary.Post(_ => { var connectReq = new UvConnectRequest(connectionTrace); - pipe.Init(kestrelThreadPrimary.Loop, kestrelThreadPrimary.QueueCloseHandle); - connectReq.Init(kestrelThreadPrimary.Loop); + pipe.Init(libuvThreadPrimary.Loop, libuvThreadPrimary.QueueCloseHandle); + connectReq.Init(libuvThreadPrimary.Loop); connectReq.Connect( pipe, @@ -153,7 +153,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests Assert.Equal("Primary", await HttpClientSlim.GetStringAsync(address)); Assert.Equal("Secondary", await HttpClientSlim.GetStringAsync(address)); - await kestrelThreadPrimary.PostAsync(_ => pipe.Dispose(), (object)null); + await libuvThreadPrimary.PostAsync(_ => pipe.Dispose(), (object)null); var primaryTrace = (TestKestrelTrace)serviceContextPrimary.Log; @@ -169,10 +169,10 @@ namespace Microsoft.AspNetCore.Server.KestrelTests Assert.Equal("Primary", await HttpClientSlim.GetStringAsync(address)); await listenerSecondary.DisposeAsync(); - await kestrelThreadSecondary.StopAsync(TimeSpan.FromSeconds(1)); + await libuvThreadSecondary.StopAsync(TimeSpan.FromSeconds(1)); await listenerPrimary.DisposeAsync(); - await kestrelThreadPrimary.StopAsync(TimeSpan.FromSeconds(1)); + await libuvThreadPrimary.StopAsync(TimeSpan.FromSeconds(1)); Assert.Equal(1, primaryTrace.Logger.TotalErrorsLogged); var errorMessage = primaryTrace.Logger.Messages.First(m => m.LogLevel == LogLevel.Error); @@ -200,23 +200,23 @@ namespace Microsoft.AspNetCore.Server.KestrelTests serviceContextSecondary.TransportContext.ConnectionHandler = new ConnectionHandler( listenOptions, serviceContextSecondary, new DummyApplication(c => c.Response.WriteAsync("Secondary"))); - var kestrelEngine = new KestrelEngine(libuv, serviceContextPrimary.TransportContext, listenOptions); + var libuvTransport = new LibuvTransport(libuv, serviceContextPrimary.TransportContext, listenOptions); var pipeName = (libuv.IsWindows ? @"\\.\pipe\kestrel_" : "/tmp/kestrel_") + Guid.NewGuid().ToString("n"); var pipeMessage = Guid.NewGuid().ToByteArray(); // Start primary listener - var kestrelThreadPrimary = new KestrelThread(kestrelEngine); - await kestrelThreadPrimary.StartAsync(); + var libuvThreadPrimary = new LibuvThread(libuvTransport); + await libuvThreadPrimary.StartAsync(); var listenerPrimary = new ListenerPrimary(serviceContextPrimary.TransportContext); - await listenerPrimary.StartAsync(pipeName, pipeMessage, listenOptions, kestrelThreadPrimary); + await listenerPrimary.StartAsync(pipeName, pipeMessage, listenOptions, libuvThreadPrimary); var address = listenOptions.ToString(); // Add secondary listener with wrong pipe message - var kestrelThreadSecondary = new KestrelThread(kestrelEngine); - await kestrelThreadSecondary.StartAsync(); + var libuvThreadSecondary = new LibuvThread(libuvTransport); + await libuvThreadSecondary.StartAsync(); var listenerSecondary = new ListenerSecondary(serviceContextSecondary.TransportContext); - await listenerSecondary.StartAsync(pipeName, Guid.NewGuid().ToByteArray(), listenOptions, kestrelThreadSecondary); + await listenerSecondary.StartAsync(pipeName, Guid.NewGuid().ToByteArray(), listenOptions, libuvThreadSecondary); var primaryTrace = (TestKestrelTrace)serviceContextPrimary.Log; @@ -232,10 +232,10 @@ namespace Microsoft.AspNetCore.Server.KestrelTests Assert.Equal("Primary", await HttpClientSlim.GetStringAsync(address)); await listenerSecondary.DisposeAsync(); - await kestrelThreadSecondary.StopAsync(TimeSpan.FromSeconds(1)); + await libuvThreadSecondary.StopAsync(TimeSpan.FromSeconds(1)); await listenerPrimary.DisposeAsync(); - await kestrelThreadPrimary.StopAsync(TimeSpan.FromSeconds(1)); + await libuvThreadPrimary.StopAsync(TimeSpan.FromSeconds(1)); Assert.Equal(1, primaryTrace.Logger.TotalErrorsLogged); var errorMessage = primaryTrace.Logger.Messages.First(m => m.LogLevel == LogLevel.Error); diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/LoggingThreadPoolTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/LoggingThreadPoolTests.cs index 65f37daf44..3209179abc 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/LoggingThreadPoolTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/LoggingThreadPoolTests.cs @@ -4,7 +4,7 @@ using System; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Testing; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/MessageBodyTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/MessageBodyTests.cs index d5294de41d..da912b65a8 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/MessageBodyTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/MessageBodyTests.cs @@ -9,8 +9,8 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Server.Kestrel; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Microsoft.Extensions.Internal; using Moq; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/MultipleLoopTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/MultipleLoopTests.cs index 3743da9a78..3a0461d394 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/MultipleLoopTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/MultipleLoopTests.cs @@ -7,8 +7,8 @@ using System.Net; using System.Net.Sockets; using System.Runtime.InteropServices; using System.Threading; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; using Microsoft.AspNetCore.Server.KestrelTests.TestHelpers; using Microsoft.AspNetCore.Testing; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/NetworkingTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/NetworkingTests.cs index cb75b906c2..9a1bea061e 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/NetworkingTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/NetworkingTests.cs @@ -7,10 +7,9 @@ using System.Net; using System.Net.Sockets; using System.Runtime.InteropServices; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; using Microsoft.AspNetCore.Testing; -using Moq; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/PathNormalizerTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/PathNormalizerTests.cs index d9b4cb6441..25d69b39bf 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/PathNormalizerTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/PathNormalizerTests.cs @@ -3,7 +3,7 @@ using System; using System.Text; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/PipeOptionsTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/PipeOptionsTests.cs index ec5ac31ff1..ff0ccdd5f0 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/PipeOptionsTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/PipeOptionsTests.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO.Pipelines; -using Microsoft.AspNetCore.Server.Kestrel.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Testing; using Moq; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/PipelineExtensionTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/PipelineExtensionTests.cs index e5227dd63e..86137019fd 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/PipelineExtensionTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/PipelineExtensionTests.cs @@ -5,7 +5,7 @@ using System; using System.IO.Pipelines; using System.Text; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/RequestTargetProcessingTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/RequestTargetProcessingTests.cs index d60253405b..3dea2881cf 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/RequestTargetProcessingTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/RequestTargetProcessingTests.cs @@ -5,9 +5,9 @@ using System.Net; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Server.Kestrel; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Testing; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/ServerAddressTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/ServerAddressTests.cs index 340ea1db27..a412527653 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/ServerAddressTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/ServerAddressTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Server.Kestrel; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/StreamSocketOutputTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/StreamSocketOutputTests.cs index 1dab5016f8..86814e8ba5 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/StreamSocketOutputTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/StreamSocketOutputTests.cs @@ -4,7 +4,7 @@ using System; using System.IO; using System.IO.Pipelines; -using Microsoft.AspNetCore.Server.Kestrel.Adapter.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal; using Xunit; namespace Microsoft.AspNetCore.Server.KestrelTests diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/MockFrameControl.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/MockFrameControl.cs index 09cec798a4..bf4b4b0d3b 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/MockFrameControl.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/MockFrameControl.cs @@ -4,7 +4,7 @@ using System; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Server.KestrelTests.TestHelpers diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/MockLibuv.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/MockLibuv.cs index 8f809cf4fe..8c0dea28e2 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/MockLibuv.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/MockLibuv.cs @@ -4,7 +4,7 @@ using System; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; namespace Microsoft.AspNetCore.Server.KestrelTests.TestHelpers { diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/MockSocket.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/MockSocket.cs index 5bbc793c6f..a8ab5075f3 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/MockSocket.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/TestHelpers/MockSocket.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; namespace Microsoft.AspNetCore.Server.KestrelTests.TestHelpers { diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/TestInput.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/TestInput.cs index e017c983dd..9bf6c5cc6d 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/TestInput.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/TestInput.cs @@ -6,7 +6,7 @@ using System.IO.Pipelines; using System.Text; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Internal; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/UvStreamHandleTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/UvStreamHandleTests.cs index 153d1b28ef..d08e8a39f3 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/UvStreamHandleTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/UvStreamHandleTests.cs @@ -1,8 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; using Microsoft.AspNetCore.Server.KestrelTests.TestHelpers; using Microsoft.AspNetCore.Testing; using Moq; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/UvTimerHandleTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/UvTimerHandleTests.cs index 628b078752..832e699c18 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/UvTimerHandleTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/UvTimerHandleTests.cs @@ -1,8 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNetCore.Server.Kestrel.Internal.Networking; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking; using Microsoft.AspNetCore.Testing; using Xunit; diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/WebHostBuilderKestrelExtensionsTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/WebHostBuilderKestrelExtensionsTests.cs index 4eeebba773..6e88011a92 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/WebHostBuilderKestrelExtensionsTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/WebHostBuilderKestrelExtensionsTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Server.Kestrel; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.Extensions.DependencyInjection; using Xunit; diff --git a/test/shared/HttpParsingData.cs b/test/shared/HttpParsingData.cs index 944a1f936d..a4d3d5521f 100644 --- a/test/shared/HttpParsingData.cs +++ b/test/shared/HttpParsingData.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using System.Linq; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Xunit; namespace Microsoft.AspNetCore.Testing diff --git a/test/shared/MockConnection.cs b/test/shared/MockConnection.cs index aebb7807a4..d37696f9c7 100644 --- a/test/shared/MockConnection.cs +++ b/test/shared/MockConnection.cs @@ -4,13 +4,13 @@ using System; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal; using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Testing { - public class MockConnection : Connection, IDisposable + public class MockConnection : LibuvConnection, IDisposable { private readonly TaskCompletionSource _socketClosedTcs = new TaskCompletionSource(); diff --git a/test/shared/MockSocketOutput.cs b/test/shared/MockSocketOutput.cs index c5cdc32cb2..69dd468c23 100644 --- a/test/shared/MockSocketOutput.cs +++ b/test/shared/MockSocketOutput.cs @@ -5,7 +5,7 @@ using System; using System.IO.Pipelines; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Testing diff --git a/test/shared/MockSystemClock.cs b/test/shared/MockSystemClock.cs index 5a903c1f2e..0032f2de7c 100644 --- a/test/shared/MockSystemClock.cs +++ b/test/shared/MockSystemClock.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; namespace Microsoft.AspNetCore.Testing { diff --git a/test/shared/PassThroughConnectionAdapter.cs b/test/shared/PassThroughConnectionAdapter.cs index 35d04ab469..7384eaa613 100644 --- a/test/shared/PassThroughConnectionAdapter.cs +++ b/test/shared/PassThroughConnectionAdapter.cs @@ -4,8 +4,8 @@ using System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Server.Kestrel.Adapter; -using Microsoft.AspNetCore.Server.Kestrel.Adapter.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter; +using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal; namespace Microsoft.AspNetCore.Testing { diff --git a/test/shared/TestApplicationErrorLogger.cs b/test/shared/TestApplicationErrorLogger.cs index 76ee249a36..dcba1da052 100644 --- a/test/shared/TestApplicationErrorLogger.cs +++ b/test/shared/TestApplicationErrorLogger.cs @@ -4,7 +4,8 @@ using System; using System.Collections.Concurrent; using System.Linq; -using Microsoft.AspNetCore.Server.Kestrel.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.Extensions.Logging; namespace Microsoft.AspNetCore.Testing diff --git a/test/shared/TestFrame.cs b/test/shared/TestFrame.cs index cc2d262bd4..65eb198c8b 100644 --- a/test/shared/TestFrame.cs +++ b/test/shared/TestFrame.cs @@ -3,7 +3,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting.Server; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; namespace Microsoft.AspNetCore.Testing { diff --git a/test/shared/TestKestrelTrace.cs b/test/shared/TestKestrelTrace.cs index 93f1c87d40..8e0a469dc7 100644 --- a/test/shared/TestKestrelTrace.cs +++ b/test/shared/TestKestrelTrace.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNetCore.Server.Kestrel.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; namespace Microsoft.AspNetCore.Testing { diff --git a/test/shared/TestServer.cs b/test/shared/TestServer.cs index fc4e91b195..f9224babdb 100644 --- a/test/shared/TestServer.cs +++ b/test/shared/TestServer.cs @@ -5,8 +5,9 @@ using System; using System.Net; using System.Net.Sockets; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Server.Kestrel; -using Microsoft.AspNetCore.Server.Kestrel.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv; namespace Microsoft.AspNetCore.Testing { @@ -15,7 +16,7 @@ namespace Microsoft.AspNetCore.Testing /// public class TestServer : IDisposable { - private KestrelEngine _engine; + private LibuvTransport _transport; private ListenOptions _listenOptions; public TestServer(RequestDelegate app) @@ -47,13 +48,13 @@ namespace Microsoft.AspNetCore.Testing try { - _engine = new KestrelEngine(context.TransportContext, _listenOptions); - _engine.BindAsync().Wait(); + _transport = new LibuvTransport(context.TransportContext, _listenOptions); + _transport.BindAsync().Wait(); } catch { - _engine.UnbindAsync().Wait(); - _engine.StopAsync().Wait(); + _transport.UnbindAsync().Wait(); + _transport.StopAsync().Wait(); throw; } } @@ -71,8 +72,8 @@ namespace Microsoft.AspNetCore.Testing public void Dispose() { - _engine.UnbindAsync().Wait(); - _engine.StopAsync().Wait(); + _transport.UnbindAsync().Wait(); + _transport.StopAsync().Wait(); } } } diff --git a/test/shared/TestServiceContext.cs b/test/shared/TestServiceContext.cs index 2c1fb53846..ca9c28cecc 100644 --- a/test/shared/TestServiceContext.cs +++ b/test/shared/TestServiceContext.cs @@ -2,14 +2,12 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Server.Kestrel; -using Microsoft.AspNetCore.Server.Kestrel.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Http; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv; using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal; -using Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Infrastructure; namespace Microsoft.AspNetCore.Testing { diff --git a/tools/CodeGenerator/FrameFeatureCollection.cs b/tools/CodeGenerator/FrameFeatureCollection.cs index 6c85665fe9..e487a36a94 100644 --- a/tools/CodeGenerator/FrameFeatureCollection.cs +++ b/tools/CodeGenerator/FrameFeatureCollection.cs @@ -72,7 +72,7 @@ namespace CodeGenerator using System; using System.Collections.Generic; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http {{ public partial class Frame {{{Each(allFeatures, feature => $@" diff --git a/tools/CodeGenerator/KnownHeaders.cs b/tools/CodeGenerator/KnownHeaders.cs index 6f8ef86303..e5feb937f2 100644 --- a/tools/CodeGenerator/KnownHeaders.cs +++ b/tools/CodeGenerator/KnownHeaders.cs @@ -292,11 +292,11 @@ namespace CodeGenerator using System; using System.Collections.Generic; using System.IO.Pipelines; -using Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.Extensions.Primitives; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http {{ {Each(loops, loop => $@" public partial class {loop.ClassName}