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

The size_hint for the Timeout stream is wrong #3901

Closed
Darksonn opened this issue Jun 28, 2021 · 0 comments · Fixed by #3902
Closed

The size_hint for the Timeout stream is wrong #3901

Darksonn opened this issue Jun 28, 2021 · 0 comments · Fixed by #3902
Labels
A-tokio-stream Area: The tokio-stream crate C-bug Category: This is a bug. M-time Module: tokio/time

Comments

@Darksonn
Copy link
Contributor

The timeout stream currently provides the following size_hint

fn size_hint(&self) -> (usize, Option<usize>) {
self.stream.size_hint()
}

However the timeout stream may insert additional errors into the stream, and those must be counted in the size hint's upper bound.

@Darksonn Darksonn added C-bug Category: This is a bug. A-tokio-stream Area: The tokio-stream crate M-time Module: tokio/time labels Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-stream Area: The tokio-stream crate C-bug Category: This is a bug. M-time Module: tokio/time
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant