Skip to content

Commit cf039bd

Browse files
authored
Merge pull request #16 from fsmanuel/fix/fast-put
Close sftp channels/connections
2 parents b69204e + b7adc75 commit cf039bd

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

lib/ssh-client.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ module.exports = CoreObject.extend({
6060

6161
stream.on('error', reject);
6262
stream.on('finish', resolve);
63+
stream.on('close', function() {
64+
sftp.end();
65+
});
6366
stream.write(data);
6467
stream.end();
6568
});
@@ -77,6 +80,8 @@ module.exports = CoreObject.extend({
7780
}
7881

7982
sftp.readFile(path, {}, function (error, data) {
83+
sftp.end();
84+
8085
if (error) {
8186
reject(error);
8287
} else {
@@ -120,6 +125,8 @@ module.exports = CoreObject.extend({
120125
}
121126

122127
sftp.fastPut(src, dest, {}, function (err) {
128+
sftp.end();
129+
123130
if (err) {
124131
reject(err);
125132
}

0 commit comments

Comments
 (0)