Skip to content

Commit

Permalink
src: Revert "nix stdin _readableState.reading"
Browse files Browse the repository at this point in the history
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: #3490
Fixes: #2996
Fixes: #2504
Reviewed-By: Trevor Norris <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Rod Vagg <[email protected]>
  • Loading branch information
silverwind authored and jasnell committed Dec 17, 2015
1 parent d1b5833 commit 9b05905
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand All @@ -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();
});
Expand Down

0 comments on commit 9b05905

Please sign in to comment.