Skip to content

Commit

Permalink
fix: Large buffer will cause FlushAsync block
Browse files Browse the repository at this point in the history
  • Loading branch information
HMBSbige committed Sep 3, 2021
1 parent f3f12a7 commit 1be52fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Pipelines.Extensions/SocketPipe/SocketPipeWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void CloseSocketIfNeeded()

public override async ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default)
{
var flushResult = await Writer.FlushAsync(cancellationToken);
var flushTask = Writer.FlushAsync(cancellationToken);

try
{
Expand All @@ -105,7 +105,7 @@ public override async ValueTask<FlushResult> FlushAsync(CancellationToken cancel
throw;
}

return flushResult;
return await flushTask;
}
}
}
4 changes: 2 additions & 2 deletions Pipelines.Extensions/WebSocketPipe/WebSocketPipeWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public override void Complete(Exception? exception = null)

public override async ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken = default)
{
var flushResult = await Writer.FlushAsync(cancellationToken);
var flushTask = Writer.FlushAsync(cancellationToken);

try
{
Expand All @@ -76,7 +76,7 @@ public override async ValueTask<FlushResult> FlushAsync(CancellationToken cancel
throw;
}

return flushResult;
return await flushTask;
}
}
}

0 comments on commit 1be52fa

Please sign in to comment.