summaryrefslogtreecommitdiffstats
path: root/src/Common/Requests/StatusRequest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/Requests/StatusRequest.cpp')
-rw-r--r--src/Common/Requests/StatusRequest.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Common/Requests/StatusRequest.cpp b/src/Common/Requests/StatusRequest.cpp
index dbaba23..3526e23 100644
--- a/src/Common/Requests/StatusRequest.cpp
+++ b/src/Common/Requests/StatusRequest.cpp
@@ -25,16 +25,19 @@ namespace Common {
namespace Requests {
void StatusRequest::sendRequest(Net::Connection *connection, uint16_t requestId) {
- connection->send(Net::Packet(Net::Packet::STATUS, requestId));
+ XmlPacket packet;
+ packet.setType("GetStatus");
+
+ connection->send(packet.encode(requestId));
}
-void StatusRequest::handlePacket(Net::Connection*, const Net::Packet &packet) {
- if(packet.getType() != Net::Packet::OK) {
+void StatusRequest::handlePacket(Net::Connection*, uint16_t, const XmlPacket &packet) {
+ if(packet.getType() != "OK") {
finishWithError(Exception(Exception::UNEXPECTED_PACKET));
return; // TODO Logging
}
- finish(Net::Packets::HostStatusPacket(packet));
+ finish(packet);
}
}