From 2937fc3c98d16df2e7c11012ed72ab92a252a9be Mon Sep 17 00:00:00 2001 From: Ben Adams Date: Sun, 29 Nov 2015 03:57:47 +0000 Subject: [PATCH] OnConnection->OnConnectionAsync Resolves #433 --- .../HttpsConnectionFilter.cs | 4 ++-- .../Filter/IConnectionFilter.cs | 2 +- .../Filter/LoggingConnectionFilter.cs | 4 ++-- .../Filter/NoOpConnectionFilter.cs | 2 +- src/Microsoft.AspNet.Server.Kestrel/Http/Connection.cs | 2 +- .../ConnectionFilterTests.cs | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Microsoft.AspNet.Server.Kestrel.Https/HttpsConnectionFilter.cs b/src/Microsoft.AspNet.Server.Kestrel.Https/HttpsConnectionFilter.cs index 1d13d6fb2e..615a846c1a 100644 --- a/src/Microsoft.AspNet.Server.Kestrel.Https/HttpsConnectionFilter.cs +++ b/src/Microsoft.AspNet.Server.Kestrel.Https/HttpsConnectionFilter.cs @@ -36,9 +36,9 @@ namespace Microsoft.AspNet.Server.Kestrel.Https _previous = previous; } - public async Task OnConnection(ConnectionFilterContext context) + public async Task OnConnectionAsync(ConnectionFilterContext context) { - await _previous.OnConnection(context); + await _previous.OnConnectionAsync(context); if (string.Equals(context.Address.Scheme, "https", StringComparison.OrdinalIgnoreCase)) { diff --git a/src/Microsoft.AspNet.Server.Kestrel/Filter/IConnectionFilter.cs b/src/Microsoft.AspNet.Server.Kestrel/Filter/IConnectionFilter.cs index accaa3b9d9..437e4e3ed9 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Filter/IConnectionFilter.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Filter/IConnectionFilter.cs @@ -7,6 +7,6 @@ namespace Microsoft.AspNet.Server.Kestrel.Filter { public interface IConnectionFilter { - Task OnConnection(ConnectionFilterContext context); + Task OnConnectionAsync(ConnectionFilterContext context); } } diff --git a/src/Microsoft.AspNet.Server.Kestrel/Filter/LoggingConnectionFilter.cs b/src/Microsoft.AspNet.Server.Kestrel/Filter/LoggingConnectionFilter.cs index 1858715ea9..e34e4fcb50 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Filter/LoggingConnectionFilter.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Filter/LoggingConnectionFilter.cs @@ -27,9 +27,9 @@ namespace Microsoft.AspNet.Server.Kestrel.Filter _previous = previous; } - public async Task OnConnection(ConnectionFilterContext context) + public async Task OnConnectionAsync(ConnectionFilterContext context) { - await _previous.OnConnection(context); + await _previous.OnConnectionAsync(context); context.Connection = new LoggingStream(context.Connection, _logger); } diff --git a/src/Microsoft.AspNet.Server.Kestrel/Filter/NoOpConnectionFilter.cs b/src/Microsoft.AspNet.Server.Kestrel/Filter/NoOpConnectionFilter.cs index 95ecc7a50a..663aea65d3 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Filter/NoOpConnectionFilter.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Filter/NoOpConnectionFilter.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Filter { public class NoOpConnectionFilter : IConnectionFilter { - public Task OnConnection(ConnectionFilterContext context) + public Task OnConnectionAsync(ConnectionFilterContext context) { return TaskUtilities.CompletedTask; } diff --git a/src/Microsoft.AspNet.Server.Kestrel/Http/Connection.cs b/src/Microsoft.AspNet.Server.Kestrel/Http/Connection.cs index 03c2a619b9..b49cb06921 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Http/Connection.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Http/Connection.cs @@ -80,7 +80,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http try { - ConnectionFilter.OnConnection(_filterContext).ContinueWith((task, state) => + ConnectionFilter.OnConnectionAsync(_filterContext).ContinueWith((task, state) => { var connection = (Connection)state; diff --git a/test/Microsoft.AspNet.Server.KestrelTests/ConnectionFilterTests.cs b/test/Microsoft.AspNet.Server.KestrelTests/ConnectionFilterTests.cs index 5dbe530f14..d0947f8d4c 100644 --- a/test/Microsoft.AspNet.Server.KestrelTests/ConnectionFilterTests.cs +++ b/test/Microsoft.AspNet.Server.KestrelTests/ConnectionFilterTests.cs @@ -118,7 +118,7 @@ namespace Microsoft.AspNet.Server.KestrelTests private RewritingStream _rewritingStream; - public Task OnConnection(ConnectionFilterContext context) + public Task OnConnectionAsync(ConnectionFilterContext context) { _rewritingStream = new RewritingStream(context.Connection); context.Connection = _rewritingStream; @@ -130,7 +130,7 @@ namespace Microsoft.AspNet.Server.KestrelTests private class AsyncConnectionFilter : IConnectionFilter { - public async Task OnConnection(ConnectionFilterContext context) + public async Task OnConnectionAsync(ConnectionFilterContext context) { var oldConnection = context.Connection; @@ -144,7 +144,7 @@ namespace Microsoft.AspNet.Server.KestrelTests private class ThrowingConnectionFilter : IConnectionFilter { - public Task OnConnection(ConnectionFilterContext context) + public Task OnConnectionAsync(ConnectionFilterContext context) { throw new Exception(); }