diff options
author | Adam <Adam@anope.org> | 2012-12-15 01:33:31 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-12-15 01:33:31 -0500 |
commit | dcd34d37287adb6aa03d32edd17fc8015b52feb8 (patch) | |
tree | 4eb963bc60c8db543973456e7fce35aaae5a4ad4 /src/config.cpp | |
parent | cdec0a3f96bbfa6d5300b7a6d602fd170e7ccd56 (diff) |
Move DNS handling to a module
Diffstat (limited to 'src/config.cpp')
-rw-r--r-- | src/config.cpp | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/config.cpp b/src/config.cpp index 8969569fd..79ebce9f3 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -17,7 +17,6 @@ #include "opertype.h" #include "channels.h" #include "hashcomp.h" -#include "dns.h" #ifndef _WIN32 #include <errno.h> @@ -175,42 +174,6 @@ ServerConfig::ServerConfig() ModeManager::UpdateDefaultMLock(this); - if (IsFile(this->NameServer)) - { - std::ifstream f(this->NameServer.c_str()); - Anope::string server; - bool success = false; - - while (f.is_open() && getline(f, server.str())) - { - if (server.find("nameserver") == 0) - { - size_t ip = server.find_first_of("123456789"); - if (ip != Anope::string::npos) - { - if (server.substr(ip).is_pos_number_only()) - { - this->NameServer = server.substr(ip); - Log(LOG_DEBUG) << "Nameserver set to " << this->NameServer; - success = true; - break; - } - } - } - } - - if (f.is_open()) - f.close(); - - if (!success) - { - Log() << "Unable to find nameserver, defaulting to 127.0.0.1"; - this->NameServer = "127.0.0.1"; - } - } - delete DNS::Engine; - DNS::Engine = new DNS::Manager(this->NameServer, this->DNSIP, this->DNSPort); - if (this->CaseMap == "ascii") Anope::casemap = std::locale(std::locale(), new Anope::ascii_ctype<char>()); else if (this->CaseMap == "rfc1459") @@ -1262,13 +1225,6 @@ ConfigItems::ConfigItems(ServerConfig *conf) {"mail", "emailchange_message", "", new ValueContainerString(&conf->MailEmailchangeMessage), DT_STRING | DT_ALLOW_NEWLINE, ValidateMail}, {"mail", "memo_subject", "", new ValueContainerString(&conf->MailMemoSubject), DT_STRING, ValidateMail}, {"mail", "memo_message", "", new ValueContainerString(&conf->MailMemoMessage), DT_STRING | DT_ALLOW_NEWLINE, ValidateMail}, - {"dns", "nameserver", "127.0.0.1", new ValueContainerString(&conf->NameServer), DT_STRING, NoValidation}, - {"dns", "timeout", "5", new ValueContainerTime(&conf->DNSTimeout), DT_TIME, NoValidation}, - {"dns", "ip", "0.0.0.0", new ValueContainerString(&conf->DNSIP), DT_STRING, NoValidation}, - {"dns", "port", "53", new ValueContainerInt(&conf->DNSPort), DT_INTEGER, NoValidation}, - {"dns", "admin", "admin@example.com", new ValueContainerString(&conf->DNSSOAAdmin), DT_STRING, NoValidation}, - {"dns", "nameservers", "ns1.example.com", new ValueContainerString(&conf->DNSSOANS), DT_STRING, NoValidation}, - {"dns", "refresh", "3600", new ValueContainerUInt(&conf->DNSSOARefresh), DT_UINTEGER, NoValidation}, {"chanserv", "name", "", new ValueContainerString(&conf->ChanServ), DT_STRING, NoValidation}, {"chanserv", "defaults", "keeptopic secure securefounder signkick", new ValueContainerString(&CSDefaults), DT_STRING, ValidateChanServ}, {"chanserv", "maxregistered", "0", new ValueContainerUInt(&conf->CSMaxReg), DT_UINTEGER, ValidateChanServ}, |