Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dropped bytes when bulk reading from uv streams with oversized bufs #35695

Merged
merged 1 commit into from
May 3, 2020

Conversation

Keno
Copy link
Member

@Keno Keno commented May 2, 2020

In readbytes!(s::UVStream, buf::AbstractVector{UInt8}, nb), we wrap buf
in a PipeBuffer of maxsize nb and swap it in as the main buffer for the
stream s. However, when we inform libuv of the size of the buffer,
we instead use the size of the underlying array, which can be larger.
In that case, we probably either drop bytes or override something that
the user did not want overriden.

…ffers

In readbytes!(s::UVStream, buf::AbstractVector{UInt8}, nb), we wrap `buf`
in a PipeBuffer of maxsize nb and swap it in as the main buffer for the
stream `s`. However, when we inform libuv of the size of the buffer,
we instead use the size of the underlying array, which can be larger.
In that case, we probably either drop bytes or override something that
the user did not want overriden.
@Keno Keno added io Involving the I/O subsystem: libuv, read, write, etc. embarrassing-bugfix Whoops! backport 1.4 labels May 2, 2020
@Keno Keno merged commit 3a84b51 into master May 3, 2020
@Keno Keno deleted the kf/readbytesfix branch May 3, 2020 06:29
KristofferC pushed a commit that referenced this pull request May 10, 2020
…ffers (#35695)

In readbytes!(s::UVStream, buf::AbstractVector{UInt8}, nb), we wrap `buf`
in a PipeBuffer of maxsize nb and swap it in as the main buffer for the
stream `s`. However, when we inform libuv of the size of the buffer,
we instead use the size of the underlying array, which can be larger.
In that case, we probably either drop bytes or override something that
the user did not want overriden.

(cherry picked from commit 3a84b51)
@KristofferC KristofferC mentioned this pull request May 10, 2020
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
embarrassing-bugfix Whoops! io Involving the I/O subsystem: libuv, read, write, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant