From 03e7a5b2fefa08d49ef34e70bfb1d52f0a7d828e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 12 Mar 2009 20:26:36 +0100 Subject: Request-Klassen vereinfacht --- src/Core/Requests/CommandRequest.cpp | 13 ------------- src/Core/Requests/CommandRequest.h | 1 - src/Core/Requests/DaemonStateUpdateRequest.cpp | 9 --------- src/Core/Requests/DaemonStateUpdateRequest.h | 1 - 4 files changed, 24 deletions(-) (limited to 'src/Core') diff --git a/src/Core/Requests/CommandRequest.cpp b/src/Core/Requests/CommandRequest.cpp index 8fdd4c2..a280bc5 100644 --- a/src/Core/Requests/CommandRequest.cpp +++ b/src/Core/Requests/CommandRequest.cpp @@ -32,19 +32,6 @@ void CommandRequest::sendRequest(Net::Connection *connection, uint16_t requestId connection->send(packet.encode(requestId)); } -void CommandRequest::handlePacket(Net::Connection*, uint16_t, const Common::XmlPacket &packet) { - if(packet.getType() == "Error") { - finishWithError(Common::Exception(packet["Where"], packet["ErrorCode"], packet["SubCode"], packet["SubSubCode"])); - return; - } - else if(packet.getType() != "OK") { - finishWithError(Common::Exception(Common::Exception::UNEXPECTED_PACKET)); - return; // TODO Logging - } - - finish(packet); -} - } } } diff --git a/src/Core/Requests/CommandRequest.h b/src/Core/Requests/CommandRequest.h index 9c6c70d..aece5ae 100644 --- a/src/Core/Requests/CommandRequest.h +++ b/src/Core/Requests/CommandRequest.h @@ -32,7 +32,6 @@ class CommandRequest : public Common::Request { protected: virtual void sendRequest(Net::Connection *connection, uint16_t requestId); - virtual void handlePacket(Net::Connection*, uint16_t, const Common::XmlPacket &packet); public: CommandRequest(bool reboot0, slot_type slot) : Common::Request(slot), reboot(reboot0) {} diff --git a/src/Core/Requests/DaemonStateUpdateRequest.cpp b/src/Core/Requests/DaemonStateUpdateRequest.cpp index c00468e..abf51de 100644 --- a/src/Core/Requests/DaemonStateUpdateRequest.cpp +++ b/src/Core/Requests/DaemonStateUpdateRequest.cpp @@ -33,15 +33,6 @@ void DaemonStateUpdateRequest::sendRequest(Net::Connection *connection, uint16_t connection->send(packet.encode(requestId)); } -void DaemonStateUpdateRequest::handlePacket(Net::Connection*, uint16_t, const Common::XmlPacket &packet) { - if(packet.getType() != "OK") { - finishWithError(Common::Exception(Common::Exception::UNEXPECTED_PACKET)); - return; // TODO Logging - } - - finish(packet); -} - } } } diff --git a/src/Core/Requests/DaemonStateUpdateRequest.h b/src/Core/Requests/DaemonStateUpdateRequest.h index f1466b2..3f15e9b 100644 --- a/src/Core/Requests/DaemonStateUpdateRequest.h +++ b/src/Core/Requests/DaemonStateUpdateRequest.h @@ -34,7 +34,6 @@ class DaemonStateUpdateRequest : public Common::Request { protected: virtual void sendRequest(Net::Connection *connection, uint16_t requestId); - virtual void handlePacket(Net::Connection*, uint16_t, const Common::XmlPacket &packet); public: DaemonStateUpdateRequest(const std::string &name0, Common::HostInfo::State state0) : Common::Request(slot_type()), name(name0), state(state0) {} -- cgit v1.2.3