summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-10-21 10:50:52 +0100
committerPeter Powell <petpow@saberuk.com>2019-10-21 12:06:37 +0100
commit3a04cd83f357f7efba9ee048b46caf30bf7e29a5 (patch)
treeb0a3959f3ed382df72e5f0af7dfaca2ba8365b21 /src
parent318b40dd70c769e1909f6acc7c8edea4d6e344dc (diff)
Get rid of the ptrHosts extension item.
This is unnecessary as the resolved value is already stored in the question in the request class.
Diffstat (limited to 'src')
-rw-r--r--src/coremods/core_hostname_lookup.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/coremods/core_hostname_lookup.cpp b/src/coremods/core_hostname_lookup.cpp
index 13214115b..5bd55f2bd 100644
--- a/src/coremods/core_hostname_lookup.cpp
+++ b/src/coremods/core_hostname_lookup.cpp
@@ -23,7 +23,6 @@
namespace
{
LocalIntExt* dl;
- LocalStringExt* ph;
}
/** Derived from Resolver, and performs user forward/reverse lookups.
@@ -76,9 +75,6 @@ class UserResolver : public DNS::Request
if (!fwd)
{
- // first half of resolution is done. We now need to verify that the host matches.
- ph->set(bound_user, ans_record->rdata);
-
UserResolver* res_forward;
if (bound_user->client_sa.family() == AF_INET6)
{
@@ -130,7 +126,7 @@ class UserResolver : public DNS::Request
if (rev_match)
{
- std::string* hostname = ph->get(bound_user);
+ std::string* hostname = &(this->question.name);
if (hostname == NULL)
{
@@ -151,8 +147,6 @@ class UserResolver : public DNS::Request
{
bound_user->WriteNotice("*** Your hostname is longer than the maximum of " + ConvToStr(ServerInstance->Config->Limits.MaxHost) + " characters, using your IP address (" + bound_user->GetIPString() + ") instead.");
}
-
- ph->unset(bound_user);
}
else
{
@@ -177,18 +171,16 @@ class UserResolver : public DNS::Request
class ModuleHostnameLookup : public Module
{
+ private:
LocalIntExt dnsLookup;
- LocalStringExt ptrHosts;
dynamic_reference<DNS::Manager> DNS;
public:
ModuleHostnameLookup()
: dnsLookup("dnsLookup", ExtensionItem::EXT_USER, this)
- , ptrHosts("ptrHosts", ExtensionItem::EXT_USER, this)
, DNS(this, "DNS")
{
dl = &dnsLookup;
- ph = &ptrHosts;
}
void OnSetUserIP(LocalUser* user) CXX11_OVERRIDE