From 0b27c37fe95c6aced613d51a3624f8930a96ad3f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 4 Jun 2009 22:23:07 +0200 Subject: RequestHandler-Interface ?berarbeitet --- src/Daemon/RequestHandlers/CommandRequestHandler.cpp | 6 +++--- src/Daemon/RequestHandlers/CommandRequestHandler.h | 6 +----- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src/Daemon/RequestHandlers') diff --git a/src/Daemon/RequestHandlers/CommandRequestHandler.cpp b/src/Daemon/RequestHandlers/CommandRequestHandler.cpp index 95e57f1..208d6e0 100644 --- a/src/Daemon/RequestHandlers/CommandRequestHandler.cpp +++ b/src/Daemon/RequestHandlers/CommandRequestHandler.cpp @@ -26,8 +26,8 @@ namespace Mad { namespace Daemon { namespace RequestHandlers { -void CommandRequestHandler::handlePacket(const Common::XmlPacket &packet) { - if(packet.getType() != "Command") { +void CommandRequestHandler::handlePacket(boost::shared_ptr packet) { + if(packet->getType() != "Command") { Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet."); Common::XmlPacket ret; @@ -43,7 +43,7 @@ void CommandRequestHandler::handlePacket(const Common::XmlPacket &packet) { // TODO Require authentication // TODO Error handling - std::string command = packet["command"]; + std::string command = (*packet)["command"]; Common::XmlPacket ret; diff --git a/src/Daemon/RequestHandlers/CommandRequestHandler.h b/src/Daemon/RequestHandlers/CommandRequestHandler.h index a033c75..be560f7 100644 --- a/src/Daemon/RequestHandlers/CommandRequestHandler.h +++ b/src/Daemon/RequestHandlers/CommandRequestHandler.h @@ -28,11 +28,7 @@ namespace RequestHandlers { class CommandRequestHandler : public Common::RequestHandler { protected: - virtual void handlePacket(const Common::XmlPacket &packet); - - public: - CommandRequestHandler(Common::Connection *connection, boost::uint16_t requestId) - : RequestHandler(connection, requestId) {} + virtual void handlePacket(boost::shared_ptr packet); }; } -- cgit v1.2.3