Skip to content

Commit da8b6ed

Browse files
committed
update
1 parent cbf8d68 commit da8b6ed

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ private Memory<byte> GetChunkedMemory(int sizeHint)
538538
}
539539

540540
var memoryMaxLength = _currentChunkMemory.Length - BeginChunkLengthMax - EndChunkLength;
541-
if (_advancedBytesForChunk >= memoryMaxLength - sizeHint)
541+
if (_advancedBytesForChunk >= memoryMaxLength - sizeHint && _advancedBytesForChunk > 0)
542542
{
543543
// Chunk is completely written, commit it to the pipe so GetMemory will return a new chunk of memory.
544544
var writer = new BufferWriter<PipeWriter>(_pipeWriter);

src/Servers/Kestrel/test/InMemory.FunctionalTests/ChunkedResponseTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ public async Task GetMemoryWithSizeHintWithoutStartAsync()
920920
Assert.Equal(4096, memory.Length);
921921

922922
memory = response.BodyWriter.GetMemory(1000000);
923-
Assert.Equal(4096, memory.Length);
923+
Assert.Equal(1000000, memory.Length);
924924
await Task.CompletedTask;
925925
}, testContext))
926926
{

0 commit comments

Comments
 (0)