Merge branch 'benaadams/connectionfilter' into dev

This commit is contained in:
Stephen Halter 2015-12-02 19:21:05 -08:00
commit 7cbbf68e9d
6 changed files with 10 additions and 10 deletions

View File

@ -36,9 +36,9 @@ namespace Microsoft.AspNet.Server.Kestrel.Https
_previous = previous; _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)) if (string.Equals(context.Address.Scheme, "https", StringComparison.OrdinalIgnoreCase))
{ {

View File

@ -7,6 +7,6 @@ namespace Microsoft.AspNet.Server.Kestrel.Filter
{ {
public interface IConnectionFilter public interface IConnectionFilter
{ {
Task OnConnection(ConnectionFilterContext context); Task OnConnectionAsync(ConnectionFilterContext context);
} }
} }

View File

@ -27,9 +27,9 @@ namespace Microsoft.AspNet.Server.Kestrel.Filter
_previous = previous; _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); context.Connection = new LoggingStream(context.Connection, _logger);
} }

View File

@ -9,7 +9,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Filter
{ {
public class NoOpConnectionFilter : IConnectionFilter public class NoOpConnectionFilter : IConnectionFilter
{ {
public Task OnConnection(ConnectionFilterContext context) public Task OnConnectionAsync(ConnectionFilterContext context)
{ {
return TaskUtilities.CompletedTask; return TaskUtilities.CompletedTask;
} }

View File

@ -80,7 +80,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
try try
{ {
ConnectionFilter.OnConnection(_filterContext).ContinueWith((task, state) => ConnectionFilter.OnConnectionAsync(_filterContext).ContinueWith((task, state) =>
{ {
var connection = (Connection)state; var connection = (Connection)state;

View File

@ -118,7 +118,7 @@ namespace Microsoft.AspNet.Server.KestrelTests
private RewritingStream _rewritingStream; private RewritingStream _rewritingStream;
public Task OnConnection(ConnectionFilterContext context) public Task OnConnectionAsync(ConnectionFilterContext context)
{ {
_rewritingStream = new RewritingStream(context.Connection); _rewritingStream = new RewritingStream(context.Connection);
context.Connection = _rewritingStream; context.Connection = _rewritingStream;
@ -130,7 +130,7 @@ namespace Microsoft.AspNet.Server.KestrelTests
private class AsyncConnectionFilter : IConnectionFilter private class AsyncConnectionFilter : IConnectionFilter
{ {
public async Task OnConnection(ConnectionFilterContext context) public async Task OnConnectionAsync(ConnectionFilterContext context)
{ {
var oldConnection = context.Connection; var oldConnection = context.Connection;
@ -144,7 +144,7 @@ namespace Microsoft.AspNet.Server.KestrelTests
private class ThrowingConnectionFilter : IConnectionFilter private class ThrowingConnectionFilter : IConnectionFilter
{ {
public Task OnConnection(ConnectionFilterContext context) public Task OnConnectionAsync(ConnectionFilterContext context)
{ {
throw new Exception(); throw new Exception();
} }