summaryrefslogtreecommitdiffstats
path: root/dnsdist-rings.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dnsdist-rings.cc')
-rw-r--r--dnsdist-rings.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/dnsdist-rings.cc b/dnsdist-rings.cc
index 5485b33..b97b44e 100644
--- a/dnsdist-rings.cc
+++ b/dnsdist-rings.cc
@@ -214,3 +214,12 @@ size_t Rings::loadFromFile(const std::string& filepath, const struct timespec& n
return inserted;
}
+
+bool Rings::Response::isACacheHit() const
+{
+ bool hit = ds.sin4.sin_family == 0;
+ if (!hit && ds.isIPv4() && ds.sin4.sin_addr.s_addr == 0 && ds.sin4.sin_port == 0) {
+ hit = true;
+ }
+ return hit;
+}