Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Newton-King <james@newtonking.com>2022-08-30 06:55:39 +0300
committerJames Newton-King <james@newtonking.com>2022-08-30 06:55:39 +0300
commit2983980177e6736cd43aed14a5f19f01cbe3bfe6 (patch)
tree053fb751ccd2e5069926dba64f744490c398edba
parent4fc34ae0bc15a854661711b0fd5e0dd99d323dbc (diff)
QUIC: Don't complete writes on abortjamesnk/quic-abort
-rw-r--r--src/Servers/Kestrel/Kestrel.slnf1
-rw-r--r--src/Servers/Kestrel/Transport.Quic/src/Internal/QuicStreamContext.cs10
2 files changed, 8 insertions, 3 deletions
diff --git a/src/Servers/Kestrel/Kestrel.slnf b/src/Servers/Kestrel/Kestrel.slnf
index 5841f4e445..a973803211 100644
--- a/src/Servers/Kestrel/Kestrel.slnf
+++ b/src/Servers/Kestrel/Kestrel.slnf
@@ -26,6 +26,7 @@
"src\\Middleware\\Diagnostics\\src\\Microsoft.AspNetCore.Diagnostics.csproj",
"src\\Middleware\\HostFiltering\\src\\Microsoft.AspNetCore.HostFiltering.csproj",
"src\\Middleware\\HttpOverrides\\src\\Microsoft.AspNetCore.HttpOverrides.csproj",
+ "src\\Middleware\\StaticFiles\\src\\Microsoft.AspNetCore.StaticFiles.csproj",
"src\\ObjectPool\\src\\Microsoft.Extensions.ObjectPool.csproj",
"src\\Security\\Authentication\\Core\\src\\Microsoft.AspNetCore.Authentication.csproj",
"src\\Security\\Authorization\\Core\\src\\Microsoft.AspNetCore.Authorization.csproj",
diff --git a/src/Servers/Kestrel/Transport.Quic/src/Internal/QuicStreamContext.cs b/src/Servers/Kestrel/Transport.Quic/src/Internal/QuicStreamContext.cs
index 9a95793a59..5f0a7d31e1 100644
--- a/src/Servers/Kestrel/Transport.Quic/src/Internal/QuicStreamContext.cs
+++ b/src/Servers/Kestrel/Transport.Quic/src/Internal/QuicStreamContext.cs
@@ -465,7 +465,7 @@ internal partial class QuicStreamContext : TransportConnection, IPooledStream, I
}
finally
{
- ShutdownWrite(_shutdownWriteReason ?? _shutdownReason ?? shutdownReason);
+ ShutdownWrite(shutdownReason);
await waitForWritesClosedTask;
@@ -525,10 +525,14 @@ internal partial class QuicStreamContext : TransportConnection, IPooledStream, I
{
lock (_shutdownLock)
{
- _shutdownReason = shutdownReason ?? SendGracefullyCompletedException;
+ _shutdownReason = _shutdownWriteReason ?? _shutdownReason ?? shutdownReason ?? SendGracefullyCompletedException;
QuicLog.StreamShutdownWrite(_log, this, _shutdownReason.Message);
- _stream.CompleteWrites();
+ // Only complete writes for a graceful shutdown.
+ if (_shutdownReason == SendGracefullyCompletedException)
+ {
+ _stream.CompleteWrites();
+ }
}
}
catch (Exception ex)