summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-07 21:35:25 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-07 21:35:25 +0000
commitf1ca6c6d71f3e31b333e0be45294bcb30fd89b4d (patch)
tree307b67ee46dc6b69b844626051c933711d1d1d0d /include
parent8d948ff975c815cb32300354244b1bab263af155 (diff)
DNS caching stuff (almost done)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6252 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/dns.h14
-rw-r--r--include/inspircd.h3
2 files changed, 15 insertions, 2 deletions
diff --git a/include/dns.h b/include/dns.h
index 83e4ab902..bfced4184 100644
--- a/include/dns.h
+++ b/include/dns.h
@@ -194,6 +194,16 @@ class Resolver : public Extensible
* The core uses this to route results to the correct objects.
*/
int myid;
+
+ /**
+ * Cached result, if there is one
+ */
+ CachedQuery *CQ;
+
+ /**
+ * Time left before cache expiry
+ */
+ int time_left;
public:
/**
* Initiate DNS lookup. Your class should not attempt to delete or free these
@@ -238,7 +248,7 @@ class Resolver : public Extensible
* When your lookup completes, this method will be called.
* @param result The resulting DNS lookup, either an IP address or a hostname.
*/
- virtual void OnLookupComplete(const std::string &result, unsigned int ttl);
+ virtual void OnLookupComplete(const std::string &result, unsigned int ttl) = 0;
/**
* If an error occurs (such as NXDOMAIN, no domain name found) then this method
* will be called.
@@ -260,6 +270,8 @@ class Resolver : public Extensible
* Returns the creator module, or NULL
*/
Module* GetCreator();
+
+ void TriggerCachedResult();
};
/** DNS is a singleton class used by the core to dispatch dns
diff --git a/include/inspircd.h b/include/inspircd.h
index 3f6b702f1..136914276 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -885,9 +885,10 @@ class InspIRCd : public classbase
/** Add a dns Resolver class to this server's active set
* @param r The resolver to add
+ * @param cached The value of 'cached' which you passed to the Resolver constructor before this function.
* @return True if the resolver was added
*/
- bool AddResolver(Resolver* r);
+ bool AddResolver(Resolver* r, bool cached);
/** Add a command to this server's command parser
* @param f A command_t command handler object to add