2010-03-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Added --remove-control-file option.  This option removes control
	file(*.aria2 file) before download. Using with
	--allow-overwrite=true, download always starts from scratch. This
	will be useful for users behind proxy server which disables
	resume. For such proxy user, -C1 is also recommended for Metalink
	downloads to avoid establishing unnecessary connections.
	* doc/aria2c.1.txt
	* src/OptionHandlerFactory.cc
	* src/RequestGroup.cc
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
pull/1/head
Tatsuhiro Tsujikawa 2010-03-25 14:44:16 +00:00
parent 886f8ee58e
commit 8507b5bde4
9 changed files with 105 additions and 4 deletions

View File

@ -1,3 +1,18 @@
2010-03-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --remove-control-file option. This option removes control
file(*.aria2 file) before download. Using with
--allow-overwrite=true, download always starts from scratch. This
will be useful for users behind proxy server which disables
resume. For such proxy user, -C1 is also recommended for Metalink
downloads to avoid establishing unnecessary connections.
* doc/aria2c.1.txt
* src/OptionHandlerFactory.cc
* src/RequestGroup.cc
* src/prefs.cc
* src/prefs.h
* src/usage_text.h
2010-03-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> 2010-03-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed arrayLength. Defined A2_ARRAY_LEN as macro to calculate Removed arrayLength. Defined A2_ARRAY_LEN as macro to calculate

View File

@ -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: 03/19/2010 .\" Date: 03/25/2010
.\" Manual: Aria2 Manual .\" Manual: Aria2 Manual
.\" Source: Aria2 1.9.1a .\" Source: Aria2 1.9.1a
.\" Language: English .\" Language: English
.\" .\"
.TH "ARIA2C" "1" "03/19/2010" "Aria2 1\&.9\&.1a" "Aria2 Manual" .TH "ARIA2C" "1" "03/25/2010" "Aria2 1\&.9\&.1a" "Aria2 Manual"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * Define some portability stuff .\" * Define some portability stuff
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
@ -1243,6 +1243,28 @@ Validate chunk of data by calculating checksum while downloading a file if chunk
\fItrue\fR \fItrue\fR
.RE .RE
.PP .PP
\fB\-\-remove\-control\-file\fR[=\fItrue\fR|\fIfalse\fR]
.RS 4
Remove control file before download\&. Using with
\fB\-\-allow\-overwrite\fR=\fItrue\fR, download always starts from scratch\&. This will be useful for users behind proxy server which disables resume\&.
.RE
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
.sp
For Metalink downloads, \-C1 is recommended for proxy server which disables resume, in order to avoid establishing unnecessary connections\&.
.sp .5v
.RE
.PP
\fB\-\-stop\fR=SEC \fB\-\-stop\fR=SEC
.RS 4 .RS 4
Stop application after SEC seconds has passed\&. If Stop application after SEC seconds has passed\&. If

View File

@ -2093,6 +2093,29 @@ are also allocated if they share the same piece.</td>
</p> </p>
</dd> </dd>
<dt class="hdlist1"> <dt class="hdlist1">
<strong>--remove-control-file</strong>[=<em>true</em>|<em>false</em>]
</dt>
<dd>
<p>
Remove control file before download. Using with
<strong>--allow-overwrite</strong>=<em>true</em>, download always starts from
scratch. This will be useful for users behind proxy server which
disables resume.
</p>
</dd>
</dl></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">For Metalink downloads, -C1 is recommended for proxy server which
disables resume, in order to avoid establishing unnecessary
connections.</td>
</tr></table>
</div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>--stop</strong>=SEC <strong>--stop</strong>=SEC
</dt> </dt>
<dd> <dd>
@ -3984,7 +4007,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-03-19 18:13:05 JST Last updated 2010-03-25 23:41:17 JST
</div> </div>
</div> </div>
</body> </body>

View File

