mirror of https://github.com/aria2/aria2
2009-05-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added purgeDownloadResult command. * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/XmlRpcMethodFactory.cc * src/XmlRpcMethodImpl.cc * src/XmlRpcMethodImpl.hpull/1/head
parent
e332ef3e1c
commit
692c4eaf3e
|
@ -1,3 +1,12 @@
|
||||||
|
2009-05-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Added purgeDownloadResult command.
|
||||||
|
* src/RequestGroupMan.cc
|
||||||
|
* src/RequestGroupMan.h
|
||||||
|
* src/XmlRpcMethodFactory.cc
|
||||||
|
* src/XmlRpcMethodImpl.cc
|
||||||
|
* src/XmlRpcMethodImpl.h
|
||||||
|
|
||||||
2009-05-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2009-05-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Refactored.
|
Refactored.
|
||||||
|
|
|
@ -696,6 +696,11 @@ RequestGroupMan::findDownloadResult(int32_t gid) const
|
||||||
return SharedHandle<DownloadResult>();
|
return SharedHandle<DownloadResult>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RequestGroupMan::purgeDownloadResult()
|
||||||
|
{
|
||||||
|
_downloadResults.clear();
|
||||||
|
}
|
||||||
|
|
||||||
SharedHandle<ServerStat>
|
SharedHandle<ServerStat>
|
||||||
RequestGroupMan::findServerStat(const std::string& hostname,
|
RequestGroupMan::findServerStat(const std::string& hostname,
|
||||||
const std::string& protocol) const
|
const std::string& protocol) const
|
||||||
|
|
|
@ -169,6 +169,9 @@ public:
|
||||||
|
|
||||||
SharedHandle<DownloadResult> findDownloadResult(int32_t gid) const;
|
SharedHandle<DownloadResult> findDownloadResult(int32_t gid) const;
|
||||||
|
|
||||||
|
// Removes all download results.
|
||||||
|
void purgeDownloadResult();
|
||||||
|
|
||||||
SharedHandle<ServerStat> findServerStat(const std::string& hostname,
|
SharedHandle<ServerStat> findServerStat(const std::string& hostname,
|
||||||
const std::string& protocol) const;
|
const std::string& protocol) const;
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,8 @@ XmlRpcMethodFactory::create(const std::string& methodName)
|
||||||
return SharedHandle<XmlRpcMethod>(new GetPeersXmlRpcMethod());
|
return SharedHandle<XmlRpcMethod>(new GetPeersXmlRpcMethod());
|
||||||
} else if(methodName == "aria2.tellActive") {
|
} else if(methodName == "aria2.tellActive") {
|
||||||
return SharedHandle<XmlRpcMethod>(new TellActiveXmlRpcMethod());
|
return SharedHandle<XmlRpcMethod>(new TellActiveXmlRpcMethod());
|
||||||
|
} else if(methodName == "aria2.purgeDownloadResult") {
|
||||||
|
return SharedHandle<XmlRpcMethod>(new PurgeDownloadResultXmlRpcMethod());
|
||||||
} else {
|
} else {
|
||||||
return SharedHandle<XmlRpcMethod>(new NoSuchMethodXmlRpcMethod());
|
return SharedHandle<XmlRpcMethod>(new NoSuchMethodXmlRpcMethod());
|
||||||
}
|
}
|
||||||
|
|
|
@ -452,6 +452,13 @@ BDE TellActiveXmlRpcMethod::process
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BDE PurgeDownloadResultXmlRpcMethod::process
|
||||||
|
(const XmlRpcRequest& req, DownloadEngine* e)
|
||||||
|
{
|
||||||
|
e->_requestGroupMan->purgeDownloadResult();
|
||||||
|
return BDE("OK");
|
||||||
|
}
|
||||||
|
|
||||||
BDE NoSuchMethodXmlRpcMethod::process
|
BDE NoSuchMethodXmlRpcMethod::process
|
||||||
(const XmlRpcRequest& req, DownloadEngine* e)
|
(const XmlRpcRequest& req, DownloadEngine* e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -61,6 +61,11 @@ protected:
|
||||||
virtual BDE process(const XmlRpcRequest& req, DownloadEngine* e);
|
virtual BDE process(const XmlRpcRequest& req, DownloadEngine* e);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class PurgeDownloadResultXmlRpcMethod:public XmlRpcMethod {
|
||||||
|
protected:
|
||||||
|
virtual BDE process(const XmlRpcRequest& req, DownloadEngine* e);
|
||||||
|
};
|
||||||
|
|
||||||
class GetUrisXmlRpcMethod:public XmlRpcMethod {
|
class GetUrisXmlRpcMethod:public XmlRpcMethod {
|
||||||
protected:
|
protected:
|
||||||
virtual BDE process(const XmlRpcRequest& req, DownloadEngine* e);
|
virtual BDE process(const XmlRpcRequest& req, DownloadEngine* e);
|
||||||
|
|
Loading…
Reference in New Issue