mirror of
https://github.com/aria2/aria2.git
synced 2025-04-06 14:07:37 +03:00
2010-01-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Now --all-proxy, --http-proxy, --https-proxy and --ftp-proxy option accepts empty string "". When "" is given, it erases previously defined proxy. * doc/aria2c.1.txt * src/OptionHandlerImpl.h * src/usage_text.h * test/OptionHandlerTest.cc
This commit is contained in:
parent
c16b346bb9
commit
c022939c8f
7 changed files with 73 additions and 47 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2010-01-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Now --all-proxy, --http-proxy, --https-proxy and --ftp-proxy
|
||||||
|
option accepts empty string "". When "" is given, it erases
|
||||||
|
previously defined proxy.
|
||||||
|
* doc/aria2c.1.txt
|
||||||
|
* src/OptionHandlerImpl.h
|
||||||
|
* src/usage_text.h
|
||||||
|
* test/OptionHandlerTest.cc
|
||||||
|
|
||||||
2010-01-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2010-01-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Code cleanup for proxy URI handling.
|
Code cleanup for proxy URI handling.
|
||||||
|
|
12
doc/aria2c.1
12
doc/aria2c.1
|
@ -2,12 +2,12 @@
|
||||||
.\" Title: aria2c
|
.\" Title: aria2c
|
||||||
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
|
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
|
||||||
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
|
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
|
||||||
.\" Date: 01/12/2010
|
.\" Date: 01/15/2010
|
||||||
.\" Manual: Aria2 Manual
|
.\" Manual: Aria2 Manual
|
||||||
.\" Source: Aria2
|
.\" Source: Aria2
|
||||||
.\" Language: English
|
.\" Language: English
|
||||||
.\"
|
.\"
|
||||||
.TH "ARIA2C" "1" "01/12/2010" "Aria2" "Aria2 Manual"
|
.TH "ARIA2C" "1" "01/15/2010" "Aria2" "Aria2 Manual"
|
||||||
.\" -----------------------------------------------------------------
|
.\" -----------------------------------------------------------------
|
||||||
.\" * Define some portability stuff
|
.\" * Define some portability stuff
|
||||||
.\" -----------------------------------------------------------------
|
.\" -----------------------------------------------------------------
|
||||||
|
@ -107,7 +107,7 @@ Default:
|
||||||
.PP
|
.PP
|
||||||
\fB\-\-all\-proxy\fR=PROXY
|
\fB\-\-all\-proxy\fR=PROXY
|
||||||
.RS 4
|
.RS 4
|
||||||
Use this proxy server for all protocols\&. You can override this setting and specify a proxy server for a particular protocol using
|
Use this proxy server for all protocols\&. To erase previously defined proxy, use ""\&. You can override this setting and specify a proxy server for a particular protocol using
|
||||||
\fB\-\-http\-proxy\fR,
|
\fB\-\-http\-proxy\fR,
|
||||||
\fB\-\-https\-proxy\fR
|
\fB\-\-https\-proxy\fR
|
||||||
and
|
and
|
||||||
|
@ -328,14 +328,14 @@ Set HTTP password\&. This affects all URLs\&.
|
||||||
.PP
|
.PP
|
||||||
\fB\-\-http\-proxy\fR=PROXY
|
\fB\-\-http\-proxy\fR=PROXY
|
||||||
.RS 4
|
.RS 4
|
||||||
Use this proxy server for HTTP\&. See also
|
Use this proxy server for HTTP\&. To erase previously defined proxy, use ""\&. See also
|
||||||
\fB\-\-all\-proxy\fR
|
\fB\-\-all\-proxy\fR
|
||||||
option\&. This affects all URLs\&. The format of PROXY is [http://][USER:PASSWORD@]HOST[:PORT]
|
option\&. This affects all URLs\&. The format of PROXY is [http://][USER:PASSWORD@]HOST[:PORT]
|
||||||
.RE
|
.RE
|
||||||
.PP
|
.PP
|
||||||
\fB\-\-https\-proxy\fR=PROXY
|
\fB\-\-https\-proxy\fR=PROXY
|
||||||
.RS 4
|
.RS 4
|
||||||
Use this proxy server for HTTPS\&. See also
|
Use this proxy server for HTTPS\&. To erase previously defined proxy, use ""\&. See also
|
||||||
\fB\-\-all\-proxy\fR
|
\fB\-\-all\-proxy\fR
|
||||||
option\&. This affects all URLs\&. The format of PROXY is [http://][USER:PASSWORD@]HOST[:PORT]
|
option\&. This affects all URLs\&. The format of PROXY is [http://][USER:PASSWORD@]HOST[:PORT]
|
||||||
.RE
|
.RE
|
||||||
|
@ -433,7 +433,7 @@ is given, the active mode will be used\&. Default:
|
||||||
.PP
|
.PP
|
||||||
\fB\-\-ftp\-proxy\fR=PROXY
|
\fB\-\-ftp\-proxy\fR=PROXY
|
||||||
.RS 4
|
.RS 4
|
||||||
Use this proxy server for FTP\&. See also
|
Use this proxy server for FTP\&. To erase previously defined proxy, use ""\&. See also
|
||||||
\fB\-\-all\-proxy\fR
|
\fB\-\-all\-proxy\fR
|
||||||
option\&. This affects all URLs\&. The format of PROXY is [http://][USER:PASSWORD@]HOST[:PORT]
|
option\&. This affects all URLs\&. The format of PROXY is [http://][USER:PASSWORD@]HOST[:PORT]
|
||||||
.RE
|
.RE
|
||||||
|
|
|
@ -678,10 +678,10 @@ downloading a file like BitTorrent.</p></div>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<p>
|
<p>
|
||||||
Use this proxy server for all protocols.
|
Use this proxy server for all protocols. To erase previously
|
||||||
You can override this setting and specify a proxy server for a particular
|
defined proxy, use "". You can override this setting and specify a
|
||||||
protocol using <strong>--http-proxy</strong>, <strong>--https-proxy</strong> and <strong>--ftp-proxy</strong> options.
|
proxy server for a particular protocol using <strong>--http-proxy</strong>,
|
||||||
This affects all URLs.
|
<strong>--https-proxy</strong> and <strong>--ftp-proxy</strong> options. This affects all URLs.
|
||||||
The format of PROXY is [<a href="http://][USER:PASSWORD@]HOST[:PORT">http://][USER:PASSWORD@]HOST[:PORT</a>]
|
The format of PROXY is [<a href="http://][USER:PASSWORD@]HOST[:PORT">http://][USER:PASSWORD@]HOST[:PORT</a>]
|
||||||
</p>
|
</p>
|
||||||
</dd>
|
</dd>
|
||||||
|
@ -955,9 +955,9 @@ aria2c -o myfile.zip "http://mirror1/file.zip" "http://mirror2/file.zip"</td>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<p>
|
<p>
|
||||||
Use this proxy server for HTTP. See also <strong>--all-proxy</strong> option.
|
Use this proxy server for HTTP. To erase previously defined proxy,
|
||||||
This affects all URLs.
|
use "". See also <strong>--all-proxy</strong> option. This affects all URLs. The
|
||||||
The format of PROXY is [<a href="http://][USER:PASSWORD@]HOST[:PORT">http://][USER:PASSWORD@]HOST[:PORT</a>]
|
format of PROXY is [<a href="http://][USER:PASSWORD@]HOST[:PORT">http://][USER:PASSWORD@]HOST[:PORT</a>]
|
||||||
</p>
|
</p>
|
||||||
</dd>
|
</dd>
|
||||||
<dt class="hdlist1">
|
<dt class="hdlist1">
|
||||||
|
@ -965,9 +965,9 @@ aria2c -o myfile.zip "http://mirror1/file.zip" "http://mirror2/file.zip"</td>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<p>
|
<p>
|
||||||
Use this proxy server for HTTPS. See also <strong>--all-proxy</strong> option.
|
Use this proxy server for HTTPS. To erase previously defined proxy,
|
||||||
This affects all URLs.
|
use "". See also <strong>--all-proxy</strong> option. This affects all URLs. The
|
||||||
The format of PROXY is [<a href="http://][USER:PASSWORD@]HOST[:PORT">http://][USER:PASSWORD@]HOST[:PORT</a>]
|
format of PROXY is [<a href="http://][USER:PASSWORD@]HOST[:PORT">http://][USER:PASSWORD@]HOST[:PORT</a>]
|
||||||
</p>
|
</p>
|
||||||
</dd>
|
</dd>
|
||||||
<dt class="hdlist1">
|
<dt class="hdlist1">
|
||||||
|
@ -1105,9 +1105,9 @@ aria2c -o myfile.zip "http://mirror1/file.zip" "http://mirror2/file.zip"</td>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<p>
|
<p>
|
||||||
Use this proxy server for FTP. See also <strong>--all-proxy</strong> option.
|
Use this proxy server for FTP. To erase previously defined proxy,
|
||||||
This affects all URLs.
|
use "". See also <strong>--all-proxy</strong> option. This affects all URLs. The
|
||||||
The format of PROXY is [<a href="http://][USER:PASSWORD@]HOST[:PORT">http://][USER:PASSWORD@]HOST[:PORT</a>]
|
format of PROXY is [<a href="http://][USER:PASSWORD@]HOST[:PORT">http://][USER:PASSWORD@]HOST[:PORT</a>]
|
||||||
</p>
|
</p>
|
||||||
</dd>
|
</dd>
|
||||||
<dt class="hdlist1">
|
<dt class="hdlist1">
|
||||||
|
@ -3578,7 +3578,7 @@ files in the program, then also delete it here.</p></div>
|
||||||
<div id="footnotes"><hr /></div>
|
<div id="footnotes"><hr /></div>
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<div id="footer-text">
|
<div id="footer-text">
|
||||||
Last updated 2010-01-12 23:26:20 JST
|
Last updated 2010-01-15 17:58:00 JST
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -76,10 +76,11 @@ Basic Options
|
||||||
HTTP/FTP Options
|
HTTP/FTP Options
|
||||||
~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~
|
||||||
*--all-proxy*=PROXY::
|
*--all-proxy*=PROXY::
|
||||||
Use this proxy server for all protocols.
|
|
||||||
You can override this setting and specify a proxy server for a particular
|
Use this proxy server for all protocols. To erase previously
|
||||||
protocol using *--http-proxy*, *--https-proxy* and *--ftp-proxy* options.
|
defined proxy, use "". You can override this setting and specify a
|
||||||
This affects all URLs.
|
proxy server for a particular protocol using *--http-proxy*,
|
||||||
|
*--https-proxy* and *--ftp-proxy* options. This affects all URLs.
|
||||||
The format of PROXY is [\http://][USER:PASSWORD@]HOST[:PORT]
|
The format of PROXY is [\http://][USER:PASSWORD@]HOST[:PORT]
|
||||||
|
|
||||||
*--connect-timeout*=SEC::
|
*--connect-timeout*=SEC::
|
||||||
|
@ -227,14 +228,16 @@ HTTP Specific Options
|
||||||
Set HTTP password. This affects all URLs.
|
Set HTTP password. This affects all URLs.
|
||||||
|
|
||||||
*--http-proxy*=PROXY::
|
*--http-proxy*=PROXY::
|
||||||
Use this proxy server for HTTP. See also *--all-proxy* option.
|
|
||||||
This affects all URLs.
|
Use this proxy server for HTTP. To erase previously defined proxy,
|
||||||
The format of PROXY is [\http://][USER:PASSWORD@]HOST[:PORT]
|
use "". See also *--all-proxy* option. This affects all URLs. The
|
||||||
|
format of PROXY is [\http://][USER:PASSWORD@]HOST[:PORT]
|
||||||
|
|
||||||
*--https-proxy*=PROXY::
|
*--https-proxy*=PROXY::
|
||||||
Use this proxy server for HTTPS. See also *--all-proxy* option.
|
|
||||||
This affects all URLs.
|
Use this proxy server for HTTPS. To erase previously defined proxy,
|
||||||
The format of PROXY is [\http://][USER:PASSWORD@]HOST[:PORT]
|
use "". See also *--all-proxy* option. This affects all URLs. The
|
||||||
|
format of PROXY is [\http://][USER:PASSWORD@]HOST[:PORT]
|
||||||
|
|
||||||
*--private-key*=FILE::
|
*--private-key*=FILE::
|
||||||
Use the private key in FILE.
|
Use the private key in FILE.
|
||||||
|
@ -301,9 +304,10 @@ FTP Specific Options
|
||||||
Default: 'true'
|
Default: 'true'
|
||||||
|
|
||||||
*--ftp-proxy*=PROXY::
|
*--ftp-proxy*=PROXY::
|
||||||
Use this proxy server for FTP. See also *--all-proxy* option.
|
|
||||||
This affects all URLs.
|
Use this proxy server for FTP. To erase previously defined proxy,
|
||||||
The format of PROXY is [\http://][USER:PASSWORD@]HOST[:PORT]
|
use "". See also *--all-proxy* option. This affects all URLs. The
|
||||||
|
format of PROXY is [\http://][USER:PASSWORD@]HOST[:PORT]
|
||||||
|
|
||||||
*--ftp-type*=TYPE::
|
*--ftp-type*=TYPE::
|
||||||
Set FTP transfer type. TYPE is either 'binary' or 'ascii'.
|
Set FTP transfer type. TYPE is either 'binary' or 'ascii'.
|
||||||
|
|
|
@ -556,6 +556,9 @@ public:
|
||||||
|
|
||||||
virtual void parseArg(Option& option, const std::string& optarg)
|
virtual void parseArg(Option& option, const std::string& optarg)
|
||||||
{
|
{
|
||||||
|
if(optarg.empty()) {
|
||||||
|
option.put(_optName, optarg);
|
||||||
|
} else {
|
||||||
Request req;
|
Request req;
|
||||||
std::string url;
|
std::string url;
|
||||||
if(util::startsWith(optarg, "http://")) {
|
if(util::startsWith(optarg, "http://")) {
|
||||||
|
@ -569,6 +572,7 @@ public:
|
||||||
throw DL_ABORT_EX(_("unrecognized proxy format"));
|
throw DL_ABORT_EX(_("unrecognized proxy format"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virtual std::string createPossibleValuesString() const
|
virtual std::string createPossibleValuesString() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,19 +63,23 @@
|
||||||
#define TEXT_MAX_TRIES \
|
#define TEXT_MAX_TRIES \
|
||||||
_(" -m, --max-tries=N Set number of tries. 0 means unlimited.")
|
_(" -m, --max-tries=N Set number of tries. 0 means unlimited.")
|
||||||
#define TEXT_HTTP_PROXY \
|
#define TEXT_HTTP_PROXY \
|
||||||
_(" --http-proxy=PROXY Use this proxy server for HTTP.\n" \
|
_(" --http-proxy=PROXY Use this proxy server for HTTP. To erase\n"\
|
||||||
|
" previously defined proxy, use \"\".\n" \
|
||||||
" See also --all-proxy option.\n" \
|
" See also --all-proxy option.\n" \
|
||||||
" This affects all URLs.")
|
" This affects all URLs.")
|
||||||
#define TEXT_HTTPS_PROXY \
|
#define TEXT_HTTPS_PROXY \
|
||||||
_(" --https-proxy=PROXY Use this proxy server for HTTPS.\n" \
|
_(" --https-proxy=PROXY Use this proxy server for HTTPS. To erase\n" \
|
||||||
|
" previously defined proxy, use \"\".\n" \
|
||||||
" See also --all-proxy option.\n" \
|
" See also --all-proxy option.\n" \
|
||||||
" This affects all URLs.")
|
" This affects all URLs.")
|
||||||
#define TEXT_FTP_PROXY \
|
#define TEXT_FTP_PROXY \
|
||||||
_(" --ftp-proxy=PROXY Use this proxy server for FTP.\n" \
|
_(" --ftp-proxy=PROXY Use this proxy server for FTP. To erase previously\n" \
|
||||||
|
" defined proxy, use \"\".\n" \
|
||||||
" See also --all-proxy option.\n" \
|
" See also --all-proxy option.\n" \
|
||||||
" This affects all URLs.")
|
" This affects all URLs.")
|
||||||
#define TEXT_ALL_PROXY \
|
#define TEXT_ALL_PROXY \
|
||||||
_(" --all-proxy=PROXY Use this proxy server for all protocols.\n" \
|
_(" --all-proxy=PROXY Use this proxy server for all protocols. To erase\n" \
|
||||||
|
" previously defined proxy, use \"\".\n" \
|
||||||
" You can override this setting and specify a\n" \
|
" You can override this setting and specify a\n" \
|
||||||
" proxy server for a particular protocol using\n" \
|
" proxy server for a particular protocol using\n" \
|
||||||
" --http-proxy, --https-proxy and --ftp-proxy\n" \
|
" --http-proxy, --https-proxy and --ftp-proxy\n" \
|
||||||
|
|
|
@ -313,6 +313,10 @@ void OptionHandlerTest::testHttpProxyOptionHandler()
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("http://proxy:8080"),
|
CPPUNIT_ASSERT_EQUAL(std::string("http://proxy:8080"),
|
||||||
option.get(PREF_HTTP_PROXY));
|
option.get(PREF_HTTP_PROXY));
|
||||||
|
|
||||||
|
handler.parse(option, "");
|
||||||
|
CPPUNIT_ASSERT(option.defined(PREF_HTTP_PROXY));
|
||||||
|
CPPUNIT_ASSERT(option.blank(PREF_HTTP_PROXY));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
handler.parse(option, "http://bar:65536");
|
handler.parse(option, "http://bar:65536");
|
||||||
CPPUNIT_FAIL("exception must be thrown.");
|
CPPUNIT_FAIL("exception must be thrown.");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue