summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
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