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

[ul] BUG: Share underlying buffer from client/server to PDataReader #606

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

naterichman
Copy link
Contributor

By creating a new read buffer in PDataReader, we potentially miss out on
any bytes that the receive() method read but didn't process yet.

Additionally, we lose the opposite when returning out of PDataReader:
remaining data in the PDataReader buffer that it didn't process.

The solution here is to mutably share that underlying read buffer with the
PDataReader so that it can continue from where the receive() method
left off and pass any data that it didn't read back to the read buffer
of the main Client or Server object.

By creating a new read buffer in PDataReader, we potentially miss out on
any bytes that the `receive()` method read but didn't process yet.

Additionally, we lose the opposite when returning out of `PDataReader`:
remaining data in the PDataReader buffer that it didn't process.

The solution here is to mutably share that underlying read buffer with the
`PDataReader` so that it can continue from where the `receive()` method
left off _and_ pass any data that it didn't read back to the read buffer
of the main `Client` or `Server` object.
@naterichman
Copy link
Contributor Author

Fixes #604

@Enet4 Enet4 added bug This is a bug A-lib Area: library C-ul Crate: dicom-ul labels Nov 26, 2024
@Enet4 Enet4 self-requested a review November 26, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lib Area: library bug This is a bug C-ul Crate: dicom-ul
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants