Skip to content

Commit

Permalink
QUIC: Don't complete writes on abort (dotnet#43630)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK authored Sep 2, 2022
1 parent d34e667 commit e3509ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Servers/Kestrel/Kestrel.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ private async ValueTask DoSendAsync()
}
finally
{
ShutdownWrite(_shutdownWriteReason ?? _shutdownReason ?? shutdownReason);
ShutdownWrite(shutdownReason);

await waitForWritesClosedTask;

Expand Down Expand Up @@ -525,10 +525,14 @@ private void ShutdownWrite(Exception? shutdownReason)
{
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)
Expand Down

0 comments on commit e3509ec

Please sign in to comment.