Merge branch 'benaadams/flush' into dev
This commit is contained in:
commit
2895447cbe
|
|
@ -71,6 +71,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Adapter.Internal
|
||||||
_inner.Flush();
|
_inner.Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override Task FlushAsync(CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
return _inner.FlushAsync(cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
public override int Read(byte[] buffer, int offset, int count)
|
public override int Read(byte[] buffer, int offset, int count)
|
||||||
{
|
{
|
||||||
int read = _inner.Read(buffer, offset, count);
|
int read = _inner.Read(buffer, offset, count);
|
||||||
|
|
|
||||||
|
|
@ -117,13 +117,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Adapter.Internal
|
||||||
|
|
||||||
public override void Flush()
|
public override void Flush()
|
||||||
{
|
{
|
||||||
// No-op since writes are immediate.
|
_output.Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Task FlushAsync(CancellationToken cancellationToken)
|
public override Task FlushAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
// No-op since writes are immediate.
|
return _output.FlushAsync(cancellationToken);
|
||||||
return TaskCache.CompletedTask;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ValueTask<int> ReadAsync(ArraySegment<byte> buffer)
|
private ValueTask<int> ReadAsync(ArraySegment<byte> buffer)
|
||||||
|
|
|
||||||
|
|
@ -114,14 +114,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Adapter.Internal
|
||||||
end.Block.Pool.Return(end.Block);
|
end.Block.Pool.Return(end.Block);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flush no-ops. We rely on connection filter streams to auto-flush.
|
|
||||||
public void Flush()
|
public void Flush()
|
||||||
{
|
{
|
||||||
|
_outputStream.Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task FlushAsync(CancellationToken cancellationToken)
|
public Task FlushAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
return TaskCache.CompletedTask;
|
return _outputStream.FlushAsync(cancellationToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,12 @@ namespace Microsoft.AspNetCore.Server.KestrelTests
|
||||||
|
|
||||||
public override void Flush()
|
public override void Flush()
|
||||||
{
|
{
|
||||||
// No-op
|
_innerStream.Flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Task FlushAsync(CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
return _innerStream.FlushAsync(cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int Read(byte[] buffer, int offset, int count)
|
public override int Read(byte[] buffer, int offset, int count)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue