Skip to content

Commit

Permalink
node: ensure that streams2 won't .end() stdin
Browse files Browse the repository at this point in the history
Stdin is purely read-only stream. Although, `net.Socket` might be used
to create it if stdin is in fact a Pipe or TCP socket, the
`stream.Duplex` should not try to call `.end()` on it.

Fix: #1068
PR-URL: #1233
Reviewed-By: Chris Dickinson <[email protected]>
  • Loading branch information
indutny committed Mar 22, 2015
1 parent 999fbe9 commit 9ae1a61
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,8 @@
writable: false
});
}
// Make sure the stdin can't be `.end()`-ed
stdin._writableState.ended = true;
break;

default:
Expand Down

0 comments on commit 9ae1a61

Please sign in to comment.