Skip to content

Commit dcc4be5

Browse files
Fixed exception type for ConnectionShutdownInitiatedByTransport (#60244)
Co-authored-by: ManickaP <mapichov@microsoft.com>
1 parent d262c21 commit dcc4be5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicConnection.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,11 @@ private static uint HandleEventShutdownInitiatedByTransport(State state, ref Con
283283
state.ConnectTcs = null;
284284
}
285285

286+
// To throw QuicConnectionAbortedException (instead of QuicOperationAbortedException) out of AcceptStreamAsync() since
287+
// it wasn't our side who shutdown the connection.
288+
// We should rather keep the Status and propagate it either in a different exception or as a different field of QuicConnectionAbortedException.
289+
// See: https://github.com/dotnet/runtime/issues/60133
290+
state.AbortErrorCode = 0;
286291
state.AcceptQueue.Writer.TryComplete();
287292
return MsQuicStatusCodes.Success;
288293
}

0 commit comments

Comments
 (0)