diff options
author | Sadie Powell <sadie@witchery.services> | 2021-03-31 13:30:53 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2021-03-31 13:41:55 +0100 |
commit | fc3c650e8dc62c3fdde8e2cc4eda62ed4a37c532 (patch) | |
tree | 394756c4b9ec46fd8cf99027c010c0e763017cf3 /src/modules/m_dnsbl.cpp | |
parent | 952ee5cc603a5231348b8cfab18ee85a097f5394 (diff) |
Add support for per-DNSBL timeouts.
This should fix the issue of some DNSBLs being slower than others.
Diffstat (limited to 'src/modules/m_dnsbl.cpp')
-rw-r--r-- | src/modules/m_dnsbl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 57a780ff2..dc43dda3f 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -42,12 +42,14 @@ class DNSBLConfEntry : public refcountbase EnumType type; unsigned long duration; unsigned int bitmask; + unsigned int timeout; unsigned char records[256]; unsigned long stats_hits, stats_misses, stats_errors; DNSBLConfEntry() : type(A_BITMASK) , duration(86400) , bitmask(0) + , timeout(0) , stats_hits(0) , stats_misses(0) , stats_errors(0) @@ -69,7 +71,7 @@ class DNSBLResolver : public DNS::Request public: DNSBLResolver(DNS::Manager *mgr, Module *me, LocalStringExt& match, LocalIntExt& ctr, const std::string &hostname, LocalUser* u, reference<DNSBLConfEntry> conf) - : DNS::Request(mgr, me, hostname, DNS::QUERY_A, true) + : DNS::Request(mgr, me, hostname, DNS::QUERY_A, true, conf->timeout) , theirsa(u->client_sa) , theiruid(u->uuid) , nameExt(match) @@ -343,6 +345,7 @@ class ModuleDNSBL : public Module, public Stats::EventListener e->host = tag->getString("host"); e->reason = tag->getString("reason", "Your IP has been blacklisted.", 1); e->domain = tag->getString("domain"); + e->timeout = tag->getDuration("timeout", 0); if (stdalgo::string::equalsci(tag->getString("type"), "bitmask")) { |