Skip to content

Commit

Permalink
fix ReadAtLeastAsync (dotnet#37130) (dotnet#37151)
Browse files Browse the repository at this point in the history
  • Loading branch information
wfurt authored Apr 24, 2019
1 parent 5d78c0f commit d06ce9d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ internal static async ValueTask<int> ReadAtLeastAsync(Stream stream, Memory<byte
int totalBytesRead = 0;
while (totalBytesRead < minReadBytes)
{
int bytesRead = await stream.ReadAsync(buffer).ConfigureAwait(false);
int bytesRead = await stream.ReadAsync(buffer.Slice(totalBytesRead)).ConfigureAwait(false);
if (bytesRead == 0)
{
throw new IOException(SR.net_http_invalid_response);
Expand Down

0 comments on commit d06ce9d

Please sign in to comment.