2010-03-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Added aria2.forceRemove XML-RPC method.
	* doc/aria2c.1.txt
	* src/XmlRpcMethodFactory.cc
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h
This commit is contained in:
Tatsuhiro Tsujikawa 2010-03-07 06:04:15 +00:00
parent 7f593c3ff8
commit 41e203bf84
7 changed files with 57 additions and 3 deletions

View file

@ -280,7 +280,8 @@ BDE AddMetalinkXmlRpcMethod::process
}
#endif // ENABLE_METALINK
BDE RemoveXmlRpcMethod::process(const XmlRpcRequest& req, DownloadEngine* e)
static BDE removeDownload
(const XmlRpcRequest& req, DownloadEngine* e, bool forceRemove)
{
const BDE& params = req._params;
assert(params.isList());
@ -306,10 +307,26 @@ BDE RemoveXmlRpcMethod::process(const XmlRpcRequest& req, DownloadEngine* e)
(StringFormat("GID#%d cannot be removed now", gid).str());
}
} else {
group->setHaltRequested(true, RequestGroup::USER_REQUEST);
if(forceRemove) {
group->setForceHaltRequested(true, RequestGroup::USER_REQUEST);
} else {
group->setHaltRequested(true, RequestGroup::USER_REQUEST);
}
}
return createGIDResponse(gid);
}
BDE RemoveXmlRpcMethod::process(const XmlRpcRequest& req, DownloadEngine* e)
{
return removeDownload(req, e, false);
}
BDE ForceRemoveXmlRpcMethod::process
(const XmlRpcRequest& req, DownloadEngine* e)
{
return removeDownload(req, e, true);
}
static void createUriEntry(BDE& uriList, const SharedHandle<FileEntry>& file)