node: ensure that streams2 won't `.end()` stdin

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: https://github.com/iojs/io.js/issues/1068
PR-URL: https://github.com/iojs/io.js/pull/1233
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
This commit is contained in:
Fedor Indutny 2015-03-21 16:19:04 -07:00
Родитель 999fbe9d96
Коммит 9ae1a61214
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -630,6 +630,8 @@
writable: false
});
}
// Make sure the stdin can't be `.end()`-ed
stdin._writableState.ended = true;
break;
default: