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 <trev.norris@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
This commit is contained in:
parent
bb1bd76395
commit
af46112828
@ -726,7 +726,7 @@
|
|||||||
// not-reading state.
|
// not-reading state.
|
||||||
if (stdin._handle && stdin._handle.readStop) {
|
if (stdin._handle && stdin._handle.readStop) {
|
||||||
stdin._handle.reading = false;
|
stdin._handle.reading = false;
|
||||||
stdin.push('');
|
stdin._readableState.reading = false;
|
||||||
stdin._handle.readStop();
|
stdin._handle.readStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -735,7 +735,7 @@
|
|||||||
stdin.on('pause', function() {
|
stdin.on('pause', function() {
|
||||||
if (!stdin._handle)
|
if (!stdin._handle)
|
||||||
return;
|
return;
|
||||||
stdin.push('');
|
stdin._readableState.reading = false;
|
||||||
stdin._handle.reading = false;
|
stdin._handle.reading = false;
|
||||||
stdin._handle.readStop();
|
stdin._handle.readStop();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user