summaryrefslogtreecommitdiffstats
path: root/src/Server/RequestHandlers
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-05-06 17:39:30 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-05-06 17:39:30 +0200
commit8324b947487f72fd8cfc439ea5ae5bd1187fff1b (patch)
treee7fb69f3207654b5e3d4ba260d3f51082b1d399a /src/Server/RequestHandlers
parent5bf3e2229015d93808bb0c2f4729c2c4f4da414e (diff)
downloadmad-8324b947487f72fd8cfc439ea5ae5bd1187fff1b.tar
mad-8324b947487f72fd8cfc439ea5ae5bd1187fff1b.zip
Exception und ThreadHandler nach Net verschoben
Diffstat (limited to 'src/Server/RequestHandlers')
-rw-r--r--src/Server/RequestHandlers/DaemonCommandRequestHandler.cpp6
-rw-r--r--src/Server/RequestHandlers/DaemonFSInfoRequestHandler.cpp6
-rw-r--r--src/Server/RequestHandlers/DaemonListRequestHandler.cpp2
-rw-r--r--src/Server/RequestHandlers/DaemonStatusRequestHandler.cpp6
-rw-r--r--src/Server/RequestHandlers/GSSAPIAuthRequestHandler.cpp15
-rw-r--r--src/Server/RequestHandlers/IdentifyRequestHandler.cpp4
-rw-r--r--src/Server/RequestHandlers/LogRequestHandler.cpp4
-rw-r--r--src/Server/RequestHandlers/UserInfoRequestHandler.cpp6
-rw-r--r--src/Server/RequestHandlers/UserListRequestHandler.cpp6
9 files changed, 24 insertions, 31 deletions
diff --git a/src/Server/RequestHandlers/DaemonCommandRequestHandler.cpp b/src/Server/RequestHandlers/DaemonCommandRequestHandler.cpp
index 7c1efb9..314aa97 100644
--- a/src/Server/RequestHandlers/DaemonCommandRequestHandler.cpp
+++ b/src/Server/RequestHandlers/DaemonCommandRequestHandler.cpp
@@ -33,7 +33,7 @@ void DaemonCommandRequestHandler::handlePacket(const Common::XmlPacket &packet)
Common::XmlPacket ret;
ret.setType("Error");
- ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET);
+ ret.add("ErrorCode", Net::Exception::UNEXPECTED_PACKET);
sendPacket(ret);
@@ -50,7 +50,7 @@ void DaemonCommandRequestHandler::handlePacket(const Common::XmlPacket &packet)
Common::RequestManager::get()->sendRequest<Requests::CommandRequest>(daemonCon,
sigc::mem_fun(this, &DaemonCommandRequestHandler::requestFinished), command == "reboot");
}
- catch(Common::Exception &e) {
+ catch(Net::Exception &e) {
Common::XmlPacket ret;
ret.setType("Error");
ret.add("ErrorCode", e.getErrorCode());
@@ -66,7 +66,7 @@ void DaemonCommandRequestHandler::requestFinished(const Common::Request &request
try {
sendPacket(request.getResult());
}
- catch(Common::Exception &e) {
+ catch(Net::Exception &e) {
Common::XmlPacket ret;
ret.setType("Error");
ret.add("ErrorCode", e.getErrorCode());
diff --git a/src/Server/RequestHandlers/DaemonFSInfoRequestHandler.cpp b/src/Server/RequestHandlers/DaemonFSInfoRequestHandler.cpp
index 9ccca40..eadc0d5 100644
--- a/src/Server/RequestHandlers/DaemonFSInfoRequestHandler.cpp
+++ b/src/Server/RequestHandlers/DaemonFSInfoRequestHandler.cpp
@@ -33,7 +33,7 @@ void DaemonFSInfoRequestHandler::handlePacket(const Common::XmlPacket &packet) {
Common::XmlPacket ret;
ret.setType("Error");
- ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET);
+ ret.add("ErrorCode", Net::Exception::UNEXPECTED_PACKET);
sendPacket(ret);
@@ -48,7 +48,7 @@ void DaemonFSInfoRequestHandler::handlePacket(const Common::XmlPacket &packet) {
Common::RequestManager::get()->sendRequest<Common::Requests::FSInfoRequest>(daemonCon,
sigc::mem_fun(this, &DaemonFSInfoRequestHandler::requestFinished));
}
- catch(Common::Exception &e) {
+ catch(Net::Exception &e) {
Common::XmlPacket ret;
ret.setType("Error");
ret.add("ErrorCode", e.getErrorCode());
@@ -64,7 +64,7 @@ void DaemonFSInfoRequestHandler::requestFinished(const Common::Request &request)
try {
sendPacket(request.getResult());
}
- catch(Common::Exception &e) {
+ catch(Net::Exception &e) {
Common::XmlPacket ret;
ret.setType("Error");
ret.add("ErrorCode", e.getErrorCode());
diff --git a/src/Server/RequestHandlers/DaemonListRequestHandler.cpp b/src/Server/RequestHandlers/DaemonListRequestHandler.cpp
index c4b4143..2b21a29 100644
--- a/src/Server/RequestHandlers/DaemonListRequestHandler.cpp
+++ b/src/Server/RequestHandlers/DaemonListRequestHandler.cpp
@@ -31,7 +31,7 @@ void DaemonListRequestHandler::handlePacket(const Common::XmlPacket &packet) {
Common::XmlPacket ret;
ret.setType("Error");
- ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET);
+ ret.add("ErrorCode", Net::Exception::UNEXPECTED_PACKET);
sendPacket(ret);
diff --git a/src/Server/RequestHandlers/DaemonStatusRequestHandler.cpp b/src/Server/RequestHandlers/DaemonStatusRequestHandler.cpp
index 07e0c4c..9e21127 100644
--- a/src/Server/RequestHandlers/DaemonStatusRequestHandler.cpp
+++ b/src/Server/RequestHandlers/DaemonStatusRequestHandler.cpp
@@ -33,7 +33,7 @@ void DaemonStatusRequestHandler::handlePacket(const Common::XmlPacket &packet) {
Common::XmlPacket ret;
ret.setType("Error");
- ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET);
+ ret.add("ErrorCode", Net::Exception::UNEXPECTED_PACKET);
sendPacket(ret);
@@ -50,7 +50,7 @@ void DaemonStatusRequestHandler::handlePacket(const Common::XmlPacket &packet) {
Common::RequestManager::get()->sendRequest<Common::Requests::StatusRequest>(daemonCon,
sigc::mem_fun(this, &DaemonStatusRequestHandler::requestFinished));
}
- catch(Common::Exception &e) {
+ catch(Net::Exception &e) {
Common::XmlPacket ret;
ret.setType("Error");
ret.add("ErrorCode", e.getErrorCode());
@@ -66,7 +66,7 @@ void DaemonStatusRequestHandler::requestFinished(const Common::Request &request)
try {
sendPacket(request.getResult());
}
- catch(Common::Exception &e) {
+ catch(Net::Exception &e) {
Common::XmlPacket ret;
ret.setType("Error");
ret.add("ErrorCode", e.getErrorCode());
diff --git a/src/Server/RequestHandlers/GSSAPIAuthRequestHandler.cpp b/src/Server/RequestHandlers/GSSAPIAuthRequestHandler.cpp
index c665843..5272d7a 100644
--- a/src/Server/RequestHandlers/GSSAPIAuthRequestHandler.cpp
+++ b/src/Server/RequestHandlers/GSSAPIAuthRequestHandler.cpp
@@ -18,9 +18,8 @@
*/
#include "GSSAPIAuthRequestHandler.h"
-#include <Common/Exception.h>
#include <Common/Logger.h>
-#include <Net/Connection.h>
+#include <Net/Exception.h>
#include <cstring>
@@ -36,7 +35,7 @@ void GSSAPIAuthRequestHandler::handlePacket(const Common::XmlPacket &packet) {
Common::XmlPacket ret;
ret.setType("Error");
- ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET);
+ ret.add("ErrorCode", Net::Exception::UNEXPECTED_PACKET);
sendPacket(ret);
@@ -73,10 +72,7 @@ void GSSAPIAuthRequestHandler::handlePacket(const Common::XmlPacket &packet) {
ret.setType("AuthGSSAPI");
ret.addBinary("authToken", sendBuffer.value, sendBuffer.length);
- if(!sendPacket(ret)) {
- gss_release_buffer(&minStat, &sendBuffer);
- return;
- }
+ sendPacket(ret);
gss_release_buffer(&minStat, &sendBuffer);
}
@@ -102,10 +98,7 @@ void GSSAPIAuthRequestHandler::handlePacket(const Common::XmlPacket &packet) {
ret.setType("AuthGSSAPI");
ret.addBinary("certMic", sendBuffer.value, sendBuffer.length);
- if(!sendPacket(ret)) {
- gss_release_buffer(&minStat, &sendBuffer);
- return;
- }
+ sendPacket(ret);
gss_release_buffer(&minStat, &sendBuffer);
diff --git a/src/Server/RequestHandlers/IdentifyRequestHandler.cpp b/src/Server/RequestHandlers/IdentifyRequestHandler.cpp
index 9db9411..ac8bb42 100644
--- a/src/Server/RequestHandlers/IdentifyRequestHandler.cpp
+++ b/src/Server/RequestHandlers/IdentifyRequestHandler.cpp
@@ -32,7 +32,7 @@ void IdentifyRequestHandler::handlePacket(const Common::XmlPacket &packet) {
Common::XmlPacket ret;
ret.setType("Error");
- ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET);
+ ret.add("ErrorCode", Net::Exception::UNEXPECTED_PACKET);
sendPacket(ret);
@@ -48,7 +48,7 @@ void IdentifyRequestHandler::handlePacket(const Common::XmlPacket &packet) {
ret.setType("OK");
sendPacket(ret);
}
- catch(Common::Exception &e) {
+ catch(Net::Exception &e) {
Common::XmlPacket ret;
ret.setType("Error");
ret.add("ErrorCode", e.getErrorCode());
diff --git a/src/Server/RequestHandlers/LogRequestHandler.cpp b/src/Server/RequestHandlers/LogRequestHandler.cpp
index ae64921..557a97c 100644
--- a/src/Server/RequestHandlers/LogRequestHandler.cpp
+++ b/src/Server/RequestHandlers/LogRequestHandler.cpp
@@ -32,7 +32,7 @@ void LogRequestHandler::handlePacket(const Common::XmlPacket &packet) {
Common::XmlPacket ret;
ret.setType("Error");
- ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET);
+ ret.add("ErrorCode", Net::Exception::UNEXPECTED_PACKET);
sendPacket(ret);
@@ -46,7 +46,7 @@ void LogRequestHandler::handlePacket(const Common::XmlPacket &packet) {
Common::LogManager::get()->log(packet["category"], packet["level"], packet["timestamp"], packet["message"],
ConnectionManager::get()->getDaemonName(getConnection()));
}
- catch(Common::Exception &e) {
+ catch(Net::Exception &e) {
Common::Logger::logf(Common::Logger::ERROR, "Can't determine daemon name: %s", e.strerror().c_str());
}
diff --git a/src/Server/RequestHandlers/UserInfoRequestHandler.cpp b/src/Server/RequestHandlers/UserInfoRequestHandler.cpp
index 16003a2..39fa63e 100644
--- a/src/Server/RequestHandlers/UserInfoRequestHandler.cpp
+++ b/src/Server/RequestHandlers/UserInfoRequestHandler.cpp
@@ -19,7 +19,7 @@
#include "UserInfoRequestHandler.h"
#include "../UserManager.h"
-#include <Common/Exception.h>
+#include <Net/Exception.h>
#include <Common/Logger.h>
namespace Mad {
@@ -32,7 +32,7 @@ void UserInfoRequestHandler::handlePacket(const Common::XmlPacket &packet) {
Common::XmlPacket ret;
ret.setType("Error");
- ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET);
+ ret.add("ErrorCode", Net::Exception::UNEXPECTED_PACKET);
sendPacket(ret);
@@ -45,7 +45,7 @@ void UserInfoRequestHandler::handlePacket(const Common::XmlPacket &packet) {
if(!UserManager::get()->getUserInfo(packet["uid"], sigc::mem_fun(this, &UserInfoRequestHandler::userInfoHandler))) {
Common::XmlPacket ret;
ret.setType("Error");
- ret.add("ErrorCode", Common::Exception::NOT_IMPLEMENTED);
+ ret.add("ErrorCode", Net::Exception::NOT_IMPLEMENTED);
sendPacket(ret);
signalFinished().emit();
diff --git a/src/Server/RequestHandlers/UserListRequestHandler.cpp b/src/Server/RequestHandlers/UserListRequestHandler.cpp
index 696b1d4..66f67bd 100644
--- a/src/Server/RequestHandlers/UserListRequestHandler.cpp
+++ b/src/Server/RequestHandlers/UserListRequestHandler.cpp
@@ -19,7 +19,7 @@
#include "UserListRequestHandler.h"
#include "../UserManager.h"
-#include <Common/Exception.h>
+#include <Net/Exception.h>
#include <Common/Logger.h>
namespace Mad {
@@ -32,7 +32,7 @@ void UserListRequestHandler::handlePacket(const Common::XmlPacket &packet) {
Common::XmlPacket ret;
ret.setType("Error");
- ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET);
+ ret.add("ErrorCode", Net::Exception::UNEXPECTED_PACKET);
sendPacket(ret);
@@ -45,7 +45,7 @@ void UserListRequestHandler::handlePacket(const Common::XmlPacket &packet) {
if(!UserManager::get()->getUserList(sigc::mem_fun(this, &UserListRequestHandler::userListHandler))) {
Common::XmlPacket ret;
ret.setType("Error");
- ret.add("ErrorCode", Common::Exception::NOT_IMPLEMENTED);
+ ret.add("ErrorCode", Net::Exception::NOT_IMPLEMENTED);
sendPacket(ret);
signalFinished().emit();