From 3944988f51769b0ffd8e58c05566c82416bf983d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 19 Oct 2008 21:21:57 +0200 Subject: Interface-?nderungen am ConfigManager/Configurable --- src/Core/ConnectionManager.cpp | 86 +++++++++++++++++++++--------------------- src/Core/ConnectionManager.h | 2 +- 2 files changed, 44 insertions(+), 44 deletions(-) (limited to 'src/Core') diff --git a/src/Core/ConnectionManager.cpp b/src/Core/ConnectionManager.cpp index 5eed936..c135d06 100644 --- a/src/Core/ConnectionManager.cpp +++ b/src/Core/ConnectionManager.cpp @@ -55,64 +55,64 @@ void ConnectionManager::updateState(const std::string &name, Common::HostInfo::S } } -bool ConnectionManager::handleConfigEntry(const std::vector &entry, const std::vector > §ion) { - if(section.empty()) { - if(Common::Util::tolower(entry.front()) == "listen") { - if(entry.size() == 2) { - try { - listenerAddresses.push_back(Net::IPAddress(entry.back())); - } - catch(Common::Exception &e) { - // TODO Log error - } - - return true; +bool ConnectionManager::handleConfigEntry(const std::vector > &entry) { + if(Common::Util::tolower(entry.front().front()) == "listen" && entry.size() == 1) { + if(entry.front().size() == 2) { + try { + listenerAddresses.push_back(Net::IPAddress(entry.front().back())); } - } - else if(Common::Util::tolower(entry.front()) == "x509trustfile") { - if(entry.size() == 2) { - x509TrustFile = entry.back(); - - return true; + catch(Common::Exception &e) { + // TODO Log error } + + return true; } - else if(Common::Util::tolower(entry.front()) == "x509crlfile") { - if(entry.size() == 2) { - x509CrlFile = entry.back(); + } + else if(Common::Util::tolower(entry.front().front()) == "x509trustfile" && entry.size() == 1) { + if(entry.front().size() == 2) { + x509TrustFile = entry.front().back(); - return true; - } + return true; } - else if(Common::Util::tolower(entry.front()) == "x509certfile") { - if(entry.size() == 2) { - x509CertFile = entry.back(); + } + else if(Common::Util::tolower(entry.front().front()) == "x509crlfile" && entry.size() == 1) { + if(entry.front().size() == 2) { + x509CrlFile = entry.front().back(); - return true; - } + return true; } - else if(Common::Util::tolower(entry.front()) == "x509keyfile") { - if(entry.size() == 2) { - x509KeyFile = entry.back(); + } + else if(Common::Util::tolower(entry.front().front()) == "x509certfile" && entry.size() == 1) { + if(entry.front().size() == 2) { + x509CertFile = entry.front().back(); - return true; - } + return true; } - else if(Common::Util::tolower(entry.front()) == "daemon") { - if(entry.size() == 2) { - daemonInfo.insert(std::make_pair(entry.back(), Common::HostInfo(entry.back()))); - identifiedDaemonConnections.insert(std::make_pair(entry.back(), 0)); + } + else if(Common::Util::tolower(entry.front().front()) == "x509keyfile" && entry.size() == 1) { + if(entry.front().size() == 2) { + x509KeyFile = entry.front().back(); - return true; - } + return true; } } - else if(Common::Util::tolower(section.front().front()) == "daemon" && section.front().size() == 2 && section.size() == 1) { - if(Common::Util::tolower(entry.front()) == "ipaddress") { - if(entry.size() == 2) { - daemonInfo[section.front().back()].setIP(entry.back()); + else if(Common::Util::tolower(entry.front().front()) == "daemon") { + if(entry.front().size() == 2) { + if(entry.size() == 1) { + daemonInfo.insert(std::make_pair(entry.front().back(), Common::HostInfo(entry.front().back()))); + identifiedDaemonConnections.insert(std::make_pair(entry.front().back(), 0)); return true; } + else if(entry.size() == 2) { + if(Common::Util::tolower(entry.back().front()) == "ipaddress") { + if(entry.back().size() == 2) { + daemonInfo[entry.front().back()].setIP(entry.back().back()); + + return true; + } + } + } } } diff --git a/src/Core/ConnectionManager.h b/src/Core/ConnectionManager.h index ad5a57e..a069478 100644 --- a/src/Core/ConnectionManager.h +++ b/src/Core/ConnectionManager.h @@ -67,7 +67,7 @@ class ConnectionManager : private Common::Configurable { void updateState(const std::string &name, Common::HostInfo::State state); protected: - virtual bool handleConfigEntry(const std::vector &entry, const std::vector > §ion); + virtual bool handleConfigEntry(const std::vector > &entry); virtual void configFinished(); public: -- cgit v1.2.3