diff options
-rw-r--r-- | include/dns.h | 1 | ||||
-rw-r--r-- | src/dns.cpp | 32 |
2 files changed, 2 insertions, 31 deletions
diff --git a/include/dns.h b/include/dns.h index c4654727d..9ba14cc37 100644 --- a/include/dns.h +++ b/include/dns.h @@ -218,7 +218,6 @@ class CoreExport DNSManager : public Timer bool listen; uint32_t serial; - int last_year, last_day, last_num; public: TCPSocket *tcpsock; diff --git a/src/dns.cpp b/src/dns.cpp index 500676677..039d90094 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -631,7 +631,7 @@ bool DNSManager::UDPSocket::ProcessWrite() return true; } -DNSManager::DNSManager(const Anope::string &nameserver, const Anope::string &ip, int port) : Timer(300, Anope::CurTime, true), listen(false), serial(0), last_year(0), last_day(0), last_num(0), tcpsock(NULL), udpsock(NULL) +DNSManager::DNSManager(const Anope::string &nameserver, const Anope::string &ip, int port) : Timer(300, Anope::CurTime, true), listen(false), serial(0), tcpsock(NULL), udpsock(NULL) { this->addrs.pton(nameserver.find(':') != Anope::string::npos ? AF_INET6 : AF_INET, nameserver, port); @@ -900,35 +900,7 @@ void DNSManager::Cleanup(Module *mod) void DNSManager::UpdateSerial() { - char timebuf[20]; - tm *tm = localtime(&Anope::CurTime); - - if (!tm) - { - Log(LOG_DEBUG) << "Resolver: Unable to update serial"; - return; - } - - if (tm->tm_yday != last_day || tm->tm_year != last_year) - { - last_day = tm->tm_yday; - last_year = tm->tm_year; - last_num = 0; - } - - ++last_num; - - int i = strftime(timebuf, sizeof(timebuf), "%Y%m%d", tm); - snprintf(timebuf + i, sizeof(timebuf) - i, "%02d", last_num); - - try - { - serial = convertTo<uint32_t>(timebuf); - } - catch (const ConvertException &) - { - Log(LOG_DEBUG) << "Resolver: Unable to update serial"; - } + serial = Anope::CurTime; } uint32_t DNSManager::GetSerial() const |