From 63907817cb057f497f03a28016d408885cbe41ea Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 1 Mar 2009 00:51:00 +0100 Subject: Alle uebrigen Requests ausser GSSAPIAuthRequest in XmlRequests umgewandelt --- src/Daemon/Requests/IdentifyRequest.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/Daemon/Requests/IdentifyRequest.cpp') diff --git a/src/Daemon/Requests/IdentifyRequest.cpp b/src/Daemon/Requests/IdentifyRequest.cpp index e8b6082..6334f00 100644 --- a/src/Daemon/Requests/IdentifyRequest.cpp +++ b/src/Daemon/Requests/IdentifyRequest.cpp @@ -19,22 +19,27 @@ #include "IdentifyRequest.h" #include +#include namespace Mad { namespace Daemon { namespace Requests { void IdentifyRequest::sendRequest(Net::Connection *connection, uint16_t requestId) { - connection->send(Net::Packet(Net::Packet::IDENTIFY, requestId, hostname.c_str(), hostname.length())); + Common::XmlPacket packet; + packet.setType("Identify"); + packet.add("hostname", hostname); + + connection->send(packet.encode(requestId)); } -void IdentifyRequest::handlePacket(Net::Connection*, const Net::Packet &packet) { - if(packet.getType() != Net::Packet::OK) { +void IdentifyRequest::handlePacket(Net::Connection*, uint16_t, const Common::XmlPacket &packet) { + if(packet.getType() != "OK") { finishWithError(Common::Exception(Common::Exception::UNEXPECTED_PACKET)); return; // TODO Logging } - finish(); + finish(packet); } } -- cgit v1.2.3