diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/Http1OutputProducer.cs b/src/Servers/Kestrel/Core/src/Internal/Http/Http1OutputProducer.cs index 7e1aca76e1..58297f2979 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/Http1OutputProducer.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/Http1OutputProducer.cs @@ -481,10 +481,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { Debug.Assert(_currentSegmentOwner == null); Debug.Assert(_completedSegments == null || _completedSegments.Count == 0); - _autoChunk = false; - _startCalled = false; - _currentChunkMemoryUpdated = false; + // Cleared in sequential address ascending order _currentMemoryPrefixBytes = 0; + _autoChunk = false; + _currentChunkMemoryUpdated = false; + _startCalled = false; } private ValueTask WriteAsync(