Skip to content

Conversation

dkropachev
Copy link
Collaborator

FrameReader and FrameWriter has code that reads from the Stream. This code uses Stream.Read which does not guarantee that requested number of bytes are read and it does not check how much bytes it read.

Simple solution would to be replace it with Stream.ReadExactly, but it is not supported in net6.

So, only choice here is implement a code that blocks until requested bytes are read.

@dkropachev dkropachev force-pushed the dk/replace-unsafe-stream-read branch from e305d3d to a6279b7 Compare October 16, 2025 11:18
@dkropachev dkropachev requested a review from wprzytula October 16, 2025 11:19
@dkropachev dkropachev force-pushed the dk/replace-unsafe-stream-read branch from a6279b7 to 10c37d7 Compare October 16, 2025 13:51
`FrameReader` and `FrameWriter` has code that reads from the Stream.
This code uses `Stream.Read` which does not guarantee that requested
number of bytes are read and it does not check how much bytes it read.

Simple solution would to be replace it with `Stream.ReadExactly`, but it
is not supported in net6.

So, only choice here is implement a code that blocks until requested
bytes are read.
Test is designed for protocol v5, but uses GetResponse with default V4,
which endsup in error.
@dkropachev dkropachev force-pushed the dk/replace-unsafe-stream-read branch from 10c37d7 to ef317d7 Compare October 16, 2025 13:52
@sylwiaszunejko sylwiaszunejko merged commit d6fafee into scylladb:master Oct 16, 2025
6 checks passed
@dkropachev dkropachev deleted the dk/replace-unsafe-stream-read branch October 16, 2025 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants