Browse Source

[trac626] fixed the bug of 'missing SOA from hot spot cache'.

As commented this may not be the cleanest solution, but should work as
a middle term workaround.  We should later revisit the base design, clarify
responsibility of cache and real data sources better.
JINMEI Tatuya 14 years ago
parent
commit
527718a5b0
1 changed files with 13 additions and 0 deletions
  1. 13 0
      src/lib/datasrc/data_source.cc

+ 13 - 0
src/lib/datasrc/data_source.cc

@@ -189,6 +189,19 @@ checkCache(QueryTask& task, RRsetList& target) {
                 rrsets.addRRset(rrset);
                 target.append(rrsets);
             }
+
+            // Reset the referral flag and treat CNAME as "not found".
+            // This emulates the behavior of the sqlite3 data source.
+            // XXX: this is not ideal in that the responsibility for handling
+            // operation specific cases is spread over various classes at
+            // different abstraction levels.  For longer terms we should
+            // revisit the whole datasource/query design, and clarify this
+            // point better.
+            flags &= ~DataSrc::REFERRAL;
+            if ((flags & DataSrc::CNAME_FOUND) != 0) {
+                flags &= ~DataSrc::CNAME_FOUND;
+                flags |= DataSrc::TYPE_NOT_FOUND;
+            }
             task.flags = flags;
             return (true);
         }