summaryrefslogtreecommitdiffstats
path: root/src/Common/RequestHandlers/FSInfoRequestHandler.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-03-16 19:13:42 +0100
committerMatthias Schiffer <matthias@gamezock.de>2009-03-16 19:13:42 +0100
commit8f098fc3070f791302ec1f497588fab6ed409980 (patch)
tree6cff9f7bb973342344a22636a5d9ef26c7a0d940 /src/Common/RequestHandlers/FSInfoRequestHandler.cpp
parentaef0f2e7a5085b8da3aa2e97565215d182d3dd2d (diff)
downloadmad-8f098fc3070f791302ec1f497588fab6ed409980.tar
mad-8f098fc3070f791302ec1f497588fab6ed409980.zip
Request- und RequestHandler-Interfaces vereinfacht
Diffstat (limited to 'src/Common/RequestHandlers/FSInfoRequestHandler.cpp')
-rw-r--r--src/Common/RequestHandlers/FSInfoRequestHandler.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/Common/RequestHandlers/FSInfoRequestHandler.cpp b/src/Common/RequestHandlers/FSInfoRequestHandler.cpp
index 878dd7c..aaa4d9e 100644
--- a/src/Common/RequestHandlers/FSInfoRequestHandler.cpp
+++ b/src/Common/RequestHandlers/FSInfoRequestHandler.cpp
@@ -20,14 +20,12 @@
#include "FSInfoRequestHandler.h"
#include "../Exception.h"
#include "../Logger.h"
-#include "../XmlPacket.h"
-#include <Net/Connection.h>
namespace Mad {
namespace Common {
namespace RequestHandlers {
-void FSInfoRequestHandler::handlePacket(Net::Connection *con, uint16_t rid, const XmlPacket &packet) {
+void FSInfoRequestHandler::handlePacket(const XmlPacket &packet) {
if(packet.getType() != "FSInfo") {
Logger::log(Logger::ERROR, "Received an unexpected packet.");
@@ -35,7 +33,7 @@ void FSInfoRequestHandler::handlePacket(Net::Connection *con, uint16_t rid, cons
ret.setType("Error");
ret.add("ErrorCode", Exception::UNEXPECTED_PACKET);
- connection->send(ret.encode(rid));
+ sendPacket(ret);
signalFinished().emit();
return;
@@ -43,15 +41,12 @@ void FSInfoRequestHandler::handlePacket(Net::Connection *con, uint16_t rid, cons
// TODO Require authentication
- connection = con;
- requestId = rid;
-
if(!SystemBackend::getFSInfo(sigc::mem_fun(this, &FSInfoRequestHandler::fsInfoHandler))) {
XmlPacket ret;
ret.setType("Error");
ret.add("ErrorCode", Exception::NOT_IMPLEMENTED);
- connection->send(ret.encode(requestId));
+ sendPacket(ret);
signalFinished().emit();
}
@@ -73,7 +68,7 @@ void FSInfoRequestHandler::fsInfoHandler(const std::vector<SystemBackend::FSInfo
entry.add("availableSize", fs->available);
}
- connection->send(ret.encode(requestId));
+ sendPacket(ret);
signalFinished().emit();
}