From: Roman Reiss Date: Mon, 26 Oct 2015 12:30:54 +0000 (+0100) Subject: src: Revert "nix stdin _readableState.reading" X-Git-Tag: v4.2.4~144 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=946fe6158b8b63120c09b5c9c2ba2eef411c447c;p=platform%2Fupstream%2Fnodejs.git src: Revert "nix stdin _readableState.reading" This reverts 8cee8f5 which was causing stdin to behave strangely on Windows 8 and 10. The suspected explanation for the issue is that there might be a race condition occuring when stdin._readableState.reading is set indirectly through `push('')`. PR-URL: https://github.com/nodejs/node/pull/3490 Fixes: https://github.com/nodejs/node/issues/2996 Fixes: https://github.com/nodejs/node/issues/2504 Reviewed-By: Trevor Norris Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Rod Vagg --- diff --git a/src/node.js b/src/node.js index 1aa489b..5a4496e 100644 --- a/src/node.js +++ b/src/node.js @@ -715,7 +715,7 @@ // not-reading state. if (stdin._handle && stdin._handle.readStop) { stdin._handle.reading = false; - stdin.push(''); + stdin._readableState.reading = false; stdin._handle.readStop(); } @@ -724,7 +724,7 @@ stdin.on('pause', function() { if (!stdin._handle) return; - stdin.push(''); + stdin._readableState.reading = false; stdin._handle.reading = false; stdin._handle.readStop(); });