mirror of
https://github.com/aria2/aria2.git
synced 2025-04-07 06:27:37 +03:00
2009-07-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Implemented getVersion xml-rpc method. This method returns struct which has 2 key-value pairs: "version" key is associated to the version of aria2, such as "1.5.0". "enabledFeatures" key is associated to the list of enabled features, such as "Async DNS", "BitTorrent". * src/FeatureConfig.h * src/XmlRpcMethodFactory.cc * src/XmlRpcMethodImpl.cc * src/XmlRpcMethodImpl.h * test/XmlRpcMethodTest.cc
This commit is contained in:
parent
53d2a64cc5
commit
d6a8fa5b10
6 changed files with 64 additions and 0 deletions
|
@ -57,6 +57,7 @@
|
|||
#include "BtProgressInfoFile.h"
|
||||
#include "prefs.h"
|
||||
#include "message.h"
|
||||
#include "FeatureConfig.h"
|
||||
#ifdef ENABLE_BITTORRENT
|
||||
# include "bittorrent_helper.h"
|
||||
# include "BtRegistry.h"
|
||||
|
@ -627,6 +628,22 @@ BDE ChangeGlobalOptionXmlRpcMethod::process
|
|||
return BDE_OK;
|
||||
}
|
||||
|
||||
BDE GetVersionXmlRpcMethod::process
|
||||
(const XmlRpcRequest& req, DownloadEngine* e)
|
||||
{
|
||||
BDE result = BDE::dict();
|
||||
result["version"] = std::string(PACKAGE_VERSION);
|
||||
BDE featureList = BDE::list();
|
||||
const FeatureMap& features = FeatureConfig::getInstance()->getFeatures();
|
||||
for(FeatureMap::const_iterator i = features.begin(); i != features.end();++i){
|
||||
if((*i).second) {
|
||||
featureList << (*i).first;
|
||||
}
|
||||
}
|
||||
result["enabledFeatures"] = featureList;
|
||||
return result;
|
||||
}
|
||||
|
||||
BDE NoSuchMethodXmlRpcMethod::process
|
||||
(const XmlRpcRequest& req, DownloadEngine* e)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue