diff options
Diffstat (limited to 'modules/commands/os_dns.cpp')
-rw-r--r-- | modules/commands/os_dns.cpp | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/modules/commands/os_dns.cpp b/modules/commands/os_dns.cpp index d46e5d972..1a3189d6b 100644 --- a/modules/commands/os_dns.cpp +++ b/modules/commands/os_dns.cpp @@ -36,7 +36,7 @@ struct DNSZone : Serializable zones->erase(it); } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["name"] << name; unsigned count = 0; @@ -89,17 +89,17 @@ class DNSServer : public Serializable { Anope::string server_name; std::vector<Anope::string> ips; - unsigned limit; + unsigned limit = 0; /* wants to be in the pool */ - bool pooled; + bool pooled = false; /* is actually in the pool */ - bool active; + bool active = false; public: std::set<Anope::string, ci::less> zones; - time_t repool; + time_t repool = 0; - DNSServer(const Anope::string &sn) : Serializable("DNSServer"), server_name(sn), limit(0), pooled(false), active(false), repool(0) + DNSServer(const Anope::string &sn) : Serializable("DNSServer"), server_name(sn) { dns_servers->push_back(this); } @@ -139,7 +139,7 @@ class DNSServer : public Serializable } } - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["server_name"] << server_name; for (unsigned i = 0; i < ips.size(); ++i) @@ -669,7 +669,7 @@ class CommandOSDNS : public Command this->SetSyntax(_("DEPOOL \037server.name\037")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { if (params.empty()) this->DisplayPoolState(source); @@ -695,7 +695,7 @@ class CommandOSDNS : public Command this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -729,15 +729,12 @@ class ModuleDNS : public Module bool remove_split_servers; bool readd_connected_servers; - time_t last_warn; + time_t last_warn = 0; public: ModuleDNS(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR), - zone_type("DNSZone", DNSZone::Unserialize), dns_type("DNSServer", DNSServer::Unserialize), commandosdns(this), - last_warn(0) + zone_type("DNSZone", DNSZone::Unserialize), dns_type("DNSServer", DNSServer::Unserialize), commandosdns(this) { - - for (unsigned j = 0; j < dns_servers->size(); ++j) { DNSServer *s = dns_servers->at(j); @@ -754,7 +751,7 @@ class ModuleDNS : public Module delete dns_servers->at(i - 1); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *conf) override { Configuration::Block *block = conf->GetModule(this); this->ttl = block->Get<time_t>("ttl"); @@ -765,7 +762,7 @@ class ModuleDNS : public Module this->readd_connected_servers = block->Get<bool>("readd_connected_servers"); } - void OnNewServer(Server *s) anope_override + void OnNewServer(Server *s) override { if (s == Me || s->IsJuped()) return; @@ -780,7 +777,7 @@ class ModuleDNS : public Module } } - void OnServerQuit(Server *s) anope_override + void OnServerQuit(Server *s) override { DNSServer *dns = DNSServer::Find(s->GetName()); if (remove_split_servers && dns && dns->Pooled() && dns->Active()) @@ -793,7 +790,7 @@ class ModuleDNS : public Module } } - void OnUserConnect(User *u, bool &exempt) anope_override + void OnUserConnect(User *u, bool &exempt) override { if (!u->Quitting() && u->server) { @@ -807,7 +804,7 @@ class ModuleDNS : public Module } } - void OnPreUserLogoff(User *u) anope_override + void OnPreUserLogoff(User *u) override { if (u && u->server) { @@ -852,7 +849,7 @@ class ModuleDNS : public Module } } - void OnDnsRequest(DNS::Query &req, DNS::Query *packet) anope_override + void OnDnsRequest(DNS::Query &req, DNS::Query *packet) override { if (req.questions.empty()) return; |