]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/dns.h
Limit DNS cache size
[user/henk/code/inspircd.git] / include / dns.h
index 95abaaf801f1c4b65f2351c2fb0ffe6e2c47e52c..05df6f69cb3baeb1efb5ac747b120126bbc580dc 100644 (file)
@@ -92,6 +92,7 @@ class CoreExport DNSResult
         * @param res The request result, a hostname or IP
         * @param timetolive The request time-to-live
         * @param orig The original request, a hostname or IP
+        * @param qt The type of DNS query this result represents.
         */
        DNSResult(int i, const std::string &res, unsigned long timetolive, const std::string &orig, QueryType qt = DNS_QUERY_NONE) : id(i), result(res), ttl(timetolive), original(orig), type(qt) { }
 };
@@ -118,6 +119,7 @@ class CoreExport CachedQuery
 
        /** Build a cached query
         * @param res The result data, an IP or hostname
+        * @param qt The type of DNS query this instance represents.
         * @param ttl The time-to-live value of the query result
         */
        CachedQuery(const std::string &res, QueryType qt, unsigned int ttl);
@@ -300,6 +302,10 @@ class CoreExport DNS : public EventHandler
         */
        static const int MAX_REQUEST_ID = 0xFFFF;
 
+       /** Maximum number of entries in cache
+        */
+       static const unsigned int MAX_CACHE_SIZE = 1000;
+
        /**
         * Currently cached items
         */