diff --git a/ChangeLog b/ChangeLog index ddd7098b..438a506a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-20 Tatsuhiro Tsujikawa + + Added _xmlRpc member variable to RequestGroupMan to reduce the + number of call Option::getAsBool(PREF_ENABLE_XML_RPC) + * src/RequestGroupMan.cc + * src/RequestGroupMan.h + 2009-06-20 Tatsuhiro Tsujikawa Call setStatus(STATUS_ONESHOT_REALTIME) from constructor. Call diff --git a/src/RequestGroupMan.cc b/src/RequestGroupMan.cc index 86a4d774..00f98a47 100644 --- a/src/RequestGroupMan.cc +++ b/src/RequestGroupMan.cc @@ -80,13 +80,14 @@ RequestGroupMan::RequestGroupMan(const RequestGroups& requestGroups, _serverStatMan(new ServerStatMan()), _maxOverallDownloadSpeedLimit (option->getAsInt(PREF_MAX_OVERALL_DOWNLOAD_LIMIT)), - _maxOverallUploadSpeedLimit(option->getAsInt(PREF_MAX_OVERALL_UPLOAD_LIMIT)) + _maxOverallUploadSpeedLimit(option->getAsInt(PREF_MAX_OVERALL_UPLOAD_LIMIT)), + _xmlRpc(option->getAsBool(PREF_ENABLE_XML_RPC)) {} bool RequestGroupMan::downloadFinished() { #ifdef ENABLE_XML_RPC - if(_option->getAsBool(PREF_ENABLE_XML_RPC)) { + if(_xmlRpc) { return false; } #endif // ENABLE_XML_RPC diff --git a/src/RequestGroupMan.h b/src/RequestGroupMan.h index 130bd249..58032cd6 100644 --- a/src/RequestGroupMan.h +++ b/src/RequestGroupMan.h @@ -73,6 +73,9 @@ private: unsigned int _maxOverallUploadSpeedLimit; + // truf if XML-RPC is enabled. + bool _xmlRpc; + std::string formatDownloadResult(const std::string& status, const SharedHandle& downloadResult) const;