1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 15:43:13 +02:00

Fix removing old connections in m_ldap and m_mysql

This commit is contained in:
Adam
2013-07-20 23:36:20 -04:00
parent 9629ccb374
commit 7480fbda2b
2 changed files with 12 additions and 11 deletions
+5 -5
View File
@@ -423,20 +423,21 @@ class ModuleLDAP : public Module, public Pipe
void OnReload(Configuration::Conf *config) anope_override
{
int i, num;
Configuration::Block *conf = config->GetModule(this);
for (std::map<Anope::string, LDAPService *>::iterator it = this->LDAPServices.begin(); it != this->LDAPServices.end();)
{
const Anope::string &cname = it->first;
LDAPService *s = it->second;
int i;
++it;
Configuration::Block *conf = Config->GetModule(this);
for (i = 0; i < conf->CountBlock("ldap"); ++i)
if (conf->GetBlock("ldap", i)->Get<const Anope::string>("name", "ldap/main") == cname)
break;
if (i == num)
if (i == conf->CountBlock("ldap"))
{
Log(LOG_NORMAL, "ldap") << "LDAP: Removing server connection " << cname;
@@ -446,8 +447,7 @@ class ModuleLDAP : public Module, public Pipe
}
}
Configuration::Block *conf = config->GetModule(this);
for (i = 0; i < conf->CountBlock("ldap"); ++i)
for (int i = 0; i < conf->CountBlock("ldap"); ++i)
{
Configuration::Block *ldap = conf->GetBlock("ldap", i);
+7 -6
View File
@@ -188,20 +188,21 @@ class ModuleSQL : public Module, public Pipe
void OnReload(Configuration::Conf *conf) anope_override
{
Configuration::Block *config = Config->GetModule(this);
int i;
Configuration::Block *config = conf->GetModule(this);
for (std::map<Anope::string, MySQLService *>::iterator it = this->MySQLServices.begin(); it != this->MySQLServices.end();)
{
const Anope::string &cname = it->first;
MySQLService *s = it->second;
int i;
++it;
for (i = 0; i < Config->CountBlock("mysql"); ++i)
if (Config->GetBlock("mysql", i)->Get<const Anope::string>("name", "main") == cname)
for (i = 0; i < config->CountBlock("mysql"); ++i)
if (config->GetBlock("mysql", i)->Get<const Anope::string>("name", "main") == cname)
break;
if (i == Config->CountBlock("mysql"))
if (i == config->CountBlock("mysql"))
{
Log(LOG_NORMAL, "mysql") << "MySQL: Removing server connection " << cname;
@@ -210,7 +211,7 @@ class ModuleSQL : public Module, public Pipe
}
}
for (i = 0; i < config->CountBlock("mysql"); ++i)
for (int i = 0; i < config->CountBlock("mysql"); ++i)
{
Configuration::Block *block = config->GetBlock("mysql", i);
const Anope::string &connname = block->Get<const Anope::string>("name", "mysql/main");