Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Commit

Permalink
Sync over multi async should just wait once
Browse files Browse the repository at this point in the history
  • Loading branch information
benaadams committed Jan 17, 2016
1 parent 2a3c33b commit 0ccdd69
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,7 @@ protected async Task FireOnCompleted()

public void Flush()
{
ProduceStartAndFireOnStarting(immediate: false).GetAwaiter().GetResult();
SocketOutput.Write(_emptyData, immediate: true);
FlushAsync(CancellationToken.None).GetAwaiter().GetResult();
}

public async Task FlushAsync(CancellationToken cancellationToken)
Expand All @@ -413,20 +412,7 @@ public async Task FlushAsync(CancellationToken cancellationToken)

public void Write(ArraySegment<byte> data)
{
ProduceStartAndFireOnStarting(immediate: false).GetAwaiter().GetResult();

if (_autoChunk)
{
if (data.Count == 0)
{
return;
}
WriteChunkedAsync(data, RequestAborted);
}
else
{
SocketOutput.Write(data, immediate: true);
}
WriteAsync(data, CancellationToken.None).GetAwaiter().GetResult();
}

public Task WriteAsync(ArraySegment<byte> data, CancellationToken cancellationToken)
Expand Down

0 comments on commit 0ccdd69

Please sign in to comment.