Commit a8fc10c
authored
wasi/pipe: fix AsyncReadStream returning empty list when closed (#12816)
After the inner stream returns `0` the StreamError::Closed is sent to
the channel, and after picking it up in read() the stream is set as closed,
and the error is returned to the caller.
If the caller however tries to recv() after the socket is closed, AsyncReadStream
is going to return empty list and not StreamError::Closed which is ambiguous.1 parent ab78bd8 commit a8fc10c
1 file changed
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
243 | 251 | | |
244 | 252 | | |
245 | 253 | | |
| |||
382 | 390 | | |
383 | 391 | | |
384 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
385 | 398 | | |
386 | 399 | | |
387 | 400 | | |
| |||
445 | 458 | | |
446 | 459 | | |
447 | 460 | | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
448 | 465 | | |
449 | 466 | | |
450 | 467 | | |
| |||
0 commit comments