Skip to content
This repository has been archived by the owner on Feb 5, 2022. It is now read-only.

Commit

Permalink
add transfer event. #1
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Jun 4, 2013
1 parent 321152f commit 043e4cd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,11 @@ Client.prototype.write = function(options, callback) {
var _write = function(handle) {
self.emit('write', options);
var lastIndex = 0;
async.eachSeries(contents, function(content, callback) {
sftp.write(handle, content, 0, content.length, lastIndex, function(err) {
lastIndex += content.length;

async.eachSeries(contents, function(buf, callback) {
self.emit('transfer', buf);
sftp.write(handle, buf, 0, buf.length, lastIndex, function(err) {
lastIndex += buf.length;
callback(err);
});
}, function(err) {
Expand Down

0 comments on commit 043e4cd

Please sign in to comment.