mirror of https://github.com/aria2/aria2
2010-04-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added aria2.pause and aria2.unpause XML-RPC method. aria2.pause pauses the download denoted by gid. gid is of type string. The status of paused download becomes "paused" and the download is placed on the first position of waiting queue. As long as the status is "paused", the download is not started. To change status to "waiting", use aria2.unpause method. This method returns GID of paused download. aria2.unpause changes the status of the download denoted by gid from "paused" to "waiting". This makes the download eligible to restart. gid is of type string. This method returns GID of unpaused download. * doc/aria2c.1.txt * src/DownloadContext.cc * src/FileEntry.cc * src/OptionHandlerFactory.cc * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/XmlRpcMethodFactory.cc * src/XmlRpcMethodImpl.cc * src/XmlRpcMethodImpl.h * src/prefs.cc * src/prefs.h * src/usage_text.hpull/1/head
parent
5cd0108f93
commit
bf0cf1f5d9
26
ChangeLog
26
ChangeLog
|
@ -1,3 +1,29 @@
|
||||||
|
2010-04-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Added aria2.pause and aria2.unpause XML-RPC method. aria2.pause
|
||||||
|
pauses the download denoted by gid. gid is of type string. The
|
||||||
|
status of paused download becomes "paused" and the download is
|
||||||
|
placed on the first position of waiting queue. As long as the
|
||||||
|
status is "paused", the download is not started. To change status
|
||||||
|
to "waiting", use aria2.unpause method. This method returns GID of
|
||||||
|
paused download. aria2.unpause changes the status of the download
|
||||||
|
denoted by gid from "paused" to "waiting". This makes the download
|
||||||
|
eligible to restart. gid is of type string. This method returns
|
||||||
|
GID of unpaused download.
|
||||||
|
* doc/aria2c.1.txt
|
||||||
|
* src/DownloadContext.cc
|
||||||
|
* src/FileEntry.cc
|
||||||
|
* src/OptionHandlerFactory.cc
|
||||||
|
* src/RequestGroup.cc
|
||||||
|
* src/RequestGroup.h
|
||||||
|
* src/RequestGroupMan.cc
|
||||||
|
* src/XmlRpcMethodFactory.cc
|
||||||
|
* src/XmlRpcMethodImpl.cc
|
||||||
|
* src/XmlRpcMethodImpl.h
|
||||||
|
* src/prefs.cc
|
||||||
|
* src/prefs.h
|
||||||
|
* src/usage_text.h
|
||||||
|
|
||||||
2010-04-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2010-04-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Added --save-session=FILE option. This option saves
|
Added --save-session=FILE option. This option saves
|
||||||
|
|
28
doc/aria2c.1
28
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: 04/08/2010
|
.\" Date: 04/09/2010
|
||||||
.\" Manual: Aria2 Manual
|
.\" Manual: Aria2 Manual
|
||||||
.\" Source: Aria2 1.9.1a
|
.\" Source: Aria2 1.9.1a
|
||||||
.\" Language: English
|
.\" Language: English
|
||||||
.\"
|
.\"
|
||||||
.TH "ARIA2C" "1" "04/08/2010" "Aria2 1\&.9\&.1a" "Aria2 Manual"
|
.TH "ARIA2C" "1" "04/09/2010" "Aria2 1\&.9\&.1a" "Aria2 Manual"
|
||||||
.\" -----------------------------------------------------------------
|
.\" -----------------------------------------------------------------
|
||||||
.\" * Define some portability stuff
|
.\" * Define some portability stuff
|
||||||
.\" -----------------------------------------------------------------
|
.\" -----------------------------------------------------------------
|
||||||
|
@ -1225,6 +1225,14 @@ option\&. Possible Values:
|
||||||
\fI/path/to/command\fR
|
\fI/path/to/command\fR
|
||||||
.RE
|
.RE
|
||||||
.PP
|
.PP
|
||||||
|
\fB\-\-on\-download\-pause\fR=COMMAND
|
||||||
|
.RS 4
|
||||||
|
Set the command to be executed when download is paused\&. See
|
||||||
|
\fB\-\-on\-download\-start\fR
|
||||||
|
option for the requirement of COMMAND\&. Possible Values:
|
||||||
|
\fI/path/to/command\fR
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
\fB\-\-on\-download\-start\fR=COMMAND
|
\fB\-\-on\-download\-start\fR=COMMAND
|
||||||
.RS 4
|
.RS 4
|
||||||
Set the command to be executed when download starts up\&. COMMAND must take just one argument and GID is passed to COMMAND as a first argument\&. Possible Values:
|
Set the command to be executed when download starts up\&. COMMAND must take just one argument and GID is passed to COMMAND as a first argument\&. Possible Values:
|
||||||
|
@ -2607,11 +2615,11 @@ This method adds new HTTP(S)/FTP/BitTorrent Magnet URI\&. \fIuris\fR is of type
|
||||||
.sp
|
.sp
|
||||||
\fBaria2\&.addTorrent\fR \fItorrent[, uris[, options[, position]]]\fR
|
\fBaria2\&.addTorrent\fR \fItorrent[, uris[, options[, position]]]\fR
|
||||||
.sp
|
.sp
|
||||||
This method adds BitTorrent download by uploading \&.torrent file\&. If you want to add BitTorrent Magnet URI, use \fBaria2\&.addUri\fR method instead\&. \fItorrent\fR is of type base64 which contains Base64\-encoded \&.torrent file\&. \fIuris\fR is of type array and its element is URI which is of type string\&. \fIuris\fR is used for Web\-seeding\&. For single file torrents, URI can be a complete URI pointing to the resource or if URI ends with /, name in torrent file is added\&. For multi\-file torrents, name and path in torrent are added to form a URI for each file\&. \fIoptions\fR is of type struct and its members are a pair of option name and value\&. See \fBOptions\fR below for more details\&. If \fIposition\fR is given as an integer starting from 0, the new download is inserted at \fIposition\fR in the waiting queue\&. If \fIposition\fR is not given or \fIposition\fR is larger than the size of the queue, it is appended at the end of the queue\&. This method returns GID of registered download\&.
|
This method adds BitTorrent download by uploading \&.torrent file\&. If you want to add BitTorrent Magnet URI, use \fBaria2\&.addUri\fR method instead\&. \fItorrent\fR is of type base64 which contains Base64\-encoded \&.torrent file\&. \fIuris\fR is of type array and its element is URI which is of type string\&. \fIuris\fR is used for Web\-seeding\&. For single file torrents, URI can be a complete URI pointing to the resource or if URI ends with /, name in torrent file is added\&. For multi\-file torrents, name and path in torrent are added to form a URI for each file\&. \fIoptions\fR is of type struct and its members are a pair of option name and value\&. See \fBOptions\fR below for more details\&. If \fIposition\fR is given as an integer starting from 0, the new download is inserted at \fIposition\fR in the waiting queue\&. If \fIposition\fR is not given or \fIposition\fR is larger than the size of the queue, it is appended at the end of the queue\&. This method returns GID of registered download\&. Please note that the downloads added by this method are not saved by \fB\-\-save\-session\fR\&.
|
||||||
.sp
|
.sp
|
||||||
\fBaria2\&.addMetalink\fR \fImetalink[, options[, position]]\fR
|
\fBaria2\&.addMetalink\fR \fImetalink[, options[, position]]\fR
|
||||||
.sp
|
.sp
|
||||||
This method adds Metalink download by uploading \&.metalink file\&. \fImetalink\fR is of type base64 which contains Base64\-encoded \&.metalink file\&. \fIoptions\fR is of type struct and its members are a pair of option name and value\&. See \fBOptions\fR below for more details\&. If \fIposition\fR is given as an integer starting from 0, the new download is inserted at \fIposition\fR in the waiting queue\&. If \fIposition\fR is not given or \fIposition\fR is larger than the size of the queue, it is appended at the end of the queue\&. This method returns array of GID of registered download\&.
|
This method adds Metalink download by uploading \&.metalink file\&. \fImetalink\fR is of type base64 which contains Base64\-encoded \&.metalink file\&. \fIoptions\fR is of type struct and its members are a pair of option name and value\&. See \fBOptions\fR below for more details\&. If \fIposition\fR is given as an integer starting from 0, the new download is inserted at \fIposition\fR in the waiting queue\&. If \fIposition\fR is not given or \fIposition\fR is larger than the size of the queue, it is appended at the end of the queue\&. This method returns array of GID of registered download\&. Please note that the downloads added by this method are not saved by \fB\-\-save\-session\fR\&.
|
||||||
.sp
|
.sp
|
||||||
\fBaria2\&.remove\fR \fIgid\fR
|
\fBaria2\&.remove\fR \fIgid\fR
|
||||||
.sp
|
.sp
|
||||||
|
@ -2621,6 +2629,14 @@ This method removes the download denoted by \fIgid\fR\&. \fIgid\fR is of type st
|
||||||
.sp
|
.sp
|
||||||
This method removes the download denoted by \fIgid\fR\&. This method behaves just like \fBaria2\&.remove\fR except that this method removes download without any action which takes time such as contacting BitTorrent tracker\&.
|
This method removes the download denoted by \fIgid\fR\&. This method behaves just like \fBaria2\&.remove\fR except that this method removes download without any action which takes time such as contacting BitTorrent tracker\&.
|
||||||
.sp
|
.sp
|
||||||
|
\fBaria2\&.pause\fR \fIgid\fR
|
||||||
|
.sp
|
||||||
|
This method pauses the download denoted by \fIgid\fR\&. \fIgid\fR is of type string\&. The status of paused download becomes "paused" and the download is placed on the first position of waiting queue\&. As long as the status is "paused", the download is not started\&. To change status to "waiting", use \fBaria2\&.unpause\fR method\&. This method returns GID of paused download\&.
|
||||||
|
.sp
|
||||||
|
\fBaria2\&.unpause\fR \fIgid\fR
|
||||||
|
.sp
|
||||||
|
This method changes the status of the download denoted by \fIgid\fR from "paused" to "waiting"\&. This makes the download eligible to restart\&. \fIgid\fR is of type string\&. This method returns GID of unpaused download\&.
|
||||||
|
.sp
|
||||||
\fBaria2\&.tellStatus\fR \fIgid\fR
|
\fBaria2\&.tellStatus\fR \fIgid\fR
|
||||||
.sp
|
.sp
|
||||||
This method returns download progress of the download denoted by \fIgid\fR\&. \fIgid\fR is of type string\&. The response is of type struct and it contains following keys\&. The value type is string\&.
|
This method returns download progress of the download denoted by \fIgid\fR\&. \fIgid\fR is of type string\&. The response is of type struct and it contains following keys\&. The value type is string\&.
|
||||||
|
@ -2632,7 +2648,7 @@ GID of this download\&.
|
||||||
.PP
|
.PP
|
||||||
status
|
status
|
||||||
.RS 4
|
.RS 4
|
||||||
"active" for currently downloading/seeding entry\&. "waiting" for the entry in the queue; download is not started\&. "error" for the stopped download because of error\&. "complete" for the stopped and completed download\&. "removed" for the download removed by user\&.
|
"active" for currently downloading/seeding entry\&. "waiting" for the entry in the queue; download is not started\&. "paused" for the paused entry\&. "error" for the stopped download because of error\&. "complete" for the stopped and completed download\&. "removed" for the download removed by user\&.
|
||||||
.RE
|
.RE
|
||||||
.PP
|
.PP
|
||||||
totalLength
|
totalLength
|
||||||
|
@ -2894,7 +2910,7 @@ This method returns the list of active downloads\&. The response is of type arra
|
||||||
.sp
|
.sp
|
||||||
\fBaria2\&.tellWaiting\fR \fIoffset, num\fR
|
\fBaria2\&.tellWaiting\fR \fIoffset, num\fR
|
||||||
.sp
|
.sp
|
||||||
This method returns the list of waiting download\&. \fIoffset\fR is of type integer and specifies the offset from the download waiting at the front\&. \fInum\fR is of type integer and specifies the number of downloads to be returned\&.
|
This method returns the list of waiting download, including paused downloads\&. \fIoffset\fR is of type integer and specifies the offset from the download waiting at the front\&. \fInum\fR is of type integer and specifies the number of downloads to be returned\&.
|
||||||
.sp
|
.sp
|
||||||
If offset is a positive integer, this method returns downloads in the range of [\fIoffset\fR, \fIoffset\fR+\fInum\fR)\&.
|
If offset is a positive integer, this method returns downloads in the range of [\fIoffset\fR, \fIoffset\fR+\fInum\fR)\&.
|
||||||
.sp
|
.sp
|
||||||
|
|
|
@ -2050,6 +2050,16 @@ name.</td>
|
||||||
</p>
|
</p>
|
||||||
</dd>
|
</dd>
|
||||||
<dt class="hdlist1">
|
<dt class="hdlist1">
|
||||||
|
<strong>--on-download-pause</strong>=COMMAND
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
<p>
|
||||||
|
Set the command to be executed when download is paused. See
|
||||||
|
<strong>--on-download-start</strong> option for the requirement of COMMAND.
|
||||||
|
Possible Values: <em>/path/to/command</em>
|
||||||
|
</p>
|
||||||
|
</dd>
|
||||||
|
<dt class="hdlist1">
|
||||||
<strong>--on-download-start</strong>=COMMAND
|
<strong>--on-download-start</strong>=COMMAND
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
@ -3066,7 +3076,9 @@ and value. See <strong>Options</strong> below for more details. If <em>position
|
||||||
given as an integer starting from 0, the new download is inserted at
|
given as an integer starting from 0, the new download is inserted at
|
||||||
<em>position</em> in the waiting queue. If <em>position</em> is not given or
|
<em>position</em> in the waiting queue. If <em>position</em> is not given or
|
||||||
<em>position</em> is larger than the size of the queue, it is appended at the
|
<em>position</em> is larger than the size of the queue, it is appended at the
|
||||||
end of the queue. This method returns GID of registered download.</p></div>
|
end of the queue. This method returns GID of registered download.
|
||||||
|
Please note that the downloads added by this method are not saved by
|
||||||
|
<strong>--save-session</strong>.</p></div>
|
||||||
<div class="paragraph"><p><strong>aria2.addMetalink</strong> <em>metalink[, options[, position]]</em></p></div>
|
<div class="paragraph"><p><strong>aria2.addMetalink</strong> <em>metalink[, options[, position]]</em></p></div>
|
||||||
<div class="paragraph"><p>This method adds Metalink download by uploading .metalink file.
|
<div class="paragraph"><p>This method adds Metalink download by uploading .metalink file.
|
||||||
<em>metalink</em> is of type base64 which contains Base64-encoded .metalink
|
<em>metalink</em> is of type base64 which contains Base64-encoded .metalink
|
||||||
|
@ -3076,7 +3088,8 @@ option name and value. See <strong>Options</strong> below for more details. If
|
||||||
inserted at <em>position</em> in the waiting queue. If <em>position</em> is not
|
inserted at <em>position</em> in the waiting queue. If <em>position</em> is not
|
||||||
given or <em>position</em> is larger than the size of the queue, it is
|
given or <em>position</em> is larger than the size of the queue, it is
|
||||||
appended at the end of the queue. This method returns array of GID of
|
appended at the end of the queue. This method returns array of GID of
|
||||||
registered download.</p></div>
|
registered download. Please note that the downloads added by this
|
||||||
|
method are not saved by <strong>--save-session</strong>.</p></div>
|
||||||
<div class="paragraph"><p><strong>aria2.remove</strong> <em>gid</em></p></div>
|
<div class="paragraph"><p><strong>aria2.remove</strong> <em>gid</em></p></div>
|
||||||
<div class="paragraph"><p>This method removes the download denoted by <em>gid</em>. <em>gid</em> is of type
|
<div class="paragraph"><p>This method removes the download denoted by <em>gid</em>. <em>gid</em> is of type
|
||||||
string. If specified download is in progress, it is stopped at
|
string. If specified download is in progress, it is stopped at
|
||||||
|
@ -3087,6 +3100,18 @@ returns GID of removed download.</p></div>
|
||||||
behaves just like <strong>aria2.remove</strong> except that this method removes
|
behaves just like <strong>aria2.remove</strong> except that this method removes
|
||||||
download without any action which takes time such as contacting
|
download without any action which takes time such as contacting
|
||||||
BitTorrent tracker.</p></div>
|
BitTorrent tracker.</p></div>
|
||||||
|
<div class="paragraph"><p><strong>aria2.pause</strong> <em>gid</em></p></div>
|
||||||
|
<div class="paragraph"><p>This method pauses the download denoted by <em>gid</em>. <em>gid</em> is of type
|
||||||
|
string. The status of paused download becomes "paused" and the
|
||||||
|
download is placed on the first position of waiting queue. As long as
|
||||||
|
the status is "paused", the download is not started. To change status
|
||||||
|
to "waiting", use <strong>aria2.unpause</strong> method.
|
||||||
|
This method returns GID of paused download.</p></div>
|
||||||
|
<div class="paragraph"><p><strong>aria2.unpause</strong> <em>gid</em></p></div>
|
||||||
|
<div class="paragraph"><p>This method changes the status of the download denoted by <em>gid</em> from
|
||||||
|
"paused" to "waiting". This makes the download eligible to restart.
|
||||||
|
<em>gid</em> is of type string. This method returns GID of unpaused
|
||||||
|
download.</p></div>
|
||||||
<div class="paragraph"><p><strong>aria2.tellStatus</strong> <em>gid</em></p></div>
|
<div class="paragraph"><p><strong>aria2.tellStatus</strong> <em>gid</em></p></div>
|
||||||
<div class="paragraph"><p>This method returns download progress of the download denoted by
|
<div class="paragraph"><p>This method returns download progress of the download denoted by
|
||||||
<em>gid</em>. <em>gid</em> is of type string. The response is of type struct and it
|
<em>gid</em>. <em>gid</em> is of type string. The response is of type struct and it
|
||||||
|
@ -3106,9 +3131,10 @@ status
|
||||||
<dd>
|
<dd>
|
||||||
<p>
|
<p>
|
||||||
"active" for currently downloading/seeding entry. "waiting" for the
|
"active" for currently downloading/seeding entry. "waiting" for the
|
||||||
entry in the queue; download is not started. "error" for the stopped
|
entry in the queue; download is not started. "paused" for the
|
||||||
download because of error. "complete" for the stopped and completed
|
paused entry. "error" for the stopped download because of
|
||||||
download. "removed" for the download removed by user.
|
error. "complete" for the stopped and completed download. "removed"
|
||||||
|
for the download removed by user.
|
||||||
</p>
|
</p>
|
||||||
</dd>
|
</dd>
|
||||||
<dt class="hdlist1">
|
<dt class="hdlist1">
|
||||||
|
@ -3531,10 +3557,10 @@ downloadSpeed
|
||||||
type array and its element is the same struct returned by
|
type array and its element is the same struct returned by
|
||||||
<strong>aria2.tellStatus</strong> method.</p></div>
|
<strong>aria2.tellStatus</strong> method.</p></div>
|
||||||
<div class="paragraph"><p><strong>aria2.tellWaiting</strong> <em>offset, num</em></p></div>
|
<div class="paragraph"><p><strong>aria2.tellWaiting</strong> <em>offset, num</em></p></div>
|
||||||
<div class="paragraph"><p>This method returns the list of waiting download. <em>offset</em> is of type
|
<div class="paragraph"><p>This method returns the list of waiting download, including paused
|
||||||
integer and specifies the offset from the download waiting at the
|
downloads. <em>offset</em> is of type integer and specifies the offset from
|
||||||
front. <em>num</em> is of type integer and specifies the number of downloads
|
the download waiting at the front. <em>num</em> is of type integer and
|
||||||
to be returned.</p></div>
|
specifies the number of downloads to be returned.</p></div>
|
||||||
<div class="paragraph"><p>If offset is a positive integer, this method returns downloads in the
|
<div class="paragraph"><p>If offset is a positive integer, this method returns downloads in the
|
||||||
range of [<em>offset</em>, <em>offset</em>+<em>num</em>).</p></div>
|
range of [<em>offset</em>, <em>offset</em>+<em>num</em>).</p></div>
|
||||||
<div class="paragraph"><p><em>offset</em> can be a negative integer. <em>offset</em> == -1 points last
|
<div class="paragraph"><p><em>offset</em> can be a negative integer. <em>offset</em> == -1 points last
|
||||||
|
@ -4148,7 +4174,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-04-08 21:48:17 JST
|
Last updated 2010-04-09 00:32:31 JST
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -832,6 +832,12 @@ name.
|
||||||
See also *--on-download-stop* option. Possible Values:
|
See also *--on-download-stop* option. Possible Values:
|
||||||
'/path/to/command'
|
'/path/to/command'
|
||||||
|
|
||||||
|
*--on-download-pause*=COMMAND::
|
||||||
|
|
||||||
|
Set the command to be executed when download is paused. See
|
||||||
|
*--on-download-start* option for the requirement of COMMAND.
|
||||||
|
Possible Values: '/path/to/command'
|
||||||
|
|
||||||
*--on-download-start*=COMMAND::
|
*--on-download-start*=COMMAND::
|
||||||
|
|
||||||
Set the command to be executed when download starts up. COMMAND must
|
Set the command to be executed when download starts up. COMMAND must
|
||||||
|
@ -1332,6 +1338,8 @@ given as an integer starting from 0, the new download is inserted at
|
||||||
'position' in the waiting queue. If 'position' is not given or
|
'position' in the waiting queue. If 'position' is not given or
|
||||||
'position' is larger than the size of the queue, it is appended at the
|
'position' is larger than the size of the queue, it is appended at the
|
||||||
end of the queue. This method returns GID of registered download.
|
end of the queue. This method returns GID of registered download.
|
||||||
|
Please note that the downloads added by this method are not saved by
|
||||||
|
*--save-session*.
|
||||||
|
|
||||||
*aria2.addMetalink* 'metalink[, options[, position]]'
|
*aria2.addMetalink* 'metalink[, options[, position]]'
|
||||||
|
|
||||||
|
@ -1343,7 +1351,8 @@ option name and value. See *Options* below for more details. If
|
||||||
inserted at 'position' in the waiting queue. If 'position' is not
|
inserted at 'position' in the waiting queue. If 'position' is not
|
||||||
given or 'position' is larger than the size of the queue, it is
|
given or 'position' is larger than the size of the queue, it is
|
||||||
appended at the end of the queue. This method returns array of GID of
|
appended at the end of the queue. This method returns array of GID of
|
||||||
registered download.
|
registered download. Please note that the downloads added by this
|
||||||
|
method are not saved by *--save-session*.
|
||||||
|
|
||||||
*aria2.remove* 'gid'
|
*aria2.remove* 'gid'
|
||||||
|
|
||||||
|
@ -1359,6 +1368,22 @@ behaves just like *aria2.remove* except that this method removes
|
||||||
download without any action which takes time such as contacting
|
download without any action which takes time such as contacting
|
||||||
BitTorrent tracker.
|
BitTorrent tracker.
|
||||||
|
|
||||||
|
*aria2.pause* 'gid'
|
||||||
|
|
||||||
|
This method pauses the download denoted by 'gid'. 'gid' is of type
|
||||||
|
string. The status of paused download becomes "paused" and the
|
||||||
|
download is placed on the first position of waiting queue. As long as
|
||||||
|
the status is "paused", the download is not started. To change status
|
||||||
|
to "waiting", use *aria2.unpause* method.
|
||||||
|
This method returns GID of paused download.
|
||||||
|
|
||||||
|
*aria2.unpause* 'gid'
|
||||||
|
|
||||||
|
This method changes the status of the download denoted by 'gid' from
|
||||||
|
"paused" to "waiting". This makes the download eligible to restart.
|
||||||
|
'gid' is of type string. This method returns GID of unpaused
|
||||||
|
download.
|
||||||
|
|
||||||
*aria2.tellStatus* 'gid'
|
*aria2.tellStatus* 'gid'
|
||||||
|
|
||||||
This method returns download progress of the download denoted by
|
This method returns download progress of the download denoted by
|
||||||
|
@ -1372,9 +1397,10 @@ gid::
|
||||||
status::
|
status::
|
||||||
|
|
||||||
"active" for currently downloading/seeding entry. "waiting" for the
|
"active" for currently downloading/seeding entry. "waiting" for the
|
||||||
entry in the queue; download is not started. "error" for the stopped
|
entry in the queue; download is not started. "paused" for the
|
||||||
download because of error. "complete" for the stopped and completed
|
paused entry. "error" for the stopped download because of
|
||||||
download. "removed" for the download removed by user.
|
error. "complete" for the stopped and completed download. "removed"
|
||||||
|
for the download removed by user.
|
||||||
|
|
||||||
totalLength::
|
totalLength::
|
||||||
|
|
||||||
|
@ -1617,10 +1643,10 @@ type array and its element is the same struct returned by
|
||||||
|
|
||||||
*aria2.tellWaiting* 'offset, num'
|
*aria2.tellWaiting* 'offset, num'
|
||||||
|
|
||||||
This method returns the list of waiting download. 'offset' is of type
|
This method returns the list of waiting download, including paused
|
||||||
integer and specifies the offset from the download waiting at the
|
downloads. 'offset' is of type integer and specifies the offset from
|
||||||
front. 'num' is of type integer and specifies the number of downloads
|
the download waiting at the front. 'num' is of type integer and
|
||||||
to be returned.
|
specifies the number of downloads to be returned.
|
||||||
|
|
||||||
If offset is a positive integer, this method returns downloads in the
|
If offset is a positive integer, this method returns downloads in the
|
||||||
range of ['offset', 'offset'+'num').
|
range of ['offset', 'offset'+'num').
|
||||||
|
@ -1871,7 +1897,7 @@ aria2 uses 5 connections to download 1 file by default.
|
||||||
-s1 limits the number of connections to just 1.
|
-s1 limits the number of connections to just 1.
|
||||||
|
|
||||||
[NOTE]
|
[NOTE]
|
||||||
To pause a download, press Ctrl-C. You can resume the transfer by running aria2c with the same argument in the same directory. You can change URIs as long as they are pointing to the same file.
|
To stop a download, press Ctrl-C. You can resume the transfer by running aria2c with the same argument in the same directory. You can change URIs as long as they are pointing to the same file.
|
||||||
|
|
||||||
Download a file from 2 different HTTP servers
|
Download a file from 2 different HTTP servers
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
@ -1938,7 +1964,7 @@ Download using a local metalink file
|
||||||
aria2c -p --lowest-speed-limit=4000 file.metalink
|
aria2c -p --lowest-speed-limit=4000 file.metalink
|
||||||
----------------------------------------------------------
|
----------------------------------------------------------
|
||||||
[NOTE]
|
[NOTE]
|
||||||
To pause a download, press Ctrl-C.
|
To stop a download, press Ctrl-C.
|
||||||
You can resume the transfer by running aria2c with the same argument in the same
|
You can resume the transfer by running aria2c with the same argument in the same
|
||||||
directory.
|
directory.
|
||||||
|
|
||||||
|
@ -1979,7 +2005,7 @@ aria2c --max-upload-limit=40K file.torrent
|
||||||
--max-upload-limit specifies the max of upload rate.
|
--max-upload-limit specifies the max of upload rate.
|
||||||
|
|
||||||
[NOTE]
|
[NOTE]
|
||||||
To pause a download, press Ctrl-C. You can resume the transfer by running aria2c with the same argument in the same directory.
|
To stop a download, press Ctrl-C. You can resume the transfer by running aria2c with the same argument in the same directory.
|
||||||
|
|
||||||
Download using BitTorrent Magnet URI
|
Download using BitTorrent Magnet URI
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
@ -69,6 +69,7 @@ DownloadContext::DownloadContext(size_t pieceLength,
|
||||||
void DownloadContext::resetDownloadStartTime()
|
void DownloadContext::resetDownloadStartTime()
|
||||||
{
|
{
|
||||||
_downloadStartTime = global::wallclock;
|
_downloadStartTime = global::wallclock;
|
||||||
|
_downloadStopTime.setTimeInSec(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DownloadContext::resetDownloadStopTime()
|
void DownloadContext::resetDownloadStopTime()
|
||||||
|
|
|
@ -333,7 +333,6 @@ void FileEntry::releaseRuntimeResource()
|
||||||
{
|
{
|
||||||
_requestPool.clear();
|
_requestPool.clear();
|
||||||
_inFlightRequests.clear();
|
_inFlightRequests.clear();
|
||||||
_uriResults.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename InputIterator, typename T>
|
template<typename InputIterator, typename T>
|
||||||
|
|
|
@ -383,6 +383,16 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
op->addTag(TAG_HOOK);
|
op->addTag(TAG_HOOK);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
SharedHandle<OptionHandler> op(new DefaultOptionHandler
|
||||||
|
(PREF_ON_DOWNLOAD_PAUSE,
|
||||||
|
TEXT_ON_DOWNLOAD_PAUSE,
|
||||||
|
NO_DEFAULT_VALUE,
|
||||||
|
"/path/to/command"));
|
||||||
|
op->addTag(TAG_ADVANCED);
|
||||||
|
op->addTag(TAG_HOOK);
|
||||||
|
handlers.push_back(op);
|
||||||
|
}
|
||||||
{
|
{
|
||||||
SharedHandle<OptionHandler> op(new DefaultOptionHandler
|
SharedHandle<OptionHandler> op(new DefaultOptionHandler
|
||||||
(PREF_ON_DOWNLOAD_START,
|
(PREF_ON_DOWNLOAD_START,
|
||||||
|
|
|
@ -122,6 +122,7 @@ RequestGroup::RequestGroup(const SharedHandle<Option>& option):
|
||||||
_haltRequested(false),
|
_haltRequested(false),
|
||||||
_forceHaltRequested(false),
|
_forceHaltRequested(false),
|
||||||
_haltReason(RequestGroup::NONE),
|
_haltReason(RequestGroup::NONE),
|
||||||
|
_pauseRequested(false),
|
||||||
_uriSelector(new InOrderURISelector()),
|
_uriSelector(new InOrderURISelector()),
|
||||||
_lastModifiedTime(Time::null()),
|
_lastModifiedTime(Time::null()),
|
||||||
_fileNotFoundCount(0),
|
_fileNotFoundCount(0),
|
||||||
|
@ -861,6 +862,7 @@ void RequestGroup::setHaltRequested(bool f, HaltReason haltReason)
|
||||||
{
|
{
|
||||||
_haltRequested = f;
|
_haltRequested = f;
|
||||||
if(_haltRequested) {
|
if(_haltRequested) {
|
||||||
|
_pauseRequested = false;
|
||||||
_haltReason = haltReason;
|
_haltReason = haltReason;
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_BITTORRENT
|
#ifdef ENABLE_BITTORRENT
|
||||||
|
@ -876,6 +878,11 @@ void RequestGroup::setForceHaltRequested(bool f, HaltReason haltReason)
|
||||||
_forceHaltRequested = f;
|
_forceHaltRequested = f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RequestGroup::setPauseRequested(bool f)
|
||||||
|
{
|
||||||
|
_pauseRequested = f;
|
||||||
|
}
|
||||||
|
|
||||||
void RequestGroup::releaseRuntimeResource(DownloadEngine* e)
|
void RequestGroup::releaseRuntimeResource(DownloadEngine* e)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_BITTORRENT
|
#ifdef ENABLE_BITTORRENT
|
||||||
|
@ -884,6 +891,9 @@ void RequestGroup::releaseRuntimeResource(DownloadEngine* e)
|
||||||
if(!_pieceStorage.isNull()) {
|
if(!_pieceStorage.isNull()) {
|
||||||
_pieceStorage->removeAdvertisedPiece(0);
|
_pieceStorage->removeAdvertisedPiece(0);
|
||||||
}
|
}
|
||||||
|
_segmentMan.reset();
|
||||||
|
_pieceStorage.reset();
|
||||||
|
_progressInfoFile.reset();
|
||||||
_downloadContext->releaseRuntimeResource();
|
_downloadContext->releaseRuntimeResource();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,6 +123,8 @@ private:
|
||||||
|
|
||||||
HaltReason _haltReason;
|
HaltReason _haltReason;
|
||||||
|
|
||||||
|
bool _pauseRequested;
|
||||||
|
|
||||||
std::vector<SharedHandle<PreDownloadHandler> > _preDownloadHandlers;
|
std::vector<SharedHandle<PreDownloadHandler> > _preDownloadHandlers;
|
||||||
|
|
||||||
std::vector<SharedHandle<PostDownloadHandler> > _postDownloadHandlers;
|
std::vector<SharedHandle<PostDownloadHandler> > _postDownloadHandlers;
|
||||||
|
@ -343,6 +345,13 @@ public:
|
||||||
return _forceHaltRequested;
|
return _forceHaltRequested;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setPauseRequested(bool f);
|
||||||
|
|
||||||
|
bool isPauseRequested() const
|
||||||
|
{
|
||||||
|
return _pauseRequested;
|
||||||
|
}
|
||||||
|
|
||||||
void dependsOn(const SharedHandle<Dependency>& dep);
|
void dependsOn(const SharedHandle<Dependency>& dep);
|
||||||
|
|
||||||
bool isDependencyResolved();
|
bool isDependencyResolved();
|
||||||
|
|
|
@ -291,11 +291,12 @@ static void executeHook(const std::string& command, gid_t gid)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void executeStartHook
|
static void executeHookByOptName
|
||||||
(const SharedHandle<RequestGroup>& group, const Option* option)
|
(const SharedHandle<RequestGroup>& group, const Option* option,
|
||||||
|
const std::string& opt)
|
||||||
{
|
{
|
||||||
if(!option->blank(PREF_ON_DOWNLOAD_START)) {
|
if(!option->blank(opt)) {
|
||||||
executeHook(option->get(PREF_ON_DOWNLOAD_START), group->getGID());
|
executeHook(option->get(opt), group->getGID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,6 +318,7 @@ class ProcessStoppedRequestGroup {
|
||||||
private:
|
private:
|
||||||
DownloadEngine* _e;
|
DownloadEngine* _e;
|
||||||
std::deque<SharedHandle<DownloadResult> >& _downloadResults;
|
std::deque<SharedHandle<DownloadResult> >& _downloadResults;
|
||||||
|
std::deque<SharedHandle<RequestGroup> >& _reservedGroups;
|
||||||
Logger* _logger;
|
Logger* _logger;
|
||||||
|
|
||||||
void saveSignature(const SharedHandle<RequestGroup>& group)
|
void saveSignature(const SharedHandle<RequestGroup>& group)
|
||||||
|
@ -337,9 +339,11 @@ private:
|
||||||
public:
|
public:
|
||||||
ProcessStoppedRequestGroup
|
ProcessStoppedRequestGroup
|
||||||
(DownloadEngine* e,
|
(DownloadEngine* e,
|
||||||
std::deque<SharedHandle<DownloadResult> >& downloadResults):
|
std::deque<SharedHandle<DownloadResult> >& downloadResults,
|
||||||
|
std::deque<SharedHandle<RequestGroup> >& reservedGroups):
|
||||||
_e(e),
|
_e(e),
|
||||||
_downloadResults(downloadResults),
|
_downloadResults(downloadResults),
|
||||||
|
_reservedGroups(reservedGroups),
|
||||||
_logger(LogFactory::getInstance()) {}
|
_logger(LogFactory::getInstance()) {}
|
||||||
|
|
||||||
void operator()(const SharedHandle<RequestGroup>& group)
|
void operator()(const SharedHandle<RequestGroup>& group)
|
||||||
|
@ -358,6 +362,7 @@ public:
|
||||||
try {
|
try {
|
||||||
group->closeFile();
|
group->closeFile();
|
||||||
if(group->downloadFinished()) {
|
if(group->downloadFinished()) {
|
||||||
|
group->setPauseRequested(false);
|
||||||
group->applyLastModifiedTimeToLocalFiles();
|
group->applyLastModifiedTimeToLocalFiles();
|
||||||
group->reportDownloadFinished();
|
group->reportDownloadFinished();
|
||||||
if(group->allDownloadFinished()) {
|
if(group->allDownloadFinished()) {
|
||||||
|
@ -382,10 +387,20 @@ public:
|
||||||
} catch(RecoverableException& ex) {
|
} catch(RecoverableException& ex) {
|
||||||
_logger->error(EX_EXCEPTION_CAUGHT, ex);
|
_logger->error(EX_EXCEPTION_CAUGHT, ex);
|
||||||
}
|
}
|
||||||
|
if(group->isPauseRequested()) {
|
||||||
|
_reservedGroups.push_front(group);
|
||||||
|
} else {
|
||||||
|
_downloadResults.push_back(group->createDownloadResult());
|
||||||
|
}
|
||||||
group->releaseRuntimeResource(_e);
|
group->releaseRuntimeResource(_e);
|
||||||
_downloadResults.push_back(group->createDownloadResult());
|
if(group->isPauseRequested()) {
|
||||||
|
group->setForceHaltRequested(false);
|
||||||
executeStopHook(_downloadResults.back(), _e->option);
|
executeHookByOptName(group, _e->option, PREF_ON_DOWNLOAD_PAUSE);
|
||||||
|
// TODO Should we have to prepend spend uris to remaining uris
|
||||||
|
// in case PREF_REUSE_URI is disabed?
|
||||||
|
} else {
|
||||||
|
executeStopHook(_downloadResults.back(), _e->option);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -452,8 +467,8 @@ void RequestGroupMan::removeStoppedGroup(DownloadEngine* e)
|
||||||
updateServerStat();
|
updateServerStat();
|
||||||
|
|
||||||
std::for_each(_requestGroups.begin(), _requestGroups.end(),
|
std::for_each(_requestGroups.begin(), _requestGroups.end(),
|
||||||
ProcessStoppedRequestGroup(e, _downloadResults));
|
ProcessStoppedRequestGroup
|
||||||
|
(e, _downloadResults, _reservedGroups));
|
||||||
std::deque<SharedHandle<RequestGroup> >::iterator i =
|
std::deque<SharedHandle<RequestGroup> >::iterator i =
|
||||||
std::remove_if(_requestGroups.begin(),
|
std::remove_if(_requestGroups.begin(),
|
||||||
_requestGroups.end(),
|
_requestGroups.end(),
|
||||||
|
@ -509,7 +524,7 @@ void RequestGroupMan::fillRequestGroupFromReserver(DownloadEngine* e)
|
||||||
_reservedGroups.pop_front();
|
_reservedGroups.pop_front();
|
||||||
std::vector<Command*> commands;
|
std::vector<Command*> commands;
|
||||||
try {
|
try {
|
||||||
if(!groupToAdd->isDependencyResolved()) {
|
if(groupToAdd->isPauseRequested()||!groupToAdd->isDependencyResolved()) {
|
||||||
temp.push_back(groupToAdd);
|
temp.push_back(groupToAdd);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -523,7 +538,7 @@ void RequestGroupMan::fillRequestGroupFromReserver(DownloadEngine* e)
|
||||||
++count;
|
++count;
|
||||||
e->addCommand(commands);
|
e->addCommand(commands);
|
||||||
commands.clear();
|
commands.clear();
|
||||||
executeStartHook(groupToAdd, e->option);
|
executeHookByOptName(groupToAdd, e->option, PREF_ON_DOWNLOAD_START);
|
||||||
} catch(RecoverableException& ex) {
|
} catch(RecoverableException& ex) {
|
||||||
_logger->error(EX_EXCEPTION_CAUGHT, ex);
|
_logger->error(EX_EXCEPTION_CAUGHT, ex);
|
||||||
if(_logger->debug()) {
|
if(_logger->debug()) {
|
||||||
|
@ -660,6 +675,16 @@ void RequestGroupMan::showDownloadResults(std::ostream& o) const
|
||||||
}
|
}
|
||||||
o << formatDownloadResult(status, result) << "\n";
|
o << formatDownloadResult(status, result) << "\n";
|
||||||
}
|
}
|
||||||
|
for(std::deque<SharedHandle<RequestGroup> >::const_iterator itr =
|
||||||
|
_reservedGroups.begin(), eoi = _reservedGroups.end();
|
||||||
|
itr != eoi; ++itr) {
|
||||||
|
if(!(*itr)->isPauseRequested()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
SharedHandle<DownloadResult> result = (*itr)->createDownloadResult();
|
||||||
|
++inpr;
|
||||||
|
o << formatDownloadResult(MARK_INPR, result) << "\n";
|
||||||
|
}
|
||||||
if(ok > 0 || err > 0 || inpr > 0) {
|
if(ok > 0 || err > 0 || inpr > 0) {
|
||||||
o << "\n"
|
o << "\n"
|
||||||
<< _("Status Legend:") << "\n";
|
<< _("Status Legend:") << "\n";
|
||||||
|
|
|
@ -58,6 +58,10 @@ XmlRpcMethodFactory::create(const std::string& methodName)
|
||||||
}
|
}
|
||||||
else if(methodName == RemoveXmlRpcMethod::getMethodName()) {
|
else if(methodName == RemoveXmlRpcMethod::getMethodName()) {
|
||||||
return SharedHandle<XmlRpcMethod>(new RemoveXmlRpcMethod());
|
return SharedHandle<XmlRpcMethod>(new RemoveXmlRpcMethod());
|
||||||
|
} else if(methodName == PauseXmlRpcMethod::getMethodName()) {
|
||||||
|
return SharedHandle<XmlRpcMethod>(new PauseXmlRpcMethod());
|
||||||
|
} else if(methodName == UnpauseXmlRpcMethod::getMethodName()) {
|
||||||
|
return SharedHandle<XmlRpcMethod>(new UnpauseXmlRpcMethod());
|
||||||
} else if(methodName == ForceRemoveXmlRpcMethod::getMethodName()) {
|
} else if(methodName == ForceRemoveXmlRpcMethod::getMethodName()) {
|
||||||
return SharedHandle<XmlRpcMethod>(new ForceRemoveXmlRpcMethod());
|
return SharedHandle<XmlRpcMethod>(new ForceRemoveXmlRpcMethod());
|
||||||
} else if(methodName == ChangePositionXmlRpcMethod::getMethodName()) {
|
} else if(methodName == ChangePositionXmlRpcMethod::getMethodName()) {
|
||||||
|
|
|
@ -83,6 +83,7 @@ const BDE BDE_FALSE = BDE("false");
|
||||||
const BDE BDE_OK = BDE("OK");
|
const BDE BDE_OK = BDE("OK");
|
||||||
const BDE BDE_ACTIVE = BDE("active");
|
const BDE BDE_ACTIVE = BDE("active");
|
||||||
const BDE BDE_WAITING = BDE("waiting");
|
const BDE BDE_WAITING = BDE("waiting");
|
||||||
|
const BDE BDE_PAUSED = BDE("paused");
|
||||||
const BDE BDE_REMOVED = BDE("removed");
|
const BDE BDE_REMOVED = BDE("removed");
|
||||||
const BDE BDE_ERROR = BDE("error");
|
const BDE BDE_ERROR = BDE("error");
|
||||||
const BDE BDE_COMPLETE = BDE("complete");
|
const BDE BDE_COMPLETE = BDE("complete");
|
||||||
|
@ -336,6 +337,48 @@ BDE ForceRemoveXmlRpcMethod::process
|
||||||
return removeDownload(req, e, true);
|
return removeDownload(req, e, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BDE PauseXmlRpcMethod::process(const XmlRpcRequest& req, DownloadEngine* e)
|
||||||
|
{
|
||||||
|
const BDE& params = req._params;
|
||||||
|
assert(params.isList());
|
||||||
|
if(params.empty() || !params[0].isString()) {
|
||||||
|
throw DL_ABORT_EX(MSG_GID_NOT_PROVIDED);
|
||||||
|
}
|
||||||
|
gid_t gid = util::parseLLInt(params[0].s());
|
||||||
|
SharedHandle<RequestGroup> group = e->_requestGroupMan->findRequestGroup(gid);
|
||||||
|
if(group.isNull() || group->isHaltRequested()) {
|
||||||
|
throw DL_ABORT_EX
|
||||||
|
(StringFormat("GID#%s cannot be paused now",
|
||||||
|
util::itos(gid).c_str()).str());
|
||||||
|
} else {
|
||||||
|
// Call setHaltRequested before setPauseRequested because
|
||||||
|
// setHaltRequested calls setPauseRequested(false) internally.
|
||||||
|
group->setHaltRequested(true, RequestGroup::USER_REQUEST);
|
||||||
|
group->setPauseRequested(true);
|
||||||
|
}
|
||||||
|
return createGIDResponse(gid);
|
||||||
|
}
|
||||||
|
|
||||||
|
BDE UnpauseXmlRpcMethod::process(const XmlRpcRequest& req, DownloadEngine* e)
|
||||||
|
{
|
||||||
|
const BDE& params = req._params;
|
||||||
|
assert(params.isList());
|
||||||
|
if(params.empty() || !params[0].isString()) {
|
||||||
|
throw DL_ABORT_EX(MSG_GID_NOT_PROVIDED);
|
||||||
|
}
|
||||||
|
gid_t gid = util::parseLLInt(params[0].s());
|
||||||
|
SharedHandle<RequestGroup> group =e->_requestGroupMan->findReservedGroup(gid);
|
||||||
|
if(group.isNull() || !group->isPauseRequested()) {
|
||||||
|
throw DL_ABORT_EX
|
||||||
|
(StringFormat("GID#%s cannot be unpaused now",
|
||||||
|
util::itos(gid).c_str()).str());
|
||||||
|
} else {
|
||||||
|
group->setPauseRequested(false);
|
||||||
|
e->_requestGroupMan->requestQueueCheck();
|
||||||
|
}
|
||||||
|
return createGIDResponse(gid);
|
||||||
|
}
|
||||||
|
|
||||||
static void createUriEntry(BDE& uriList, const SharedHandle<FileEntry>& file)
|
static void createUriEntry(BDE& uriList, const SharedHandle<FileEntry>& file)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -669,7 +712,11 @@ BDE TellStatusXmlRpcMethod::process
|
||||||
}
|
}
|
||||||
gatherStoppedDownload(entryDict, ds);
|
gatherStoppedDownload(entryDict, ds);
|
||||||
} else {
|
} else {
|
||||||
entryDict[KEY_STATUS] = BDE_WAITING;
|
if(group->isPauseRequested()) {
|
||||||
|
entryDict[KEY_STATUS] = BDE_PAUSED;
|
||||||
|
} else {
|
||||||
|
entryDict[KEY_STATUS] = BDE_WAITING;
|
||||||
|
}
|
||||||
gatherProgress(entryDict, group, e);
|
gatherProgress(entryDict, group, e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -705,7 +752,11 @@ void TellWaitingXmlRpcMethod::createEntry
|
||||||
(BDE& entryDict, const SharedHandle<RequestGroup>& item,
|
(BDE& entryDict, const SharedHandle<RequestGroup>& item,
|
||||||
DownloadEngine* e) const
|
DownloadEngine* e) const
|
||||||
{
|
{
|
||||||
entryDict[KEY_STATUS] = BDE_WAITING;
|
if(item->isPauseRequested()) {
|
||||||
|
entryDict[KEY_STATUS] = BDE_PAUSED;
|
||||||
|
} else {
|
||||||
|
entryDict[KEY_STATUS] = BDE_WAITING;
|
||||||
|
}
|
||||||
gatherProgress(entryDict, item, e);
|
gatherProgress(entryDict, item, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,28 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class PauseXmlRpcMethod:public XmlRpcMethod {
|
||||||
|
protected:
|
||||||
|
virtual BDE process(const XmlRpcRequest& req, DownloadEngine* e);
|
||||||
|
public:
|
||||||
|
static const std::string& getMethodName()
|
||||||
|
{
|
||||||
|
static std::string methodName = "aria2.pause";
|
||||||
|
return methodName;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class UnpauseXmlRpcMethod:public XmlRpcMethod {
|
||||||
|
protected:
|
||||||
|
virtual BDE process(const XmlRpcRequest& req, DownloadEngine* e);
|
||||||
|
public:
|
||||||
|
static const std::string& getMethodName()
|
||||||
|
{
|
||||||
|
static std::string methodName = "aria2.unpause";
|
||||||
|
return methodName;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef ENABLE_BITTORRENT
|
#ifdef ENABLE_BITTORRENT
|
||||||
class AddTorrentXmlRpcMethod:public XmlRpcMethod {
|
class AddTorrentXmlRpcMethod:public XmlRpcMethod {
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -167,6 +167,7 @@ const std::string PREF_XML_RPC_PASSWD("xml-rpc-passwd");
|
||||||
const std::string PREF_XML_RPC_MAX_REQUEST_SIZE("xml-rpc-max-request-size");
|
const std::string PREF_XML_RPC_MAX_REQUEST_SIZE("xml-rpc-max-request-size");
|
||||||
// value: string
|
// value: string
|
||||||
const std::string PREF_ON_DOWNLOAD_START("on-download-start");
|
const std::string PREF_ON_DOWNLOAD_START("on-download-start");
|
||||||
|
const std::string PREF_ON_DOWNLOAD_PAUSE("on-download-pause");
|
||||||
const std::string PREF_ON_DOWNLOAD_STOP("on-download-stop");
|
const std::string PREF_ON_DOWNLOAD_STOP("on-download-stop");
|
||||||
const std::string PREF_ON_DOWNLOAD_COMPLETE("on-download-complete");
|
const std::string PREF_ON_DOWNLOAD_COMPLETE("on-download-complete");
|
||||||
const std::string PREF_ON_DOWNLOAD_ERROR("on-download-error");
|
const std::string PREF_ON_DOWNLOAD_ERROR("on-download-error");
|
||||||
|
|
|
@ -171,6 +171,7 @@ extern const std::string PREF_XML_RPC_PASSWD;
|
||||||
extern const std::string PREF_XML_RPC_MAX_REQUEST_SIZE;
|
extern const std::string PREF_XML_RPC_MAX_REQUEST_SIZE;
|
||||||
// value: string
|
// value: string
|
||||||
extern const std::string PREF_ON_DOWNLOAD_START;
|
extern const std::string PREF_ON_DOWNLOAD_START;
|
||||||
|
extern const std::string PREF_ON_DOWNLOAD_PAUSE;
|
||||||
extern const std::string PREF_ON_DOWNLOAD_STOP;
|
extern const std::string PREF_ON_DOWNLOAD_STOP;
|
||||||
extern const std::string PREF_ON_DOWNLOAD_COMPLETE;
|
extern const std::string PREF_ON_DOWNLOAD_COMPLETE;
|
||||||
extern const std::string PREF_ON_DOWNLOAD_ERROR;
|
extern const std::string PREF_ON_DOWNLOAD_ERROR;
|
||||||
|
|
|
@ -547,6 +547,11 @@
|
||||||
_(" --on-download-start=COMMAND Set the command to be executed when download\n" \
|
_(" --on-download-start=COMMAND Set the command to be executed when download\n" \
|
||||||
" starts up. COMMAND must take just one argument and\n" \
|
" starts up. COMMAND must take just one argument and\n" \
|
||||||
" GID is passed to COMMAND as a first argument.")
|
" GID is passed to COMMAND as a first argument.")
|
||||||
|
#define TEXT_ON_DOWNLOAD_PAUSE \
|
||||||
|
_(" --on-download-pause=COMMAND Set the command to be executed when download\n" \
|
||||||
|
" is paused.\n"\
|
||||||
|
" See --on-download-start option for the\n" \
|
||||||
|
" requirement of COMMAND.")
|
||||||
#define TEXT_ON_DOWNLOAD_ERROR \
|
#define TEXT_ON_DOWNLOAD_ERROR \
|
||||||
_(" --on-download-error=COMMAND Set the command to be executed when download\n" \
|
_(" --on-download-error=COMMAND Set the command to be executed when download\n" \
|
||||||
" aborts due to error.\n" \
|
" aborts due to error.\n" \
|
||||||
|
|
Loading…
Reference in New Issue