diff options
Diffstat (limited to 'src/Server/RequestHandlers')
5 files changed, 11 insertions, 8 deletions
diff --git a/src/Server/RequestHandlers/CMakeLists.txt b/src/Server/RequestHandlers/CMakeLists.txt index 2c6305d..e340a1e 100644 --- a/src/Server/RequestHandlers/CMakeLists.txt +++ b/src/Server/RequestHandlers/CMakeLists.txt @@ -3,7 +3,7 @@ include_directories(${INCLUDES}) add_library(ServerRequestHandlers DaemonCommandRequestHandler.cpp DaemonFSInfoRequestHandler.cpp DaemonListRequestHandler.cpp DaemonStatusRequestHandler.cpp - GSSAPIAuthRequestHandler.cpp IdentifyRequestHandler.cpp + IdentifyRequestHandler.cpp LogRequestHandler.cpp UserInfoRequestHandler.cpp UserListRequestHandler.cpp ) diff --git a/src/Server/RequestHandlers/DaemonCommandRequestHandler.cpp b/src/Server/RequestHandlers/DaemonCommandRequestHandler.cpp index 17a7e5d..e4b511e 100644 --- a/src/Server/RequestHandlers/DaemonCommandRequestHandler.cpp +++ b/src/Server/RequestHandlers/DaemonCommandRequestHandler.cpp @@ -46,8 +46,8 @@ void DaemonCommandRequestHandler::handlePacket(const Common::XmlPacket &packet) std::string command = packet["command"]; try { - Common::Connection *daemonCon = ConnectionManager::get()->getDaemonConnection(packet["daemon"]); - Common::RequestManager::get()->sendRequest<Requests::CommandRequest>(daemonCon, + boost::shared_ptr<Common::Connection> daemonCon = ConnectionManager::get()->getDaemonConnection(packet["daemon"]); + Common::RequestManager::get()->sendRequest<Requests::CommandRequest>(daemonCon.get(), boost::bind(&DaemonCommandRequestHandler::requestFinished, this, _1), command == "reboot"); } catch(Net::Exception &e) { diff --git a/src/Server/RequestHandlers/DaemonFSInfoRequestHandler.cpp b/src/Server/RequestHandlers/DaemonFSInfoRequestHandler.cpp index df57a94..11a3f09 100644 --- a/src/Server/RequestHandlers/DaemonFSInfoRequestHandler.cpp +++ b/src/Server/RequestHandlers/DaemonFSInfoRequestHandler.cpp @@ -44,8 +44,8 @@ void DaemonFSInfoRequestHandler::handlePacket(const Common::XmlPacket &packet) { // TODO Require authentication try { - Common::Connection *daemonCon = ConnectionManager::get()->getDaemonConnection(packet["daemon"]); - Common::RequestManager::get()->sendRequest<Common::Requests::FSInfoRequest>(daemonCon, + boost::shared_ptr<Common::Connection> daemonCon = ConnectionManager::get()->getDaemonConnection(packet["daemon"]); + Common::RequestManager::get()->sendRequest<Common::Requests::FSInfoRequest>(daemonCon.get(), boost::bind(&DaemonFSInfoRequestHandler::requestFinished, this, _1)); } catch(Net::Exception &e) { diff --git a/src/Server/RequestHandlers/DaemonStatusRequestHandler.cpp b/src/Server/RequestHandlers/DaemonStatusRequestHandler.cpp index 3d99c57..c1e2fcd 100644 --- a/src/Server/RequestHandlers/DaemonStatusRequestHandler.cpp +++ b/src/Server/RequestHandlers/DaemonStatusRequestHandler.cpp @@ -46,8 +46,8 @@ void DaemonStatusRequestHandler::handlePacket(const Common::XmlPacket &packet) { std::string daemonName = packet["daemonName"]; try { - Common::Connection *daemonCon = ConnectionManager::get()->getDaemonConnection(daemonName); - Common::RequestManager::get()->sendRequest<Common::Requests::StatusRequest>(daemonCon, + boost::shared_ptr<Common::Connection> daemonCon = ConnectionManager::get()->getDaemonConnection(daemonName); + Common::RequestManager::get()->sendRequest<Common::Requests::StatusRequest>(daemonCon.get(), boost::bind(&DaemonStatusRequestHandler::requestFinished, this, _1)); } catch(Net::Exception &e) { diff --git a/src/Server/RequestHandlers/IdentifyRequestHandler.cpp b/src/Server/RequestHandlers/IdentifyRequestHandler.cpp index f69b3f5..b47b505 100644 --- a/src/Server/RequestHandlers/IdentifyRequestHandler.cpp +++ b/src/Server/RequestHandlers/IdentifyRequestHandler.cpp @@ -42,7 +42,10 @@ void IdentifyRequestHandler::handlePacket(const Common::XmlPacket &packet) { // TODO Require authentication try { - ConnectionManager::get()->identifyDaemonConnection(getConnection(), packet["hostname"]); + if(packet["hostname"].isEmpty()) + ConnectionManager::get()->identifyClientConnection(getConnection()); + else + ConnectionManager::get()->identifyDaemonConnection(getConnection(), packet["hostname"]); Common::XmlPacket ret; ret.setType("OK"); |