1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 09:16:37 +02:00

Rewrote the config reader to better handle invalid configs.

This prevents Anope from exploding when /os reload has errors.
This commit is contained in:
Adam
2010-08-17 19:27:37 -04:00
parent 2575008baa
commit e65d8b2f3d
195 changed files with 3133 additions and 3249 deletions
+4 -4
View File
@@ -23,14 +23,14 @@ bool bad_password(User *u)
{
time_t now = time(NULL);
if (!u || !Config.BadPassLimit)
if (!u || !Config->BadPassLimit)
return false;
if (Config.BadPassTimeout > 0 && u->invalid_pw_time > 0 && u->invalid_pw_time < now - Config.BadPassTimeout)
if (Config->BadPassTimeout > 0 && u->invalid_pw_time > 0 && u->invalid_pw_time < now - Config->BadPassTimeout)
u->invalid_pw_count = 0;
++u->invalid_pw_count;
u->invalid_pw_time = now;
if (u->invalid_pw_count >= Config.BadPassLimit)
if (u->invalid_pw_count >= Config->BadPassLimit)
{
kill_user("", u->nick, "Too many invalid passwords");
return true;
@@ -53,7 +53,7 @@ void kill_user(const Anope::string &source, const Anope::string &user, const Ano
if (user.empty())
return;
Anope::string real_source = source.empty() ? Config.ServerName : source;
Anope::string real_source = source.empty() ? Config->ServerName : source;
Anope::string buf = real_source + " (" + reason + ")";