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

Add method that exposes the internal buffer of StreamReader #4559

Merged
merged 2 commits into from
Mar 23, 2022

Conversation

b-naber
Copy link
Contributor

@b-naber b-naber commented Mar 9, 2022

Attempt to fix #4552 by exposing the internal buffer of StreamReader.

@Darksonn Darksonn added A-tokio-util Area: The tokio-util crate M-io Module: tokio/io labels Mar 16, 2022
Comment on lines 99 to 105
if let Some(chunk) = self.chunk {
if chunk.remaining() > 0 {
return (self.inner, Some(chunk));
}
}

(self.inner, None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if let Some(chunk) = self.chunk {
if chunk.remaining() > 0 {
return (self.inner, Some(chunk));
}
}
(self.inner, None)
if self.has_chunk() {
(self.inner, self.chunk)
} else {
(self.inner, None)
}

@Darksonn Darksonn merged commit f84c4d5 into tokio-rs:master Mar 23, 2022
@b-naber b-naber deleted the StreamReader-internal-buffer branch March 23, 2022 20:04
masa-koz pushed a commit to masa-koz/tokio that referenced this pull request Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-util Area: The tokio-util crate M-io Module: tokio/io
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StreamReader.into_inner should return its held chunk
2 participants