Some modifications to fakeftp
This commit is contained in:
parent
c8cf9f2431
commit
e5cdab5114
1 changed files with 6 additions and 1 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue