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

Commit 21608ce

Browse files
committed
Merge pull request #69 from toyamarinyon/fix/close-the-connection-when-download-is-complete
Close the connection when download is complete
2 parents a710ec8 + 2c2ef7f commit 21608ce

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/client.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ Client.prototype.download = function(src, dest, callback) {
298298
sftp_readStream.pipe(fs.createWriteStream(dest))
299299
.on('close',function(){
300300
self.emit('read', src);
301+
self.close();
301302
callback(null);
302303
})
303304
.on('error', function(err){

0 commit comments

Comments
 (0)