Skip to content

Commit

Permalink
tar: use stat data to avoid buffering where possible. needs tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ctalkington committed Jul 4, 2014
1 parent bfc1cc2 commit 162ca3b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/modules/tar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ Tar.prototype.append = function(source, data, callback) {

if (data.sourceType === 'buffer') {
append(null, source);
} else if (data.sourceType === 'stream' && data._stats) {
data.size = data._stats.size;

var entry = self.engine.entry(data, function(err) {
callback(err, data);
});

source.pipe(entry);
} else if (data.sourceType === 'stream') {
util.collectStream(source, append);
}
Expand Down

0 comments on commit 162ca3b

Please sign in to comment.