summaryrefslogtreecommitdiffstats
path: root/src/Core
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-10-19 21:21:57 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-10-19 21:21:57 +0200
commit3944988f51769b0ffd8e58c05566c82416bf983d (patch)
tree5dcfdec6f2d74a8545da84617b56d2685060397b /src/Core
parent96b6f07a32cb02ae5d907bacd81f62fc25fdc278 (diff)
downloadmad-3944988f51769b0ffd8e58c05566c82416bf983d.tar
mad-3944988f51769b0ffd8e58c05566c82416bf983d.zip
Interface-?nderungen am ConfigManager/Configurable
Diffstat (limited to 'src/Core')
-rw-r--r--src/Core/ConnectionManager.cpp86
-rw-r--r--src/Core/ConnectionManager.h2
2 files changed, 44 insertions, 44 deletions
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<std::string> &entry, const std::vector<std::vector<std::string> > &section) {
- 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<std::vector<std::string> > &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<std::string,Net::ServerConnection*>(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<std::string,Net::ServerConnection*>(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<std::string> &entry, const std::vector<std::vector<std::string> > &section);
+ virtual bool handleConfigEntry(const std::vector<std::vector<std::string> > &entry);
virtual void configFinished();
public: