From 41f62a2a3badd6b7dbffb4fdb995c41ef709462c Mon Sep 17 00:00:00 2001 From: peavey Date: Mon, 13 Nov 2006 00:45:37 +0000 Subject: add config option to control whowas behaviour. *may break* git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5731 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/configreader.h | 13 +++++++++++++ include/inspircd.h | 4 ++++ include/users.h | 9 +++++++++ 3 files changed, 26 insertions(+) (limited to 'include') diff --git a/include/configreader.h b/include/configreader.h index e6591e7a8..516c6a6ed 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -120,6 +120,19 @@ class ServerConfig : public Extensible */ ConfigDataHash config_data; + /** Max number of WhoWas entries per user. + */ + int WhoWasGroupSize; + + /** Max number of cumulative user-entries in WhoWas. + * When max reached and added to, push out oldest entry FIFO style. + */ + int WhoWasMaxGroups; + + /** Max seconds a user is kept in WhoWas before being pruned. + */ + int WhoWasMaxKeep; + /** Holds the server name of the local server * as defined by the administrator. */ diff --git a/include/inspircd.h b/include/inspircd.h index baa1fb589..7fecf22ae 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -401,6 +401,10 @@ class InspIRCd : public classbase */ irc::whowas::whowas_users whowas; + /** Whowas container, contains a map of time_t to users tracked by WHOWAS + */ + irc::whowas::whowas_users_fifo whowas_fifo; + /** DNS class, provides resolver facilities to the core and modules */ DNS* Res; diff --git a/include/users.h b/include/users.h index 018336e77..ce8f4eb28 100644 --- a/include/users.h +++ b/include/users.h @@ -828,9 +828,18 @@ namespace irc */ typedef std::map whowas_users; + /** Sets of time and users in whowas list + */ + typedef std::map whowas_users_fifo; + /** Called every hour by the core to remove expired entries */ void MaintainWhoWas(InspIRCd* ServerInstance, time_t TIME); + + /** Prune for WhoWasGroupSize, WhoWasMaxGroups and + * WhoWasMaxKeep on rehash + */ + void PruneWhoWas(InspIRCd* ServerInstance, time_t TIME); }; }; -- cgit v1.3.1-10-gc9f91