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/Common/Request.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/Common/Request.cpp') diff --git a/src/Common/Request.cpp b/src/Common/Request.cpp index e27c1b9..723039f 100644 --- a/src/Common/Request.cpp +++ b/src/Common/Request.cpp @@ -22,19 +22,17 @@ namespace Mad { namespace Common { -Request::slot_type Request::empty_slot(&Request::doNothing); - -void Request::handlePacket(const XmlPacket &packet) { - if(packet.getType() == "Error") { - finishWithError(Net::Exception(packet["Where"], packet["ErrorCode"], packet["SubCode"], packet["SubSubCode"])); +void Request::handlePacket(boost::shared_ptr packet) { + if(packet->getType() == "Error") { + signalFinished(Net::Exception((*packet)["Where"], (*packet)["ErrorCode"], (*packet)["SubCode"], (*packet)["SubSubCode"])); return; } - else if(packet.getType() != "OK") { - finishWithError(Net::Exception(Net::Exception::UNEXPECTED_PACKET)); + else if(packet->getType() != "OK") { + signalFinished(Net::Exception(Net::Exception::UNEXPECTED_PACKET)); return; // TODO Logging } - finish(packet); + signalFinished(packet); } } -- cgit v1.2.3