Skip to content

rust: mark streams done after Dropped(0) - #1755

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
macovedj:stream-dropped-zero
Oct 22, 2026
Merged

alexcrichton merged 1 commit into
bytecodealliance:mainfrom
macovedj:stream-dropped-zero

Conversation

@macovedj

Copy link
Copy Markdown
Contributor

When a stream reports that its peer has dropped, subsequent reads or writes should return StreamResult::Dropped without calling the host again.

For Dropped(0), wit-bindgen returns the result without recording that the stream has ended. A later operation therefore calls stream.read or stream.write again, which traps because further I/O after a dropped notification is forbidden by the host.

This is resolved by settting the reader and writer’s done flags when handling Dropped(0).

@alexcrichton
alexcrichton added this pull request to the merge queue Oct 22, 2026
Merged via the queue into bytecodealliance:main with commit 9d4895e Oct 22, 2026
31 checks passed
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.

2 participants