diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/commands/cmd_hostname_lookup.cpp | 10 | ||||
-rw-r--r-- | src/configreader.cpp | 14 | ||||
-rw-r--r-- | src/modules/m_cgiirc.cpp | 5 | ||||
-rw-r--r-- | src/users.cpp | 6 |
4 files changed, 16 insertions, 19 deletions
diff --git a/src/commands/cmd_hostname_lookup.cpp b/src/commands/cmd_hostname_lookup.cpp index 04592c6e5..d43730b94 100644 --- a/src/commands/cmd_hostname_lookup.cpp +++ b/src/commands/cmd_hostname_lookup.cpp @@ -177,7 +177,6 @@ class UserResolver : public DNS::Request class ModuleHostnameLookup : public Module { - bool nouserdns; LocalIntExt dnsLookup; LocalStringExt ptrHosts; dynamic_reference<DNS::Manager> DNS; @@ -198,18 +197,13 @@ class ModuleHostnameLookup : public Module ServerInstance->Modules->AddService(this->dnsLookup); ServerInstance->Modules->AddService(this->ptrHosts); - Implementation i[] = { I_OnUserInit, I_OnCheckReady, I_OnRehash }; + Implementation i[] = { I_OnUserInit, I_OnCheckReady }; ServerInstance->Modules->Attach(i, this, sizeof(i) / sizeof(Implementation)); } - void OnRehash(User* user) - { - nouserdns = ServerInstance->Config->ConfValue("performance")->getBool("nouserdns"); - } - void OnUserInit(LocalUser *user) { - if (!DNS || nouserdns) + if (!DNS || user->MyClass->nouserdns) { user->WriteServ("NOTICE %s :*** Skipping host resolution (disabled by server administrator)", user->nick.c_str()); return; diff --git a/src/configreader.cpp b/src/configreader.cpp index 32e8966fa..1b565c7f7 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -313,6 +313,7 @@ void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current) me->maxchans = tag->getInt("maxchans", me->maxchans); me->maxconnwarn = tag->getBool("maxconnwarn", me->maxconnwarn); me->limit = tag->getInt("limit", me->limit); + me->nouserdns = tag->getBool("nouserdns", me->nouserdns); ClassMap::iterator oldMask = oldBlocksByMask.find(typeMask); if (oldMask != oldBlocksByMask.end()) @@ -346,12 +347,13 @@ struct DeprecatedConfig }; static const DeprecatedConfig ChangedConfig[] = { - { "bind", "transport", "", "has been moved to <bind:ssl> as of 2.0" }, - { "die", "value", "", "you need to reread your config" }, - { "link", "autoconnect", "", "2.0+ does not use this attribute - define <autoconnect> tags instead" }, - { "link", "transport", "", "has been moved to <link:ssl> as of 2.0" }, - { "module", "name", "m_chanprotect.so", "has been replaced with m_customprefix as of 2.2" }, - { "module", "name", "m_halfop.so", "has been replaced with m_customprefix as of 2.2" }, + { "bind", "transport", "", "has been moved to <bind:ssl> as of 2.0" }, + { "die", "value", "", "you need to reread your config" }, + { "link", "autoconnect", "", "2.0+ does not use this attribute - define <autoconnect> tags instead" }, + { "link", "transport", "", "has been moved to <link:ssl> as of 2.0" }, + { "module", "name", "m_chanprotect.so", "has been replaced with m_customprefix as of 2.2" }, + { "module", "name", "m_halfop.so", "has been replaced with m_customprefix as of 2.2" }, + { "performance", "nouserdns", "", "has been moved to <connect:nouserdns> as of 2.2" } }; void ServerConfig::Fill() diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 9d87a01b3..bbb6151bd 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -182,7 +182,6 @@ class ModuleCgiIRC : public Module CommandWebirc cmd; LocalIntExt waiting; dynamic_reference<DNS::Manager> DNS; - bool nouserdns; static void RecheckClass(LocalUser* user) { @@ -207,8 +206,9 @@ class ModuleCgiIRC : public Module user->host = user->dhost = user->GetIPString(); user->InvalidateCache(); RecheckClass(user); + // Don't create the resolver if the core couldn't put the user in a connect class or when dns is disabled - if (user->quitting || !DNS || nouserdns) + if (user->quitting || !DNS || user->MyClass->nouserdns) return; CGIResolver* r = new CGIResolver(*this->DNS, this, cmd.notify, newip, user, (was_pass ? "PASS" : "IDENT"), waiting); @@ -248,7 +248,6 @@ public: void OnRehash(User* user) { - nouserdns = ServerInstance->Config->ConfValue("performance")->getBool("nouserdns"); cmd.Hosts.clear(); // Do we send an oper notice when a CGI:IRC has their host changed? diff --git a/src/users.cpp b/src/users.cpp index d6363171c..623af7fe3 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1610,7 +1610,8 @@ const std::string& FakeUser::GetFullRealHost() ConnectClass::ConnectClass(ConfigTag* tag, char t, const std::string& mask) : config(tag), type(t), fakelag(true), name("unnamed"), registration_timeout(0), host(mask), pingtime(0), softsendqmax(0), hardsendqmax(0), recvqmax(0), - penaltythreshold(0), commandrate(0), maxlocal(0), maxglobal(0), maxconnwarn(true), maxchans(0), limit(0) + penaltythreshold(0), commandrate(0), maxlocal(0), maxglobal(0), maxconnwarn(true), maxchans(0), + limit(0), nouserdns(false) { } @@ -1620,7 +1621,7 @@ ConnectClass::ConnectClass(ConfigTag* tag, char t, const std::string& mask, cons softsendqmax(parent.softsendqmax), hardsendqmax(parent.hardsendqmax), recvqmax(parent.recvqmax), penaltythreshold(parent.penaltythreshold), commandrate(parent.commandrate), maxlocal(parent.maxlocal), maxglobal(parent.maxglobal), maxconnwarn(parent.maxconnwarn), maxchans(parent.maxchans), - limit(parent.limit) + limit(parent.limit), nouserdns(parent.nouserdns) { } @@ -1643,4 +1644,5 @@ void ConnectClass::Update(const ConnectClass* src) maxconnwarn = src->maxconnwarn; maxchans = src->maxchans; limit = src->limit; + nouserdns = src->nouserdns; } |