Fix: Multiple pipes to the same stream were broken
authorFelix Geisendörfer <felix@debuggable.com>
Thu, 14 Apr 2011 18:33:54 +0000 (20:33 +0200)
committerRyan Dahl <ry@tinyclouds.org>
Thu, 14 Apr 2011 21:12:01 +0000 (14:12 -0700)
commit6c5b31bd80d2d38600d84a5be0ae9c5bbad94c01
tree9e2a6d70414412470cdbfd4ffd3a198e40425f14
parent8417870f513e6f1ab98e07fe95d3430dbec48b87
Fix: Multiple pipes to the same stream were broken

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.

closes #929
lib/stream.js
test/simple/test-stream-pipe-cleanup.js