Skip to content

Commit 34f30cc

Browse files
author
Evan Oxfeld
committed
Stop piping when data descriptor is reached
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.
1 parent 6a98337 commit 34f30cc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/parse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Parse.prototype._readFile = function () {
162162
if (hasEntryListener) {
163163
this.push(buf);
164164
}
165-
setImmediate(function() {
165+
process.nextTick(function() {
166166
self._pullStream.unpipe();
167167
self._pullStream.prepend(extra);
168168
self._processDataDescriptor(entry);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"binary": "~0.3.0",
2525
"readable-stream": "~1.0.0",
2626
"setimmediate": "~1.0.1",
27-
"match-stream": "0.0.1"
27+
"match-stream": "~0.0.2"
2828
},
2929
"devDependencies": {
3030
"tap": "~0.3.0",

0 commit comments

Comments
 (0)