Skip to content

Commit 4d1e865

Browse files
authored
Fix StreamWriter::write_all wrt WebAssembly/component-model#490 (#1259)
Handle the fact that cancellation/0-length writes look the same.
1 parent 8694d56 commit 4d1e865

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

+5
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)