mirror of https://github.com/aria2/aria2
2010-03-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added 'status' key to the response of getUri XML-RPC method. * doc/aria2c.1.txt * src/XmlRpcMethodImpl.ccpull/1/head
parent
e3b5d60893
commit
7923125382
|
@ -1,3 +1,9 @@
|
||||||
|
2010-03-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Added 'status' key to the response of getUri XML-RPC method.
|
||||||
|
* doc/aria2c.1.txt
|
||||||
|
* src/XmlRpcMethodImpl.cc
|
||||||
|
|
||||||
2010-03-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2010-03-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Replaced Time::reset() call with assigning of global::wallclock.
|
Replaced Time::reset() call with assigning of global::wallclock.
|
||||||
|
|
13
doc/aria2c.1
13
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: 03/06/2010
|
.\" Date: 03/07/2010
|
||||||
.\" Manual: Aria2 Manual
|
.\" Manual: Aria2 Manual
|
||||||
.\" Source: Aria2 1.9.0a
|
.\" Source: Aria2 1.9.0a
|
||||||
.\" Language: English
|
.\" Language: English
|
||||||
.\"
|
.\"
|
||||||
.TH "ARIA2C" "1" "03/06/2010" "Aria2 1\&.9\&.0a" "Aria2 Manual"
|
.TH "ARIA2C" "1" "03/07/2010" "Aria2 1\&.9\&.0a" "Aria2 Manual"
|
||||||
.\" -----------------------------------------------------------------
|
.\" -----------------------------------------------------------------
|
||||||
.\" * Define some portability stuff
|
.\" * Define some portability stuff
|
||||||
.\" -----------------------------------------------------------------
|
.\" -----------------------------------------------------------------
|
||||||
|
@ -2352,6 +2352,15 @@ uri
|
||||||
.RS 4
|
.RS 4
|
||||||
URI
|
URI
|
||||||
.RE
|
.RE
|
||||||
|
.PP
|
||||||
|
status
|
||||||
|
.RS 4
|
||||||
|
|
||||||
|
\fIused\fR
|
||||||
|
if the URI is already used\&.
|
||||||
|
\fIwaiting\fR
|
||||||
|
if the URI is waiting in the queue\&.
|
||||||
|
.RE
|
||||||
.sp
|
.sp
|
||||||
\fBaria2\&.getFiles\fR \fIgid\fR
|
\fBaria2\&.getFiles\fR \fIgid\fR
|
||||||
.sp
|
.sp
|
||||||
|
|
|
@ -2999,6 +2999,15 @@ uri
|
||||||
URI
|
URI
|
||||||
</p>
|
</p>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="hdlist1">
|
||||||
|
status
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
<p>
|
||||||
|
<em>used</em> if the URI is already used. <em>waiting</em> if the URI is waiting
|
||||||
|
in the queue.
|
||||||
|
</p>
|
||||||
|
</dd>
|
||||||
</dl></div>
|
</dl></div>
|
||||||
<div class="paragraph"><p><strong>aria2.getFiles</strong> <em>gid</em></p></div>
|
<div class="paragraph"><p><strong>aria2.getFiles</strong> <em>gid</em></p></div>
|
||||||
<div class="paragraph"><p>This method returns file list of the download denoted by <em>gid</em>. <em>gid</em>
|
<div class="paragraph"><p>This method returns file list of the download denoted by <em>gid</em>. <em>gid</em>
|
||||||
|
@ -3740,7 +3749,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-06 23:18:27 JST
|
Last updated 2010-03-07 00:00:09 JST
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -1330,6 +1330,11 @@ uri::
|
||||||
|
|
||||||
URI
|
URI
|
||||||
|
|
||||||
|
status::
|
||||||
|
|
||||||
|
'used' if the URI is already used. 'waiting' if the URI is waiting
|
||||||
|
in the queue.
|
||||||
|
|
||||||
*aria2.getFiles* 'gid'
|
*aria2.getFiles* 'gid'
|
||||||
|
|
||||||
This method returns file list of the download denoted by 'gid'. 'gid'
|
This method returns file list of the download denoted by 'gid'. 'gid'
|
||||||
|
|
|
@ -83,6 +83,7 @@ const BDE BDE_WAITING = BDE("waiting");
|
||||||
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");
|
||||||
|
const BDE BDE_USED = BDE("used");
|
||||||
|
|
||||||
const std::string KEY_GID = "gid";
|
const std::string KEY_GID = "gid";
|
||||||
const std::string KEY_ERROR_CODE = "errorCode";
|
const std::string KEY_ERROR_CODE = "errorCode";
|
||||||
|
@ -311,6 +312,30 @@ BDE RemoveXmlRpcMethod::process(const XmlRpcRequest& req, DownloadEngine* e)
|
||||||
return createGIDResponse(gid);
|
return createGIDResponse(gid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void createUriEntry(BDE& uriList, const SharedHandle<FileEntry>& file)
|
||||||
|
{
|
||||||
|
{
|
||||||
|
const std::deque<std::string>& uris = file->getSpentUris();
|
||||||
|
for(std::deque<std::string>::const_iterator i = uris.begin(),
|
||||||
|
eoi = uris.end(); i != eoi; ++i) {
|
||||||
|
BDE entry = BDE::dict();
|
||||||
|
entry[KEY_URI] = *i;
|
||||||
|
entry[KEY_STATUS] = BDE_USED;
|
||||||
|
uriList << entry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
const std::deque<std::string>& uris = file->getRemainingUris();
|
||||||
|
for(std::deque<std::string>::const_iterator i = uris.begin(),
|
||||||
|
eoi = uris.end(); i != eoi; ++i) {
|
||||||
|
BDE entry = BDE::dict();
|
||||||
|
entry[KEY_URI] = *i;
|
||||||
|
entry[KEY_STATUS] = BDE_WAITING;
|
||||||
|
uriList << entry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template<typename InputIterator>
|
template<typename InputIterator>
|
||||||
static void createFileEntry(BDE& files, InputIterator first, InputIterator last)
|
static void createFileEntry(BDE& files, InputIterator first, InputIterator last)
|
||||||
{
|
{
|
||||||
|
@ -323,14 +348,7 @@ static void createFileEntry(BDE& files, InputIterator first, InputIterator last)
|
||||||
entry[KEY_LENGTH] = util::uitos((*first)->getLength());
|
entry[KEY_LENGTH] = util::uitos((*first)->getLength());
|
||||||
|
|
||||||
BDE uriList = BDE::list();
|
BDE uriList = BDE::list();
|
||||||
std::vector<std::string> uris;
|
createUriEntry(uriList, *first);
|
||||||
(*first)->getUris(uris);
|
|
||||||
for(std::vector<std::string>::const_iterator i = uris.begin(),
|
|
||||||
eoi = uris.end(); i != eoi; ++i) {
|
|
||||||
BDE uriEntry = BDE::dict();
|
|
||||||
uriEntry[KEY_URI] = *i;
|
|
||||||
uriList << uriEntry;
|
|
||||||
}
|
|
||||||
entry[KEY_URIS] = uriList;
|
entry[KEY_URIS] = uriList;
|
||||||
files << entry;
|
files << entry;
|
||||||
}
|
}
|
||||||
|
@ -559,14 +577,7 @@ BDE GetUrisXmlRpcMethod::process
|
||||||
BDE uriList = BDE::list();
|
BDE uriList = BDE::list();
|
||||||
// TODO Current implementation just returns first FileEntry's URIs.
|
// TODO Current implementation just returns first FileEntry's URIs.
|
||||||
if(!group->getDownloadContext()->getFileEntries().empty()) {
|
if(!group->getDownloadContext()->getFileEntries().empty()) {
|
||||||
std::vector<std::string> uris;
|
createUriEntry(uriList, group->getDownloadContext()->getFirstFileEntry());
|
||||||
group->getDownloadContext()->getFirstFileEntry()->getUris(uris);
|
|
||||||
for(std::vector<std::string>::const_iterator i = uris.begin(),
|
|
||||||
eoi = uris.end(); i != eoi; ++i) {
|
|
||||||
BDE entry = BDE::dict();
|
|
||||||
entry[KEY_URI] = *i;
|
|
||||||
uriList << entry;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return uriList;
|
return uriList;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue