Browse Source

[1976] Comment refinements

Michal 'vorner' Vaner 12 years ago
parent
commit
9c128152d1

+ 0 - 3
src/lib/datasrc/client_list.cc

@@ -254,9 +254,6 @@ ConfigurableClientList::findInternal(MutableResult& candidate,
 
     // TODO: In case we have only the datasource and not the finder
     // and the need_updater parameter is true, get the zone there.
-
-    // Return the partial match we have. In case we didn't want a partial
-    // match, this surely contains the original empty result.
 }
 
 ConfigurableClientList::ReloadResult

+ 4 - 0
src/lib/datasrc/client_list.h

@@ -331,6 +331,10 @@ private:
     ///
     /// The result is returned as parameter because MutableResult is not
     /// defined in the header file.
+    ///
+    /// If there's no match, the result is not modified. Therefore, this
+    /// expects to get a fresh result object each time it is called, not
+    /// to reuse it.
     void findInternal(MutableResult& result, const dns::Name& name,
                       bool want_exact_match, bool want_finder) const;
     const isc::dns::RRClass rrclass_;

+ 5 - 2
src/lib/datasrc/tests/client_list_unittest.cc

@@ -255,7 +255,8 @@ public:
                                               0, 0, 0, 0, 0));
             finder->add(soa);
         }
-        // We leave the zone empty, so we can check it was reloaded.
+        // If we don't do prefill, we leave the zone empty. This way,
+        // we can check when it was reloaded.
         cache->addZone(finder);
         list_->getDataSources()[index].cache_ = cache;
     }
@@ -811,7 +812,9 @@ TEST_F(ListTest, reloadNotEnabled) {
 TEST_F(ListTest, reloadNoSuchZone) {
     list_->configure(config_elem_zones_, true);
     Name name("example.org");
-    // We put the cache in even when not enabled. This won't confuse the thing.
+    // We put the cache in even when not enabled. This won't confuse the
+    // reload method, as that one looks at the real state of things, not
+    // at the configuration.
     prepareCache(0, Name("example.com"));
     // Not in the data sources
     EXPECT_EQ(ConfigurableClientList::ZONE_NOT_FOUND,