-
-
Notifications
You must be signed in to change notification settings - Fork 352
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
use framed codecs to avoid unbounded buffer #33
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pull request! This looks good to me, I only have minor comments.
The only other issue that I notice is the interaction between Framed
and proxy()
after a new connection from the client. Currently stream.get_mut()
turns the Framed
object back into its inner TcpStream
; however, this seems to be not correct if in the middle of a framed read, there are still bytes remaining in the internal buffer. I believe that these bytes will be skipped, which is a bug.
I'm basing this off the tokio::codec
documentation. Not sure if there's any tests that detect this error right now, but given my lack of understanding I feel like we should either:
- Write a test that catches it and fix it (e.g., by calling
Framed::read_buffer
if the bug exists, or - Explain why the bug doesn't exist.
ddf4d42
to
b8558fa
Compare
|
Thank you Prasanth! |
fixes #32
Edit:
If approach looks good, I will look into fixing test cases