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

Potential non-terminating loop in tokio_io::length_delimited::FramedWrite #497

Closed
twittner opened this issue Jul 20, 2018 · 0 comments · Fixed by #576
Closed

Potential non-terminating loop in tokio_io::length_delimited::FramedWrite #497

twittner opened this issue Jul 20, 2018 · 0 comments · Fixed by #576

Comments

@twittner
Copy link
Contributor

tokio_io::length_delimited::FramedWrite::do_write does not handle Ok(Async::Ready(0)) specifically, which could be returned from AsyncWrite::write_buf, which calls AsyncWrite::poll_write, which in turn calls std::io::Write::write, whose documentation states: "A return value of 0 typically means that the underlying object is no longer able to accept bytes and will likely not be able to in the future as well [...]". Instead, the loop will continue and if Ok(Async::Ready(0)) is returned consistently, never terminate.

@kpp kpp mentioned this issue Jul 20, 2018
6 tasks
hawkw added a commit to hawkw/tokio that referenced this issue Aug 25, 2018
hawkw added a commit to hawkw/tokio that referenced this issue Aug 30, 2018
@tobz tobz closed this as completed in #576 Aug 31, 2018
tobz pushed a commit that referenced this issue Aug 31, 2018
…#576)

* tokio-io: fix non-terminating loop in length_delimited::FramedWrite (#497)
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 a pull request may close this issue.

2 participants