fix(chunkstream): max call stack thrown when parsing large pngs

This commit is contained in:
steelsojka 2013-11-22 16:21:22 -06:00
parent 82dd9a96c0
commit df84165ca3

View file

@ -48,14 +48,16 @@ ChunkStream.prototype.read = function(length, callback) {
func: callback
});
this._process();
process.nextTick(function() {
this._process();
// its paused and there is not enought data then ask for more
if (this._paused && this._reads.length > 0) {
this._paused = false;
// its paused and there is not enought data then ask for more
if (this._paused && this._reads.length > 0) {
this._paused = false;
this.emit('drain');
}
this.emit('drain');
}
}.bind(this));
};
ChunkStream.prototype.write = function(data, encoding) {