File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,10 +40,10 @@ impl AsyncRead for AsyncInputStream {
4040 // Ideally, the ABI would be able to read directly into buf. However, with the default
4141 // generated bindings, it returns a newly allocated vec, which we need to copy into buf.
4242 let read = match self . stream . read ( buf. len ( ) as u64 ) {
43- // 0 bytets from WASI's `read` just means we got zero bytes.
44- Ok ( r ) if r . is_empty ( ) => {
45- return Err ( std :: io :: Error :: from ( std :: io :: ErrorKind :: Interrupted ) )
46- }
43+ // We don't need to special-case 0 here: a value of 0 bytes from
44+ // WASI's `read` doesn't mean end-of-stream as it does in Rust,
45+ // however since we called `self.ready()`, we'll always get at
46+ // least one byte.
4747 Ok ( r) => r,
4848 // 0 bytes from Rust's `read` means end-of-stream.
4949 Err ( StreamError :: Closed ) => return Ok ( 0 ) ,
You can’t perform that action at this time.
0 commit comments