diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-26 23:22:35 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-26 23:22:35 +0000 |
commit | 5a956ba84649aca12a3fc2b28d3b786d4904e408 (patch) | |
tree | 64fb2738d13678c19663e391b3ad1aa525e35a0e /src/configreader.cpp | |
parent | c1917f619adc964f99ea6dc1a651ae03f59ed055 (diff) |
Fix crashes and broken code in connect:parent stuff that got broken with introduction of connect:limit and slight refactor
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8382 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r-- | src/configreader.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index b026f5a9f..ed1216c8b 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -492,17 +492,21 @@ bool DoConnect(ServerConfig* conf, const char*, char**, ValueList &values, int*) /* Find 'parent' and inherit a new class from it, * then overwrite any values that are set here */ - for (ClassVector::iterator item = conf->Classes.begin(); item != conf->Classes.end(); ++item) + ClassVector::iterator item = conf->Classes.begin(); + for (; item != conf->Classes.end(); ++item) { ConnectClass* c = *item; + conf->GetInstance()->Log(DEBUG,"Class: %s", c->GetName().c_str()); if (c->GetName() == parent) { - ConnectClass* c = new ConnectClass(name, c); - c->Update(timeout, flood, *allow ? allow : deny, pingfreq, password, threshold, sendq, recvq, localmax, globalmax, maxchans, port, limit); - conf->Classes.push_back(c); + ConnectClass* newclass = new ConnectClass(name, c); + newclass->Update(timeout, flood, *allow ? allow : deny, pingfreq, password, threshold, sendq, recvq, localmax, globalmax, maxchans, port, limit); + conf->Classes.push_back(newclass); + break; } } - throw CoreException("Class name '" + std::string(name) + "' is configured to inherit from class '" + std::string(parent) + "' which cannot be found."); + if (item == conf->Classes.end()) + throw CoreException("Class name '" + std::string(name) + "' is configured to inherit from class '" + std::string(parent) + "' which cannot be found."); } else { |