https://issues.shibboleth.net/jira/browse/CPPOST-9
[shibboleth/cpp-opensaml.git] / saml / saml2 / metadata / impl / ChainingMetadataProvider.cpp
index d0810d8..9faca91 100644 (file)
@@ -25,6 +25,7 @@
 #include "saml/binding/SAMLArtifact.h"
 #include "saml2/metadata/ChainingMetadataProvider.h"
 
+#include <memory>
 #include <xercesc/util/XMLUniDefs.hpp>
 #include <xmltooling/logging.h>
 #include <xmltooling/util/XMLHelper.h>
@@ -106,7 +107,6 @@ void ChainingMetadataProvider::init()
 
 Lockable* ChainingMetadataProvider::lock()
 {
-    m_log.debug("locked metadata chain (no-op)");
     return this;   // we're not lockable ourselves...
 }
 
@@ -117,10 +117,6 @@ void ChainingMetadataProvider::unlock()
     if (ptr) {
         m_tlsKey->setData(NULL);
         reinterpret_cast<MetadataProvider*>(ptr)->unlock();
-        m_log.debug("unlocked embedded metadata provider (%p)", ptr);
-    }
-    else {
-        m_log.debug("unlocked metadata chain (no-op)");
     }
 }
 
@@ -172,8 +168,6 @@ const EntitiesDescriptor* ChainingMetadataProvider::getEntitiesDescriptor(const
 
 pair<const EntityDescriptor*,const RoleDescriptor*> ChainingMetadataProvider::getEntityDescriptor(const Criteria& criteria) const
 {
-    bool bRole = (criteria.role && criteria.protocol);  // searching for role also?
-
     // Clear any existing lock.
     const_cast<ChainingMetadataProvider*>(this)->unlock();
 
@@ -185,7 +179,7 @@ pair<const EntityDescriptor*,const RoleDescriptor*> ChainingMetadataProvider::ge
         (*i)->lock();
         cur = (*i)->getEntityDescriptor(criteria);
         if (cur.first) {
-            if (bRole) {
+            if (criteria.role) {
                 // We want a role also. Did we find one?
                 if (cur.second) {
                     // Are we using a first match policy?