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
pull/1/head
Tatsuhiro Tsujikawa 2009-05-14 13:48:26 +00:00
parent e332ef3e1c
commit 692c4eaf3e
6 changed files with 31 additions and 0 deletions

View File

@ -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>
Refactored.

View File

@ -696,6 +696,11 @@ RequestGroupMan::findDownloadResult(int32_t gid) const
return SharedHandle<DownloadResult>();
}
void RequestGroupMan::purgeDownloadResult()
{
_downloadResults.clear();
}
SharedHandle<ServerStat>
RequestGroupMan::findServerStat(const std::string& hostname,
const std::string& protocol) const

View File

@ -169,6 +169,9 @@ public:
SharedHandle<DownloadResult> findDownloadResult(int32_t gid) const;
// Removes all download results.
void purgeDownloadResult();
SharedHandle<ServerStat> findServerStat(const std::string& hostname,
const std::string& protocol) const;

View File

@ -62,6 +62,8 @@ XmlRpcMethodFactory::create(const std::string& methodName)
return SharedHandle<XmlRpcMethod>(new GetPeersXmlRpcMethod());
} else if(methodName == "aria2.tellActive") {
return SharedHandle<XmlRpcMethod>(new TellActiveXmlRpcMethod());
} else if(methodName == "aria2.purgeDownloadResult") {
return SharedHandle<XmlRpcMethod>(new PurgeDownloadResultXmlRpcMethod());
} else {
return SharedHandle<XmlRpcMethod>(new NoSuchMethodXmlRpcMethod());
}

View File

@ -452,6 +452,13 @@ BDE TellActiveXmlRpcMethod::process
return list;
}
BDE PurgeDownloadResultXmlRpcMethod::process
(const XmlRpcRequest& req, DownloadEngine* e)
{
e->_requestGroupMan->purgeDownloadResult();
return BDE("OK");
}
BDE NoSuchMethodXmlRpcMethod::process
(const XmlRpcRequest& req, DownloadEngine* e)
{

View File

@ -61,6 +61,11 @@ protected:
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 {
protected:
virtual BDE process(const XmlRpcRequest& req, DownloadEngine* e);