Commit 7f71f50
committed
fixup! stream: pass ERR_STREAM_WRITE_AFTER_END to .end(cb) after end
The previous version always synthesized ERR_STREAM_WRITE_AFTER_END
when kEnding was set, which broke test-stream-writable-end-cb-error
block 1: a writable whose underlying _write errors with `_err`, and
whose `.end(cb1)` and `.end(cb2)` are both expected to receive that
underlying error via kOnFinished.
Tighten the condition to only synthesize WRITE_AFTER_END when the
stream has no in-flight write (kWriting), no buffered data
(kBuffered), no stored error (kErrored), and an empty buffer length.
In any of those cases there is real pending state that will surface a
meaningful error through the existing kOnFinished cascade, so the cb
should be queued and receive that real error instead.
Signed-off-by: Maruthan G <[email protected]>1 parent be655c5 commit 7f71f50
1 file changed
Lines changed: 9 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
845 | 845 | | |
846 | 846 | | |
847 | 847 | | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
855 | 857 | | |
856 | 858 | | |
857 | 859 | | |
| |||
0 commit comments