/** BanCacheManager is used to speed up checking of restrictions on connection
* to the IRCd.
*/
- BanCacheManager *BanCache;
+ BanCacheManager BanCache;
/** Stats class, holds miscellaneous stats counters
*/
DeleteZero(this->XLines);
DeleteZero(this->Parser);
DeleteZero(this->Modules);
- DeleteZero(this->BanCache);
DeleteZero(this->SNO);
DeleteZero(this->Config);
DeleteZero(this->PI);
this->Users = 0;
this->Config = 0;
this->SNO = 0;
- this->BanCache = 0;
this->Modules = 0;
this->Parser = 0;
this->XLines = 0;
this->Config = new ServerConfig;
this->SNO = new SnomaskManager;
- this->BanCache = new BanCacheManager;
this->Modules = new ModuleManager();
dynamic_reference_base::reset_all();
this->Parser = new CommandParser;
*/
New->exempt = (ServerInstance->XLines->MatchesLine("E",New) != NULL);
- if (BanCacheHit *b = ServerInstance->BanCache->GetHit(New->GetIPString()))
+ BanCacheHit* const b = ServerInstance->BanCache.GetHit(New->GetIPString());
+ if (b)
{
if (!b->Type.empty() && !New->exempt)
{
ServerInstance->SNO->WriteToSnoMask('c',"Client connecting on port %d (class %s): %s (%s) [%s]",
this->GetServerPort(), this->MyClass->name.c_str(), GetFullRealHost().c_str(), this->GetIPString().c_str(), this->fullname.c_str());
ServerInstance->Logs->Log("BANCACHE", LOG_DEBUG, "BanCache: Adding NEGATIVE hit for " + this->GetIPString());
- ServerInstance->BanCache->AddHit(this->GetIPString(), "", "");
+ ServerInstance->BanCache.AddHit(this->GetIPString(), "", "");
// reset the flood penalty (which could have been raised due to things like auto +x)
CommandFloodPenalty = 0;
}
if (!xlf)
return false;
- ServerInstance->BanCache->RemoveEntries(line->type, false); // XXX perhaps remove ELines here?
+ ServerInstance->BanCache.RemoveEntries(line->type, false); // XXX perhaps remove ELines here?
if (xlf->AutoApplyToUserList(line))
pending_lines.push_back(line);
if (simulate)
return true;
- ServerInstance->BanCache->RemoveEntries(y->second->type, true);
+ ServerInstance->BanCache.RemoveEntries(y->second->type, true);
FOREACH_MOD(OnDelLine, (user, y->second));
if (bancache)
{
ServerInstance->Logs->Log("BANCACHE", LOG_DEBUG, "BanCache: Adding positive hit (" + line + ") for " + u->GetIPString());
- ServerInstance->BanCache->AddHit(u->GetIPString(), this->type, banReason, this->duration);
+ ServerInstance->BanCache.AddHit(u->GetIPString(), this->type, banReason, this->duration);
}
}