File tree 2 files changed +6
-5
lines changed
Transport.Quic/src/Internal
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -637,9 +637,6 @@ public async Task ProcessRequestAsync<TContext>(IHttpApplication<TContext> appli
637
637
}
638
638
finally
639
639
{
640
- var streamError = error as ConnectionAbortedException
641
- ?? new ConnectionAbortedException ( "The stream has completed." , error ! ) ;
642
-
643
640
await Input . CompleteAsync ( ) ;
644
641
645
642
// Once the header is finished being received then the app has started.
@@ -692,6 +689,9 @@ public async Task ProcessRequestAsync<TContext>(IHttpApplication<TContext> appli
692
689
}
693
690
catch
694
691
{
692
+ var streamError = error as ConnectionAbortedException
693
+ ?? new ConnectionAbortedException ( "The stream has completed." , error ! ) ;
694
+
695
695
Abort ( streamError , Http3ErrorCode . ProtocolError ) ;
696
696
throw ;
697
697
}
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Internal;
14
14
15
15
internal partial class QuicStreamContext : TransportConnection , IPooledStream , IDisposable
16
16
{
17
+ private static readonly ConnectionAbortedException SendGracefullyCompletedException = new ConnectionAbortedException ( "The QUIC transport's send loop completed gracefully." ) ;
18
+
17
19
// Internal for testing.
18
20
internal Task _processingTask = Task . CompletedTask ;
19
21
@@ -499,8 +501,7 @@ private void ShutdownWrite(Exception? shutdownReason)
499
501
{
500
502
lock ( _shutdownLock )
501
503
{
502
- // TODO: Exception is always allocated. Consider only allocating if receive hasn't completed.
503
- _shutdownReason = shutdownReason ?? new ConnectionAbortedException ( "The QUIC transport's send loop completed gracefully." ) ;
504
+ _shutdownReason = shutdownReason ?? SendGracefullyCompletedException ;
504
505
QuicLog . StreamShutdownWrite ( _log , this , _shutdownReason . Message ) ;
505
506
506
507
_stream . Shutdown ( ) ;
You can’t perform that action at this time.
0 commit comments