mirror of https://github.com/aria2/aria2
2009-05-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added tellAll command. * src/XmlRpcMethodFactory.cc * src/XmlRpcMethodImpl.cc * src/XmlRpcMethodImpl.hpull/1/head
parent
1312c535be
commit
ddb5d4a8cb
|
@ -1,3 +1,10 @@
|
|||
2009-05-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Added tellAll command.
|
||||
* src/XmlRpcMethodFactory.cc
|
||||
* src/XmlRpcMethodImpl.cc
|
||||
* src/XmlRpcMethodImpl.h
|
||||
|
||||
2009-05-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Use gatherProgress() in TellActiveXmlRpcMethod::process().
|
||||
|
|
|
@ -54,6 +54,8 @@ XmlRpcMethodFactory::create(const std::string& methodName)
|
|||
return SharedHandle<XmlRpcMethod>(new RemoveXmlRpcMethod());
|
||||
} else if(methodName == "aria2.tellStatus") {
|
||||
return SharedHandle<XmlRpcMethod>(new TellStatusXmlRpcMethod());
|
||||
} else if(methodName == "aria2.tellAll") {
|
||||
return SharedHandle<XmlRpcMethod>(new TellAllXmlRpcMethod());
|
||||
} else if(methodName == "aria2.getUris") {
|
||||
return SharedHandle<XmlRpcMethod>(new GetUrisXmlRpcMethod());
|
||||
} else if(methodName == "aria2.getFiles") {
|
||||
|
|
|
@ -447,6 +447,39 @@ BDE TellActiveXmlRpcMethod::process
|
|||
return list;
|
||||
}
|
||||
|
||||
BDE TellAllXmlRpcMethod::process
|
||||
(const XmlRpcRequest& req, DownloadEngine* e)
|
||||
{
|
||||
BDE list = BDE::list();
|
||||
const std::deque<SharedHandle<RequestGroup> >& groups =
|
||||
e->_requestGroupMan->getRequestGroups();
|
||||
for(std::deque<SharedHandle<RequestGroup> >::const_iterator i =
|
||||
groups.begin(); i != groups.end(); ++i) {
|
||||
BDE entryDict = BDE::dict();
|
||||
entryDict["status"] = BDE("active");
|
||||
gatherProgress(entryDict, *i, e);
|
||||
list << entryDict;
|
||||
}
|
||||
const std::deque<SharedHandle<RequestGroup> >& waiting =
|
||||
e->_requestGroupMan->getReservedGroups();
|
||||
for(std::deque<SharedHandle<RequestGroup> >::const_iterator i =
|
||||
waiting.begin(); i != waiting.end(); ++i) {
|
||||
BDE entryDict = BDE::dict();
|
||||
entryDict["status"] = BDE("waiting");
|
||||
gatherProgress(entryDict, *i, e);
|
||||
list << entryDict;
|
||||
}
|
||||
const std::deque<SharedHandle<DownloadResult> >& stopped =
|
||||
e->_requestGroupMan->getDownloadResults();
|
||||
for(std::deque<SharedHandle<DownloadResult> >::const_iterator i =
|
||||
stopped.begin(); i != stopped.end(); ++i) {
|
||||
BDE entryDict = BDE::dict();
|
||||
gatherStoppedDownload(entryDict, *i);
|
||||
list << entryDict;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
BDE PurgeDownloadResultXmlRpcMethod::process
|
||||
(const XmlRpcRequest& req, DownloadEngine* e)
|
||||
{
|
||||
|
|
|
@ -91,6 +91,11 @@ protected:
|
|||
virtual BDE process(const XmlRpcRequest& req, DownloadEngine* e);
|
||||
};
|
||||
|
||||
class TellAllXmlRpcMethod:public XmlRpcMethod {
|
||||
protected:
|
||||
virtual BDE process(const XmlRpcRequest& req, DownloadEngine* e);
|
||||
};
|
||||
|
||||
class ChangeOptionXmlRpcMethod:public XmlRpcMethod {
|
||||
protected:
|
||||
virtual BDE process(const XmlRpcRequest& req, DownloadEngine* e);
|
||||
|
|
Loading…
Reference in New Issue