summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-11-09 14:59:35 -0500
committerAdam <Adam@anope.org>2010-11-09 15:04:28 -0500
commit0d2db1f9f907616d4b83dccd34f95bf31c95ba0f (patch)
tree902f480cf681bcfa2989b5882fc91f095fcb0d60 /include
parentfe6d7913ce3c2fc686691806202d1da6a0969e00 (diff)
Fixed DNS caching and made DNS cache empty results
(cherry picked from commit 438ae629e51b519d0d5f70531d0262be1b9fe2bc)
Diffstat (limited to 'include')
-rw-r--r--include/dns.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/dns.h b/include/dns.h
index cbadc3916..653229b6f 100644
--- a/include/dns.h
+++ b/include/dns.h
@@ -33,6 +33,7 @@ enum QueryFlags
enum DNSError
{
+ DNS_ERROR_NONE,
DNS_ERROR_UNKNOWN,
DNS_ERROR_UNLOADED,
DNS_ERROR_TIMEOUT,
@@ -57,6 +58,8 @@ class CoreExport DNSRequest
{
/* Timeout timer for this request */
DNSRequestTimeout *timeout;
+ /* Use result cache if available */
+ bool use_cache;
public:
/* Request id */
@@ -73,9 +76,11 @@ class CoreExport DNSRequest
virtual ~DNSRequest();
+ void Process();
+
virtual void OnLookupComplete(const DNSRecord *r) = 0;
- virtual void OnError(DNSError error, const Anope::string &message);
+ virtual void OnError(const DNSRecord *r);
};
/** A full packet sent to the nameserver, may contain multiple queries
@@ -116,6 +121,8 @@ struct DNSRecord
Anope::string result;
/* Type of query this was */
QueryType type;
+ /* Error, if there was one */
+ DNSError error;
/* Record class, should always be 1 */
unsigned short record_class;
/* Time to live */
@@ -123,7 +130,7 @@ struct DNSRecord
/* Record length */
unsigned short rdlength;
- inline DNSRecord();
+ inline DNSRecord(const Anope::string &n);
/* When this record was created in our cache */
time_t created;
};