Final bad conflicts
This commit is contained in:
parent
93a51f5f13
commit
d9ccf235fd
|
|
@ -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]);
|
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]
|
[Fact]
|
||||||
public void AppendLargeCookieWithLimit_Chunked()
|
public void AppendLargeCookieWithLimit_Chunked()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -334,27 +334,6 @@ namespace Microsoft.AspNetCore.Http.Connections.Internal
|
||||||
Transport?.Output.Complete();
|
Transport?.Output.Complete();
|
||||||
Transport?.Input.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
|
// Notify all waiters that we're done disposing
|
||||||
|
|
|
||||||
|
|
@ -702,26 +702,6 @@ namespace Microsoft.AspNetCore.SignalR
|
||||||
_receivedMessageTimeoutEnabled = false;
|
_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
|
private static class Log
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue