mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 21:40:21 +00:00
Merge pull request #13160 from EricByers/ftpd-changes
Adding ftpd logLevel to options and runtime, also adding tests
This commit is contained in:
+5
-3
@@ -9,7 +9,8 @@ var options: ftpd.FtpServerOptions = {
|
||||
},
|
||||
getRoot: function(connection: ftpd.FtpConnection): string {
|
||||
return '/';
|
||||
}
|
||||
},
|
||||
logLevel: ftpd.LogLevel.ERROR
|
||||
};
|
||||
|
||||
var host: string = '10.0.0.42';
|
||||
@@ -21,11 +22,12 @@ server.on('client:connected', function(conn: ftpd.FtpConnection): void {
|
||||
success();
|
||||
});
|
||||
conn.on('command:pass', function(
|
||||
pass: string,
|
||||
success: (username: string, fs?: ftpd.FtpFileSystem) => void,
|
||||
pass: string,
|
||||
success: (username: string, fs?: ftpd.FtpFileSystem) => void,
|
||||
failure: () => void) {
|
||||
success("Rogier");
|
||||
});
|
||||
});
|
||||
|
||||
server.debugging = ftpd.LogLevel.TRACE;
|
||||
server.listen(21);
|
||||
|
||||
Vendored
+18
@@ -12,6 +12,14 @@ import fs = require("fs");
|
||||
import net = require("net");
|
||||
import tls = require("tls");
|
||||
|
||||
export const enum LogLevel {
|
||||
ERROR = 0,
|
||||
WARN = 1,
|
||||
INFO = 2,
|
||||
DEBUG = 3,
|
||||
TRACE = 4
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for FtpServer constructor
|
||||
*/
|
||||
@@ -85,6 +93,11 @@ export interface FtpServerOptions {
|
||||
* Integer, specifies the upper-bound port (max port) for creating PASV connections
|
||||
*/
|
||||
pasvPortRangeEnd?: number;
|
||||
/**
|
||||
* Integer from 0-4 representing the Log Level to show.
|
||||
*/
|
||||
logLevel?: LogLevel;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -195,4 +208,9 @@ export declare class FtpServer extends events.EventEmitter {
|
||||
* Stop listening
|
||||
*/
|
||||
public close(callback?: () => void): void;
|
||||
|
||||
/**
|
||||
* Change/Retrieve logLevel at runtime.
|
||||
*/
|
||||
public debugging: LogLevel;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user