summaryrefslogtreecommitdiffstats
path: root/src/Server/RequestHandlers
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-05-20 01:08:16 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-05-20 01:08:16 +0200
commit776377bb21ee1cfe0bcdbc000f7c6fa0be227226 (patch)
treea60e8bdd92678dece5fbb96e75535eba2b61b7da /src/Server/RequestHandlers
parentbadc0da3b74d99c90b7b28180d08cd6d08830254 (diff)
downloadmad-776377bb21ee1cfe0bcdbc000f7c6fa0be227226.tar
mad-776377bb21ee1cfe0bcdbc000f7c6fa0be227226.zip
Netzwerk-Code auf boost::asio umgestellt
Diffstat (limited to 'src/Server/RequestHandlers')
-rw-r--r--src/Server/RequestHandlers/CMakeLists.txt2
-rw-r--r--src/Server/RequestHandlers/DaemonCommandRequestHandler.cpp4
-rw-r--r--src/Server/RequestHandlers/DaemonFSInfoRequestHandler.cpp4
-rw-r--r--src/Server/RequestHandlers/DaemonStatusRequestHandler.cpp4
-rw-r--r--src/Server/RequestHandlers/IdentifyRequestHandler.cpp5
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");