From 07768a871691433e2f3c490aa14c45cde40e00b4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 29 Sep 2008 20:28:26 +0200 Subject: Status in HostInfo hei?t jetzt State --- src/Core/ConnectionManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Core/ConnectionManager.cpp') diff --git a/src/Core/ConnectionManager.cpp b/src/Core/ConnectionManager.cpp index faf6e29..506a7d4 100644 --- a/src/Core/ConnectionManager.cpp +++ b/src/Core/ConnectionManager.cpp @@ -137,7 +137,7 @@ void ConnectionManager::handleConnections(std::list& con if(idCon->second == *con) { idCon->second = 0; - daemonInfo[idCon->first].setStatus(Common::HostInfo::INACTIVE); + daemonInfo[idCon->first].setState(Common::HostInfo::INACTIVE); break; } } @@ -200,7 +200,7 @@ void ConnectionManager::identifyDaemonConnection(Net::Connection *connection, co } idCon->second = *con; - daemonInfo[idCon->first].setStatus(Common::HostInfo::RUNNING); + daemonInfo[idCon->first].setState(Common::HostInfo::RUNNING); connection->setIdentified(); Common::Logger::logf("Identified as '%s'.", name.c_str()); -- cgit v1.2.3 From 13fd1bb4f19e4791e000cb71cca2065820184bdb Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 29 Sep 2008 22:25:04 +0200 Subject: Daemon-Liste wird jetzt vom Core aktualisiert --- src/Core/ConnectionManager.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/Core/ConnectionManager.cpp') diff --git a/src/Core/ConnectionManager.cpp b/src/Core/ConnectionManager.cpp index 506a7d4..c83f3aa 100644 --- a/src/Core/ConnectionManager.cpp +++ b/src/Core/ConnectionManager.cpp @@ -21,6 +21,7 @@ #include "ConfigManager.h" #include #include +#include "Requests/DaemonStateUpdateRequest.h" #include "RequestHandlers/DaemonCommandRequestHandler.h" #include "RequestHandlers/DaemonListRequestHandler.h" #include "RequestHandlers/DaemonStatusRequestHandler.h" @@ -64,6 +65,16 @@ void ConnectionManager::refreshPollfds() { } } +void ConnectionManager::updateState(const std::string &name, Common::HostInfo::State state) { + daemonInfo[name].setState(state); + + for(std::list::iterator con = clientConnections.begin(); con != clientConnections.end(); ++con) { + Common::RequestManager::getRequestManager()->sendRequest(*con, std::auto_ptr( + new Requests::DaemonStateUpdateRequest(name, state) + )); + } +} + ConnectionManager::ConnectionManager() { Common::RequestManager::init(true); @@ -137,7 +148,7 @@ void ConnectionManager::handleConnections(std::list& con if(idCon->second == *con) { idCon->second = 0; - daemonInfo[idCon->first].setState(Common::HostInfo::INACTIVE); + updateState(idCon->first, Common::HostInfo::INACTIVE); break; } } @@ -200,7 +211,7 @@ void ConnectionManager::identifyDaemonConnection(Net::Connection *connection, co } idCon->second = *con; - daemonInfo[idCon->first].setState(Common::HostInfo::RUNNING); + updateState(idCon->first, Common::HostInfo::RUNNING); connection->setIdentified(); Common::Logger::logf("Identified as '%s'.", name.c_str()); -- cgit v1.2.3