/* Creator of this request */
Module* const creator;
- Request(Manager* mgr, Module* mod, const std::string& addr, QueryType qt, bool usecache = true)
- : Timer(ServerInstance->Config->ConfValue("dns")->getDuration("timeout", 5, 1))
+ Request(Manager* mgr, Module* mod, const std::string& addr, QueryType qt, bool usecache = true, unsigned int timeout = 0)
+ : Timer(timeout ? timeout : ServerInstance->Config->ConfValue("dns")->getDuration("timeout", 5, 1))
, manager(mgr)
, question(addr, qt)
, use_cache(usecache)
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)
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)
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"))
{