-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Lines::poll_next
panics if the reader returns an error after returning data
#2862
Comments
|
hkratz
added a commit
to hkratz/futures-rs
that referenced
this issue
Sep 14, 2024
Fixes the following issues in `AsyncBufRead::read_line`: * When the future is dropped the previous string contents are not restored so the string is empty. * If invalid UTF-8 is encountered the previous string contents are not restored. * If an IO error occurs after `read_until_internal` already read a couple of bytes a debug assertion fails. * Performance: The whole string to which read contents are appended is check for UTF-8 validity instead of just the added bytes. * Fixes the following issues in `AsyncBufRead::read_line` * If an IO error occurs after `read_until_internal` already read a couple of bytes a debug assertion fails. (rust-lang#2862) Fixes rust-lang#2862.
hkratz
added a commit
to hkratz/futures-rs
that referenced
this issue
Sep 14, 2024
Fixes the following issues in `AsyncBufRead::read_line`: * When the future is dropped the previous string contents are not restored so the string is empty. * If invalid UTF-8 is encountered the previous string contents are not restored. * If an IO error occurs after `read_until_internal` already read a couple of bytes a debug assertion fails. * Performance: The whole string to which read contents are appended is check for UTF-8 validity instead of just the added bytes. * Fixes the following issues in `AsyncBufRead::read_line` * If an IO error occurs after `read_until_internal` already read a couple of bytes a debug assertion fails. (rust-lang#2862) Fixes rust-lang#2862.
taiki-e
pushed a commit
that referenced
this issue
Oct 5, 2024
#2884) Fixes the following issues in `AsyncBufRead::read_line`: * When the future is dropped the previous string contents are not restored so the string is empty. * If invalid UTF-8 is encountered the previous string contents are not restored. * If an IO error occurs after `read_until_internal` already read a couple of bytes a debug assertion fails. * Performance: The whole string to which read contents are appended is check for UTF-8 validity instead of just the added bytes. Fixes the following issues in `AsyncBufRead::read_line`: * If an IO error occurs after `read_until_internal` already read a couple of bytes a debug assertion fails. (#2862) Fixes #2862
taiki-e
pushed a commit
that referenced
this issue
Oct 5, 2024
#2884) Fixes the following issues in `AsyncBufRead::read_line`: * When the future is dropped the previous string contents are not restored so the string is empty. * If invalid UTF-8 is encountered the previous string contents are not restored. * If an IO error occurs after `read_until_internal` already read a couple of bytes a debug assertion fails. * Performance: The whole string to which read contents are appended is check for UTF-8 validity instead of just the added bytes. Fixes the following issues in `AsyncBufRead::read_line`: * If an IO error occurs after `read_until_internal` already read a couple of bytes a debug assertion fails. (#2862) Fixes #2862
taiki-e
pushed a commit
that referenced
this issue
Oct 5, 2024
#2884) Fixes the following issues in `AsyncBufRead::read_line`: * When the future is dropped the previous string contents are not restored so the string is empty. * If invalid UTF-8 is encountered the previous string contents are not restored. * If an IO error occurs after `read_until_internal` already read a couple of bytes a debug assertion fails. * Performance: The whole string to which read contents are appended is check for UTF-8 validity instead of just the added bytes. Fixes the following issues in `AsyncBufRead::read_line`: * If an IO error occurs after `read_until_internal` already read a couple of bytes a debug assertion fails. (#2862) Fixes #2862
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
0.3.30:
Lines::poll_next
propagates the error from reader before it restores the invariant thatbuf
is empty. This results in panics on IO failures.https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=488083df8fff1bae3dd22cabbb405451
Output:
The text was updated successfully, but these errors were encountered: