X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fbancache.h;h=6e19e1ebe753d4afb0a3e309bb20e323782edfb7;hb=a7a0f69c6bf32b63c3314a097929c533296b1c86;hp=7251596db0dba216626fd71f147c2741276dce66;hpb=01de0a19ad49f71f7d2a4b9fbcb80c0713a90d7d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/bancache.h b/include/bancache.h index 7251596db..6e19e1ebe 100644 --- a/include/bancache.h +++ b/include/bancache.h @@ -40,23 +40,19 @@ class CoreExport BanCacheHit */ time_t Expiry; - BanCacheHit(const std::string &type, const std::string &reason, time_t seconds) - : Type(type), Reason(reason), Expiry(ServerInstance->Time() + seconds) - { - } + BanCacheHit(const std::string& type, const std::string& reason, time_t seconds); bool IsPositive() const { return (!Reason.empty()); } }; -/* A container of ban cache items. - * must be defined after class BanCacheHit. - */ -typedef TR1NS::unordered_map > BanCacheHash; - /** A manager for ban cache, which allocates and deallocates and checks cached bans. */ class CoreExport BanCacheManager { + /** A container of ban cache items. + */ + typedef TR1NS::unordered_map > BanCacheHash; + BanCacheHash BanHash; bool RemoveIfExpired(BanCacheHash::iterator& it);