Closed xujihui1985 closed 9 years ago
if (this.__sftp) {
callback(null, this.__sftp);
return;
}
var remote = _.defaults(this.remote, this._options);
if (this.__ssh) {
this.__ssh.connect(remote);
return;
}
when I try to call client.scp second time, it complain that then connection has already close, that's because this.ssh has closed but the reference is still there, so when it check `this.sftp` it return true and returned immediatly
I thought, it's better to set the two underlining object to null after closed, so it will create a new client then.
})
in this demo, the next callback will be called twice thus done will be called twice