提交 d7086c2f authored 作者: Thomas Mueller's avatar Thomas Mueller

bug in the FTP server

上级 9334d8af
...@@ -55,7 +55,7 @@ public class FtpControl extends Thread { ...@@ -55,7 +55,7 @@ public class FtpControl extends Thread {
reply(421, "Too many users"); reply(421, "Too many users");
} else { } else {
reply(220, SERVER_NAME); reply(220, SERVER_NAME);
// TODO need option to configure the serverIpAddress // TODO need option to configure the serverIpAddress?
serverIpAddress = control.getLocalAddress().getHostAddress().replace('.', ','); serverIpAddress = control.getLocalAddress().getHostAddress().replace('.', ',');
BufferedReader input = new BufferedReader(new InputStreamReader(control.getInputStream())); BufferedReader input = new BufferedReader(new InputStreamReader(control.getInputStream()));
while (!stop) { while (!stop) {
...@@ -134,7 +134,9 @@ public class FtpControl extends Thread { ...@@ -134,7 +134,9 @@ public class FtpControl extends Thread {
} }
} }
if (!replied) { if (!replied) {
listener.onUnsupportedCommand(event); if (listener != null) {
listener.onUnsupportedCommand(event);
}
reply(506, "Invalid command"); reply(506, "Invalid command");
} }
if (listener != null) { if (listener != null) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论