summaryrefslogtreecommitdiffstats
path: root/src/Core/RequestHandlers/DaemonStatusRequestHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Core/RequestHandlers/DaemonStatusRequestHandler.cpp')
-rw-r--r--src/Core/RequestHandlers/DaemonStatusRequestHandler.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Core/RequestHandlers/DaemonStatusRequestHandler.cpp b/src/Core/RequestHandlers/DaemonStatusRequestHandler.cpp
index bb5d45f..efdf3ea 100644
--- a/src/Core/RequestHandlers/DaemonStatusRequestHandler.cpp
+++ b/src/Core/RequestHandlers/DaemonStatusRequestHandler.cpp
@@ -48,15 +48,21 @@ void DaemonStatusRequestHandler::handlePacket(Net::Connection *connection, const
try {
Net::Connection *daemonCon = ConnectionManager::getConnectionManager()->getDaemonConnection(daemonName);
- Requests::DaemonStatusRequest::send(daemonCon, sigc::mem_fun(this, &DaemonStatusRequestHandler::requestFinished));
+ Common::RequestManager::getRequestManager()->sendRequest(daemonCon, std::auto_ptr<Common::RequestBase>(new Requests::DaemonStatusRequest(sigc::mem_fun(this, &DaemonStatusRequestHandler::requestFinished))));
}
catch(Common::Exception &e) {
connection->send(Net::Packets::ErrorPacket(Net::Packet::ERROR, packet.getRequestId(), e));
}
}
-void DaemonStatusRequestHandler::requestFinished(const Net::Packets::HostStatusPacket &packet) {
- con->send(Net::Packet(Net::Packet::OK, requestId, packet.getData(), packet.getLength()));
+void DaemonStatusRequestHandler::requestFinished(const Common::Request<Net::Packets::HostStatusPacket> &request) {
+ try {
+ const Net::Packet &packet = request.getResult();
+ con->send(Net::Packet(Net::Packet::OK, requestId, packet.getData(), packet.getLength()));
+ }
+ catch(Common::Exception &e) {
+ con->send(Net::Packets::ErrorPacket(Net::Packet::ERROR, requestId, e));
+ }
signalFinished().emit();
}