diff options
| author | 2021-03-10 04:53:30 +0000 | |
|---|---|---|
| committer | 2021-03-10 04:53:30 +0000 | |
| commit | ae997d094597251ec0ec9c5931c97b4db49a31d1 (patch) | |
| tree | 8bbf2c9346800da792d442ec7f8b6708274e7e06 /src/modules/m_dnsbl.cpp | |
| parent | Merge branch 'insp3' into master. (diff) | |
| parent | Rename `<bind:ssl>` to `<bind:sslprofile>`. (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_dnsbl.cpp')
| -rw-r--r-- | src/modules/m_dnsbl.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 545a315cf..28a09034b 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -84,7 +84,10 @@ class DNSBLResolver : public DNS::Request /* Check the user still exists */ LocalUser* them = IS_LOCAL(ServerInstance->Users.FindUUID(theiruid)); if (!them || them->client_sa != theirsa) + { + ConfEntry->stats_misses++; return; + } int i = countExt.get(them); if (i) @@ -242,6 +245,20 @@ class DNSBLResolver : public DNS::Request void OnError(const DNS::Query *q) override { + bool is_miss = true; + switch (q->error) + { + case DNS::ERROR_NO_RECORDS: + case DNS::ERROR_DOMAIN_NOT_FOUND: + ConfEntry->stats_misses++; + break; + + default: + ConfEntry->stats_errors++; + is_miss = false; + break; + } + LocalUser* them = IS_LOCAL(ServerInstance->Users.FindUUID(theiruid)); if (!them || them->client_sa != theirsa) return; @@ -250,13 +267,9 @@ class DNSBLResolver : public DNS::Request if (i) countExt.set(them, i - 1); - if (q->error == DNS::ERROR_NO_RECORDS || q->error == DNS::ERROR_DOMAIN_NOT_FOUND) - { - ConfEntry->stats_misses++; + if (is_miss) return; - } - ConfEntry->stats_errors++; ServerInstance->SNO.WriteGlobalSno('d', "An error occurred whilst checking whether %s (%s) is on the '%s' DNS blacklist: %s", them->GetFullRealHost().c_str(), them->GetIPString().c_str(), ConfEntry->name.c_str(), this->manager->GetErrorStr(q->error).c_str()); } |
