Closes GH-687 Don't read fs read stream if not open
This commit is contained in:
parent
1efac74958
commit
8b9dbdad27
@ -921,6 +921,9 @@ ReadStream.prototype.resume = function() {
|
|||||||
this.buffer = null;
|
this.buffer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// hasn't opened yet.
|
||||||
|
if (null == this.fd) return;
|
||||||
|
|
||||||
this._read();
|
this._read();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -119,3 +119,8 @@ stream.on('data', function(chunk) {
|
|||||||
stream.on('end', function() {
|
stream.on('end', function() {
|
||||||
assert.equal('x', stream.data);
|
assert.equal('x', stream.data);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// pause and then resume immediately.
|
||||||
|
var pauseRes = fs.createReadStream(rangeFile);
|
||||||
|
pauseRes.pause();
|
||||||
|
pauseRes.resume();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user