Skip to content

Commit 8d721cf

Browse files
Reuse HttpProtocol CTS (#31466)
1 parent d33567d commit 8d721cf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,11 @@ public void Reset()
400400
lock (_abortLock)
401401
{
402402
_preventRequestAbortedCancellation = false;
403-
localAbortCts = _abortedCts;
404-
_abortedCts = null;
403+
if (_abortedCts?.TryReset() == false)
404+
{
405+
localAbortCts = _abortedCts;
406+
_abortedCts = null;
407+
}
405408
}
406409

407410
localAbortCts?.Dispose();

0 commit comments

Comments
 (0)