Merge pull request #10 from stewarttylerr/sandbotorg-master
Sandbotorg master
This commit is contained in:
@@ -132,7 +132,7 @@ Returns new directory relative to cwd
|
||||
> Used in `CWD`, `CDUP`
|
||||
|
||||
`mkdir(path)`
|
||||
Return a path to a newly created directory
|
||||
Returns a path to a newly created directory
|
||||
|
||||
> Used in `MKD`
|
||||
|
||||
@@ -164,7 +164,7 @@ Modify a file or directory's permissions
|
||||
> Used in `SITE CHMOD`
|
||||
|
||||
`getUniqueName()`
|
||||
Return a unique file name to write to
|
||||
Returns a unique file name to write to
|
||||
|
||||
> Used in `STOU`
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ const commands = [
|
||||
require('./registration/pasv'),
|
||||
require('./registration/port'),
|
||||
require('./registration/pwd'),
|
||||
require('./registration/quit'),
|
||||
require('./registration/retr'),
|
||||
require('./registration/rmd'),
|
||||
require('./registration/rnfr'),
|
||||
|
||||
@@ -42,12 +42,10 @@ class FtpConnection {
|
||||
}
|
||||
|
||||
close(code = 421, message = 'Closing connection') {
|
||||
return when(() => {
|
||||
if (code) return this.reply(code, message);
|
||||
})
|
||||
.then(() => {
|
||||
if (this.commandSocket) this.commandSocket.end();
|
||||
});
|
||||
return when
|
||||
.resolve(code)
|
||||
.then(code => code && this.reply(code, message))
|
||||
.then(() => this.commandSocket && this.commandSocket.end());
|
||||
}
|
||||
|
||||
login(username, password) {
|
||||
|
||||
@@ -46,7 +46,7 @@ describe('Connector - Passive //', function () {
|
||||
});
|
||||
|
||||
it('has invalid pasv range', function (done) {
|
||||
delete mockConnection.server.options.pasv_range;
|
||||
mockConnection.server.options.pasv_range = -1;
|
||||
|
||||
passive.setupServer()
|
||||
.then(() => done('should not happen'))
|
||||
@@ -85,7 +85,8 @@ describe('Connector - Passive //', function () {
|
||||
expect(passive.dataServer).to.exist;
|
||||
|
||||
const {port} = passive.dataServer.address();
|
||||
net.createConnection(port, () => {
|
||||
net.createConnection(port);
|
||||
passive.dataServer.once('connection', () => {
|
||||
setTimeout(() => {
|
||||
expect(passive.connection.reply.callCount).to.equal(1);
|
||||
expect(passive.connection.reply.args[0][0]).to.equal(550);
|
||||
|
||||
@@ -235,4 +235,10 @@ describe('FtpServer', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('QUIT', done => {
|
||||
client.once('close', done)
|
||||
client.logout(err => {
|
||||
expect(err).to.be.undefined;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user