Browse Source

[2310] added some implementation notes as comment for in-memory findAtOrigin.

JINMEI Tatuya 12 years ago
parent
commit
ed2adc060e
1 changed files with 10 additions and 0 deletions
  1. 10 0
      src/lib/datasrc/memory/zone_finder.cc

+ 10 - 0
src/lib/datasrc/memory/zone_finder.cc

@@ -765,6 +765,16 @@ InMemoryZoneFinder::findAll(const isc::dns::Name& name,
                                                           options))));
                                                           options))));
 }
 }
 
 
+// The implementation is a special case of the generic findInternal: we know
+// the qname should have an "exact match" and its node is accessible via
+// getOriginNode(); and, since there should be at least SOA RR at the origin
+// the case of CNAME can be eliminated (these should be guaranteed at the load
+// or update time, but even if they miss a corner case and allows a CNAME to
+// be added at origin, the zone is broken anyway, so we'd just let this
+// method return garbage, too).  As a result, there can be only too cases
+// for the result codes: SUCCESS if the requested type of RR exists; NXRRSET
+// otherwise.  Due to its simplicity we implement it separately, rather than
+// sharing the code with findInternal.
 boost::shared_ptr<ZoneFinder::Context>
 boost::shared_ptr<ZoneFinder::Context>
 InMemoryZoneFinder::findAtOrigin(const isc::dns::RRType& type,
 InMemoryZoneFinder::findAtOrigin(const isc::dns::RRType& type,
                                  bool use_minttl,
                                  bool use_minttl,