From adb4ef2168934c1f6223172768ba2218dc475765 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 16 Nov 2008 04:41:07 +0000 Subject: [PATCH] 2008-11-16 Tatsuhiro Tsujikawa Made the default value of --ftp-pasv option set to true and it can take true/false values. * src/OptionHandlerFactory.cc * src/option_processing.cc * src/usage_text.h * doc/aria2c.1.txt --- ChangeLog | 9 +++++++++ doc/aria2c.1 | 11 +++++++---- doc/aria2c.1.html | 8 +++++--- doc/aria2c.1.txt | 6 ++++-- src/OptionHandlerFactory.cc | 2 +- src/option_processing.cc | 4 ++-- src/usage_text.h | 3 ++- 7 files changed, 30 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 06782df4..7795a058 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-11-16 Tatsuhiro Tsujikawa + + Made the default value of --ftp-pasv option set to true and it can take + true/false values. + * src/OptionHandlerFactory.cc + * src/option_processing.cc + * src/usage_text.h + * doc/aria2c.1.txt + 2008-11-15 Tatsuhiro Tsujikawa Given custom random number generator to std::random_shuffle. diff --git a/doc/aria2c.1 b/doc/aria2c.1 index 139b3134..fa0289fe 100644 --- a/doc/aria2c.1 +++ b/doc/aria2c.1 @@ -1,11 +1,11 @@ .\" Title: aria2c .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 11/15/2008 +.\" Date: 11/16/2008 .\" Manual: .\" Source: .\" -.TH "ARIA2C" "1" "11/15/2008" "" "" +.TH "ARIA2C" "1" "11/16/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -341,9 +341,12 @@ Set FTP password\&. This affects all URLs\&. Default: \fIARIA2USER@\fR .RE .PP -\fB\-p\fR, \fB\-\-ftp\-pasv\fR +\fB\-p\fR, \fB\-\-ftp\-pasv\fR[=\fItrue\fR|\fIfalse\fR] .RS 4 -Use passive mode in FTP\&. +Use the passive mode in FTP\&. If +\fIfalse\fR +is given, the active mode will be used\&. Default: +\fItrue\fR .RE .PP \fB\-\-ftp\-proxy\fR=PROXY diff --git a/doc/aria2c.1.html b/doc/aria2c.1.html index b152b4f2..e3278fb0 100644 --- a/doc/aria2c.1.html +++ b/doc/aria2c.1.html @@ -827,11 +827,13 @@ aria2c -o myfile.zip http://mirror1/file.zip http://mirror2/file.zip

--p, --ftp-pasv +-p, --ftp-pasv[=true|false]

- Use passive mode in FTP. + Use the passive mode in FTP. + If false is given, the active mode will be used. + Default: true

@@ -2019,7 +2021,7 @@ files in the program, then also delete it here.

diff --git a/doc/aria2c.1.txt b/doc/aria2c.1.txt index bea04aa8..2ff669f2 100644 --- a/doc/aria2c.1.txt +++ b/doc/aria2c.1.txt @@ -245,8 +245,10 @@ FTP Specific Options Set FTP password. This affects all URLs. Default: 'ARIA2USER@' -*-p*, *--ftp-pasv*:: - Use passive mode in FTP. +*-p*, *--ftp-pasv*[='true'|'false']:: + Use the passive mode in FTP. + If 'false' is given, the active mode will be used. + Default: 'true' *--ftp-proxy*=PROXY:: Use this proxy server for FTP. See also *--all-proxy* option. diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc index 49a4d1d6..db53baa5 100644 --- a/src/OptionHandlerFactory.cc +++ b/src/OptionHandlerFactory.cc @@ -555,7 +555,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers() SharedHandle op(new BooleanOptionHandler (PREF_FTP_PASV, TEXT_FTP_PASV, - V_FALSE)); // TODO ommit? + V_TRUE)); op->addTag(TAG_FTP); handlers.push_back(op); } diff --git a/src/option_processing.cc b/src/option_processing.cc index 34287f74..822a0b49 100644 --- a/src/option_processing.cc +++ b/src/option_processing.cc @@ -132,7 +132,7 @@ Option* option_processing(int argc, char* const argv[]) { PREF_FTP_USER.c_str(), required_argument, &lopt, 9 }, { PREF_FTP_PASSWD.c_str(), required_argument, &lopt, 10 }, { PREF_FTP_TYPE.c_str(), required_argument, &lopt, 11 }, - { PREF_FTP_PASV.c_str(), no_argument, NULL, 'p' }, + { PREF_FTP_PASV.c_str(), optional_argument, 0, 'p' }, { "ftp-via-http-proxy", required_argument, &lopt, 12 }, { "http-proxy-method", required_argument, &lopt, 14 }, { PREF_LOWEST_SPEED_LIMIT.c_str(), required_argument, &lopt, 200 }, @@ -497,7 +497,7 @@ Option* option_processing(int argc, char* const argv[]) cmdstream << PREF_MAX_TRIES << "=" << optarg << "\n"; break; case 'p': - cmdstream << PREF_FTP_PASV << "=" << V_TRUE << "\n"; + cmdstream << PREF_FTP_PASV << "=" << toBoolArg(optarg) << "\n"; break; case 'S': cmdstream << PREF_SHOW_FILES << "=" << V_TRUE << "\n"; diff --git a/src/usage_text.h b/src/usage_text.h index ea45a61e..54358f42 100644 --- a/src/usage_text.h +++ b/src/usage_text.h @@ -95,7 +95,8 @@ _(" --ftp-passwd=PASSWD Set FTP password. This affects all URLs.") #define TEXT_FTP_TYPE \ _(" --ftp-type=TYPE Set FTP transfer type.") #define TEXT_FTP_PASV \ -_(" -p, --ftp-pasv Use passive mode in FTP.") +_(" -p, --ftp-pasv[=true|false] Use the passive mode in FTP. If false is given,\n"\ + " the active mode will be used.") #define TEXT_LOWEST_SPEED_LIMIT \ _(" --lowest-speed-limit=SPEED Close connection if download speed is lower than\n"\ " or equal to this value(bytes per sec).\n"\