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

Fix RecvStream::is_end_stream(): return true only when END_STREAM is received #810

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eaufavor
Copy link
Contributor

@eaufavor eaufavor commented Nov 4, 2024

Before this change, it returned true on other types of disconnection as well.

Fixes #806

Removed unused is_recv_closed().

pub fn is_recv_closed(&self) -> bool {
matches!(
self.inner,
Closed(..) | HalfClosedRemote(..) | ReservedLocal
Copy link
Member

Choose a reason for hiding this comment

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

I've given this some thought, and I'm less sure that we want the check to be so strict. If it is half-closed successfully, I think we do want to say that the RecvStream is finished. If there is later an error on the sending side, I don't think that should be a problem, the SendStream will notice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Updated to check both Closed(Cause::EndStream) and HalfClosedRemote(..). Also updated the function name accordingly.

…received

Before this change, it returned true on other types of disconnection as
well.

Fixes hyperium#806
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 this pull request may close these issues.

RecvStream::is_end_stream() shouldn't return true after encountering error
2 participants