Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Stream#pipe bugfixes #929

Closed
wants to merge 3 commits into from
Closed

Stream#pipe bugfixes #929

wants to merge 3 commits into from

Conversation

felixge
Copy link

@felixge felixge commented Apr 14, 2011

This pull request includes 2 bug fixes and one whitespace fix.

Please check the commits for details and feel free to cherry-pick.

Some readable streams may only emit a 'close' event, and no 'end'
event. This patch fixes Stream#pipe so that it will still call
end() on the destination stream in that case.

Note: The test case for this patch also exposed another issue where
multiple pipes to the same writable stream will each call end() on
the source. This will break all remaining pipes.
When creating multiple .pipe()s to the same destination stream, the
first source to end would close the destination, breaking all remaining
pipes. This patch fixes the problem by keeping track of all open
pipes, so that we only call end on destinations that have no more
sources piping to them.
@ry ry closed this in 6c5b31b Apr 14, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants