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

Wait until channel read completes before decoding packet. #3

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

Conversation

wassup-
Copy link

@wassup- wassup- commented Mar 13, 2021

When reading large(ish) amounts of data, it is possible this data is read in multiple passes.
This means that channelRead could be called multiple times in succession, each time receiving only a chunk of the full data.

To prevent trying to decode partial data, we must postpone the packet decoding until the channel read operation completes, which is we should do this in channelReadComplete instead.

I have also inserted calls to forward operations to the next handler in the pipeline, as suggested by the documentation of the protocol functions.

wassup- added 3 commits March 13, 2021 07:44
when reading large amounts of data, this data may be read in multiple passes.
we must wait until all data has been read before trying to decode a packet from this data.
@wassup-
Copy link
Author

wassup- commented Mar 13, 2021

Fixes #4

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.

1 participant