Skip to content

Commit

Permalink
fix: extras data missing in stream unpack mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hefangshi committed Jun 14, 2016
1 parent 516de74 commit 858e58d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/ral.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,11 @@ RalRunner.prototype.doRequest = function () {
unpack.once('end', function () {
timer.end('unpack');
});
onData(unpack);
response.pipe(unpack);
// return unpack in nextTick to get correct extras data
process.nextTick(function () {
onData(unpack);
response.pipe(unpack);
});
}
else {
response.on('data', function (data) {
Expand Down

0 comments on commit 858e58d

Please sign in to comment.