Chromium Code Reviews| Index: net/tools/testserver/testserver.py |
| diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py |
| index 065ea7baf44df79a7e1aa8547343abe9083badc3..5411aea3517d7c6304914d2abf90674236ae2cfb 100644 |
| --- a/net/tools/testserver/testserver.py |
| +++ b/net/tools/testserver/testserver.py |
| @@ -1113,7 +1113,8 @@ def main(options, args): |
| # anonymous user |
| authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') |
| - authorizer.add_anonymous(my_data_dir) |
| + if options.ftp_enable_anonymous: |
| + authorizer.add_anonymous(my_data_dir) |
| # Instantiate FTP handler class |
| ftp_handler = pyftpdlib.ftpserver.FTPHandler |
| @@ -1137,10 +1138,13 @@ def main(options, args): |
| if __name__ == '__main__': |
| option_parser = optparse.OptionParser() |
| - option_parser.add_option("-f", '--ftp', action='store_const', |
| + option_parser.add_option('--ftp', action='store_const', |
| const=SERVER_FTP, default=SERVER_HTTP, |
| dest='server_type', |
| help='FTP or HTTP server default HTTP') |
| + option_parser.add_option('--ftp-enable-anonymous', action='store_true', |
|
eroman
2009/09/22 07:42:24
It might be more convenient to invert the directio
|
| + default=False, dest='ftp_enable_anonymous', |
| + help='Enable anonymous FTP') |
| option_parser.add_option('--forking', action='store_true', default=False, |
| dest='forking', |
| help='Serve each request in a separate process') |