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: poll_read: wrong behavior on half close #362

Merged
merged 2 commits into from
Aug 31, 2022

Conversation

umiro
Copy link

@umiro umiro commented Aug 31, 2022

this fixes #360.

修改

  • process_flags以前会在内部将LocalClosingReset状态转换到Closed,阻止poll_read观测Closed的来源,现在将状态保留了,drop部分对应Reset的检查也有更新。
  • check_self_state现在返回一个Result<Option<Result>>,表示存在不需要读底层的流就能向用户返回数据的情况(根据约定,对EOF返回一个零长度的读)。
  • 以前yamux在一端shutdown后,另一方向的流也会出现问题,所以放宽了poll_read, poll_write等几个函数中的一些flag检查,现在可以在shutdown之后继续调用read读取数据了。

yamux/src/stream.rs Outdated Show resolved Hide resolved
@driftluo driftluo merged commit dceb87c into nervosnetwork:master Aug 31, 2022
@umiro umiro deleted the dev5 branch August 31, 2022 09:01
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.

read on StreamHandle returns UnexpectedEof instead of Ok(0)
3 participants