From 8f098fc3070f791302ec1f497588fab6ed409980 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 16 Mar 2009 19:13:42 +0100 Subject: Request- und RequestHandler-Interfaces vereinfacht --- src/Client/InformationManager.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/Client/InformationManager.cpp') diff --git a/src/Client/InformationManager.cpp b/src/Client/InformationManager.cpp index cafe2fa..4c9800b 100644 --- a/src/Client/InformationManager.cpp +++ b/src/Client/InformationManager.cpp @@ -29,7 +29,7 @@ namespace Client { InformationManager InformationManager::informationManager; -void InformationManager::DaemonStateUpdateRequestHandler::handlePacket(Net::Connection *connection, uint16_t requestId, const Common::XmlPacket &packet) { +void InformationManager::DaemonStateUpdateRequestHandler::handlePacket(const Common::XmlPacket &packet) { if(packet.getType() != "UpdateHostState") { Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet."); @@ -37,7 +37,7 @@ void InformationManager::DaemonStateUpdateRequestHandler::handlePacket(Net::Conn ret.setType("Error"); ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET); - connection->send(ret.encode(requestId)); + sendPacket(ret); signalFinished().emit(); return; @@ -53,7 +53,7 @@ void InformationManager::DaemonStateUpdateRequestHandler::handlePacket(Net::Conn Common::XmlPacket ret; ret.setType("OK"); - connection->send(ret.encode(requestId)); + sendPacket(ret); signalFinished().emit(); } @@ -71,11 +71,8 @@ void InformationManager::updateDaemonList(Net::Connection *con) { if(updating) return; - Common::RequestManager::get()->sendRequest(con, - std::auto_ptr( - new Requests::DaemonListRequest(sigc::mem_fun(this, &InformationManager::daemonListRequestFinished)) - ) - ); + Common::RequestManager::get()->sendRequest(con, + sigc::mem_fun(this, &InformationManager::daemonListRequestFinished)); updating = true; } -- cgit v1.2.3