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 <trev.norris@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
  • Loading branch information
silverwind authored and rvagg committed Dec 4, 2015
1 parent 28474ef commit 08e23eb
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 08e23eb

Please sign in to comment.