Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
fix ReadAtLeastAsync (#37130) (#37151)
Browse files Browse the repository at this point in the history
  • Loading branch information
wfurt committed Apr 24, 2019
1 parent 5d78c0f commit d06ce9d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Original file line 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; int totalBytesRead = 0;
while (totalBytesRead < minReadBytes) while (totalBytesRead < minReadBytes)
{ {
int bytesRead = await stream.ReadAsync(buffer).ConfigureAwait(false); int bytesRead = await stream.ReadAsync(buffer.Slice(totalBytesRead)).ConfigureAwait(false);
if (bytesRead == 0) if (bytesRead == 0)
{ {
throw new IOException(SR.net_http_invalid_response); throw new IOException(SR.net_http_invalid_response);
Expand Down

0 comments on commit d06ce9d

Please sign in to comment.