@ -851,6 +851,20 @@ are also allocated if they share the same piece.
chunk checksums are provided. chunk checksums are provided.
Default: 'true' Default: 'true'
*--remove-control-file*[='true'|'false']::
Remove control file before download. Using with
*--allow-overwrite*='true', download always starts from
scratch. This will be useful for users behind proxy server which
disables resume.
[NOTE]
For Metalink downloads, -C1 is recommended for proxy server which
disables resume, in order to avoid establishing unnecessary
connections.
*--stop*=SEC:: *--stop*=SEC::
Stop application after SEC seconds has passed. Stop application after SEC seconds has passed.
If '0' is given, this feature is disabled. If '0' is given, this feature is disabled.

View File

@ -411,6 +411,15 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
handlers.push_back(op); handlers.push_back(op);
} }
#endif // ENABLE_MESSAGE_DIGEST #endif // ENABLE_MESSAGE_DIGEST
{
SharedHandle<OptionHandler> op(new BooleanOptionHandler
(PREF_REMOVE_CONTROL_FILE,
TEXT_REMOVE_CONTROL_FILE,
V_FALSE,
OptionHandler::OPT_ARG));
op->addTag(TAG_ADVANCED);
handlers.push_back(op);
}
{ {
SharedHandle<OptionHandler> op(new NumberOptionHandler SharedHandle<OptionHandler> op(new NumberOptionHandler
(PREF_STOP, (PREF_STOP,

View File

@ -556,7 +556,16 @@ void RequestGroup::adjustFilename
{ {
if(!isPreLocalFileCheckEnabled()) { if(!isPreLocalFileCheckEnabled()) {
// OK, no need to care about filename. // OK, no need to care about filename.
} else if(infoFile->exists()) { return;
}
if(!_option->getAsBool(PREF_DRY_RUN) &&
_option->getAsBool(PREF_REMOVE_CONTROL_FILE) &&
infoFile->exists()) {
infoFile->removeFile();
_logger->notice("Removed control file for %s because it is requested by"
" user.", infoFile->getFilename().c_str());
}
if(infoFile->exists()) {
// Use current filename // Use current filename
} else if(downloadFinishedByFileLength()) { } else if(downloadFinishedByFileLength()) {
// File was downloaded already, no need to change file name. // File was downloaded already, no need to change file name.

View File

@ -178,6 +178,8 @@ const std::string PREF_INTERFACE("interface");
const std::string PREF_DISABLE_IPV6("disable-ipv6"); const std::string PREF_DISABLE_IPV6("disable-ipv6");
// value: true | false // value: true | false
const std::string PREF_HUMAN_READABLE("human-readable"); const std::string PREF_HUMAN_READABLE("human-readable");
// value: true | false
const std::string PREF_REMOVE_CONTROL_FILE("remove-control-file");
/** /**
* FTP related preferences * FTP related preferences

View File

@ -182,6 +182,8 @@ extern const std::string PREF_INTERFACE;
extern const std::string PREF_DISABLE_IPV6; extern const std::string PREF_DISABLE_IPV6;
// value: true | false // value: true | false
extern const std::string PREF_HUMAN_READABLE; extern const std::string PREF_HUMAN_READABLE;
// value: true | false
extern const std::string PREF_REMOVE_CONTROL_FILE;
/** /**
* FTP related preferences * FTP related preferences

View File

@ -635,3 +635,8 @@
_(" --ftp-proxy-user=USER Set user for --ftp-proxy option.") _(" --ftp-proxy-user=USER Set user for --ftp-proxy option.")
#define TEXT_FTP_PROXY_PASSWD \ #define TEXT_FTP_PROXY_PASSWD \
_(" --ftp-proxy-passwd=PASSWD Set password for --ftp-proxy option.") _(" --ftp-proxy-passwd=PASSWD Set password for --ftp-proxy option.")
#define TEXT_REMOVE_CONTROL_FILE \
_(" --remove-control-file[=true|false] Remove control file before download. Using\n" \
" with --allow-overwrite=true, download always\n" \
" starts from scratch. This will be useful for\n" \
" users behind proxy server which disables resume.")