From 7446fe4cc7bcfdf210376a972d31cd160f782c58 Mon Sep 17 00:00:00 2001 From: Stephen Halter Date: Wed, 29 Jul 2015 20:03:04 -0700 Subject: [PATCH] Update SocketOutputTests to account for the "immediate" Write param --- src/Microsoft.AspNet.Server.Kestrel/Http/SocketOutput.cs | 2 +- .../SocketOutputTests.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.AspNet.Server.Kestrel/Http/SocketOutput.cs b/src/Microsoft.AspNet.Server.Kestrel/Http/SocketOutput.cs index 7ff695fc52..c48cb87ed1 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Http/SocketOutput.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Http/SocketOutput.cs @@ -36,7 +36,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http _callbacksPending = new Queue(); } - public void Write(ArraySegment buffer, Action callback, object state, bool immediate) + public void Write(ArraySegment buffer, Action callback, object state, bool immediate = true) { //TODO: need buffering that works var copy = new byte[buffer.Count]; diff --git a/test/Microsoft.AspNet.Server.KestrelTests/SocketOutputTests.cs b/test/Microsoft.AspNet.Server.KestrelTests/SocketOutputTests.cs index bb95a96507..072feecc4f 100644 --- a/test/Microsoft.AspNet.Server.KestrelTests/SocketOutputTests.cs +++ b/test/Microsoft.AspNet.Server.KestrelTests/SocketOutputTests.cs @@ -51,7 +51,7 @@ namespace Microsoft.AspNet.Server.KestrelTests }; // Act - socketOutput.Write(buffer, onCompleted, state: null); + socketOutput.Write(buffer, onCompleted, null); // Assert Assert.True(completedWh.Wait(100)); @@ -94,14 +94,14 @@ namespace Microsoft.AspNet.Server.KestrelTests }; // Act - socketOutput.Write(buffer, onCompleted, state: null); + socketOutput.Write(buffer, onCompleted, null); // Assert // The first write should pre-complete since it is <= _maxBytesPreCompleted. Assert.True(completedWh.Wait(100)); // Arrange completedWh.Reset(); // Act - socketOutput.Write(buffer, onCompleted, state: null); + socketOutput.Write(buffer, onCompleted, null); // Assert // Too many bytes are already pre-completed for the second write to pre-complete. Assert.False(completedWh.Wait(100));