]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_dnsbl.cpp
Add ConfigTag::getUInt for reading unsigned config values.
[user/henk/code/inspircd.git] / src / modules / m_dnsbl.cpp
index 732717ff3dc08ea7704f956f41a0e7961c45d94f..16694de932fe937278123c6c98cbd234289f282e 100644 (file)
@@ -24,6 +24,7 @@
 #include "inspircd.h"
 #include "xline.h"
 #include "modules/dns.h"
+#include "modules/stats.h"
 
 /* Class holding data for a single entry */
 class DNSBLConfEntry : public refcountbase
@@ -34,7 +35,7 @@ class DNSBLConfEntry : public refcountbase
                std::string name, ident, host, domain, reason;
                EnumBanaction banaction;
                EnumType type;
-               long duration;
+               unsigned long duration;
                unsigned int bitmask;
                unsigned char records[256];
                unsigned long stats_hits, stats_misses;
@@ -42,7 +43,7 @@ class DNSBLConfEntry : public refcountbase
 };
 
 
-/** Resolver for CGI:IRC hostnames encoded in ident/GECOS
+/** Resolver for CGI:IRC hostnames encoded in ident/real name
  */
 class DNSBLResolver : public DNS::Request
 {
@@ -220,7 +221,7 @@ class DNSBLResolver : public DNS::Request
        }
 };
 
-class ModuleDNSBL : public Module
+class ModuleDNSBL : public Module, public Stats::EventListener
 {
        std::vector<reference<DNSBLConfEntry> > DNSBLConfEntries;
        dynamic_reference<DNS::Manager> DNS;
@@ -247,7 +248,8 @@ class ModuleDNSBL : public Module
        }
  public:
        ModuleDNSBL()
-               : DNS(this, "DNS")
+               : Stats::EventListener(this)
+               , DNS(this, "DNS")
                , nameExt("dnsbl_match", ExtensionItem::EXT_USER, this)
                , countExt("dnsbl_pending", ExtensionItem::EXT_USER, this)
        {
@@ -279,7 +281,7 @@ class ModuleDNSBL : public Module
                        if (tag->getString("type") == "bitmask")
                        {
                                e->type = DNSBLConfEntry::A_BITMASK;
-                               e->bitmask = tag->getInt("bitmask", 0, 0, UINT_MAX);
+                               e->bitmask = tag->getUInt("bitmask", 0, 0, UINT_MAX);
                        }
                        else
                        {