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 Fishrock123 committed Nov 10, 2015
1 parent b663d2b commit 2498e29
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 @@ -726,7 +726,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 @@ -735,7 +735,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 2498e29

Please sign in to comment.