]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2165] Remove another block of redundant code
authorMukund Sivaraman <muks@isc.org>
Sun, 26 Aug 2012 22:19:17 +0000 (03:49 +0530)
committerMukund Sivaraman <muks@isc.org>
Sun, 26 Aug 2012 22:19:24 +0000 (03:49 +0530)
This seems to be existing code from before #2165. It is also
sub-optimal, so it's better replaced with stripRRsigs().

src/bin/auth/tests/query_unittest.cc

index 513b18bce404ae18ffcde1f51c4cb373bba53905..ab3359b96c18cd6af358447e38482572a52e87ce 100644 (file)
@@ -708,24 +708,8 @@ MockZoneFinder::find(const Name& name, const RRType& type,
         RRsetStore::const_iterator found_rrset =
             found_domain->second.find(type);
         if (found_rrset != found_domain->second.end()) {
-            ConstRRsetPtr rrset;
-            // Strip whatever signature there is in case DNSSEC is not required
-            // Just to make sure the Query asks for it when it is needed
-            if ((options & ZoneFinder::FIND_DNSSEC) != 0 &&
-                found_rrset->second->getRRsig()) {
-                rrset = found_rrset->second;
-            } else {
-                RRsetPtr noconst(new RRset(found_rrset->second->getName(),
-                                           found_rrset->second->getClass(),
-                                           found_rrset->second->getType(),
-                                           found_rrset->second->getTTL()));
-                for (RdataIteratorPtr
-                     i(found_rrset->second->getRdataIterator());
-                     !i->isLast(); i->next()) {
-                    noconst->addRdata(i->getCurrent());
-                }
-                rrset = noconst;
-            }
+            ConstRRsetPtr rrset = ZoneFinder::stripRRsigs(found_rrset->second,
+                                                          options);
             return (createContext(options, SUCCESS, rrset));
         }