summaryrefslogtreecommitdiffstats
path: root/src/Daemon/Requests
diff options
context:
space:
mode:
Diffstat (limited to 'src/Daemon/Requests')
-rw-r--r--src/Daemon/Requests/IdentifyRequest.cpp6
-rw-r--r--src/Daemon/Requests/IdentifyRequest.h5
-rw-r--r--src/Daemon/Requests/LogRequest.cpp5
-rw-r--r--src/Daemon/Requests/LogRequest.h6
4 files changed, 10 insertions, 12 deletions
diff --git a/src/Daemon/Requests/IdentifyRequest.cpp b/src/Daemon/Requests/IdentifyRequest.cpp
index 1ae9372..ba0adef 100644
--- a/src/Daemon/Requests/IdentifyRequest.cpp
+++ b/src/Daemon/Requests/IdentifyRequest.cpp
@@ -18,19 +18,17 @@
*/
#include "IdentifyRequest.h"
-#include <Net/Connection.h>
-#include <Common/XmlPacket.h>
namespace Mad {
namespace Daemon {
namespace Requests {
-void IdentifyRequest::sendRequest(Net::Connection *connection, uint16_t requestId) {
+void IdentifyRequest::sendRequest() {
Common::XmlPacket packet;
packet.setType("Identify");
packet.add("hostname", hostname);
- connection->send(packet.encode(requestId));
+ sendPacket(packet);
}
}
diff --git a/src/Daemon/Requests/IdentifyRequest.h b/src/Daemon/Requests/IdentifyRequest.h
index b3f48ab..75ecd6e 100644
--- a/src/Daemon/Requests/IdentifyRequest.h
+++ b/src/Daemon/Requests/IdentifyRequest.h
@@ -32,10 +32,11 @@ class IdentifyRequest : public Common::Request {
std::string hostname;
protected:
- virtual void sendRequest(Net::Connection *connection, uint16_t requestId);
+ virtual void sendRequest();
public:
- IdentifyRequest(const std::string &hostname0, slot_type slot) : Common::Request(slot), hostname(hostname0) {}
+ IdentifyRequest(Net::Connection *connection, uint16_t requestId, slot_type slot, const std::string &hostname0)
+ : Common::Request(connection, requestId, slot), hostname(hostname0) {}
};
}
diff --git a/src/Daemon/Requests/LogRequest.cpp b/src/Daemon/Requests/LogRequest.cpp
index a7c4d03..0741168 100644
--- a/src/Daemon/Requests/LogRequest.cpp
+++ b/src/Daemon/Requests/LogRequest.cpp
@@ -18,13 +18,12 @@
*/
#include "LogRequest.h"
-#include <Net/Connection.h>
namespace Mad {
namespace Daemon {
namespace Requests {
-void LogRequest::sendRequest(Net::Connection *connection, uint16_t requestId) {
+void LogRequest::sendRequest() {
Common::XmlPacket packet;
packet.setType("Log");
@@ -34,7 +33,7 @@ void LogRequest::sendRequest(Net::Connection *connection, uint16_t requestId) {
packet.add("timestamp", messageTimestamp);
packet.add("message", message);
- connection->send(packet.encode(requestId));
+ sendPacket(packet);
}
}
diff --git a/src/Daemon/Requests/LogRequest.h b/src/Daemon/Requests/LogRequest.h
index 7cceade..9e22b64 100644
--- a/src/Daemon/Requests/LogRequest.h
+++ b/src/Daemon/Requests/LogRequest.h
@@ -36,11 +36,11 @@ class LogRequest : public Common::Request {
std::string message;
protected:
- virtual void sendRequest(Net::Connection *connection, uint16_t requestId);
+ virtual void sendRequest();
public:
- LogRequest(Common::Logger::MessageCategory category0, Common::Logger::MessageLevel level0, time_t messageTimestamp0, const std::string &message0, slot_type slot)
- : Common::Request(slot), category(category0), level(level0), messageTimestamp(messageTimestamp0), message(message0) {}
+ LogRequest(Net::Connection *connection, uint16_t requestId, slot_type slot, Common::Logger::MessageCategory category0, Common::Logger::MessageLevel level0, time_t messageTimestamp0, const std::string &message0)
+ : Common::Request(connection, requestId, slot), category(category0), level(level0), messageTimestamp(messageTimestamp0), message(message0) {}
};
}