From e5cdab5114c427704a4cd697e49af7a1c04a2fb6 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Sat, 23 May 2015 23:43:14 +0200 Subject: [PATCH] Some modifications to fakeftp --- fakeftp.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fakeftp.py b/fakeftp.py index 0a02ad0..5c21057 100644 --- a/fakeftp.py +++ b/fakeftp.py @@ -256,6 +256,11 @@ class QuitMessage(FTPMessage): def __init__(self): FTPMessage.__init__(self,"221","Goodbye.") +class CommandNotImplementedMessage(FTPMessage): + ''' Message sent to client when command not implemented''' + def __init__(self): + FTPMessage.__init__(self,"501","Command not implemented") + class InvalidCommandMessage(FTPMessage): '''Message sent to client when server received message it didn't understand''' def __init__(self,cmd): @@ -413,7 +418,7 @@ class ForbiddenCommandHandler(CommandHandler): class UnknownCommandHandler(CommandHandler): def process(self, handler, message): handler.log("Unknown command %s" % message.cmd) - handler.send( InvalidCommandMessage(message.cmd) ) + handler.send( CommandNotImplementedMessage() ) class QuitCommandHandler(CommandHandler): cmd = "QUIT"