From d9ccf235fd8844bacdae25e7c409f7d95cc73899 Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Wed, 15 Jan 2020 16:39:50 -0800 Subject: [PATCH] Final bad conflicts --- .../CookiePolicy/test/CookieChunkingTests.cs | 23 ------------------- .../src/Internal/HttpConnectionContext.cs | 21 ----------------- .../server/Core/src/HubConnectionContext.cs | 20 ---------------- 3 files changed, 64 deletions(-) diff --git a/src/Security/CookiePolicy/test/CookieChunkingTests.cs b/src/Security/CookiePolicy/test/CookieChunkingTests.cs index a8b8c59305..4b65df4073 100644 --- a/src/Security/CookiePolicy/test/CookieChunkingTests.cs +++ b/src/Security/CookiePolicy/test/CookieChunkingTests.cs @@ -44,29 +44,6 @@ namespace Microsoft.AspNetCore.Internal Assert.Equal($"TestCookie={testString}; expires={now.AddMinutes(5).ToString("R")}; max-age=300; domain=foo.com; path=/bar; secure; samesite=strict; httponly", values[0]); } - [Fact] - public void AppendLargeCookie_WithOptions_Appended() - { - HttpContext context = new DefaultHttpContext(); - var now = DateTimeOffset.UtcNow; - var options = new CookieOptions - { - Domain = "foo.com", - HttpOnly = true, - SameSite = SameSiteMode.Strict, - Path = "/bar", - Secure = true, - Expires = now.AddMinutes(5), - MaxAge = TimeSpan.FromMinutes(5) - }; - var testString = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - new ChunkingCookieManager() { ChunkSize = null }.AppendResponseCookie(context, "TestCookie", testString, options); - - var values = context.Response.Headers["Set-Cookie"]; - Assert.Single(values); - Assert.Equal($"TestCookie={testString}; expires={now.AddMinutes(5).ToString("R")}; max-age=300; domain=foo.com; path=/bar; secure; samesite=strict; httponly", values[0]); - } - [Fact] public void AppendLargeCookieWithLimit_Chunked() { diff --git a/src/SignalR/common/Http.Connections/src/Internal/HttpConnectionContext.cs b/src/SignalR/common/Http.Connections/src/Internal/HttpConnectionContext.cs index b496aa370e..abf6b69524 100644 --- a/src/SignalR/common/Http.Connections/src/Internal/HttpConnectionContext.cs +++ b/src/SignalR/common/Http.Connections/src/Internal/HttpConnectionContext.cs @@ -334,27 +334,6 @@ namespace Microsoft.AspNetCore.Http.Connections.Internal Transport?.Output.Complete(); Transport?.Input.Complete(); } - - Application?.Input.CancelPendingRead(); - - await transportTask.NoThrow(); - Application?.Input.Complete(); - - Log.WaitingForTransportAndApplication(_logger, TransportType); - - // A poorly written application *could* in theory get stuck forever and it'll show up as a memory leak - // Wait for application so we can complete the writer safely - await applicationTask.NoThrow(); - Log.TransportAndApplicationComplete(_logger, TransportType); - - // Shutdown application side now that it's finished - Transport?.Output.Complete(applicationTask.Exception?.InnerException); - - // Close the reading side after both sides run - Transport?.Input.Complete(); - - // Observe exceptions - await Task.WhenAll(transportTask, applicationTask); } // Notify all waiters that we're done disposing diff --git a/src/SignalR/server/Core/src/HubConnectionContext.cs b/src/SignalR/server/Core/src/HubConnectionContext.cs index b299b2c93b..1dc7ad89c4 100644 --- a/src/SignalR/server/Core/src/HubConnectionContext.cs +++ b/src/SignalR/server/Core/src/HubConnectionContext.cs @@ -702,26 +702,6 @@ namespace Microsoft.AspNetCore.SignalR _receivedMessageTimeoutEnabled = false; } } - finally - { - _ = InnerAbortConnection(connection); - } - } - - private static async Task InnerAbortConnection(HubConnectionContext connection) - { - // We lock to make sure all writes are done before triggering the completion of the pipe - await connection._writeLock.WaitAsync(); - try - { - // Communicate the fact that we're finished triggering abort callbacks - // HubOnDisconnectedAsync is waiting on this to complete the Pipe - connection._abortCompletedTcs.TrySetResult(null); - } - finally - { - connection._writeLock.Release(); - } } private static class Log