diff options
Diffstat (limited to 'src/Daemon/RequestHandlers')
-rw-r--r-- | src/Daemon/RequestHandlers/CommandRequestHandler.cpp | 4 | ||||
-rw-r--r-- | src/Daemon/RequestHandlers/CommandRequestHandler.h | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/Daemon/RequestHandlers/CommandRequestHandler.cpp b/src/Daemon/RequestHandlers/CommandRequestHandler.cpp index d00c415..ae11de5 100644 --- a/src/Daemon/RequestHandlers/CommandRequestHandler.cpp +++ b/src/Daemon/RequestHandlers/CommandRequestHandler.cpp @@ -31,9 +31,9 @@ void CommandRequestHandler::handleRequest(boost::shared_ptr<const Common::XmlPac std::string command = (*packet)["command"]; if(command == "reboot") - Common::SystemManager::get()->reboot(); + getApplication()->getSystemManager()->reboot(); else - Common::SystemManager::get()->shutdown(); + getApplication()->getSystemManager()->shutdown(); ret->setType("OK"); } diff --git a/src/Daemon/RequestHandlers/CommandRequestHandler.h b/src/Daemon/RequestHandlers/CommandRequestHandler.h index 22c7a4b..db7b3d4 100644 --- a/src/Daemon/RequestHandlers/CommandRequestHandler.h +++ b/src/Daemon/RequestHandlers/CommandRequestHandler.h @@ -28,10 +28,11 @@ namespace RequestHandlers { class CommandRequestHandler : public Common::RequestHandlers::SimpleRequestHandler { private: - static void handleRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret); + void handleRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret); public: - CommandRequestHandler() : Common::RequestHandlers::SimpleRequestHandler("Command", &CommandRequestHandler::handleRequest) {} + CommandRequestHandler(Common::Application *application) + : Common::RequestHandlers::SimpleRequestHandler(application, "Command", boost::bind(&CommandRequestHandler::handleRequest, this, _1, _2)) {} }; } |