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

stream: clean-up packet parsing #25

Merged
merged 1 commit into from
May 14, 2018

Conversation

yjh0502
Copy link
Contributor

@yjh0502 yjh0502 commented May 13, 2018

This PR introduces parse_packet to cleanup packet parsing in Stream. The PR actually fixes several problems/bugs.

  • EOF handling: AyncRead returns Ready(0) on EOF, but Stream didn't handle it correctly [1]. The PR handles the problem.
  • Ensure that exact amount of data is fed into PacketParser. It seems that PacketParser required to receive exact amount of data returned by PacketParser::parse.

The PR solves problems I observed while using the library.

[1] https://github.com/blackbeam/mysql_async/blob/master/src/io/mod.rs#L298

@blackbeam blackbeam merged commit a8a1503 into blackbeam:master May 14, 2018
@blackbeam
Copy link
Owner

Thanks for your work.

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.

2 participants