Skip to content

Commit 1ee90a8

Browse files
committed
Renames
1 parent c1c0247 commit 1ee90a8

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed

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

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class Http1OutputProducer : IHttpOutputProducer, IHttpOutputAborter, IDis
4949
private int _advancedBytesForChunk;
5050
private Memory<byte> _currentChunkMemory;
5151
private bool _currentChunkMemoryUpdated;
52-
private IMemoryOwner<byte> _completedMemoryOwner;
52+
private IMemoryOwner<byte> _fakeMemoryOwner;
5353

5454
public Http1OutputProducer(
5555
PipeWriter pipeWriter,
@@ -230,19 +230,24 @@ public void Dispose()
230230
{
231231
lock (_contextLock)
232232
{
233-
if (_completedMemoryOwner != null)
233+
if (_fakeMemoryOwner != null)
234234
{
235-
_completedMemoryOwner.Dispose();
236-
_completedMemoryOwner = null;
235+
_fakeMemoryOwner.Dispose();
236+
_fakeMemoryOwner = null;
237237
}
238238

239-
if (!_pipeWriterCompleted)
240-
{
241-
_log.ConnectionDisconnect(_connectionId);
242-
_pipeWriterCompleted = true;
243-
_completed = true;
244-
_pipeWriter.Complete();
245-
}
239+
CompletePipe();
240+
}
241+
}
242+
243+
private void CompletePipe()
244+
{
245+
if (!_pipeWriterCompleted)
246+
{
247+
_log.ConnectionDisconnect(_connectionId);
248+
_pipeWriterCompleted = true;
249+
_completed = true;
250+
_pipeWriter.Complete();
246251
}
247252
}
248253

@@ -259,7 +264,8 @@ public void Abort(ConnectionAbortedException error)
259264

260265
_aborted = true;
261266
_connectionContext.Abort(error);
262-
Dispose();
267+
268+
CompletePipe();
263269
}
264270
}
265271

@@ -379,11 +385,11 @@ private void WriteCurrentMemoryToPipeWriter()
379385

380386
private Memory<byte> GetFakeMemory(int sizeHint)
381387
{
382-
if (_completedMemoryOwner == null)
388+
if (_fakeMemoryOwner == null)
383389
{
384-
_completedMemoryOwner = _memoryPool.Rent(sizeHint);
390+
_fakeMemoryOwner = _memoryPool.Rent(sizeHint);
385391
}
386-
return _completedMemoryOwner.Memory;
392+
return _fakeMemoryOwner.Memory;
387393
}
388394
}
389395
}

src/Servers/Kestrel/Core/src/Internal/Http2/Http2OutputProducer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ ValueTask<FlushResult> IHttpOutputProducer.WriteChunkAsync(ReadOnlySpan<byte> da
260260

261261
public void Complete()
262262
{
263-
// This will noop for now. See:
263+
// This will noop for now. See: https://github.com/aspnet/AspNetCore/issues/7370
264264
}
265265

266266
private async ValueTask<FlushResult> ProcessDataWrites()

0 commit comments

Comments
 (0)