summaryrefslogtreecommitdiff
path: root/include/dns.h
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-07 22:01:00 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-07 22:01:00 +0000
commitfe46f3c228ae993b59fbf5eca423c3171d90e1b3 (patch)
tree00e891232399b60adfe3a815b1a00ee2273da99d /include/dns.h
parent2a5e6d416ff00d25230cee662b6e56e9a3d59f75 (diff)
Document dns caching, add a "bool cached" to OnLookupComplete method in Resolver, and and add " -- cached" to end of 'looking up your host' string if their result is a cached result
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6254 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/dns.h')
-rw-r--r--include/dns.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/dns.h b/include/dns.h
index bfced4184..c7283f6b8 100644
--- a/include/dns.h
+++ b/include/dns.h
@@ -228,6 +228,14 @@ class Resolver : public Extensible
* To get around this automatic behaviour, you must use one of the values
* DNS_QUERY_PTR4 or DNS_QUERY_PTR6 to force ipv4 or ipv6 behaviour on the lookup,
* irrespective of what protocol InspIRCd has been built for.
+ * @param cached The constructor will set this boolean to true or false depending
+ * on whether the DNS lookup you are attempting is cached (and not expired) or not.
+ * If the value is cached, upon return this will be set to true, otherwise it will
+ * be set to false. You should pass this value to InspIRCd::AddResolver(), which
+ * will then influence the behaviour of the method and determine whether a cached
+ * or non-cached result is obtained. The value in this variable is always correct
+ * for the given request when the constructor exits.
+ * @param creator See the note below.
* @throw ModuleException This class may throw an instance of ModuleException, in the
* event a lookup could not be allocated, or a similar hard error occurs such as
* the network being down. This will also be thrown if an invalid IP address is
@@ -247,8 +255,12 @@ 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.
+ * @param ttl The time-to-live value of the result, in the instance of a cached
+ * result, this is the number of seconds remaining before refresh/expiry.
+ * @param cached True if the result is a cached result, false if it was requested
+ * from the DNS server.
*/
- virtual void OnLookupComplete(const std::string &result, unsigned int ttl) = 0;
+ virtual void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached) = 0;
/**
* If an error occurs (such as NXDOMAIN, no domain name found) then this method
* will be called.