Some modifications to fakeftp

This commit is contained in:
madmaurice 2015-05-23 23:43:14 +02:00
parent c8cf9f2431
commit e5cdab5114

View file

@ -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"