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/Common/Requests/DisconnectRequest.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/Common/Requests/DisconnectRequest.cpp') diff --git a/src/Common/Requests/DisconnectRequest.cpp b/src/Common/Requests/DisconnectRequest.cpp index d8e7ee9..afab8ed 100644 --- a/src/Common/Requests/DisconnectRequest.cpp +++ b/src/Common/Requests/DisconnectRequest.cpp @@ -25,18 +25,21 @@ namespace Common { namespace Requests { void DisconnectRequest::sendRequest(Net::Connection *connection, uint16_t requestId) { - connection->send(Net::Packet(Net::Packet::DISCONNECT, requestId)); + XmlPacket packet; + packet.setType("Disconnect"); + + connection->send(packet.encode(requestId)); } -void DisconnectRequest::handlePacket(Net::Connection *connection, const Net::Packet &packet) { - if(packet.getType() != Net::Packet::OK) { +void DisconnectRequest::handlePacket(Net::Connection *connection, uint16_t, const XmlPacket &packet) { + if(packet.getType() != "OK") { finishWithError(Exception(Exception::UNEXPECTED_PACKET)); return; // TODO Logging } connection->disconnect(); - finish(); + finish(packet); } } -- cgit v1.2.3