diff --git a/benchmarks/Kestrel.Performance/Http1WritingBenchmark.cs b/benchmarks/Kestrel.Performance/Http1WritingBenchmark.cs index 7052bf3a41..acc57a23d6 100644 --- a/benchmarks/Kestrel.Performance/Http1WritingBenchmark.cs +++ b/benchmarks/Kestrel.Performance/Http1WritingBenchmark.cs @@ -22,8 +22,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance // Standard completed task private static readonly Func _syncTaskFunc = (obj) => Task.CompletedTask; // Non-standard completed task - private static readonly Task _psuedoAsyncTask = Task.FromResult(27); - private static readonly Func _psuedoAsyncTaskFunc = (obj) => _psuedoAsyncTask; + private static readonly Task _pseudoAsyncTask = Task.FromResult(27); + private static readonly Func _pseudoAsyncTaskFunc = (obj) => _pseudoAsyncTask; private TestHttp1Connection _http1Connection; private DuplexPipe.DuplexPipePair _pair; @@ -80,7 +80,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance _http1Connection.OnStarting(_syncTaskFunc, null); break; case Startup.Async: - _http1Connection.OnStarting(_psuedoAsyncTaskFunc, null); + _http1Connection.OnStarting(_pseudoAsyncTaskFunc, null); break; } } diff --git a/benchmarks/Kestrel.Performance/Mocks/MockTrace.cs b/benchmarks/Kestrel.Performance/Mocks/MockTrace.cs index 9841be5826..0fc02aa7d9 100644 --- a/benchmarks/Kestrel.Performance/Mocks/MockTrace.cs +++ b/benchmarks/Kestrel.Performance/Mocks/MockTrace.cs @@ -43,8 +43,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance public void RequestBodyDone(string connectionId, string traceIdentifier) { } public void RequestBodyNotEntirelyRead(string connectionId, string traceIdentifier) { } public void RequestBodyDrainTimedOut(string connectionId, string traceIdentifier) { } - public void RequestBodyMininumDataRateNotSatisfied(string connectionId, string traceIdentifier, double rate) { } - public void ResponseMininumDataRateNotSatisfied(string connectionId, string traceIdentifier) { } + public void RequestBodyMinimumDataRateNotSatisfied(string connectionId, string traceIdentifier, double rate) { } + public void ResponseMinimumDataRateNotSatisfied(string connectionId, string traceIdentifier) { } public void ApplicationAbortedConnection(string connectionId, string traceIdentifier) { } public void Http2ConnectionError(string connectionId, Http2ConnectionErrorException ex) { } public void Http2StreamError(string connectionId, Http2StreamErrorException ex) { } diff --git a/benchmarks/Kestrel.Performance/PipeThroughputBenchmark.cs b/benchmarks/Kestrel.Performance/PipeThroughputBenchmark.cs index b647567715..eb0cedad24 100644 --- a/benchmarks/Kestrel.Performance/PipeThroughputBenchmark.cs +++ b/benchmarks/Kestrel.Performance/PipeThroughputBenchmark.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance { public class PipeThroughputBenchmark { - private const int _writeLenght = 57; + private const int _writeLength = 57; private const int InnerLoopCount = 512; private Pipe _pipe; @@ -32,15 +32,15 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance { for (int i = 0; i < InnerLoopCount; i++) { - _pipe.Writer.GetMemory(_writeLenght); - _pipe.Writer.Advance(_writeLenght); + _pipe.Writer.GetMemory(_writeLength); + _pipe.Writer.Advance(_writeLength); await _pipe.Writer.FlushAsync(); } }); var reading = Task.Run(async () => { - long remaining = InnerLoopCount * _writeLenght; + long remaining = InnerLoopCount * _writeLength; while (remaining != 0) { var result = await _pipe.Reader.ReadAsync(); @@ -57,8 +57,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance { for (int i = 0; i < InnerLoopCount; i++) { - _pipe.Writer.GetMemory(_writeLenght); - _pipe.Writer.Advance(_writeLenght); + _pipe.Writer.GetMemory(_writeLength); + _pipe.Writer.Advance(_writeLength); _pipe.Writer.FlushAsync().GetAwaiter().GetResult(); var result = _pipe.Reader.ReadAsync().GetAwaiter().GetResult(); _pipe.Reader.AdvanceTo(result.Buffer.End, result.Buffer.End); diff --git a/shared/Microsoft.Extensions.Buffers.MemoryPool.Sources/DiagnosticMemoryPool.cs b/shared/Microsoft.Extensions.Buffers.MemoryPool.Sources/DiagnosticMemoryPool.cs index 3d2c0d72c7..d4d58e0241 100644 --- a/shared/Microsoft.Extensions.Buffers.MemoryPool.Sources/DiagnosticMemoryPool.cs +++ b/shared/Microsoft.Extensions.Buffers.MemoryPool.Sources/DiagnosticMemoryPool.cs @@ -24,7 +24,7 @@ namespace System.Buffers private readonly List _blockAccessExceptions; - private readonly TaskCompletionSource _allBlocksRetuned; + private readonly TaskCompletionSource _allBlocksReturned; private int _totalBlocks; @@ -40,7 +40,7 @@ namespace System.Buffers _rentTracking = rentTracking; _blocks = new HashSet(); _syncObj = new object(); - _allBlocksRetuned = new TaskCompletionSource(); + _allBlocksReturned = new TaskCompletionSource(); _blockAccessExceptions = new List(); } @@ -138,11 +138,11 @@ namespace System.Buffers { if (_blockAccessExceptions.Any()) { - _allBlocksRetuned.SetException(CreateAccessExceptions()); + _allBlocksReturned.SetException(CreateAccessExceptions()); } else { - _allBlocksRetuned.SetResult(null); + _allBlocksReturned.SetResult(null); } } @@ -153,8 +153,8 @@ namespace System.Buffers public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout) { - var task = await Task.WhenAny(_allBlocksRetuned.Task, Task.Delay(timeout)); - if (task != _allBlocksRetuned.Task) + var task = await Task.WhenAny(_allBlocksReturned.Task, Task.Delay(timeout)); + if (task != _allBlocksReturned.Task) { MemoryPoolThrowHelper.ThrowInvalidOperationException_BlocksWereNotReturnedInTime(_totalBlocks - _blocks.Count, _totalBlocks, _blocks.ToArray()); } diff --git a/shared/Microsoft.Extensions.Buffers.MemoryPool.Sources/MemoryPoolSlab.cs b/shared/Microsoft.Extensions.Buffers.MemoryPool.Sources/MemoryPoolSlab.cs index d4e5d5ab9a..99dfe082e5 100644 --- a/shared/Microsoft.Extensions.Buffers.MemoryPool.Sources/MemoryPoolSlab.cs +++ b/shared/Microsoft.Extensions.Buffers.MemoryPool.Sources/MemoryPoolSlab.cs @@ -7,7 +7,7 @@ namespace System.Buffers { /// /// Slab tracking object used by the byte buffer memory pool. A slab is a large allocation which is divided into smaller blocks. The - /// individual blocks are then treated as independant array segments. + /// individual blocks are then treated as independent array segments. /// internal class MemoryPoolSlab : IDisposable { diff --git a/src/Kestrel.Core/Internal/Http/Http1Connection.cs b/src/Kestrel.Core/Internal/Http/Http1Connection.cs index 5a4e1d68bb..c2655344b8 100644 --- a/src/Kestrel.Core/Internal/Http/Http1Connection.cs +++ b/src/Kestrel.Core/Internal/Http/Http1Connection.cs @@ -356,7 +356,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http else if (_requestTargetForm != HttpRequestTarget.OriginForm) { // Tail call - ValidateNonOrginHostHeader(hostText); + ValidateNonOriginHostHeader(hostText); } else if (!HttpUtilities.IsHostHeaderValid(hostText)) { @@ -364,7 +364,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } } - private void ValidateNonOrginHostHeader(string hostText) + private void ValidateNonOriginHostHeader(string hostText) { if (_requestTargetForm == HttpRequestTarget.AuthorityForm) { diff --git a/src/Kestrel.Core/Internal/Http/Http1MessageBody.cs b/src/Kestrel.Core/Internal/Http/Http1MessageBody.cs index 8440927229..c0461f9eb8 100644 --- a/src/Kestrel.Core/Internal/Http/Http1MessageBody.cs +++ b/src/Kestrel.Core/Internal/Http/Http1MessageBody.cs @@ -572,8 +572,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http var extensionCursor = extensionCursorPosition.Value; var charsToByteCRExclusive = buffer.Slice(0, extensionCursor).Length; - var sufixBuffer = buffer.Slice(extensionCursor); - if (sufixBuffer.Length < 2) + var suffixBuffer = buffer.Slice(extensionCursor); + if (suffixBuffer.Length < 2) { consumed = extensionCursor; examined = buffer.End; @@ -581,16 +581,16 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http return; } - sufixBuffer = sufixBuffer.Slice(0, 2); - var sufixSpan = sufixBuffer.ToSpan(); + suffixBuffer = suffixBuffer.Slice(0, 2); + var sufixSpan = suffixBuffer.ToSpan(); if (sufixSpan[1] == '\n') { // We consumed the \r\n at the end of the extension, so switch modes. _mode = _inputLength > 0 ? Mode.Data : Mode.Trailer; - consumed = sufixBuffer.End; - examined = sufixBuffer.End; + consumed = suffixBuffer.End; + examined = suffixBuffer.End; AddAndCheckConsumedBytes(charsToByteCRExclusive + 2); } else diff --git a/src/Kestrel.Core/Internal/Http/HttpHeaders.cs b/src/Kestrel.Core/Internal/Http/HttpHeaders.cs index b537e44e5f..4a1a474b08 100644 --- a/src/Kestrel.Core/Internal/Http/HttpHeaders.cs +++ b/src/Kestrel.Core/Internal/Http/HttpHeaders.cs @@ -48,7 +48,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (string.IsNullOrEmpty(key)) { - ThrowInvalidEmtpyHeaderName(); + ThrowInvalidEmptyHeaderName(); } if (value.Count == 0) { @@ -177,7 +177,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http } if (string.IsNullOrEmpty(key)) { - ThrowInvalidEmtpyHeaderName(); + ThrowInvalidEmptyHeaderName(); } if (value.Count > 0 && !AddValueFast(key, value)) @@ -457,7 +457,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http throw new InvalidOperationException(CoreStrings.FormatInvalidAsciiOrControlChar(string.Format("0x{0:X4}", (ushort)ch))); } - private static void ThrowInvalidEmtpyHeaderName() + private static void ThrowInvalidEmptyHeaderName() { throw new InvalidOperationException(CoreStrings.InvalidEmptyHeaderName); } diff --git a/src/Kestrel.Core/Internal/Http/PipelineExtensions.cs b/src/Kestrel.Core/Internal/Http/PipelineExtensions.cs index e56c43b23c..c379fa257e 100644 --- a/src/Kestrel.Core/Internal/Http/PipelineExtensions.cs +++ b/src/Kestrel.Core/Internal/Http/PipelineExtensions.cs @@ -177,7 +177,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http const int Shift16Shift24 = (1 << 16) | (1 << 24); const int Shift8Identity = (1 << 8) | (1); - // Encode as bytes upto the first non-ASCII byte and return count encoded + // Encode as bytes up to the first non-ASCII byte and return count encoded int i = 0; // Use Intrinsic switch if (IntPtr.Size == 8) // 64 bit diff --git a/src/Kestrel.Core/Internal/Http2/Bitshifter.cs b/src/Kestrel.Core/Internal/Http2/Bitshifter.cs index 7c3915203f..6dea868291 100644 --- a/src/Kestrel.Core/Internal/Http2/Bitshifter.cs +++ b/src/Kestrel.Core/Internal/Http2/Bitshifter.cs @@ -8,7 +8,7 @@ using System.Runtime.CompilerServices; namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 { - // Mimics BinaryPrimities with oddly sized units + // Mimics BinaryPrimitives with oddly sized units internal class Bitshifter { [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/Kestrel.Core/Internal/Http2/FlowControl/StreamInputFlowControl.cs b/src/Kestrel.Core/Internal/Http2/FlowControl/StreamInputFlowControl.cs index e85b2bbe2e..4ee1d0238c 100644 --- a/src/Kestrel.Core/Internal/Http2/FlowControl/StreamInputFlowControl.cs +++ b/src/Kestrel.Core/Internal/Http2/FlowControl/StreamInputFlowControl.cs @@ -29,9 +29,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl public void Advance(int bytes) { - var connectionSucess = _connectionLevelFlowControl.TryAdvance(bytes); + var connectionSuccess = _connectionLevelFlowControl.TryAdvance(bytes); - Debug.Assert(connectionSucess, "Connection-level input flow control should never be aborted."); + Debug.Assert(connectionSuccess, "Connection-level input flow control should never be aborted."); if (!_streamLevelFlowControl.TryAdvance(bytes)) { @@ -78,9 +78,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl private void UpdateConnectionWindow(int bytes) { - var connectionSucess = _connectionLevelFlowControl.TryUpdateWindow(bytes, out var connectionWindowUpdateSize); + var connectionSuccess = _connectionLevelFlowControl.TryUpdateWindow(bytes, out var connectionWindowUpdateSize); - Debug.Assert(connectionSucess, "Connection-level input flow control should never be aborted."); + Debug.Assert(connectionSuccess, "Connection-level input flow control should never be aborted."); if (connectionWindowUpdateSize > 0) { diff --git a/src/Kestrel.Core/Internal/Http2/HPack/HeaderField.cs b/src/Kestrel.Core/Internal/Http2/HPack/HeaderField.cs index 73eb4d726e..fd224f4e52 100644 --- a/src/Kestrel.Core/Internal/Http2/HPack/HeaderField.cs +++ b/src/Kestrel.Core/Internal/Http2/HPack/HeaderField.cs @@ -25,6 +25,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack public int Length => GetLength(Name.Length, Value.Length); - public static int GetLength(int nameLength, int valueLenth) => nameLength + valueLenth + 32; + public static int GetLength(int nameLength, int valueLength) => nameLength + valueLength + 32; } } diff --git a/src/Kestrel.Core/Internal/HttpConnection.cs b/src/Kestrel.Core/Internal/HttpConnection.cs index d860d36ba7..9fc64acb68 100644 --- a/src/Kestrel.Core/Internal/HttpConnection.cs +++ b/src/Kestrel.Core/Internal/HttpConnection.cs @@ -465,7 +465,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal if (rate < minRequestBodyDataRate.BytesPerSecond && !Debugger.IsAttached) { - Log.RequestBodyMininumDataRateNotSatisfied(_context.ConnectionId, _http1Connection.TraceIdentifier, minRequestBodyDataRate.BytesPerSecond); + Log.RequestBodyMinimumDataRateNotSatisfied(_context.ConnectionId, _http1Connection.TraceIdentifier, minRequestBodyDataRate.BytesPerSecond); RequestTimedOut = true; _http1Connection.SendTimeoutResponse(); } @@ -492,7 +492,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal if (_writeTimingWrites > 0 && timestamp > _writeTimingTimeoutTimestamp && !Debugger.IsAttached) { RequestTimedOut = true; - Log.ResponseMininumDataRateNotSatisfied(_http1Connection.ConnectionIdFeature, _http1Connection.TraceIdentifier); + Log.ResponseMinimumDataRateNotSatisfied(_http1Connection.ConnectionIdFeature, _http1Connection.TraceIdentifier); Abort(new ConnectionAbortedException(CoreStrings.ConnectionTimedBecauseResponseMininumDataRateNotSatisfied)); } } diff --git a/src/Kestrel.Core/Internal/Infrastructure/IKestrelTrace.cs b/src/Kestrel.Core/Internal/Infrastructure/IKestrelTrace.cs index 9d28cd3804..19ecc86ee2 100644 --- a/src/Kestrel.Core/Internal/Infrastructure/IKestrelTrace.cs +++ b/src/Kestrel.Core/Internal/Infrastructure/IKestrelTrace.cs @@ -49,9 +49,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure void RequestBodyDrainTimedOut(string connectionId, string traceIdentifier); - void RequestBodyMininumDataRateNotSatisfied(string connectionId, string traceIdentifier, double rate); + void RequestBodyMinimumDataRateNotSatisfied(string connectionId, string traceIdentifier, double rate); - void ResponseMininumDataRateNotSatisfied(string connectionId, string traceIdentifier); + void ResponseMinimumDataRateNotSatisfied(string connectionId, string traceIdentifier); void ApplicationAbortedConnection(string connectionId, string traceIdentifier); diff --git a/src/Kestrel.Core/Internal/Infrastructure/KestrelTrace.cs b/src/Kestrel.Core/Internal/Infrastructure/KestrelTrace.cs index 3c269b0ac9..f735370d3e 100644 --- a/src/Kestrel.Core/Internal/Infrastructure/KestrelTrace.cs +++ b/src/Kestrel.Core/Internal/Infrastructure/KestrelTrace.cs @@ -64,10 +64,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal LoggerMessage.Define(LogLevel.Debug, new EventId(26, nameof(RequestBodyDone)), @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": done reading request body."); private static readonly Action _requestBodyMinimumDataRateNotSatisfied = - LoggerMessage.Define(LogLevel.Information, new EventId(27, nameof(RequestBodyMininumDataRateNotSatisfied)), @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": the request timed out because it was not sent by the client at a minimum of {Rate} bytes/second."); + LoggerMessage.Define(LogLevel.Information, new EventId(27, nameof(RequestBodyMinimumDataRateNotSatisfied)), @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": the request timed out because it was not sent by the client at a minimum of {Rate} bytes/second."); private static readonly Action _responseMinimumDataRateNotSatisfied = - LoggerMessage.Define(LogLevel.Information, new EventId(28, nameof(ResponseMininumDataRateNotSatisfied)), @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": the connection was closed because the response was not read by the client at the specified minimum data rate."); + LoggerMessage.Define(LogLevel.Information, new EventId(28, nameof(ResponseMinimumDataRateNotSatisfied)), @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": the connection was closed because the response was not read by the client at the specified minimum data rate."); private static readonly Action _http2ConnectionError = LoggerMessage.Define(LogLevel.Information, new EventId(29, nameof(Http2ConnectionError)), @"Connection id ""{ConnectionId}"": HTTP/2 connection error."); @@ -199,7 +199,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal _requestBodyDone(_logger, connectionId, traceIdentifier, null); } - public virtual void RequestBodyMininumDataRateNotSatisfied(string connectionId, string traceIdentifier, double rate) + public virtual void RequestBodyMinimumDataRateNotSatisfied(string connectionId, string traceIdentifier, double rate) { _requestBodyMinimumDataRateNotSatisfied(_logger, connectionId, traceIdentifier, rate, null); } @@ -214,7 +214,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal _requestBodyDrainTimedOut(_logger, connectionId, traceIdentifier, null); } - public virtual void ResponseMininumDataRateNotSatisfied(string connectionId, string traceIdentifier) + public virtual void ResponseMinimumDataRateNotSatisfied(string connectionId, string traceIdentifier) { _responseMinimumDataRateNotSatisfied(_logger, connectionId, traceIdentifier, null); } diff --git a/src/Kestrel.Transport.Libuv/Internal/LibuvConnection.cs b/src/Kestrel.Transport.Libuv/Internal/LibuvConnection.cs index 1280e0c204..663f7bfbd5 100644 --- a/src/Kestrel.Transport.Libuv/Internal/LibuvConnection.cs +++ b/src/Kestrel.Transport.Libuv/Internal/LibuvConnection.cs @@ -23,7 +23,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal (handle, status, state) => ReadCallback(handle, status, state); private static readonly Func _allocCallback = - (handle, suggestedsize, state) => AllocCallback(handle, suggestedsize, state); + (handle, suggestedSize, state) => AllocCallback(handle, suggestedSize, state); private readonly UvStreamHandle _socket; private readonly CancellationTokenSource _connectionClosedTokenSource = new CancellationTokenSource(); diff --git a/src/Kestrel.Transport.Libuv/Internal/Listener.cs b/src/Kestrel.Transport.Libuv/Internal/Listener.cs index 5a89ebe545..e2c392d02d 100644 --- a/src/Kestrel.Transport.Libuv/Internal/Listener.cs +++ b/src/Kestrel.Transport.Libuv/Internal/Listener.cs @@ -187,7 +187,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal protected virtual void DispatchConnection(UvStreamHandle socket) { // REVIEW: This task should be tracked by the server for graceful shutdown - // Today it's handled specifically for http but not for aribitrary middleware + // Today it's handled specifically for http but not for arbitrary middleware _ = HandleConnectionAsync(socket); } diff --git a/src/Kestrel.Transport.Libuv/Internal/ListenerSecondary.cs b/src/Kestrel.Transport.Libuv/Internal/ListenerSecondary.cs index 2ef1ec2a12..3547047add 100644 --- a/src/Kestrel.Transport.Libuv/Internal/ListenerSecondary.cs +++ b/src/Kestrel.Transport.Libuv/Internal/ListenerSecondary.cs @@ -153,7 +153,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal DispatchPipe.Accept(acceptSocket); // REVIEW: This task should be tracked by the server for graceful shutdown - // Today it's handled specifically for http but not for aribitrary middleware + // Today it's handled specifically for http but not for arbitrary middleware _ = HandleConnectionAsync(acceptSocket); } catch (UvException ex) when (LibuvConstants.IsConnectionReset(ex.StatusCode)) diff --git a/src/Kestrel.Transport.Libuv/Internal/Networking/SockAddr.cs b/src/Kestrel.Transport.Libuv/Internal/Networking/SockAddr.cs index 5386749623..96fa624bcd 100644 --- a/src/Kestrel.Transport.Libuv/Internal/Networking/SockAddr.cs +++ b/src/Kestrel.Transport.Libuv/Internal/Networking/SockAddr.cs @@ -68,7 +68,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networkin int family = (int)_field0; if (PlatformApis.IsDarwin) { - // see explaination in example 4 + // see explanation in example 4 family = family >> 8; } family = family & 0xFF; diff --git a/test/Kestrel.Core.Tests/HttpConnectionTests.cs b/test/Kestrel.Core.Tests/HttpConnectionTests.cs index 8d0f1e418b..2ade6c44a6 100644 --- a/test/Kestrel.Core.Tests/HttpConnectionTests.cs +++ b/test/Kestrel.Core.Tests/HttpConnectionTests.cs @@ -82,7 +82,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests _httpConnection.Debugger = mockDebugger.Object; var bytesPerSecond = 100; var mockLogger = new Mock(); - mockLogger.Setup(l => l.RequestBodyMininumDataRateNotSatisfied(It.IsAny(), It.IsAny(), It.IsAny())).Throws(new InvalidOperationException("Should not log")); + mockLogger.Setup(l => l.RequestBodyMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny(), It.IsAny())).Throws(new InvalidOperationException("Should not log")); TickBodyWithMinimumDataRate(mockLogger.Object, bytesPerSecond); @@ -99,7 +99,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Timed out Assert.True(_httpConnection.RequestTimedOut); mockLogger.Verify(logger => - logger.RequestBodyMininumDataRateNotSatisfied(It.IsAny(), It.IsAny(), bytesPerSecond), Times.Once); + logger.RequestBodyMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny(), bytesPerSecond), Times.Once); } private void TickBodyWithMinimumDataRate(IKestrelTrace logger, int bytesPerSecond) @@ -155,7 +155,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Not timed out Assert.False(_httpConnection.RequestTimedOut); mockLogger.Verify(logger => - logger.RequestBodyMininumDataRateNotSatisfied(It.IsAny(), It.IsAny(), bytesPerSecond), Times.Never); + logger.RequestBodyMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny(), bytesPerSecond), Times.Never); // Tick after grace period w/ low data rate now += TimeSpan.FromSeconds(2); @@ -165,7 +165,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Timed out Assert.True(_httpConnection.RequestTimedOut); mockLogger.Verify(logger => - logger.RequestBodyMininumDataRateNotSatisfied(It.IsAny(), It.IsAny(), bytesPerSecond), Times.Once); + logger.RequestBodyMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny(), bytesPerSecond), Times.Once); } [Fact] @@ -202,7 +202,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Not timed out Assert.False(_httpConnection.RequestTimedOut); mockLogger.Verify(logger => - logger.RequestBodyMininumDataRateNotSatisfied(It.IsAny(), It.IsAny(), bytesPerSecond), Times.Never); + logger.RequestBodyMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny(), bytesPerSecond), Times.Never); // Data rate: 150 bytes/second now += TimeSpan.FromSeconds(1); @@ -212,7 +212,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Not timed out Assert.False(_httpConnection.RequestTimedOut); mockLogger.Verify(logger => - logger.RequestBodyMininumDataRateNotSatisfied(It.IsAny(), It.IsAny(), bytesPerSecond), Times.Never); + logger.RequestBodyMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny(), bytesPerSecond), Times.Never); // Data rate: 120 bytes/second now += TimeSpan.FromSeconds(1); @@ -222,7 +222,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Not timed out Assert.False(_httpConnection.RequestTimedOut); mockLogger.Verify(logger => - logger.RequestBodyMininumDataRateNotSatisfied(It.IsAny(), It.IsAny(), bytesPerSecond), Times.Never); + logger.RequestBodyMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny(), bytesPerSecond), Times.Never); // Data rate: 100 bytes/second now += TimeSpan.FromSeconds(1); @@ -232,7 +232,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Not timed out Assert.False(_httpConnection.RequestTimedOut); mockLogger.Verify(logger => - logger.RequestBodyMininumDataRateNotSatisfied(It.IsAny(), It.IsAny(), bytesPerSecond), Times.Never); + logger.RequestBodyMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny(), bytesPerSecond), Times.Never); // Data rate: ~85 bytes/second now += TimeSpan.FromSeconds(1); @@ -242,7 +242,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Timed out Assert.True(_httpConnection.RequestTimedOut); mockLogger.Verify(logger => - logger.RequestBodyMininumDataRateNotSatisfied(It.IsAny(), It.IsAny(), bytesPerSecond), Times.Once); + logger.RequestBodyMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny(), bytesPerSecond), Times.Once); } [Fact] @@ -285,7 +285,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Not timed out Assert.False(_httpConnection.RequestTimedOut); mockLogger.Verify( - logger => logger.RequestBodyMininumDataRateNotSatisfied(It.IsAny(), It.IsAny(), It.IsAny()), + logger => logger.RequestBodyMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny(), It.IsAny()), Times.Never); // Resume at 6.5s @@ -299,7 +299,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Not timed out Assert.False(_httpConnection.RequestTimedOut); mockLogger.Verify( - logger => logger.RequestBodyMininumDataRateNotSatisfied(It.IsAny(), It.IsAny(), It.IsAny()), + logger => logger.RequestBodyMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny(), It.IsAny()), Times.Never); // Tick at 10s, expected counted time is 7s, expected data rate drops below 100 bytes/second @@ -309,7 +309,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Timed out Assert.True(_httpConnection.RequestTimedOut); mockLogger.Verify( - logger => logger.RequestBodyMininumDataRateNotSatisfied(It.IsAny(), It.IsAny(), It.IsAny()), + logger => logger.RequestBodyMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny(), It.IsAny()), Times.Once); } @@ -341,7 +341,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Not timed out Assert.False(_httpConnection.RequestTimedOut); mockLogger.Verify( - logger => logger.RequestBodyMininumDataRateNotSatisfied(It.IsAny(), It.IsAny(), It.IsAny()), + logger => logger.RequestBodyMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny(), It.IsAny()), Times.Never); // Pause at 2.25s @@ -360,7 +360,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Not timed out Assert.False(_httpConnection.RequestTimedOut); mockLogger.Verify( - logger => logger.RequestBodyMininumDataRateNotSatisfied(It.IsAny(), It.IsAny(), It.IsAny()), + logger => logger.RequestBodyMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny(), It.IsAny()), Times.Never); // Tick at 4s, expected counted time is 4s, expected data rate drops below 100 bytes/second @@ -370,7 +370,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Timed out Assert.True(_httpConnection.RequestTimedOut); mockLogger.Verify( - logger => logger.RequestBodyMininumDataRateNotSatisfied(It.IsAny(), It.IsAny(), It.IsAny()), + logger => logger.RequestBodyMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny(), It.IsAny()), Times.Once); } @@ -539,7 +539,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } [Fact] - public async Task WriteTimingAbortsConnectionWhenRepeadtedSmallWritesDoNotCompleteWithMinimumDataRate() + public async Task WriteTimingAbortsConnectionWhenRepeatedSmallWritesDoNotCompleteWithMinimumDataRate() { var systemClock = new MockSystemClock(); var minResponseDataRate = new MinDataRate(bytesPerSecond: 100, gracePeriod: TimeSpan.FromSeconds(5)); diff --git a/test/Kestrel.Core.Tests/HttpParserTests.cs b/test/Kestrel.Core.Tests/HttpParserTests.cs index f40c25669b..825ee085de 100644 --- a/test/Kestrel.Core.Tests/HttpParserTests.cs +++ b/test/Kestrel.Core.Tests/HttpParserTests.cs @@ -494,7 +494,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } } - // Doesn't put empty blocks inbetween every byte + // Doesn't put empty blocks in between every byte internal class BytePerSegmentTestSequenceFactory : ReadOnlySequenceFactory { public static ReadOnlySequenceFactory Instance { get; } = new HttpParserTests.BytePerSegmentTestSequenceFactory(); diff --git a/test/Kestrel.Core.Tests/MessageBodyTests.cs b/test/Kestrel.Core.Tests/MessageBodyTests.cs index 870e89c47b..f52d8622e1 100644 --- a/test/Kestrel.Core.Tests/MessageBodyTests.cs +++ b/test/Kestrel.Core.Tests/MessageBodyTests.cs @@ -562,7 +562,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await body.StopAsync(); - // Add some more data. Checking for cancelation and exiting the loop + // Add some more data. Checking for cancellation and exiting the loop // should take priority over reading this data. input.Add("b"); diff --git a/test/Kestrel.Tests/ConfigurationReaderTests.cs b/test/Kestrel.Tests/ConfigurationReaderTests.cs index ecc7f5e587..6d9b58071d 100644 --- a/test/Kestrel.Tests/ConfigurationReaderTests.cs +++ b/test/Kestrel.Tests/ConfigurationReaderTests.cs @@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Tests public class ConfigurationReaderTests { [Fact] - public void ReadCertificatesWhenNoCertificatsSection_ReturnsEmptyCollection() + public void ReadCertificatesWhenNoCertificatesSection_ReturnsEmptyCollection() { var config = new ConfigurationBuilder().AddInMemoryCollection().Build(); var reader = new ConfigurationReader(config); diff --git a/test/Kestrel.Transport.BindTests/AddressRegistrationTests.cs b/test/Kestrel.Transport.BindTests/AddressRegistrationTests.cs index 7152851f37..a67d4bcaed 100644 --- a/test/Kestrel.Transport.BindTests/AddressRegistrationTests.cs +++ b/test/Kestrel.Transport.BindTests/AddressRegistrationTests.cs @@ -211,7 +211,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests RunTestWithStaticPort(port => RegisterAddresses_Success($"{addressInput}:{port}", testUrls, port)); [Fact] - public async Task RegisterHttpAddress_UpradedToHttpsByConfigureEndpointDefaults() + public async Task RegisterHttpAddress_UpgradedToHttpsByConfigureEndpointDefaults() { var hostBuilder = TransportSelector.GetWebHostBuilder() .UseKestrel(serverOptions => @@ -676,14 +676,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests [Theory] [InlineData("ftp://localhost")] [InlineData("ssh://localhost")] - public void ThrowsForUnsupportedAddressFromHosting(string addr) + public void ThrowsForUnsupportedAddressFromHosting(string address) { TestApplicationErrorLogger.IgnoredExceptions.Add(typeof(InvalidOperationException)); var hostBuilder = TransportSelector.GetWebHostBuilder() .ConfigureServices(AddTestLogging) .UseKestrel() - .UseUrls(addr) + .UseUrls(address) .Configure(ConfigureEchoAddress); using (var host = hostBuilder.Build()) @@ -786,7 +786,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests using (var socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp)) { - // Bind first to IPv6Any to ensure both the IPv4 and IPv6 ports are avaiable. + // Bind first to IPv6Any to ensure both the IPv4 and IPv6 ports are available. socket.Bind(new IPEndPoint(IPAddress.IPv6Any, 0)); socket.Listen(0); port = ((IPEndPoint)socket.LocalEndPoint).Port; diff --git a/test/Kestrel.Transport.FunctionalTests/ResponseTests.cs b/test/Kestrel.Transport.FunctionalTests/ResponseTests.cs index bc61229b9c..e38ea63639 100644 --- a/test/Kestrel.Transport.FunctionalTests/ResponseTests.cs +++ b/test/Kestrel.Transport.FunctionalTests/ResponseTests.cs @@ -470,7 +470,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests var mockKestrelTrace = new Mock(); mockKestrelTrace - .Setup(trace => trace.ResponseMininumDataRateNotSatisfied(It.IsAny(), It.IsAny())) + .Setup(trace => trace.ResponseMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny())) .Callback(() => responseRateTimeoutMessageLogged.SetResult(null)); mockKestrelTrace .Setup(trace => trace.ConnectionStop(It.IsAny())) @@ -560,7 +560,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests var mockKestrelTrace = new Mock(); mockKestrelTrace - .Setup(trace => trace.ResponseMininumDataRateNotSatisfied(It.IsAny(), It.IsAny())) + .Setup(trace => trace.ResponseMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny())) .Callback(() => responseRateTimeoutMessageLogged.SetResult(null)); mockKestrelTrace .Setup(trace => trace.ConnectionStop(It.IsAny())) @@ -645,7 +645,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests var mockKestrelTrace = new Mock(); mockKestrelTrace - .Setup(trace => trace.ResponseMininumDataRateNotSatisfied(It.IsAny(), It.IsAny())) + .Setup(trace => trace.ResponseMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny())) .Callback(() => responseRateTimeoutMessageLogged.SetResult(null)); mockKestrelTrace .Setup(trace => trace.ConnectionStop(It.IsAny())) @@ -779,7 +779,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests await AssertStreamCompleted(connection.Stream, minTotalOutputSize, targetBytesPerSecond); await appFuncCompleted.Task.DefaultTimeout(); - mockKestrelTrace.Verify(t => t.ResponseMininumDataRateNotSatisfied(It.IsAny(), It.IsAny()), Times.Never()); + mockKestrelTrace.Verify(t => t.ResponseMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny()), Times.Never()); mockKestrelTrace.Verify(t => t.ConnectionStop(It.IsAny()), Times.Once()); Assert.False(requestAborted); } @@ -854,7 +854,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests var targetBytesPerSecond = responseSize / 4; await AssertStreamCompleted(connection.Stream, minTotalOutputSize, targetBytesPerSecond); - mockKestrelTrace.Verify(t => t.ResponseMininumDataRateNotSatisfied(It.IsAny(), It.IsAny()), Times.Never()); + mockKestrelTrace.Verify(t => t.ResponseMinimumDataRateNotSatisfied(It.IsAny(), It.IsAny()), Times.Never()); mockKestrelTrace.Verify(t => t.ConnectionStop(It.IsAny()), Times.Once()); Assert.False(requestAborted); } diff --git a/test/shared/CompositeKestrelTrace.cs b/test/shared/CompositeKestrelTrace.cs index ecd82d1a99..8c9be6c1bc 100644 --- a/test/shared/CompositeKestrelTrace.cs +++ b/test/shared/CompositeKestrelTrace.cs @@ -153,16 +153,16 @@ namespace Microsoft.AspNetCore.Testing _trace2.RequestBodyDrainTimedOut(connectionId, traceIdentifier); } - public void RequestBodyMininumDataRateNotSatisfied(string connectionId, string traceIdentifier, double rate) + public void RequestBodyMinimumDataRateNotSatisfied(string connectionId, string traceIdentifier, double rate) { - _trace1.RequestBodyMininumDataRateNotSatisfied(connectionId, traceIdentifier, rate); - _trace2.RequestBodyMininumDataRateNotSatisfied(connectionId, traceIdentifier, rate); + _trace1.RequestBodyMinimumDataRateNotSatisfied(connectionId, traceIdentifier, rate); + _trace2.RequestBodyMinimumDataRateNotSatisfied(connectionId, traceIdentifier, rate); } - public void ResponseMininumDataRateNotSatisfied(string connectionId, string traceIdentifier) + public void ResponseMinimumDataRateNotSatisfied(string connectionId, string traceIdentifier) { - _trace1.ResponseMininumDataRateNotSatisfied(connectionId, traceIdentifier); - _trace2.ResponseMininumDataRateNotSatisfied(connectionId, traceIdentifier); + _trace1.ResponseMinimumDataRateNotSatisfied(connectionId, traceIdentifier); + _trace2.ResponseMinimumDataRateNotSatisfied(connectionId, traceIdentifier); } public void ApplicationAbortedConnection(string connectionId, string traceIdentifier) diff --git a/test/shared/TransportTestHelpers/IPv6ScopeIdPresentConditionAttribute.cs b/test/shared/TransportTestHelpers/IPv6ScopeIdPresentConditionAttribute.cs index f1705b9c7b..a1bab723cf 100644 --- a/test/shared/TransportTestHelpers/IPv6ScopeIdPresentConditionAttribute.cs +++ b/test/shared/TransportTestHelpers/IPv6ScopeIdPresentConditionAttribute.cs @@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests return NetworkInterface.GetAllNetworkInterfaces() .Where(iface => iface.OperationalStatus == OperationalStatus.Up) .SelectMany(iface => iface.GetIPProperties().UnicastAddresses) - .Any(addrInfo => addrInfo.Address.AddressFamily == AddressFamily.InterNetworkV6 && addrInfo.Address.ScopeId != 0); + .Any(addressInfo => addressInfo.Address.AddressFamily == AddressFamily.InterNetworkV6 && addressInfo.Address.ScopeId != 0); } catch (SocketException) { diff --git a/tools/CodeGenerator/KnownHeaders.cs b/tools/CodeGenerator/KnownHeaders.cs index 9d84bab347..5e16debf1d 100644 --- a/tools/CodeGenerator/KnownHeaders.cs +++ b/tools/CodeGenerator/KnownHeaders.cs @@ -269,7 +269,7 @@ namespace CodeGenerator PrimaryHeader = responsePrimaryHeaders.Contains("Content-Length") }}) .ToArray(); - // 63 for reponseHeaders as it steals one bit for Content-Length in CopyTo(ref MemoryPoolIterator output) + // 63 for responseHeaders as it steals one bit for Content-Length in CopyTo(ref MemoryPoolIterator output) Debug.Assert(responseHeaders.Length <= 63); Debug.Assert(responseHeaders.Max(x => x.Index) <= 62);