int bound_fd;
bool fwd;
public:
- UserResolver(InspIRCd* Instance, userrec* user, std::string to_resolve, QueryType qt);
+ UserResolver(InspIRCd* Instance, userrec* user, std::string to_resolve, QueryType qt, bool &cache);
- void OnLookupComplete(const std::string &result);
+ void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached);
void OnError(ResolverError e, const std::string &errormessage);
};
/** Number of channels this user is currently on
*/
unsigned int ChannelCount;
+
+ char* cached_fullhost;
+ char* cached_hostip;
+ char* cached_makehost;
+ char* cached_fullrealhost;
+
+ /** When we erase the user (in the destructor),
+ * we call this method to subtract one from all
+ * mode characters this user is making use of.
+ */
+ void DecrementModes();
public:
/** Resolvers for looking up this users IP address
* This will occur if and when res_reverse completes.
*/
virtual char* GetFullRealHost();
+ /** This clears any cached results that are used for GetFullRealHost() etc.
+ * The results of these calls are cached as generating them can be generally expensive.
+ */
+ void InvalidateCache();
+
/** Create a displayable mode string for this users snomasks
* @return The notice mask character sequence
*/
virtual ~userrec();
};
-
-namespace irc
-{
- /** Holds whowas related functions and classes
- */
- namespace whowas
- {
-
- /** Used to hold WHOWAS information
- */
- class WhoWasGroup : public classbase
- {
- public:
- /** Real host
- */
- char* host;
- /** Displayed host
- */
- char* dhost;
- /** Ident
- */
- char* ident;
- /** Server name
- */
- const char* server;
- /** Fullname (GECOS)
- */
- char* gecos;
- /** Signon time
- */
- time_t signon;
-
- /** Initialize this WhoQasFroup with a user
- */
- WhoWasGroup(userrec* user);
- /** Destructor
- */
- ~WhoWasGroup();
- };
-
- /** A group of users related by nickname
- */
- typedef std::deque<WhoWasGroup*> whowas_set;
-
- /** Sets of users in the whowas system
- */
- typedef std::map<irc::string,whowas_set*> whowas_users;
-
- /** Sets of time and users in whowas list
- */
- typedef std::map<time_t,irc::string> 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);
- };
-};
-
/* Configuration callbacks */
class ServerConfig;