Skip to content

Commit

Permalink
Stop piping when data descriptor is reached
Browse files Browse the repository at this point in the history
setImmediate happens on the next tick and allows I/O, causing writes to
the MatchStream after it should have ended.

Only fixes this issue in Node 0.10.x. In node 0.8.x, process.nextTick
has similar behavior to setImmediate.
  • Loading branch information
Evan Oxfeld committed Apr 4, 2013
1 parent 6a98337 commit 34f30cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Parse.prototype._readFile = function () {
if (hasEntryListener) {
this.push(buf);
}
setImmediate(function() {
process.nextTick(function() {
self._pullStream.unpipe();
self._pullStream.prepend(extra);
self._processDataDescriptor(entry);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"binary": "~0.3.0",
"readable-stream": "~1.0.0",
"setimmediate": "~1.0.1",
"match-stream": "0.0.1"
"match-stream": "~0.0.2"
},
"devDependencies": {
"tap": "~0.3.0",
Expand Down

0 comments on commit 34f30cc

Please sign in to comment.