Skip to content

Commit 4440023

Browse files
committed
Use Debug.Assert
1 parent 4d30367 commit 4440023

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,9 @@ public void Reset()
415415
if (!_connectionAborted && _abortedCts is not null)
416416
{
417417
// _connectionAborted is terminal and only set inside the _abortLock, so if it isn't set here,
418-
// it has not been canceled yet.
419-
Trace.Assert(_abortedCts.TryReset());
418+
// _abortedCts has not been canceled yet.
419+
var resetSuccess = _abortedCts.TryReset();
420+
Debug.Assert(resetSuccess);
420421
}
421422
}
422423

src/Servers/Kestrel/Core/src/Internal/Http3/Http3Connection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,8 +610,8 @@ private async Task CreateHttp3Stream<TContext>(ConnectionContext streamContext,
610610
}
611611
else
612612
{
613-
reusableStream.InitializeWithExistingContext(streamContext.Transport);
614613
stream = reusableStream;
614+
reusableStream.InitializeWithExistingContext(streamContext.Transport);
615615
}
616616

617617
_streamLifetimeHandler.OnStreamCreated(stream);

0 commit comments

Comments
 (0)