Skip to content

Commit c1799e1

Browse files
committed
Correct fix
1 parent 283396a commit c1799e1

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/Servers/Kestrel/Core/src/Internal/Http/Http1ContentLengthMessageBody.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public override async ValueTask<ReadResult> ReadAsync(CancellationToken cancella
5757
}
5858
catch (ConnectionAbortedException ex)
5959
{
60-
Log.RequestBodyDrainTimedOut(_context.ConnectionIdFeature, _context.TraceIdentifier);
6160
throw new TaskCanceledException("The request was aborted", ex);
6261
}
6362

src/Servers/Kestrel/Core/src/Internal/Http/Http1MessageBody.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ protected override Task OnConsumeAsync()
5555
_context.SetBadRequestState(ex);
5656
return Task.CompletedTask;
5757
}
58-
catch (ConnectionAbortedException)
59-
{
60-
Log.RequestBodyDrainTimedOut(_context.ConnectionIdFeature, _context.TraceIdentifier);
61-
}
6258
catch (InvalidOperationException ex)
6359
{
6460
var connectionAbortedException = new ConnectionAbortedException(CoreStrings.ConnectionAbortedByApplication, ex);
@@ -91,7 +87,7 @@ protected async Task OnConsumeAsyncAwaited()
9187
{
9288
_context.SetBadRequestState(ex);
9389
}
94-
catch (ConnectionAbortedException)
90+
catch (OperationCanceledException ex) when (ex is ConnectionAbortedException || ex is TaskCanceledException)
9591
{
9692
Log.RequestBodyDrainTimedOut(_context.ConnectionIdFeature, _context.TraceIdentifier);
9793
}

0 commit comments

Comments
 (0)