Skip to content

Commit bb95154

Browse files
committed
Fix StreamWriter::write_all wrt WebAssembly/component-model#490
Handle the fact that cancellation/0-length writes look the same.
1 parent 4536acf commit bb95154

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/guest-rust/rt/src/async_support/stream_support.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ impl<T> StreamWriter<T> {
160160
break;
161161
}
162162
(status, buf) = self.write_buf(buf).await;
163+
164+
// FIXME(WebAssembly/component-model#490)
165+
if status == StreamResult::Cancelled {
166+
status = StreamResult::Complete(0);
167+
}
163168
}
164169

165170
// Return back any values that weren't written by shifting them to the

0 commit comments

Comments
 (0)